diff --git a/.github/ISSUE_TEMPLATE/00-bug-performance-issue.md b/.github/ISSUE_TEMPLATE/00-bug-performance-issue.md index 34ba4cf9601..d64a1afd895 100644 --- a/.github/ISSUE_TEMPLATE/00-bug-performance-issue.md +++ b/.github/ISSUE_TEMPLATE/00-bug-performance-issue.md @@ -8,21 +8,17 @@ about: Use this template for reporting a bug or a performance issue. **System information** - Have I written custom code (as opposed to using a stock example script provided in TensorFlow): -- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): -- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: +- OS Platform and Distribution (e.g., Linux Ubuntu 16.04 x86\_64): - TensorFlow installed from (source or binary): - TensorFlow version (use command below): -- Python version: +- Java version (i.e., the output of `java -version`): +- Java command line flags (e.g., GC parameters): +- Python version (if transferring a model trained in Python): - Bazel version (if compiling from source): - GCC/Compiler version (if compiling from source): - CUDA/cuDNN version: - GPU model and memory: - -You can collect some of this information using our environment capture [script](https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh) -You can also obtain the TensorFlow version with -python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)" - **Describe the current behavior** **Describe the expected behavior** diff --git a/.github/ISSUE_TEMPLATE/10-build-installation-issue.md b/.github/ISSUE_TEMPLATE/10-build-installation-issue.md index 99c2fe61271..75d00465ed2 100644 --- a/.github/ISSUE_TEMPLATE/10-build-installation-issue.md +++ b/.github/ISSUE_TEMPLATE/10-build-installation-issue.md @@ -7,23 +7,21 @@ about: Use this template for build/installation issues Please make sure that this is a build/installation issue. As per our [GitHub Policy](https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md), we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template **System information** -- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): -- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: +- OS Platform and Distribution (e.g., Linux Ubuntu 16.04 x86\_64): - TensorFlow installed from (source or binary): - TensorFlow version: -- Python version: -- Installed using virtualenv? pip? conda?: +- Java version (i.e., the output of `java -version`): +- Java command line flags (e.g., GC parameters): +- Installed from Maven Central?: - Bazel version (if compiling from source): - GCC/Compiler version (if compiling from source): - CUDA/cuDNN version: - GPU model and memory: - **Describe the problem** **Provide the exact sequence of commands / steps that you executed before running into the problem** - **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/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..eb13a791345 --- /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://ossrh-staging-api.central.sonatype.com/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 365f735af28..00000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,231 +0,0 @@ -name: CI jobs -on: - push: - branches: - - master - - staging - - r[0-9]+.* - pull_request: - branches: - - master - 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 - steps: - - name: Checkout repository - uses: actions/checkout@v1 - - name: Build project - run: | - git --version - mvn -version - mvn clean install -Pdev -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: ["", -mkl, -gpu, -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.1.0/bazel-3.1.0-installer-linux-x86_64.sh -o bazel.sh --retry 10 - bash bazel.sh - if [[ "${{ matrix.ext }}" == *-gpu ]]; then - echo Installing CUDA - curl -L https://developer.download.nvidia.com/compute/cuda/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.1.0/bazel-3.1.0-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.1.0/bazel-3.1.0-windows-x86_64.exe -o C:/bazel/bazel.exe --retry 10 - set "EXT=${{ matrix.ext }}" - if "%EXT:~-4%" == "-gpu" ( - echo Removing some unused stuff to avoid running out of disk space - rm.exe -Rf "C:/Program Files (x86)/Android" "C:/Program Files/dotnet" "%CONDA%" "%GOROOT_1_10_X64%" "%GOROOT_1_11_X64%" "%GOROOT_1_12_X64%" "%GOROOT_1_13_X64%" "C:\hostedtoolcache\windows\Ruby" "C:\Rust" - echo Installing CUDA - curl.exe -L 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 - 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 cdbd28eca7c..d9e902d7d9e 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ __pycache__ cmake_build/ tensorflow/contrib/cmake/_build/ .idea/** +.run /build/ [Bb]uild/ /tensorflow/core/util/version_info.cc @@ -35,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 @@ -55,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 88e17c1ca3d..9da8b9603aa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,53 +1,45 @@ # Building and Contributing to TensorFlow Java -## Building +## Contributing -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`. +### Formatting -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). +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. -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`). +### Dependencies -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. +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. -### Native Builds +## Building -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). +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). -### GPU Support +### JDK 16+ -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. +If you're using JDK 16+, you need to add some exports for the formatter plugin: -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. +``` +--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.parser=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED +``` -## Running Tests +This can be done in `.mvn/jvm.config` or `MAVEN_OPTS`. + +### Native Builds -`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. +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. + +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 @@ -79,36 +71,96 @@ Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.0:tes This is because the native code crashed (i.e. because of a segfault), and it should have created a dump file somewhere in the project that you can use to tell what caused the issue. -## Contributing +## Upgrading TensorFlow Version -### Formatting +To upgrade the version of TensorFlow that is embedded within TensorFlow Java, please follow carefully these steps. -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. +### Upgrading TensorFlow Native Library -### Dependencies +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 -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. +#### 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. + +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. + +#### 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 +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 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). +`mvn clean install -Pgenerating` in `tensorflow-core-api`. -### Working with Bazel generation +## Known Issues -`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: +### Missing Gradients +In some cases, a op supported by Tensorflow Java will not have a gradient defined, resulting in errors like this: ``` -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 +org.tensorflow.exceptions.TensorFlowException: No gradient defined for op: ReadVariableOp. Please see https://www.tensorflow.org/code/tensorflow/cc/gradients/README.md for instructions on how to add C++ gradients. + at org.tensorflow.internal.c_api.AbstractTF_Status.throwExceptionIfNotOK(AbstractTF_Status.java:101) + 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`. 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). -(called in `tensorflow-core-api`). +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 new file mode 100644 index 00000000000..ac7276eba99 --- /dev/null +++ b/MIGRATING.md @@ -0,0 +1,148 @@ +# Migrating Between TensorFlow Java Releases + +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 + +In previous versions, the `Tensor` class was parameterized with its tensor type interface, which is part of the `TType` family. To access directly the memory +tensor from the JVM, an explicit conversion between `Tensor` and its tensor type was required by calling `tensor.data()`. + +In 0.3.0, tensors are always typed, making this generic parameter and explicit mapping obsolete. As soon as you get a handle to a tensor, you are able to +access directly its memory for reading (or writing for most tensor types) and no convertion is required. Any instances of a class in the `TType` family +can also now be manipulated directly as a `Tensor` (e.g. to be passed to a session for inference). + +Steps: +1. Replace a parameterized `Tensor` by its parameter (e.g. `Tensor` -> `TFloat32`) +2. Replace instance of `Tensor` with unknown parameter by `Tensor` +3. Remove any invocation to `Tensor.data()` (e.g. `tensor.data().getFloat()` -> `tensor.getFloat()`) +4. Replace any invocation to `Operand.data()` by `Operand.asTensor()` + +### Use of Java Type System instead of DataType + +In previous versions, the `DataType` class was used to carry information about the type of a `Tensor`, that can then be converted back to a tensor of that +type (see previous section). Since there were a exact parity between interfaces of the `TType` family and an instance of `DataType`, the latter has been dropped +in 0.3.0 to leverage instead the standard type system in Java, for a better idiomatic experience. + +Steps: +1. Replace all accesses to the `DTYPE` field of a `TType` interface by its class (e.g. `TFloat32.DTYPE` -> `TFloat32.class`) +2. Use Java type system for checking tensor types at runtime (e.g. using `instanceof` or `isAssignableFrom`) +3. Replace any invocation to `Tensor.expect()` by an explicit cast (e.g. `tensor.expect(TFloat32.DTYPE)` -> `(TFloat32)tensor`) + +### Example + +0.2.0: +``` +Session session = ...; + +try (Tensor tensor = TFloat32.tensorOf(Shape.of(1, 2))) { + TFloat32 tensorData = tensor.data(); + tensorData.setFloat(10.0f, 0); + tensorData.setFloat(20.0f, 1); + + try (Tensor result = session.runner().feed("x", tensor).fetch("y").run().get(0)) { + if (result.dataType() == TFloat32.DTYPE) { + Tensor typedResult = result.expect(TFloat32.DTYPE); + TFloat32 resultData = typedResult.data(); + System.out.println("Result is " + resultData.getFloat()); + } + } +} +``` + +0.3.0: +``` +Session session = ...; + +try (TFloat32 tensor = TFloat32.tensorOf(Shape.of(1, 2))) { + tensor.setFloat(10.0f, 0); + tensor.setFloat(20.0f, 1); + + try (Tensor result = session.runner().feed("x", tensor).fetch("y").run().get(0)) { + if (result instanceof TFloat32) { + TFloat32 typedResult = (TFloat32)result; + System.out.println("Result is " + typedResult.getFloat()); + } + } +} +``` + diff --git a/README.md b/README.md index 2aef6c0d689..536ce3f27ba 100644 --- a/README.md +++ b/README.md @@ -21,26 +21,21 @@ 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 * Intended audience: neural network developers * For more information: [tensorflow-framework/README.md](tensorflow-framework/README.md) - -* `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 - + +*Note: The NdArray Library module has now its own [repository](https://github.com/tensorflow/java-ndarray) and has been moved out of TensorFlow Java.* ## 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 @@ -48,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.2.0 + 1.1.0 org.tensorflow - tensorflow-core-api - 0.2.0 - 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: @@ -77,50 +93,74 @@ native dependencies as follows: org.tensorflow tensorflow-core-api - 0.2.0 + 1.1.0 org.tensorflow - tensorflow-core-api - 0.2.0 - linux-x86_64${javacpp.platform.extension} + tensorflow-core-native + 1.1.0 + linux-x86_64-gpu org.tensorflow - tensorflow-core-api - 0.2.0 - macosx-x86_64${javacpp.platform.extension} + tensorflow-core-native + 1.1.0 + macosx-arm64 org.tensorflow - tensorflow-core-api - 0.2.0 - 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.2.0 + 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 @@ -137,20 +177,50 @@ to add Sonatype OSS repository in your pom.xml, like the following org.tensorflow tensorflow-core-platform - 0.3.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-SNAPSHOT | 2.4.1 | +## 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.21.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 322ae8c072c..66bd9dfaa9e 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,10 +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. +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 ``` @@ -131,14 +133,14 @@ for temporary staging. - ossrh - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} + central + ${USERNAME} + ${PASSWORD} - ossrh-staging - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} + central-staging + ${USERNAME} + ${PASSWORD} @@ -158,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. @@ -176,9 +178,7 @@ for temporary staging. Some things of note: - For details, look at the [Sonatype guide](http://central.sonatype.org/pages/releasing-the-deployment.html). - - Syncing with [Maven Central](http://repo1.maven.org/maven2/org/tensorflow/) - can take 10 minutes to 2 hours (as per the [OSSRH - guide](http://central.sonatype.org/pages/ossrh-guide.html#releasing-to-central)). + - Syncing with [Maven Central](http://repo1.maven.org/maven2/org/tensorflow/) can take 10 minutes to 2 hours. ### Finishing a release @@ -193,10 +193,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 ``` @@ -221,6 +221,4 @@ Some things of note: ## References -- [Sonatype guide](http://central.sonatype.org/pages/ossrh-guide.html) for - hosting releases. -- [Ticket that created the `org/tensorflow` configuration](https://issues.sonatype.org/browse/OSSRH-28072) on OSSRH. +- [Maven Central guide](https://central.sonatype.org/register/central-portal/) for hosting releases. diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index 85aa179ae82..00000000000 --- a/deploy.sh +++ /dev/null @@ -1,137 +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 - PLATFORM_EXT=${BASH_REMATCH[1]} - 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 -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 new file mode 100755 index 00000000000..93b4e5db2ae --- /dev/null +++ b/docs/_toc.yaml @@ -0,0 +1,18 @@ +# 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. +# +# ============================================================================== +toc: +- title: Install + path: /jvm/install 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/docs/install.md b/docs/docs/install.md new file mode 100755 index 00000000000..2fe676e956a --- /dev/null +++ b/docs/docs/install.md @@ -0,0 +1,218 @@ +# Install TensorFlow Java + +[TensorFlow Java](https://github.com/tensorflow/java) can run on any JVM for +building, training and deploying machine learning models. It supports both CPU +and GPU execution, in graph or eager mode, and presents a rich API for using +TensorFlow in a JVM environment. Java and other JVM languages, like Scala and +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. + +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 11 and above, and supports out-of-the-box the +following platforms: + +* 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 + +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 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 +[versioning table](https://github.com/tensorflow/java/#tensorflow-version-support) +to list all versions available and their mapping with the TensorFlow runtime. + +## Artifacts + +There are +[several ways](https://github.com/tensorflow/java/#using-maven-artifacts) to add +TensorFlow Java to your project. The easiest one is to add a dependency on the +`tensorflow-core-platform` artifact, which includes both the TensorFlow Java +Core API and the native dependencies it requires to run on all supported +platforms. + +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 +learning on the JVM. + +## Installing with Maven + +To include TensorFlow in your [Maven](http://maven.apache.org) application, add +a dependency on its [artifacts](#artifacts) to your project's `pom.xml` file. +For example, + +```xml + + org.tensorflow + tensorflow-core-platform + 1.1.0 + +``` + +### Reducing Number of Dependencies + +It is important to note that adding a dependency on a `tensorflow-core-platform` +artifact will import native libraries for all supported platforms, which can +significantly increase the size of your project. + +If you wish to target a subset of the available platforms then you can exclude +the unnecessary artifacts from the other platforms using the +[Maven Dependency Exclusion](https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html#dependency-exclusions) +feature. + +Another way to select which platforms you want to include in your application is +to set JavaCPP system properties, in your Maven command line or in your +`pom.xml`. Please see JavaCPP +[documentation](https://github.com/bytedeco/javacpp-presets/wiki/Reducing-the-Number-of-Dependencies) +for more details. + +### Using Snapshots + +The latest TensorFlow Java development snapshots from the TensorFlow Java source +repository are available on the [OSS Sonatype](https://oss.sonatype.org) Nexus +repository. To depend on these artifacts, make sure to configure the OSS +snapshots repository in your `pom.xml`. + +```xml + + + tensorflow-snapshots + https://oss.sonatype.org/content/repositories/snapshots/ + + true + + + + + + + org.tensorflow + tensorflow-core-platform + 1.2.0-SNAPSHOT + + +``` + +## Installing with Gradle + +To include TensorFlow in your [Gradle](https://gradle.org) application, add a +dependency on its [artifacts](#artifacts) to your project's `build.gradle` file. +For example, + +```groovy +repositories { + mavenCentral() +} + +dependencies { + compile group: 'org.tensorflow', name: 'tensorflow-core-platform', version: '1.0.0' +} +``` + +### Reducing Number of Dependencies + +Excluding native artifacts from TensorFlow Java with Gradle is not as easy as +with Maven. We recommend that you use Gradle JavaCPP plugins to reduce this +number of dependencies. + +Please read at Gradle JavaCPP +[documentation](https://github.com/bytedeco/gradle-javacpp) for more details. + +## Installing from Sources + +To build TensorFlow Java from sources, and possibly customize it, please read +the following +[instructions](https://github.com/tensorflow/java/blob/master/CONTRIBUTING.md#building). + +*Note: Only official builds distributed by TensorFlow are supported by its +maintainers and custom builds should be used at the user's risk.* + +## Example Program + +This example shows how to build an Apache Maven project with TensorFlow. First, +add the TensorFlow dependency to the project's `pom.xml` file: + +```xml + + 4.0.0 + org.myorg + hellotensorflow + 1.0-SNAPSHOT + + + HelloTensorFlow + + 11 + 11 + + + + + + org.tensorflow + tensorflow-core-platform + 1.1.0 + + + +``` + +Create the source file `src/main/java/HelloTensorFlow.java`: + +```java +import org.tensorflow.ConcreteFunction; +import org.tensorflow.Signature; +import org.tensorflow.Tensor; +import org.tensorflow.TensorFlow; +import org.tensorflow.op.Ops; +import org.tensorflow.op.core.Placeholder; +import org.tensorflow.op.math.Add; +import org.tensorflow.types.TInt32; + +public class HelloTensorFlow { + + public static void main(String[] args) throws Exception { + System.out.println("Hello TensorFlow " + TensorFlow.version()); + + try (ConcreteFunction dbl = ConcreteFunction.create(HelloTensorFlow::dbl); + TInt32 x = TInt32.scalarOf(10); + TInt32 dblX = (TInt32)dbl.call(x)) { + System.out.println(x.getInt() + " doubled is " + dblX.getInt()); + } + } + + private static Signature dbl(Ops tf) { + Placeholder x = tf.placeholder(TInt32.class); + Add dblX = tf.math.add(x, x); + return Signature.builder().input("x", x).output("dbl", dblX).build(); + } +} +``` + +Compile and execute: + +
+mvn -q compile exec:java
+
+ +The command prints TensorFlow version and a simple calculation. + +Success! TensorFlow Java is configured. 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/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/ndarray/README.md b/ndarray/README.md
deleted file mode 100644
index b823422bbfd..00000000000
--- a/ndarray/README.md
+++ /dev/null
@@ -1,122 +0,0 @@
-# NdArray Java Library
-
-## Introduction
-
-NdArray is a library exposing utilities for manipulating data in a n-dimensional space in Java. 
-Unlike other Java artifacts distributed by TensorFlow, this library does not depend on the TensorFlow
-runtime, therefore is very lightweight and can be used by any kind of Java project.
-
-To import the NdArray library in your project, simply add the following dependency:
-```xml
-
-  org.tensorflow
-  ndarray
-  0.2.0-SNAPSHOT
-
-```
-
-### Data Buffers
-
-Instances of `DataBuffer` map contiguous segments of memory with 64-bits indexing and supports 
-generic parametrization while still allowing direct access to primitive types. Such segments 
-could be standard Java arrays, JDK NIO buffers or native memory. In addition, it can serialize and 
-deserialize data of any type (and not only primitive types, as with `java.util.nio`).
-
-```java
-// Allocate a buffer of 4K int values
-IntDataBuffer bufferA = DataBuffers.ofInts(4096L);
-assertEquals(4096L, bufferA.size());
-
-// Write an int array at the beginning of the buffer
-bufferA.write(new int[] { 1, 2, 3 });
-assertEquals(3, bufferA.getInt(2));
-
-// Slice buffer after its first value
-IntDataBuffer bufferB = bufferA.offset(1);
-assertEquals(4095L, bufferB.size());
-assertEquals(2, bufferB.getInt(0));
-
-// Resize a buffer to 10 elements
-IntDataBuffer bufferC = bufferA.narrow(10);
-assertEquals(10L, bufferB.size());
-assertEquals(2, bufferB.getInt(0));
-```
-
-### ND Arrays
-
-Instances of `NdArray` are used to view memory segments stored in a `DataBuffer` as a 
-multidimensional arrays and to provide an API for traversing, reading, writing and slicing
-their data. The goal of these tools is to replace the usage of standard multidimensional Java arrays 
-(e.g. `new int[][][]`) since those results in slow performances, from the non-contiguous 
-storage of their data and the multiple dereferences required to access their values. 
-
-```java
-// Allocating a 3D matrix of 2x3x2
-IntNdArray matrix3d = NdArrays.ofInts(Shape.of(2, 3, 2));
-assertEquals(3, matrix3d.rank());
-
-// Initializing 3D matrix data with vectors from the first dimension (index 0)
-matrix3d.elements(0).forEach(matrix -> {
-    assertEquals(2, matrix.rank());
-    assertEquals(Shape.of(3, 2), matrix.shape());
-    matrix
-      .set(NdArrays.vectorOf(1, 2), 0)
-      .set(NdArrays.vectorOf(3, 4), 1)
-      .set(NdArrays.vectorOf(5, 6), 2);
-});
-
-// Visit all scalars of 3D matrix, printing their coordinates and value
-matrix3d.scalars().forEachIdx((coords, scalar) ->
-    System.out.println("Scalar at " + Arrays.toString(coords) + " has value " + scalar.getInt())
-);
-
-// Retrieving the second vector of the first matrix
-IntNdArray vector = matrix3d.get(0, 1);
-assertEquals(1, vector.rank());
-
-// Rewriting the values of the vector using a primitive array
-vector.write(new int[] { 7, 8 });
-assertEquals(7, matrix3d.getInt(0, 1, 0));
-assertEquals(8, matrix3d.getInt(0, 1, 1));
-
-// Slicing the 3D matrix so we only keep the second element of the second dimension
-IntNdArray slice = matrix3d.slice(all(), at(1));
-assertEquals(2, slice.rank());
-assertEquals(Shape.of(2, 2), slice.shape());
-assertEquals(7, slice.getInt(0, 0));  // (0, 1, 0) in the original matrix
-assertEquals(3, slice.getInt(1, 0));  // (1, 1, 0) in the original matrix
-```
-
-## Integration with TensorFlow
-
-The NdArray library is independent of the TensorFlow runtime library, making it a good choice for
-manipulating multi-dimensional data structures from anywhere. But as an example, here
-is how it is actually being used by the [TensorFlow Core API](https://github.com/tensorflow/java/tree/master/tensorflow-core/tensorflow-core-api):
-
-```java
-// Allocate a tensor of 32-bits integer of the shape (2, 3, 2)
-Tensor tensor = TInt32.ofShape(2, 3, 2);
-
-// Access tensor memory directly
-IntNdArray tensorData = tensor.data();
-assertEquals(3, tensorData.rank());
-assertEquals(12, tensorData.size());
-
-try (EagerSession session = EagerSession.create()) {
-  Ops tf = Ops.create(session);
-
-  // Initialize tensor memory with zeros and take a snapshot
-  tensorData.scalars().forEach(scalar -> scalar.setInt(0));
-  Constant x = tf.constant(tensor);
-
-  // Initialize the same tensor memory with ones and take a snapshot
-  tensorData.scalars().forEach(scalar -> scalar.setInt(1));
-  Constant y = tf.constant(tensor);
-
-  // Subtract y from x and validate the result
-  Sub sub = tf.math.sub(x, y);
-  sub.data().scalars().forEach(scalar ->
-      assertEquals(-1, scalar.getInt())
-  );
-}
-```
diff --git a/ndarray/pom.xml b/ndarray/pom.xml
deleted file mode 100644
index 4139b8b7929..00000000000
--- a/ndarray/pom.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-  4.0.0
-
-  
-    org.tensorflow
-    tensorflow-java
-    0.3.0-SNAPSHOT
-  
-  ndarray
-  jar
-
-  TensorFlow NdArray Library
-  
-    Utility library for N-dimensional data I/O operations.
-  
-
-  
-    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
-    
-  
-
-  
-    
-      
-        maven-jar-plugin
-        3.2.0
-        
-          
-            
-              ${java.module.name}
-            
-          
-        
-      
-      
-        org.apache.maven.plugins
-        maven-surefire-plugin
-        2.22.2
-        
-          1
-          false
-          -Xmx2G -XX:MaxPermSize=256m
-          
-            **/*Test.java
-          
-        
-      
-    
-  
-
-
diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/BooleanNdArray.java b/ndarray/src/main/java/org/tensorflow/ndarray/BooleanNdArray.java
deleted file mode 100644
index 5b4bedb1c84..00000000000
--- a/ndarray/src/main/java/org/tensorflow/ndarray/BooleanNdArray.java
+++ /dev/null
@@ -1,108 +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.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 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 read(DataBuffer dst); - - BooleanNdArray read(BooleanDataBuffer dst); - - @Override - BooleanNdArray write(DataBuffer src); - - BooleanNdArray write(BooleanDataBuffer src); -} diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/ByteNdArray.java b/ndarray/src/main/java/org/tensorflow/ndarray/ByteNdArray.java deleted file mode 100644 index 0e6f118f5ef..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/ByteNdArray.java +++ /dev/null @@ -1,108 +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.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 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 read(DataBuffer dst); - - ByteNdArray read(ByteDataBuffer dst); - - @Override - ByteNdArray write(DataBuffer src); - - ByteNdArray write(ByteDataBuffer src); -} diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/DoubleNdArray.java b/ndarray/src/main/java/org/tensorflow/ndarray/DoubleNdArray.java deleted file mode 100644 index 80e99b01877..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/DoubleNdArray.java +++ /dev/null @@ -1,108 +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.ndarray; - -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); - - @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 read(DataBuffer dst); - - DoubleNdArray read(DoubleDataBuffer dst); - - @Override - DoubleNdArray write(DataBuffer src); - - DoubleNdArray write(DoubleDataBuffer src); -} diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/FloatNdArray.java b/ndarray/src/main/java/org/tensorflow/ndarray/FloatNdArray.java deleted file mode 100644 index 8d4fbf5c1ed..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/FloatNdArray.java +++ /dev/null @@ -1,108 +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.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 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 read(DataBuffer dst); - - FloatNdArray read(FloatDataBuffer dst); - - @Override - FloatNdArray write(DataBuffer src); - - FloatNdArray write(FloatDataBuffer src); -} diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/IllegalRankException.java b/ndarray/src/main/java/org/tensorflow/ndarray/IllegalRankException.java deleted file mode 100644 index b816d338d7e..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/IllegalRankException.java +++ /dev/null @@ -1,27 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/IntNdArray.java b/ndarray/src/main/java/org/tensorflow/ndarray/IntNdArray.java deleted file mode 100644 index aa2cc652d69..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/IntNdArray.java +++ /dev/null @@ -1,108 +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.ndarray; - -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); - - @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 read(DataBuffer dst); - - IntNdArray read(IntDataBuffer dst); - - @Override - IntNdArray write(DataBuffer src); - - IntNdArray write(IntDataBuffer src); -} diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/LongNdArray.java b/ndarray/src/main/java/org/tensorflow/ndarray/LongNdArray.java deleted file mode 100644 index 3e5be6dc7ec..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/LongNdArray.java +++ /dev/null @@ -1,108 +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.ndarray; - -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); - - @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 read(DataBuffer dst); - - LongNdArray read(LongDataBuffer dst); - - @Override - LongNdArray write(DataBuffer src); - - LongNdArray write(LongDataBuffer src); -} diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/NdArray.java b/ndarray/src/main/java/org/tensorflow/ndarray/NdArray.java deleted file mode 100644 index 6686abd9148..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/NdArray.java +++ /dev/null @@ -1,302 +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.ndarray; - -import java.util.function.BiConsumer; -import java.util.function.Consumer; -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(); - - /** - * 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); - - /** - * 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); - - /** - * Read 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. - * - * @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 read(DataBuffer dst); - - /** - * Write the content of this N-dimensional array from the source 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. - * - * @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 write(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/ndarray/src/main/java/org/tensorflow/ndarray/NdArraySequence.java b/ndarray/src/main/java/org/tensorflow/ndarray/NdArraySequence.java deleted file mode 100644 index afb930e278b..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/NdArraySequence.java +++ /dev/null @@ -1,67 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/NdArrays.java b/ndarray/src/main/java/org/tensorflow/ndarray/NdArrays.java deleted file mode 100644 index 8ad55cae7ed..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/NdArrays.java +++ /dev/null @@ -1,495 +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.ndarray; - -import org.tensorflow.ndarray.impl.dense.DenseNdArray; -import org.tensorflow.ndarray.impl.dense.IntDenseNdArray; -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.DoubleDenseNdArray; -import org.tensorflow.ndarray.impl.dense.FloatDenseNdArray; -import org.tensorflow.ndarray.impl.dense.LongDenseNdArray; -import org.tensorflow.ndarray.impl.dense.ShortDenseNdArray; - -/** - * 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); - } - - // 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); - } - - // 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); - } - - // 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); - } - - // 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); - } - - // 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); - } - - // 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); - } - - // 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); - } -} - diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/Shaped.java b/ndarray/src/main/java/org/tensorflow/ndarray/Shaped.java deleted file mode 100644 index fbe19d75623..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/Shaped.java +++ /dev/null @@ -1,51 +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.ndarray; - -import java.util.function.BiConsumer; -import java.util.function.Consumer; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.index.Index; - -/** - * 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/ndarray/src/main/java/org/tensorflow/ndarray/ShortNdArray.java b/ndarray/src/main/java/org/tensorflow/ndarray/ShortNdArray.java deleted file mode 100644 index f9335b4d5d2..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/ShortNdArray.java +++ /dev/null @@ -1,108 +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.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 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 read(DataBuffer dst); - - ShortNdArray read(ShortDataBuffer dst); - - @Override - ShortNdArray write(DataBuffer src); - - ShortNdArray write(ShortDataBuffer src); -} diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/buffer/BooleanDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/buffer/BooleanDataBuffer.java deleted file mode 100644 index 73a570d4fe8..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/buffer/BooleanDataBuffer.java +++ /dev/null @@ -1,165 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/buffer/ByteDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/buffer/ByteDataBuffer.java deleted file mode 100644 index b1cce441b13..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/buffer/ByteDataBuffer.java +++ /dev/null @@ -1,232 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/buffer/DataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/buffer/DataBuffer.java deleted file mode 100644 index e62ba87ce6e..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/buffer/DataBuffer.java +++ /dev/null @@ -1,324 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/buffer/DoubleDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/buffer/DoubleDataBuffer.java deleted file mode 100644 index f2db925eb78..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/buffer/DoubleDataBuffer.java +++ /dev/null @@ -1,165 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/buffer/FloatDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/buffer/FloatDataBuffer.java deleted file mode 100644 index 4961c1b3445..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/buffer/FloatDataBuffer.java +++ /dev/null @@ -1,165 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/buffer/IntDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/buffer/IntDataBuffer.java deleted file mode 100644 index 2d660756e09..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/buffer/IntDataBuffer.java +++ /dev/null @@ -1,165 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/buffer/LongDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/buffer/LongDataBuffer.java deleted file mode 100644 index f88ae4a80b4..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/buffer/LongDataBuffer.java +++ /dev/null @@ -1,165 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/buffer/ShortDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/buffer/ShortDataBuffer.java deleted file mode 100644 index 290e2d57619..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/buffer/ShortDataBuffer.java +++ /dev/null @@ -1,165 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/ByteDataLayout.java b/ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/ByteDataLayout.java deleted file mode 100644 index e4d4bf9c8cf..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/ByteDataLayout.java +++ /dev/null @@ -1,65 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/impl/AbstractNdArray.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/AbstractNdArray.java deleted file mode 100644 index 690dedc2042..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/AbstractNdArray.java +++ /dev/null @@ -1,92 +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.ndarray.impl; - -import java.util.Iterator; -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 { - - 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 AbstractNdArray(DimensionalSpace dimensions) { - this.dimensions = dimensions; - } - - 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();) { - if (!thisIter.next().getObject().equals(otherIter.next().getObject())) { - return false; - } - } - return true; - } - - protected final DimensionalSpace dimensions; -} diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/impl/Validator.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/Validator.java deleted file mode 100644 index 285d09966de..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/Validator.java +++ /dev/null @@ -1,55 +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.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 readToBufferArgs(NdArray ndArray, DataBuffer dst) { - if (dst.size() < ndArray.size()) { - throw new BufferOverflowException(); - } - } - - public static void writeFromBufferArgs(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/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/AbstractDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/AbstractDataBuffer.java deleted file mode 100644 index e5103a2c17a..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/AbstractDataBuffer.java +++ /dev/null @@ -1,182 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/Validator.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/Validator.java deleted file mode 100644 index 8f18e620b90..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/Validator.java +++ /dev/null @@ -1,132 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/layout/Float16Layout.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/layout/Float16Layout.java deleted file mode 100644 index b19744bbd13..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/layout/Float16Layout.java +++ /dev/null @@ -1,119 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/misc/ArrayDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/misc/ArrayDataBuffer.java deleted file mode 100644 index 676e291357a..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/misc/ArrayDataBuffer.java +++ /dev/null @@ -1,126 +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.ndarray.impl.buffer.misc; - -import java.util.Arrays; -import org.tensorflow.ndarray.impl.buffer.AbstractDataBuffer; -import org.tensorflow.ndarray.impl.buffer.Validator; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataStorageVisitor; - -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/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/misc/BitSetDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/misc/BitSetDataBuffer.java deleted file mode 100644 index 5b5ec15294b..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/misc/BitSetDataBuffer.java +++ /dev/null @@ -1,183 +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.ndarray.impl.buffer.misc; - -import java.util.BitSet; -import org.tensorflow.ndarray.impl.buffer.AbstractDataBuffer; -import org.tensorflow.ndarray.impl.buffer.Validator; -import org.tensorflow.ndarray.buffer.BooleanDataBuffer; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataStorageVisitor; - -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/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/misc/BooleanArrayDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/misc/BooleanArrayDataBuffer.java deleted file mode 100644 index f8d033519ec..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/misc/BooleanArrayDataBuffer.java +++ /dev/null @@ -1,176 +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.ndarray.impl.buffer.misc; - -import java.util.Arrays; -import java.util.BitSet; -import org.tensorflow.ndarray.impl.buffer.AbstractDataBuffer; -import org.tensorflow.ndarray.impl.buffer.Validator; -import org.tensorflow.ndarray.buffer.BooleanDataBuffer; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataStorageVisitor; - -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/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/AbstractNioDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/AbstractNioDataBuffer.java deleted file mode 100644 index 82bc981ad46..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/AbstractNioDataBuffer.java +++ /dev/null @@ -1,41 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/ByteNioDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/ByteNioDataBuffer.java deleted file mode 100644 index 5ede97cef78..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/ByteNioDataBuffer.java +++ /dev/null @@ -1,185 +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.ndarray.impl.buffer.nio; - -import java.nio.ByteBuffer; -import org.tensorflow.ndarray.impl.buffer.Validator; -import org.tensorflow.ndarray.impl.buffer.adapter.DataBufferAdapterFactory; -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; - -/** - * 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/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/DoubleNioDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/DoubleNioDataBuffer.java deleted file mode 100644 index bddc5db1e3f..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/DoubleNioDataBuffer.java +++ /dev/null @@ -1,147 +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.ndarray.impl.buffer.nio; - -import java.nio.DoubleBuffer; -import org.tensorflow.ndarray.impl.buffer.Validator; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataStorageVisitor; -import org.tensorflow.ndarray.buffer.DoubleDataBuffer; - -/** - * 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/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/FloatNioDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/FloatNioDataBuffer.java deleted file mode 100644 index 06a9a31b56a..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/FloatNioDataBuffer.java +++ /dev/null @@ -1,147 +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.ndarray.impl.buffer.nio; - -import java.nio.FloatBuffer; -import org.tensorflow.ndarray.impl.buffer.Validator; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataStorageVisitor; -import org.tensorflow.ndarray.buffer.FloatDataBuffer; - -/** - * 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/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/IntNioDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/IntNioDataBuffer.java deleted file mode 100644 index cea729e86a7..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/IntNioDataBuffer.java +++ /dev/null @@ -1,147 +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.ndarray.impl.buffer.nio; - -import java.nio.IntBuffer; -import org.tensorflow.ndarray.impl.buffer.Validator; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataStorageVisitor; -import org.tensorflow.ndarray.buffer.IntDataBuffer; - -/** - * 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/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/LongNioDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/LongNioDataBuffer.java deleted file mode 100644 index 7231ee7d408..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/LongNioDataBuffer.java +++ /dev/null @@ -1,147 +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.ndarray.impl.buffer.nio; - -import java.nio.LongBuffer; -import org.tensorflow.ndarray.impl.buffer.Validator; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataStorageVisitor; -import org.tensorflow.ndarray.buffer.LongDataBuffer; - -/** - * 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/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/ShortNioDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/ShortNioDataBuffer.java deleted file mode 100644 index 776faa103c2..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/ShortNioDataBuffer.java +++ /dev/null @@ -1,147 +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.ndarray.impl.buffer.nio; - -import java.nio.ShortBuffer; -import org.tensorflow.ndarray.impl.buffer.Validator; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataStorageVisitor; -import org.tensorflow.ndarray.buffer.ShortDataBuffer; - -/** - * 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/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/BooleanRawDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/BooleanRawDataBuffer.java deleted file mode 100644 index e7e825ea505..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/BooleanRawDataBuffer.java +++ /dev/null @@ -1,146 +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.ndarray.impl.buffer.raw; - -import java.util.Arrays; -import org.tensorflow.ndarray.impl.buffer.Validator; -import org.tensorflow.ndarray.buffer.BooleanDataBuffer; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataStorageVisitor; - -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/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/ByteRawDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/ByteRawDataBuffer.java deleted file mode 100644 index b4b490e98ed..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/ByteRawDataBuffer.java +++ /dev/null @@ -1,185 +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.ndarray.impl.buffer.raw; - -import java.nio.ByteBuffer; -import org.tensorflow.ndarray.impl.buffer.Validator; -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; - -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/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/DoubleRawDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/DoubleRawDataBuffer.java deleted file mode 100644 index 680d9565184..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/DoubleRawDataBuffer.java +++ /dev/null @@ -1,149 +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.ndarray.impl.buffer.raw; - -import java.nio.DoubleBuffer; -import org.tensorflow.ndarray.impl.buffer.Validator; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataStorageVisitor; -import org.tensorflow.ndarray.buffer.DoubleDataBuffer; - -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/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/FloatRawDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/FloatRawDataBuffer.java deleted file mode 100644 index 43bd370a88b..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/FloatRawDataBuffer.java +++ /dev/null @@ -1,150 +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.ndarray.impl.buffer.raw; - -import java.nio.FloatBuffer; - -import org.tensorflow.ndarray.impl.buffer.Validator; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataStorageVisitor; -import org.tensorflow.ndarray.buffer.FloatDataBuffer; - -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/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/IntRawDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/IntRawDataBuffer.java deleted file mode 100644 index 1c905e2756d..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/IntRawDataBuffer.java +++ /dev/null @@ -1,149 +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.ndarray.impl.buffer.raw; - -import java.nio.IntBuffer; -import org.tensorflow.ndarray.impl.buffer.Validator; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataStorageVisitor; -import org.tensorflow.ndarray.buffer.IntDataBuffer; - -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/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/LongRawDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/LongRawDataBuffer.java deleted file mode 100644 index 724868fe81f..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/LongRawDataBuffer.java +++ /dev/null @@ -1,149 +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.ndarray.impl.buffer.raw; - -import java.nio.LongBuffer; -import org.tensorflow.ndarray.impl.buffer.Validator; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataStorageVisitor; -import org.tensorflow.ndarray.buffer.LongDataBuffer; - -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/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/ShortRawDataBuffer.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/ShortRawDataBuffer.java deleted file mode 100644 index 80f9c289852..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/ShortRawDataBuffer.java +++ /dev/null @@ -1,149 +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.ndarray.impl.buffer.raw; - -import java.nio.ShortBuffer; -import org.tensorflow.ndarray.impl.buffer.Validator; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataStorageVisitor; -import org.tensorflow.ndarray.buffer.ShortDataBuffer; - -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/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/UnsafeReference.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/UnsafeReference.java deleted file mode 100644 index 7b95eac7349..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/UnsafeReference.java +++ /dev/null @@ -1,64 +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.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) { - // Validate that this Unsafe instance exposes all methods we need - clazz.getDeclaredMethod("getByte", Object.class, long.class); - clazz.getDeclaredMethod("putByte", Object.class, long.class, byte.class); - clazz.getDeclaredMethod("getShort", Object.class, long.class); - clazz.getDeclaredMethod("putShort", Object.class, long.class, short.class); - clazz.getDeclaredMethod("getInt", Object.class, long.class); - clazz.getDeclaredMethod("putInt", Object.class, long.class, int.class); - clazz.getDeclaredMethod("getLong", Object.class, long.class); - clazz.getDeclaredMethod("putLong", Object.class, long.class, long.class); - clazz.getDeclaredMethod("getFloat", Object.class, long.class); - clazz.getDeclaredMethod("putFloat", Object.class, long.class, float.class); - clazz.getDeclaredMethod("getDouble", Object.class, long.class); - clazz.getDeclaredMethod("putDouble", Object.class, long.class, double.class); - clazz.getDeclaredMethod("getBoolean", Object.class, long.class); - clazz.getDeclaredMethod("putBoolean", Object.class, long.class, boolean.class); - clazz.getDeclaredMethod("copyMemory", Object.class, long.class, Object.class, long.class, long.class); - clazz.getDeclaredMethod("arrayBaseOffset", Class.class); - clazz.getDeclaredMethod("arrayIndexScale", Class.class); - unsafe = (Unsafe) instance; - } - } catch (ClassNotFoundException | NoSuchMethodException | NoSuchFieldException | SecurityException | IllegalAccessException | ClassCastException ex) { - // Do nothing, keep unsafe as null - } - UNSAFE = unsafe; - } -} diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/AbstractDenseNdArray.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/AbstractDenseNdArray.java deleted file mode 100644 index 0497095116e..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/AbstractDenseNdArray.java +++ /dev/null @@ -1,163 +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.ndarray.impl.dense; - -import org.tensorflow.ndarray.NdArray; -import org.tensorflow.ndarray.NdArraySequence; -import org.tensorflow.ndarray.impl.AbstractNdArray; -import org.tensorflow.ndarray.impl.dimension.RelativeDimensionalSpace; -import org.tensorflow.ndarray.impl.sequence.FastElementSequence; -import org.tensorflow.ndarray.index.Index; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataBufferWindow; -import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; -import org.tensorflow.ndarray.impl.sequence.SlicingElementSequence; -import org.tensorflow.ndarray.impl.sequence.SingleElementSequence; - -@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 = instantiate(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 slice(long position, DimensionalSpace sliceDimensions) { - DataBuffer sliceBuffer = buffer().slice(position, sliceDimensions.physicalSize()); - return instantiate(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 read(DataBuffer dst) { - Validator.readToBufferArgs(this, dst); - DataTransfer.execute(buffer(), dimensions(), dst, DataTransfer::ofValue); - return (U)this; - } - - @Override - public U write(DataBuffer src) { - Validator.writeFromBufferArgs(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()); - } - - protected AbstractDenseNdArray(DimensionalSpace dimensions) { - super(dimensions); - } - - abstract protected DataBuffer buffer(); - - abstract U instantiate(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/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/BooleanDenseNdArray.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/BooleanDenseNdArray.java deleted file mode 100644 index 0764146f962..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/BooleanDenseNdArray.java +++ /dev/null @@ -1,91 +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.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 read(BooleanDataBuffer dst) { - Validator.readToBufferArgs(this, dst); - DataTransfer.execute(buffer, dimensions(), dst, DataTransfer::ofBoolean); - return this; - } - - @Override - public BooleanNdArray write(BooleanDataBuffer src) { - Validator.writeFromBufferArgs(this, src); - DataTransfer.execute(src, buffer, dimensions(), DataTransfer::ofBoolean); - return this; - } - - protected BooleanDenseNdArray(BooleanDataBuffer buffer, Shape shape) { - this(buffer, DimensionalSpace.create(shape)); - } - - @Override - BooleanDenseNdArray instantiate(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; - } -} \ No newline at end of file diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/ByteDenseNdArray.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/ByteDenseNdArray.java deleted file mode 100644 index 172432b5939..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/ByteDenseNdArray.java +++ /dev/null @@ -1,91 +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.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 read(ByteDataBuffer dst) { - Validator.readToBufferArgs(this, dst); - DataTransfer.execute(buffer, dimensions(), dst, DataTransfer::ofByte); - return this; - } - - @Override - public ByteNdArray write(ByteDataBuffer src) { - Validator.writeFromBufferArgs(this, src); - DataTransfer.execute(src, buffer, dimensions(), DataTransfer::ofByte); - return this; - } - - protected ByteDenseNdArray(ByteDataBuffer buffer, Shape shape) { - this(buffer, DimensionalSpace.create(shape)); - } - - @Override - ByteDenseNdArray instantiate(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; - } -} \ No newline at end of file diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/DenseNdArray.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/DenseNdArray.java deleted file mode 100644 index 819d95de2fc..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/DenseNdArray.java +++ /dev/null @@ -1,63 +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.ndarray.impl.dense; - -import org.tensorflow.ndarray.Shape; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.NdArray; -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 instantiate(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; - } -} \ No newline at end of file diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/DoubleDenseNdArray.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/DoubleDenseNdArray.java deleted file mode 100644 index f54b8d0347a..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/DoubleDenseNdArray.java +++ /dev/null @@ -1,91 +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.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 read(DoubleDataBuffer dst) { - Validator.readToBufferArgs(this, dst); - DataTransfer.execute(buffer, dimensions(), dst, DataTransfer::ofDouble); - return this; - } - - @Override - public DoubleNdArray write(DoubleDataBuffer src) { - Validator.writeFromBufferArgs(this, src); - DataTransfer.execute(src, buffer, dimensions(), DataTransfer::ofDouble); - return this; - } - - protected DoubleDenseNdArray(DoubleDataBuffer buffer, Shape shape) { - this(buffer, DimensionalSpace.create(shape)); - } - - @Override - DoubleDenseNdArray instantiate(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; - } -} \ No newline at end of file diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/FloatDenseNdArray.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/FloatDenseNdArray.java deleted file mode 100644 index 196b5ef8b11..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/FloatDenseNdArray.java +++ /dev/null @@ -1,91 +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.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 read(FloatDataBuffer dst) { - Validator.readToBufferArgs(this, dst); - DataTransfer.execute(buffer, dimensions(), dst, DataTransfer::ofFloat); - return this; - } - - @Override - public FloatNdArray write(FloatDataBuffer src) { - Validator.writeFromBufferArgs(this, src); - DataTransfer.execute(src, buffer, dimensions(), DataTransfer::ofFloat); - return this; - } - - protected FloatDenseNdArray(FloatDataBuffer buffer, Shape shape) { - this(buffer, DimensionalSpace.create(shape)); - } - - @Override - FloatDenseNdArray instantiate(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/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/IntDenseNdArray.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/IntDenseNdArray.java deleted file mode 100644 index a7af498dd6f..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/IntDenseNdArray.java +++ /dev/null @@ -1,91 +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.ndarray.impl.dense; - -import org.tensorflow.ndarray.Shape; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.IntDataBuffer; -import org.tensorflow.ndarray.IntNdArray; -import org.tensorflow.ndarray.NdArray; -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 read(IntDataBuffer dst) { - Validator.readToBufferArgs(this, dst); - DataTransfer.execute(buffer, dimensions(), dst, DataTransfer::ofInt); - return this; - } - - @Override - public IntNdArray write(IntDataBuffer src) { - Validator.writeFromBufferArgs(this, src); - DataTransfer.execute(src, buffer, dimensions(), DataTransfer::ofInt); - return this; - } - - protected IntDenseNdArray(IntDataBuffer buffer, Shape shape) { - this(buffer, DimensionalSpace.create(shape)); - } - - @Override - IntDenseNdArray instantiate(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; - } -} \ No newline at end of file diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/LongDenseNdArray.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/LongDenseNdArray.java deleted file mode 100644 index cd56dadfb2b..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/LongDenseNdArray.java +++ /dev/null @@ -1,91 +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.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 read(LongDataBuffer dst) { - Validator.readToBufferArgs(this, dst); - DataTransfer.execute(buffer, dimensions(), dst, DataTransfer::ofLong); - return this; - } - - @Override - public LongNdArray write(LongDataBuffer src) { - Validator.writeFromBufferArgs(this, src); - DataTransfer.execute(src, buffer, dimensions(), DataTransfer::ofLong); - return this; - } - - protected LongDenseNdArray(LongDataBuffer buffer, Shape shape) { - this(buffer, DimensionalSpace.create(shape)); - } - - @Override - LongDenseNdArray instantiate(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; - } -} \ No newline at end of file diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/ShortDenseNdArray.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/ShortDenseNdArray.java deleted file mode 100644 index 291c01ac8e1..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/ShortDenseNdArray.java +++ /dev/null @@ -1,91 +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.ndarray.impl.dense; - -import org.tensorflow.ndarray.NdArray; -import org.tensorflow.ndarray.ShortNdArray; -import org.tensorflow.ndarray.Shape; -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 read(ShortDataBuffer dst) { - Validator.readToBufferArgs(this, dst); - DataTransfer.execute(buffer, dimensions(), dst, DataTransfer::ofShort); - return this; - } - - @Override - public ShortNdArray write(ShortDataBuffer src) { - Validator.writeFromBufferArgs(this, src); - DataTransfer.execute(src, buffer, dimensions(), DataTransfer::ofShort); - return this; - } - - protected ShortDenseNdArray(ShortDataBuffer buffer, Shape shape) { - this(buffer, DimensionalSpace.create(shape)); - } - - @Override - ShortDenseNdArray instantiate(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; - } -} \ No newline at end of file diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/Validator.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/Validator.java deleted file mode 100644 index b0bcae252fb..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/Validator.java +++ /dev/null @@ -1,49 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/AbstractDimension.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/AbstractDimension.java deleted file mode 100644 index f2a0fb05b6e..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/AbstractDimension.java +++ /dev/null @@ -1,45 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/Axis.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/Axis.java deleted file mode 100644 index 91973c752a1..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/Axis.java +++ /dev/null @@ -1,61 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/Dimension.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/Dimension.java deleted file mode 100644 index cbae2d897a8..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/Dimension.java +++ /dev/null @@ -1,36 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/IndexedDimension.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/IndexedDimension.java deleted file mode 100644 index 2b609bc3535..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/IndexedDimension.java +++ /dev/null @@ -1,69 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/ReducedDimension.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/ReducedDimension.java deleted file mode 100644 index 4b5cb1adcf8..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/ReducedDimension.java +++ /dev/null @@ -1,62 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/RelativeDimensionalSpace.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/RelativeDimensionalSpace.java deleted file mode 100644 index 4259bbcf76e..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/RelativeDimensionalSpace.java +++ /dev/null @@ -1,32 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/FastElementSequence.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/FastElementSequence.java deleted file mode 100644 index 92cebeb2338..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/FastElementSequence.java +++ /dev/null @@ -1,81 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/index/All.java b/ndarray/src/main/java/org/tensorflow/ndarray/index/All.java deleted file mode 100644 index 9d3139f3248..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/All.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.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/ndarray/src/main/java/org/tensorflow/ndarray/index/At.java b/ndarray/src/main/java/org/tensorflow/ndarray/index/At.java deleted file mode 100644 index 31ce021ddc8..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/At.java +++ /dev/null @@ -1,74 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/index/Ellipsis.java b/ndarray/src/main/java/org/tensorflow/ndarray/index/Ellipsis.java deleted file mode 100644 index d4085735df2..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/Ellipsis.java +++ /dev/null @@ -1,48 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/index/Hyperslab.java b/ndarray/src/main/java/org/tensorflow/ndarray/index/Hyperslab.java deleted file mode 100644 index 55c4e510748..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/Hyperslab.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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/ndarray/src/main/java/org/tensorflow/ndarray/index/Index.java b/ndarray/src/main/java/org/tensorflow/ndarray/index/Index.java deleted file mode 100644 index 617ca4d474b..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/Index.java +++ /dev/null @@ -1,131 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/index/Indices.java b/ndarray/src/main/java/org/tensorflow/ndarray/index/Indices.java deleted file mode 100644 index 346ab705595..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/Indices.java +++ /dev/null @@ -1,363 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/index/NewAxis.java b/ndarray/src/main/java/org/tensorflow/ndarray/index/NewAxis.java deleted file mode 100644 index a68b1ed9ad1..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/NewAxis.java +++ /dev/null @@ -1,53 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/index/Sequence.java b/ndarray/src/main/java/org/tensorflow/ndarray/index/Sequence.java deleted file mode 100644 index 5b93e434e54..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/Sequence.java +++ /dev/null @@ -1,52 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/index/Slice.java b/ndarray/src/main/java/org/tensorflow/ndarray/index/Slice.java deleted file mode 100644 index 1be4368261c..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/Slice.java +++ /dev/null @@ -1,89 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/index/SliceFrom.java b/ndarray/src/main/java/org/tensorflow/ndarray/index/SliceFrom.java deleted file mode 100644 index c968a325cf7..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/SliceFrom.java +++ /dev/null @@ -1,86 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/index/SliceTo.java b/ndarray/src/main/java/org/tensorflow/ndarray/index/SliceTo.java deleted file mode 100644 index 761d1d52a3a..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/SliceTo.java +++ /dev/null @@ -1,86 +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.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/ndarray/src/main/java/org/tensorflow/ndarray/index/Step.java b/ndarray/src/main/java/org/tensorflow/ndarray/index/Step.java deleted file mode 100644 index c9a21c507b6..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/Step.java +++ /dev/null @@ -1,83 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/BooleanNdArrayTestBase.java b/ndarray/src/test/java/org/tensorflow/ndarray/BooleanNdArrayTestBase.java deleted file mode 100644 index 6426ff5a1c2..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/BooleanNdArrayTestBase.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.ndarray; - -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.assertFalse; -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/ndarray/src/test/java/org/tensorflow/ndarray/ByteNdArrayTestBase.java b/ndarray/src/test/java/org/tensorflow/ndarray/ByteNdArrayTestBase.java deleted file mode 100644 index 407efffda94..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/ByteNdArrayTestBase.java +++ /dev/null @@ -1,55 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/DoubleNdArrayTestBase.java b/ndarray/src/test/java/org/tensorflow/ndarray/DoubleNdArrayTestBase.java deleted file mode 100644 index d4f98e2caa0..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/DoubleNdArrayTestBase.java +++ /dev/null @@ -1,55 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/FloatNdArrayTestBase.java b/ndarray/src/test/java/org/tensorflow/ndarray/FloatNdArrayTestBase.java deleted file mode 100644 index 55f05ae3de1..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/FloatNdArrayTestBase.java +++ /dev/null @@ -1,55 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/IndexTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/IndexTest.java deleted file mode 100644 index 6f92dab9b99..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/IndexTest.java +++ /dev/null @@ -1,205 +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.ndarray; - -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 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/ndarray/src/test/java/org/tensorflow/ndarray/IntNdArrayTestBase.java b/ndarray/src/test/java/org/tensorflow/ndarray/IntNdArrayTestBase.java deleted file mode 100644 index 1a3c7cb1a12..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/IntNdArrayTestBase.java +++ /dev/null @@ -1,55 +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.ndarray; - -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)); - } -} diff --git a/ndarray/src/test/java/org/tensorflow/ndarray/LongNdArrayTestBase.java b/ndarray/src/test/java/org/tensorflow/ndarray/LongNdArrayTestBase.java deleted file mode 100644 index b91c19d6557..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/LongNdArrayTestBase.java +++ /dev/null @@ -1,55 +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.ndarray; - -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)); - } -} diff --git a/ndarray/src/test/java/org/tensorflow/ndarray/NdArrayTestBase.java b/ndarray/src/test/java/org/tensorflow/ndarray/NdArrayTestBase.java deleted file mode 100644 index 26ac533daa8..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/NdArrayTestBase.java +++ /dev/null @@ -1,338 +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.ndarray; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.fail; -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.sliceFrom; -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.sliceTo; - -import java.nio.BufferOverflowException; -import java.nio.BufferUnderflowException; -import org.junit.jupiter.api.Test; -import org.tensorflow.ndarray.buffer.DataBuffer; - -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().size(0)); - assertEquals(5L, matrix.shape().size(1)); - - for (NdArray vector : matrix.elements(0)) { - assertEquals(1L, vector.shape().numDimensions()) ; - assertEquals(5L, vector.shape().size(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.write(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.read(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.write(buffer.narrow(10)); - fail(); - } catch (BufferUnderflowException e) { - // as expected - } - try { - matrix.read(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()); - } -} diff --git a/ndarray/src/test/java/org/tensorflow/ndarray/ShortNdArrayTestBase.java b/ndarray/src/test/java/org/tensorflow/ndarray/ShortNdArrayTestBase.java deleted file mode 100644 index f9043fec4f5..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/ShortNdArrayTestBase.java +++ /dev/null @@ -1,55 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/benchmark/NdArrayBenchmark.java b/ndarray/src/test/java/org/tensorflow/ndarray/benchmark/NdArrayBenchmark.java deleted file mode 100644 index fb7022bc830..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/benchmark/NdArrayBenchmark.java +++ /dev/null @@ -1,163 +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.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.Shape; -import org.tensorflow.ndarray.FloatNdArray; -import org.tensorflow.ndarray.NdArrays; -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/ndarray/src/test/java/org/tensorflow/ndarray/buffer/BooleanDataBufferTestBase.java b/ndarray/src/test/java/org/tensorflow/ndarray/buffer/BooleanDataBufferTestBase.java deleted file mode 100644 index 3f6df8aa1ce..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/buffer/BooleanDataBufferTestBase.java +++ /dev/null @@ -1,142 +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.ndarray.buffer; - -import static org.junit.jupiter.api.Assertions.assertTrue; -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 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/ndarray/src/test/java/org/tensorflow/ndarray/buffer/ByteDataBufferTestBase.java b/ndarray/src/test/java/org/tensorflow/ndarray/buffer/ByteDataBufferTestBase.java deleted file mode 100644 index 777368466f5..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/buffer/ByteDataBufferTestBase.java +++ /dev/null @@ -1,145 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/buffer/DoubleDataBufferTestBase.java b/ndarray/src/test/java/org/tensorflow/ndarray/buffer/DoubleDataBufferTestBase.java deleted file mode 100644 index 4dee064968c..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/buffer/DoubleDataBufferTestBase.java +++ /dev/null @@ -1,135 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/buffer/FloatDataBufferTestBase.java b/ndarray/src/test/java/org/tensorflow/ndarray/buffer/FloatDataBufferTestBase.java deleted file mode 100644 index 49c4f15b808..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/buffer/FloatDataBufferTestBase.java +++ /dev/null @@ -1,135 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/buffer/IntDataBufferTestBase.java b/ndarray/src/test/java/org/tensorflow/ndarray/buffer/IntDataBufferTestBase.java deleted file mode 100644 index f3642e88ef8..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/buffer/IntDataBufferTestBase.java +++ /dev/null @@ -1,135 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/buffer/LongDataBufferTestBase.java b/ndarray/src/test/java/org/tensorflow/ndarray/buffer/LongDataBufferTestBase.java deleted file mode 100644 index e0d8b1b4539..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/buffer/LongDataBufferTestBase.java +++ /dev/null @@ -1,135 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/buffer/ShortDataBufferTestBase.java b/ndarray/src/test/java/org/tensorflow/ndarray/buffer/ShortDataBufferTestBase.java deleted file mode 100644 index f3269e85a8f..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/buffer/ShortDataBufferTestBase.java +++ /dev/null @@ -1,135 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/BigIntegerDataBufferAdapterTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/BigIntegerDataBufferAdapterTest.java deleted file mode 100644 index 4bb86fe3f33..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/BigIntegerDataBufferAdapterTest.java +++ /dev/null @@ -1,67 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/BooleanDataBufferAdapterTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/BooleanDataBufferAdapterTest.java deleted file mode 100644 index a15e8f388a8..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/BooleanDataBufferAdapterTest.java +++ /dev/null @@ -1,45 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/ByteDataBufferAdapterTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/ByteDataBufferAdapterTest.java deleted file mode 100644 index 8a6287601f5..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/ByteDataBufferAdapterTest.java +++ /dev/null @@ -1,27 +0,0 @@ -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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/DoubleDataBufferAdapterTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/DoubleDataBufferAdapterTest.java deleted file mode 100644 index 8dfee1182b1..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/DoubleDataBufferAdapterTest.java +++ /dev/null @@ -1,61 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/FloatDataBufferAdapterTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/FloatDataBufferAdapterTest.java deleted file mode 100644 index 82b8ee947dd..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/FloatDataBufferAdapterTest.java +++ /dev/null @@ -1,52 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/IntDataBufferAdapterTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/IntDataBufferAdapterTest.java deleted file mode 100644 index 9c00f92b00d..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/IntDataBufferAdapterTest.java +++ /dev/null @@ -1,51 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/LongDataBufferAdapterTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/LongDataBufferAdapterTest.java deleted file mode 100644 index 40bc4c55b3e..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/LongDataBufferAdapterTest.java +++ /dev/null @@ -1,60 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/ShortDataBufferAdapterTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/ShortDataBufferAdapterTest.java deleted file mode 100644 index 3c11d3a46ad..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/ShortDataBufferAdapterTest.java +++ /dev/null @@ -1,45 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/layout/Bfloat16LayoutTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/layout/Bfloat16LayoutTest.java deleted file mode 100644 index 48ddeb1c56e..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/layout/Bfloat16LayoutTest.java +++ /dev/null @@ -1,84 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/layout/BoolLayoutTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/layout/BoolLayoutTest.java deleted file mode 100644 index 6ba903cadec..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/layout/BoolLayoutTest.java +++ /dev/null @@ -1,42 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/layout/Float16LayoutTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/layout/Float16LayoutTest.java deleted file mode 100644 index 7bc430ac4ba..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/layout/Float16LayoutTest.java +++ /dev/null @@ -1,90 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/misc/BitSetDataBufferTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/misc/BitSetDataBufferTest.java deleted file mode 100644 index ec5c513869a..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/misc/BitSetDataBufferTest.java +++ /dev/null @@ -1,34 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/misc/StringArrayDataBufferTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/misc/StringArrayDataBufferTest.java deleted file mode 100644 index 3e9c3c0cdbf..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/misc/StringArrayDataBufferTest.java +++ /dev/null @@ -1,33 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/ByteNioDataBufferTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/ByteNioDataBufferTest.java deleted file mode 100644 index 28ff5a6c104..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/ByteNioDataBufferTest.java +++ /dev/null @@ -1,29 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/DoubleNioDataBufferTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/DoubleNioDataBufferTest.java deleted file mode 100644 index 7a4d39dce94..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/DoubleNioDataBufferTest.java +++ /dev/null @@ -1,29 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/FloatNioDataBufferTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/FloatNioDataBufferTest.java deleted file mode 100644 index 08089e76ad8..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/FloatNioDataBufferTest.java +++ /dev/null @@ -1,29 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/IntNioDataBufferTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/IntNioDataBufferTest.java deleted file mode 100644 index 00a993e42ed..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/IntNioDataBufferTest.java +++ /dev/null @@ -1,29 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/LongNioDataBufferTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/LongNioDataBufferTest.java deleted file mode 100644 index 5922d2b922c..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/LongNioDataBufferTest.java +++ /dev/null @@ -1,29 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/ShortNioDataBufferTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/ShortNioDataBufferTest.java deleted file mode 100644 index c76191fbcf1..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/ShortNioDataBufferTest.java +++ /dev/null @@ -1,29 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/BooleanRawDataBufferTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/BooleanRawDataBufferTest.java deleted file mode 100644 index 1f09d76055d..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/BooleanRawDataBufferTest.java +++ /dev/null @@ -1,28 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/ByteRawDataBufferTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/ByteRawDataBufferTest.java deleted file mode 100644 index 4a415aff49f..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/ByteRawDataBufferTest.java +++ /dev/null @@ -1,28 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/DoubleRawDataBufferTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/DoubleRawDataBufferTest.java deleted file mode 100644 index df845092dd1..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/DoubleRawDataBufferTest.java +++ /dev/null @@ -1,28 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/FloatRawDataBufferTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/FloatRawDataBufferTest.java deleted file mode 100644 index bc453d79f37..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/FloatRawDataBufferTest.java +++ /dev/null @@ -1,28 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/IntRawDataBufferTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/IntRawDataBufferTest.java deleted file mode 100644 index 1142f19131d..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/IntRawDataBufferTest.java +++ /dev/null @@ -1,28 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/LongRawDataBufferTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/LongRawDataBufferTest.java deleted file mode 100644 index af86d64a414..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/LongRawDataBufferTest.java +++ /dev/null @@ -1,28 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/ShortRawDataBufferTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/ShortRawDataBufferTest.java deleted file mode 100644 index 1ce1f25391b..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/ShortRawDataBufferTest.java +++ /dev/null @@ -1,28 +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.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/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/BooleanDenseNdArrayTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/BooleanDenseNdArrayTest.java deleted file mode 100644 index 36540104eb7..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/BooleanDenseNdArrayTest.java +++ /dev/null @@ -1,35 +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.ndarray.impl.dense; - -import org.tensorflow.ndarray.Shape; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataBuffers; -import org.tensorflow.ndarray.BooleanNdArray; -import org.tensorflow.ndarray.BooleanNdArrayTestBase; -import org.tensorflow.ndarray.NdArrays; - -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); - } -} diff --git a/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/ByteDenseNdArrayTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/ByteDenseNdArrayTest.java deleted file mode 100644 index 2e5d1939bc3..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/ByteDenseNdArrayTest.java +++ /dev/null @@ -1,35 +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.ndarray.impl.dense; - -import org.tensorflow.ndarray.Shape; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataBuffers; -import org.tensorflow.ndarray.ByteNdArray; -import org.tensorflow.ndarray.ByteNdArrayTestBase; -import org.tensorflow.ndarray.NdArrays; - -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/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/DoubleDenseNdArrayTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/DoubleDenseNdArrayTest.java deleted file mode 100644 index 9810a744c50..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/DoubleDenseNdArrayTest.java +++ /dev/null @@ -1,35 +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.ndarray.impl.dense; - -import org.tensorflow.ndarray.Shape; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataBuffers; -import org.tensorflow.ndarray.DoubleNdArray; -import org.tensorflow.ndarray.DoubleNdArrayTestBase; -import org.tensorflow.ndarray.NdArrays; - -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); - } -} diff --git a/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/FloatDenseNdArrayTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/FloatDenseNdArrayTest.java deleted file mode 100644 index efee2bf2cb8..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/FloatDenseNdArrayTest.java +++ /dev/null @@ -1,35 +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.ndarray.impl.dense; - -import org.tensorflow.ndarray.Shape; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataBuffers; -import org.tensorflow.ndarray.FloatNdArray; -import org.tensorflow.ndarray.FloatNdArrayTestBase; -import org.tensorflow.ndarray.NdArrays; - -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); - } -} diff --git a/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/IntDenseNdArrayTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/IntDenseNdArrayTest.java deleted file mode 100644 index 712f6f44333..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/IntDenseNdArrayTest.java +++ /dev/null @@ -1,35 +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.ndarray.impl.dense; - -import org.tensorflow.ndarray.Shape; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataBuffers; -import org.tensorflow.ndarray.IntNdArray; -import org.tensorflow.ndarray.IntNdArrayTestBase; -import org.tensorflow.ndarray.NdArrays; - -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/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/LongDenseNdArrayTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/LongDenseNdArrayTest.java deleted file mode 100644 index 346e3845080..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/LongDenseNdArrayTest.java +++ /dev/null @@ -1,35 +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.ndarray.impl.dense; - -import org.tensorflow.ndarray.Shape; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataBuffers; -import org.tensorflow.ndarray.LongNdArray; -import org.tensorflow.ndarray.LongNdArrayTestBase; -import org.tensorflow.ndarray.NdArrays; - -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/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/ShortDenseNdArrayTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/ShortDenseNdArrayTest.java deleted file mode 100644 index 6f845c7c65d..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/ShortDenseNdArrayTest.java +++ /dev/null @@ -1,35 +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.ndarray.impl.dense; - -import org.tensorflow.ndarray.Shape; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataBuffers; -import org.tensorflow.ndarray.NdArrays; -import org.tensorflow.ndarray.ShortNdArray; -import org.tensorflow.ndarray.ShortNdArrayTestBase; - -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/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/StringDenseNdArrayTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/StringDenseNdArrayTest.java deleted file mode 100644 index 5afc1420ab2..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/StringDenseNdArrayTest.java +++ /dev/null @@ -1,43 +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.ndarray.impl.dense; - -import org.tensorflow.ndarray.Shape; -import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.ndarray.buffer.DataBuffers; -import org.tensorflow.ndarray.NdArray; -import org.tensorflow.ndarray.NdArrayTestBase; -import org.tensorflow.ndarray.NdArrays; - -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/pom.xml b/pom.xml index 4e79a6ca61c..d39dedd9e2a 100644 --- a/pom.xml +++ b/pom.xml @@ -1,11 +1,13 @@ - + 4.0.0 org.tensorflow tensorflow-java - 0.3.0-SNAPSHOT + 1.2.0-SNAPSHOT pom TensorFlow Java Parent @@ -17,40 +19,45 @@ 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 - ndarray + tensorflow-ndarray tensorflow-core tensorflow-framework - ASCII - 1.8 - 1.8 - 5.6.2 - 1.21 + ${os.name}-${os.arch} + + UTF8 + 11 + 11 + 11 + 5.10.0 + 1.37 2.7 + 2.25.0 true true true + 2.46.1 - ossrh-snapshots - OSSRH Sonatype Snapshots - https://oss.sonatype.org/content/repositories/snapshots + central-snapshots + Maven Central Snapshots + https://central.sonatype.com/repository/maven-snapshots/ false @@ -59,11 +66,12 @@ + - ossrh-snapshots - OSSRH Sonatype Snapshots - https://oss.sonatype.org/content/repositories/snapshots + central-snapshots + Maven Central Plugin Snapshots + https://central.sonatype.com/repository/maven-snapshots/ false @@ -73,19 +81,14 @@ - - ossrh - https://oss.sonatype.org/content/repositories/snapshots + central + https://central.sonatype.com/repository/maven-snapshots - ossrh - https://oss.sonatype.org/service/local/staging/deployByRepositoryId/${stagingRepositoryId}/ + central + https://ossrh-staging-api.central.sonatype.com/service/local/staging/deployByRepositoryId/${stagingRepositoryId}/ @@ -102,19 +105,19 @@ junit-jupiter-engine ${junit.version} test - - - org.openjdk.jmh - jmh-core - ${jmh.version} - test - - - org.openjdk.jmh - jmh-generator-annprocess - ${jmh.version} + + + org.openjdk.jmh + jmh-core + ${jmh.version} + test + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh.version} test - + @@ -142,6 +145,7 @@ false + + + lint + + + + lint.skip + !true + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + true + + + -Xlint:all + -XDcompilePolicy=simple + + -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 + -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED + -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 + + + + com.google.errorprone + error_prone_core + ${errorprone.version} + + + + + + + + + + + apply-format + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + spotless-apply + initialize + + apply + + + + + + + + + + + check-format + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + spotless-check + initialize + + check + + + + + + + + + + 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 + + - 11 - 11 - 11 + windows @@ -179,19 +468,47 @@ - TensorFlowers + 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 @@ -210,7 +527,7 @@ maven-source-plugin - 3.2.1 + 3.3.0 attach-sources @@ -222,16 +539,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 - @@ -245,13 +584,51 @@ true + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + origin/master + + + + 1.20.0 + + + + + + + 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 52a61d4615a..cc87f6a76bc 100644 --- a/tensorflow-core/pom.xml +++ b/tensorflow-core/pom.xml @@ -22,7 +22,7 @@ org.tensorflow tensorflow-java - 0.3.0-SNAPSHOT + 1.2.0-SNAPSHOT tensorflow-core pom @@ -31,892 +31,47 @@ Parent POM of TensorFlow core artifacts + tensorflow-core-native tensorflow-core-generator tensorflow-core-api + + 4.31.1 + ${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.4 + 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-mkl - tensorflow-core-platform-mkl-gpu - 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 461b2996401..00000000000 --- a/tensorflow-core/tensorflow-core-api/.bazelrc +++ /dev/null @@ -1,618 +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=@org_tensorflow//third_party/toolchains/java:tf_java_toolchain -build --host_java_toolchain=@org_tensorflow//third_party/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" diff --git a/tensorflow-core/tensorflow-core-api/BUILD b/tensorflow-core/tensorflow-core-api/BUILD deleted file mode 100644 index ad260fe61ea..00000000000 --- a/tensorflow-core/tensorflow-core-api/BUILD +++ /dev/null @@ -1,81 +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_generator", - linkopts = select({ - "@org_tensorflow//tensorflow:windows": [], - "//conditions:default": ["-lm"], - }), - deps = [ - ":java_op_gen_lib", - ], -) - -cc_library( - name = "java_op_gen_lib", - srcs = [ - "src/bazel/op_generator/op_gen_main.cc", - "src/bazel/op_generator/op_generator.cc", - "src/bazel/op_generator/op_specs.cc", - "src/bazel/op_generator/source_writer.cc", - ], - hdrs = [ - "src/bazel/op_generator/java_defs.h", - "src/bazel/op_generator/op_generator.h", - "src/bazel/op_generator/op_specs.h", - "src/bazel/op_generator/source_writer.h", - ], - 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", - "@com_googlesource_code_re2//:re2", - ], -) - -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 bd5ce478f66..00000000000 --- a/tensorflow-core/tensorflow-core-api/WORKSPACE +++ /dev/null @@ -1,47 +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/v2.4.1.tar.gz", - ], - sha256 = "f681331f8fc0800883761c7709d13cda11942d4ad5ff9f44ad855e9dc78387e0", - strip_prefix = "tensorflow-2.4.1" -) - -# START: Upstream TensorFlow dependencies -# TensorFlow build depends on these dependencies. -# Needs to be in-sync with TensorFlow sources. -http_archive( - name = "io_bazel_rules_closure", - sha256 = "5b00383d08dd71f28503736db0500b6fb4dda47489ff5fc6bed42557c07c6ba9", - strip_prefix = "rules_closure-308b05b2419edb5c8ee0471b67a40403df940149", - urls = [ - "https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz", - "https://github.com/bazelbuild/rules_closure/archive/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz", # 2019-06-13 - ], -) -# END: Upstream TensorFlow dependencies - -load("@org_tensorflow//tensorflow:workspace.bzl", "tf_workspace") -tf_workspace() - -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 b87f513c4bd..00000000000 --- a/tensorflow-core/tensorflow-core-api/build.sh +++ /dev/null @@ -1,91 +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_generator \ - :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 ' ') - 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 - -# Generate Java operator wrappers -$BAZEL_BIN/java_op_generator \ - --output_dir=$GEN_SRCS_DIR \ - --api_dirs=$BAZEL_SRCS/external/org_tensorflow/tensorflow/core/api_def/base_api,src/bazel/api_def \ - $TENSORFLOW_LIB - -# 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 3dac55ccee7..00000000000 --- a/tensorflow-core/tensorflow-core-api/external/tensorflow-proto.patch +++ /dev/null @@ -1,150 +0,0 @@ -diff -ruN tensorflow-2.4.1/tensorflow/core/protobuf/bfc_memory_map.proto tensorflow-2.4.1-proto/tensorflow/core/protobuf/bfc_memory_map.proto ---- tensorflow-2.4.1/tensorflow/core/protobuf/bfc_memory_map.proto 2021-01-21 09:25:54.000000000 +0900 -+++ tensorflow-2.4.1-proto/tensorflow/core/protobuf/bfc_memory_map.proto 2021-02-08 09:43:41.885495355 +0900 -@@ -3,6 +3,9 @@ - package tensorflow; - - option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/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.4.1/tensorflow/core/protobuf/data/experimental/snapshot.proto tensorflow-2.4.1-proto/tensorflow/core/protobuf/data/experimental/snapshot.proto ---- tensorflow-2.4.1/tensorflow/core/protobuf/data/experimental/snapshot.proto 2021-01-21 09:25:54.000000000 +0900 -+++ tensorflow-2.4.1-proto/tensorflow/core/protobuf/data/experimental/snapshot.proto 2021-02-08 09:40:24.584065472 +0900 -@@ -6,6 +6,10 @@ - import "tensorflow/core/framework/tensor_shape.proto"; - import "tensorflow/core/framework/types.proto"; - -+option java_outer_classname = "SnapshotProtos"; -+option java_multiple_files = true; -+option java_package = "org.tensorflow.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.4.1/tensorflow/core/protobuf/device_properties.proto tensorflow-2.4.1-proto/tensorflow/core/protobuf/device_properties.proto ---- tensorflow-2.4.1/tensorflow/core/protobuf/device_properties.proto 2021-01-21 09:25:54.000000000 +0900 -+++ tensorflow-2.4.1-proto/tensorflow/core/protobuf/device_properties.proto 2021-02-08 09:41:23.317918806 +0900 -@@ -19,6 +19,8 @@ - - option cc_enable_arenas = true; - option java_outer_classname = "DevicePropertiesProtos"; -+option java_multiple_files = true; -+option java_package = "org.tensorflow.framework"; - option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto"; - - message DeviceProperties { -diff -ruN tensorflow-2.4.1/tensorflow/core/protobuf/saved_object_graph.proto tensorflow-2.4.1-proto/tensorflow/core/protobuf/saved_object_graph.proto ---- tensorflow-2.4.1/tensorflow/core/protobuf/saved_object_graph.proto 2021-01-21 09:25:54.000000000 +0900 -+++ tensorflow-2.4.1-proto/tensorflow/core/protobuf/saved_object_graph.proto 2021-02-08 09:41:50.066852012 +0900 -@@ -11,6 +11,9 @@ - - option cc_enable_arenas = true; - option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/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.4.1/tensorflow/core/protobuf/struct.proto tensorflow-2.4.1-proto/tensorflow/core/protobuf/struct.proto ---- tensorflow-2.4.1/tensorflow/core/protobuf/struct.proto 2021-01-21 09:25:54.000000000 +0900 -+++ tensorflow-2.4.1-proto/tensorflow/core/protobuf/struct.proto 2021-02-08 09:42:06.645810614 +0900 -@@ -7,6 +7,9 @@ - import "tensorflow/core/framework/types.proto"; - - option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/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.4.1/tensorflow/core/protobuf/trackable_object_graph.proto tensorflow-2.4.1-proto/tensorflow/core/protobuf/trackable_object_graph.proto ---- tensorflow-2.4.1/tensorflow/core/protobuf/trackable_object_graph.proto 2021-01-21 09:25:54.000000000 +0900 -+++ tensorflow-2.4.1-proto/tensorflow/core/protobuf/trackable_object_graph.proto 2021-02-08 09:42:24.581760720 +0900 -@@ -4,6 +4,9 @@ - - option cc_enable_arenas = true; - option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/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.4.1/tensorflow/core/protobuf/transport_options.proto tensorflow-2.4.1-proto/tensorflow/core/protobuf/transport_options.proto ---- tensorflow-2.4.1/tensorflow/core/protobuf/transport_options.proto 2021-01-21 09:25:54.000000000 +0900 -+++ tensorflow-2.4.1-proto/tensorflow/core/protobuf/transport_options.proto 2021-02-08 09:42:56.660650580 +0900 -@@ -3,6 +3,7 @@ - package tensorflow; - - option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/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.4.1/tensorflow/core/lib/core/error_codes.proto tensorflow-2.4.1-proto/tensorflow/core/lib/core/error_codes.proto ---- tensorflow-2.4.1/tensorflow/core/lib/core/error_codes.proto 2021-01-21 09:25:54.000000000 +0900 -+++ tensorflow-2.4.1-proto/tensorflow/core/lib/core/error_codes.proto 2021-02-08 09:40:24.590065457 +0900 -@@ -1,3 +1,5 @@ - syntax = "proto3"; - -+option java_package = "org.tensorflow.framework"; -+ - import public "tensorflow/core/protobuf/error_codes.proto"; -diff -ruN tensorflow-2.4.1/tensorflow/core/profiler/protobuf/xplane.proto tensorflow-2.4.1-proto/tensorflow/core/profiler/protobuf/xplane.proto ---- tensorflow-2.4.1/tensorflow/core/profiler/protobuf/xplane.proto 2021-01-21 09:25:54.000000000 +0900 -+++ tensorflow-2.4.1-proto/tensorflow/core/profiler/protobuf/xplane.proto 2021-02-08 09:40:24.591065455 +0900 -@@ -3,6 +3,9 @@ - package tensorflow.profiler; - - option cc_enable_arenas = true; -+option java_outer_classname = "XPlaneProtos"; -+option java_multiple_files = true; -+option java_package = "org.tensorflow.profiler"; - - // A container of parallel XPlanes, generated by one or more profiling sources. - // Next ID: 5 -diff -ruN tensorflow-2.4.1/tensorflow/core/util/memmapped_file_system.proto tensorflow-2.4.1-proto/tensorflow/core/util/memmapped_file_system.proto ---- tensorflow-2.4.1/tensorflow/core/util/memmapped_file_system.proto 2021-01-21 09:25:54.000000000 +0900 -+++ tensorflow-2.4.1-proto/tensorflow/core/util/memmapped_file_system.proto 2021-02-08 09:40:24.592065452 +0900 -@@ -17,6 +17,9 @@ - package tensorflow; - - option cc_enable_arenas = true; -+option java_outer_classname = "MemmappedFileSystemProtos"; -+option java_multiple_files = true; -+option java_package = "org.tensorflow.util"; - - // A message that describes one region of memmapped file. - message MemmappedFileSystemDirectoryElement { -diff -ruN tensorflow-2.4.1/tensorflow/core/profiler/profiler_options.proto tensorflow-2.4.1-proto/tensorflow/core/profiler/profiler_options.proto ---- tensorflow-2.4.1/tensorflow/core/profiler/profiler_options.proto 2021-01-21 09:25:54.000000000 +0900 -+++ tensorflow-2.4.1-proto/tensorflow/core/profiler/profiler_options.proto 2021-02-08 09:40:24.593065450 +0900 -@@ -1,6 +1,9 @@ - syntax = "proto3"; - - package tensorflow; -+option java_outer_classname = "ProfilerOptionsProtos"; -+option java_multiple_files = true; -+option java_package = "org.tensorflow.profiler"; - - // Next ID: 11 - message ProfileOptions { - -diff --git a/tensorflow/core/protobuf/data/experimental/service_config.proto b/tensorflow/core/protobuf/data/experimental/service_config.proto -index 3dcd2cd48d..ae2cfdd94f 100644 ---- a/tensorflow/core/protobuf/data/experimental/service_config.proto -+++ b/tensorflow/core/protobuf/data/experimental/service_config.proto -@@ -1,6 +1,7 @@ - syntax = "proto3"; - - package tensorflow.data.experimental; -+option java_package = "org.tensorflow.data.experimental"; - - // Configuration for a tf.data service DispatchServer. - message DispatcherConfig { diff --git a/tensorflow-core/tensorflow-core-api/external/tensorflow-visibility.patch b/tensorflow-core/tensorflow-core-api/external/tensorflow-visibility.patch deleted file mode 100644 index 03fda9811c3..00000000000 --- a/tensorflow-core/tensorflow-core-api/external/tensorflow-visibility.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff --git a/tensorflow/BUILD b/tensorflow/BUILD -index 55406a5686..35d1547dfb 100644 ---- a/tensorflow/BUILD -+++ b/tensorflow/BUILD -@@ -33,7 +33,7 @@ load( - load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - - package( -- default_visibility = [":internal"], -+ default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 - ) - -diff --ruN a/tensorflow/core/api_def/BUILD b/tensorflow/core/api_def/BUILD ---- a/tensorflow/core/api_def/BUILD 2020-03-26 18:19:19.000000000 -0400 -+++ b/tensorflow/core/api_def/BUILD 2020-04-01 22:50:37.000000000 -0400 -@@ -28,7 +28,7 @@ package( - filegroup( - name = "base_api_def", - srcs = glob(["base_api/*"]), -- visibility = ["//tensorflow:internal"], -+ visibility = ["//visibility:public"], - ) - - filegroup( -diff -ruN a/tensorflow/tools/api/lib/BUILD b/tensorflow/tools/api/lib/BUILD ---- a/tensorflow/tools/api/lib/BUILD 2020-03-26 18:19:19.000000000 -0400 -+++ b/tensorflow/tools/api/lib/BUILD 2020-04-01 22:50:37.000000000 -0400 -@@ -13,6 +13,7 @@ - tf_proto_library( - name = "api_objects_proto", - srcs = ["api_objects.proto"], -+ visibility = ["//visibility:public"], - ) - - py_library( - \ No newline at end of file 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 3e04e9bb1f7..a4cd84dcf20 100644 --- a/tensorflow-core/tensorflow-core-api/pom.xml +++ b/tensorflow-core/tensorflow-core-api/pom.xml @@ -6,56 +6,47 @@ org.tensorflow tensorflow-core - 0.3.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. - - 3.8.0 - false - ${native.build.skip} - ${native.build.skip} - ${native.build.skip} - org.tensorflow.core.api + 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 + tensorflow-core-native ${project.version} + ${native.classifier} + test - - org.junit.jupiter - junit-jupiter-api - test - - - org.junit.jupiter - junit-jupiter-engine - test + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter-engine + test org.openjdk.jmh @@ -65,7 +56,7 @@ com.google.truth truth - 1.0.1 + ${truth.version} test @@ -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,312 +199,54 @@ ${project.basedir}/src/gen/java + ${project.basedir}/src/gen/annotations + - maven-compiler-plugin - 3.8.0 + maven-source-plugin + 3.3.0 - - default-compile - - - org.tensorflow.processor.operator.OperatorProcessor - - - - org.tensorflow - tensorflow-core-generator - ${project.version} - - - - ${project.basedir}/src/gen/annotations - - - - - javacpp-parser - generate-sources + attach-sources - compile + jar-no-fork - - - 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/ - - + org.codehaus.mojo + exec-maven-plugin + 3.1.0 - javacpp-validate - validate + dist-download + test-compile - build - - - - - javacpp-build - initialize - - build + exec - ${javacpp.build.skip} - - bash - ${project.basedir}/build.sh - + ${test.download.skip} + bash + + scripts/test_download.sh + ${test.download.folder} + - ${javacpp.platform.extension} - ${native.build.flags} + ${native.classifier} ${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 - - build - - - ${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} - - - - - 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 - - jar-no-fork - - - - - - maven-javadoc-plugin - 3.2.0 - - - attach-javadocs - - jar - - - false - 256m - 2048m - - http://bytedeco.org/javacpp/apidocs - - - - - - - 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..22666bb2b80 --- /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/a9/b9/02707723d44e5d0fe5f7d27ba4237528bc654bac1b0f638efe37988584b1/tensorflow_text-2.20.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl' + ;; + 'linux-arm64') + TEXT_WHEEL_URL='https://files.pythonhosted.org/packages/17/99/b397038628a660a1446bb79c8be284443a28500d072227a77ebaeb5cd149/tensorflow_text-2.20.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl' + ;; + 'macosx-arm64') + TEXT_WHEEL_URL='https://files.pythonhosted.org/packages/61/b8/ccb0c3b048f268860f4c92f6bb7ab55c6af6c2fe4e26746c8dc384063915/tensorflow_text-2.20.1-cp313-cp313-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/api/api_def_AssertCardinalityDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AssertCardinalityDataset.pbtxt new file mode 100644 index 00000000000..fc93c13b627 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AssertCardinalityDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "AssertCardinalityDataset" + visibility: VISIBLE + endpoint { + name: "data.AssertCardinalityDataset" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AssertNextDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AssertNextDataset.pbtxt new file mode 100644 index 00000000000..d85694ae56e --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AssertNextDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "AssertNextDataset" + visibility: VISIBLE + endpoint { + name: "data.AssertNextDataset" + } +} 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/api/api_def_AutoShardDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AutoShardDataset.pbtxt new file mode 100644 index 00000000000..75488eb84eb --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AutoShardDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "AutoShardDataset" + visibility: VISIBLE + endpoint { + name: "data.AutoShardDataset" + } +} 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/api/api_def_BatchMatMulV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatMulV2.pbtxt new file mode 100644 index 00000000000..a3fd55b55f5 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatMulV2.pbtxt @@ -0,0 +1,4 @@ +op { + graph_op_name: "BatchMatMulV2" + visibility: SKIP +} 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/api/api_def_BytesProducedStatsDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BytesProducedStatsDataset.pbtxt new file mode 100644 index 00000000000..b9d81b54105 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BytesProducedStatsDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "BytesProducedStatsDataset" + visibility: VISIBLE + endpoint { + name: "data.BytesProducedStatsDataset" + } +} 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/api/api_def_CSVDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CSVDataset.pbtxt new file mode 100644 index 00000000000..b4637f34b40 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CSVDataset.pbtxt @@ -0,0 +1,4 @@ +op { + graph_op_name: "CSVDataset" + visibility: SKIP +} diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CSVDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CSVDatasetV2.pbtxt new file mode 100644 index 00000000000..2c2848e9a74 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CSVDatasetV2.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "CSVDatasetV2" + visibility: VISIBLE + endpoint { + name: "data.CSVDataset" + } +} 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/api/api_def_CacheDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CacheDataset.pbtxt new file mode 100644 index 00000000000..4b4b9bb3b53 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CacheDataset.pbtxt @@ -0,0 +1,4 @@ +op { + graph_op_name: "CacheDataset" + visibility: SKIP +} diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CacheDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CacheDatasetV2.pbtxt new file mode 100644 index 00000000000..8c5b58383c3 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CacheDatasetV2.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "CacheDatasetV2" + visibility: VISIBLE + endpoint { + name: "data.CacheDataset" + } +} 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/api/api_def_ChooseFastestBranchDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ChooseFastestBranchDataset.pbtxt new file mode 100644 index 00000000000..b3be1a9cd3b --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ChooseFastestBranchDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "ChooseFastestBranchDataset" + visibility: VISIBLE + endpoint { + name: "data.ChooseFastestBranchDataset" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ChooseFastestDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ChooseFastestDataset.pbtxt new file mode 100644 index 00000000000..a25508efebc --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ChooseFastestDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "ChooseFastestDataset" + visibility: VISIBLE + endpoint { + name: "data.ChooseFastestDataset" + } +} 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/api/api_def_DataServiceDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DataServiceDataset.pbtxt new file mode 100644 index 00000000000..cfe0fc978fc --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DataServiceDataset.pbtxt @@ -0,0 +1,4 @@ +op { + graph_op_name: "DataServiceDataset" + visibility: SKIP +} 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/api/api_def_DatasetCardinality.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetCardinality.pbtxt new file mode 100644 index 00000000000..6a699fc214e --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetCardinality.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "DatasetCardinality" + visibility: VISIBLE + endpoint { + name: "data.DatasetCardinality" + } +} 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/api/api_def_DatasetFromGraph.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetFromGraph.pbtxt new file mode 100644 index 00000000000..80ea2a57196 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetFromGraph.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "DatasetFromGraph" + visibility: VISIBLE + endpoint { + name: "data.DatasetFromGraph" + } +} 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/api/api_def_DatasetToGraphV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetToGraphV2.pbtxt new file mode 100644 index 00000000000..99be66c5e54 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetToGraphV2.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "DatasetToGraphV2" + visibility: VISIBLE + endpoint { + name: "data.DatasetToGraph" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetToSingleElement.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetToSingleElement.pbtxt new file mode 100644 index 00000000000..0f0407914d4 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetToSingleElement.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "DatasetToSingleElement" + visibility: VISIBLE + endpoint { + name: "data.DatasetToSingleElement" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetToTFRecord.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetToTFRecord.pbtxt new file mode 100644 index 00000000000..c4d256969f7 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetToTFRecord.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "DatasetToTFRecord" + visibility: VISIBLE + endpoint { + name: "data.DatasetToTfRecord" + } +} 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/api/api_def_DenseToSparseBatchDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DenseToSparseBatchDataset.pbtxt new file mode 100644 index 00000000000..106059e48f0 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DenseToSparseBatchDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "DenseToSparseBatchDataset" + visibility: VISIBLE + endpoint { + name: "data.DenseToSparseBatchDataset" + } +} 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/api/api_def_DirectedInterleaveDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DirectedInterleaveDataset.pbtxt new file mode 100644 index 00000000000..60c9729704e --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DirectedInterleaveDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "DirectedInterleaveDataset" + visibility: VISIBLE + endpoint { + name: "data.DirectedInterleaveDataset" + } +} 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 82% 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 index 26051ab446f..804c2fc317e 100644 --- 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 @@ -1,5 +1,6 @@ op { graph_op_name: "EnqueueInQueueDataset" + visibility: VISIBLE endpoint { name: "data.EnqueueInQueueDataset" } 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/api/api_def_FilterByLastComponentDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FilterByLastComponentDataset.pbtxt new file mode 100644 index 00000000000..4ad74385bce --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FilterByLastComponentDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "FilterByLastComponentDataset" + visibility: VISIBLE + endpoint { + name: "data.FilterByLastComponentDataset" + } +} 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/api/api_def_FinalizeDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FinalizeDataset.pbtxt new file mode 100644 index 00000000000..78b37455e28 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FinalizeDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "FinalizeDataset" + visibility: VISIBLE + endpoint { + name: "data.FinalizeDataset" + } +} 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/api/api_def_FixedLengthRecordDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FixedLengthRecordDatasetV2.pbtxt new file mode 100644 index 00000000000..b0f66ca1642 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FixedLengthRecordDatasetV2.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "FixedLengthRecordDatasetV2" + visibility: VISIBLE + endpoint { + name: "data.FixedLengthRecordDataset" + } +} 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/api/api_def_GeneratorDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GeneratorDataset.pbtxt new file mode 100644 index 00000000000..9ff9c28330a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GeneratorDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "GeneratorDataset" + visibility: VISIBLE + endpoint { + name: "data.GeneratorDataset" + } +} 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/api/api_def_GroupByReducerDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GroupByReducerDataset.pbtxt new file mode 100644 index 00000000000..57b781c5a0a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GroupByReducerDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "GroupByReducerDataset" + visibility: VISIBLE + endpoint { + name: "data.GroupByReducerDataset" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GroupByWindowDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GroupByWindowDataset.pbtxt new file mode 100644 index 00000000000..529ca47d86e --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GroupByWindowDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "GroupByWindowDataset" + visibility: VISIBLE + endpoint { + name: "data.GroupByWindowDataset" + } +} 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/api/api_def_IgnoreErrorsDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IgnoreErrorsDataset.pbtxt new file mode 100644 index 00000000000..a8812f70e1a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IgnoreErrorsDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "IgnoreErrorsDataset" + visibility: VISIBLE + endpoint { + name: "data.IgnoreErrorsDataset" + } +} 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/api/api_def_InitializeTableFromDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_InitializeTableFromDataset.pbtxt new file mode 100644 index 00000000000..bfd98dd2d1c --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_InitializeTableFromDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "InitializeTableFromDataset" + visibility: VISIBLE + endpoint { + name: "data.InitializeTableFromDataset" + } +} 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 79% 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 index 5f0da216cbb..6055a53c894 100644 --- 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 @@ -1,5 +1,6 @@ op { graph_op_name: "KafkaDataset" + visibility: VISIBLE endpoint { name: "data.KafkaDataset" } 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/api/api_def_LMDBDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LMDBDataset.pbtxt new file mode 100644 index 00000000000..68de33fde0b --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LMDBDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "LMDBDataset" + visibility: VISIBLE + endpoint { + name: "data.LMDBDataset" + } +} 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/api/api_def_LatencyStatsDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LatencyStatsDataset.pbtxt new file mode 100644 index 00000000000..8447fb7e287 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LatencyStatsDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "LatencyStatsDataset" + visibility: VISIBLE + endpoint { + name: "data.LatencyStatsDataset" + } +} 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/api/api_def_LegacyParallelInterleaveDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LegacyParallelInterleaveDatasetV2.pbtxt new file mode 100644 index 00000000000..4046256a580 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LegacyParallelInterleaveDatasetV2.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "LegacyParallelInterleaveDatasetV2" + visibility: VISIBLE + endpoint { + name: "data.LegacyParallelInterleaveDataset" + } +} 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/api/api_def_LoadDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadDataset.pbtxt new file mode 100644 index 00000000000..7bbd800c889 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "LoadDataset" + visibility: VISIBLE + endpoint { + name: "data.LoadDataset" + } +} 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/api/api_def_MapAndBatchDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MapAndBatchDataset.pbtxt new file mode 100644 index 00000000000..bbf61d0f31e --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MapAndBatchDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "MapAndBatchDataset" + visibility: VISIBLE + endpoint { + name: "data.MapAndBatchDataset" + } +} 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/api/api_def_MatchingFilesDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatchingFilesDataset.pbtxt new file mode 100644 index 00000000000..2bee85539f8 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatchingFilesDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "MatchingFilesDataset" + visibility: VISIBLE + endpoint { + name: "data.MatchingFilesDataset" + } +} 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/api/api_def_MaxIntraOpParallelismDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxIntraOpParallelismDataset.pbtxt new file mode 100644 index 00000000000..20a2e55ba80 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxIntraOpParallelismDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "MaxIntraOpParallelismDataset" + visibility: VISIBLE + endpoint { + name: "data.MaxIntraOpParallelismDataset" + } +} 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/api/api_def_ModelDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ModelDataset.pbtxt new file mode 100644 index 00000000000..8549b4582cc --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ModelDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "ModelDataset" + visibility: VISIBLE + endpoint { + name: "data.ModelDataset" + } +} 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/api/api_def_NonSerializableDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_NonSerializableDataset.pbtxt new file mode 100644 index 00000000000..4efa2ec9978 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_NonSerializableDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "NonSerializableDataset" + visibility: VISIBLE + endpoint { + name: "data.NonSerializableDataset" + } +} 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/api/api_def_OptimizeDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OptimizeDataset.pbtxt new file mode 100644 index 00000000000..4220b306071 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OptimizeDataset.pbtxt @@ -0,0 +1,4 @@ +op { + graph_op_name: "OptimizeDataset" + visibility: SKIP +} diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_OptimizeDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OptimizeDatasetV2.pbtxt new file mode 100644 index 00000000000..4b0214740a9 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OptimizeDatasetV2.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "OptimizeDatasetV2" + visibility: VISIBLE + endpoint { + name: "data.OptimizeDataset" + } +} 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/api/api_def_OptionsDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OptionsDataset.pbtxt new file mode 100644 index 00000000000..0ccf9d12546 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OptionsDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "OptionsDataset" + visibility: VISIBLE + endpoint { + name: "data.OptionsDataset" + } +} 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/api/api_def_PaddedBatchDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_PaddedBatchDatasetV2.pbtxt new file mode 100644 index 00000000000..0999120d361 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_PaddedBatchDatasetV2.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "PaddedBatchDatasetV2" + visibility: VISIBLE + endpoint { + name: "data.PaddedBatchDataset" + } +} 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/api/api_def_ParallelBatchDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelBatchDataset.pbtxt new file mode 100644 index 00000000000..3fd9b1a423b --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelBatchDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "ParallelBatchDataset" + visibility: VISIBLE + endpoint { + name: "data.ParallelBatchDataset" + } +} 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/api/api_def_ParallelInterleaveDatasetV4.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelInterleaveDatasetV4.pbtxt new file mode 100644 index 00000000000..7dddfc15a66 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelInterleaveDatasetV4.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "ParallelInterleaveDatasetV4" + visibility: VISIBLE + endpoint { + name: "data.ParallelInterleaveDataset" + } +} 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/api/api_def_ParallelMapDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelMapDatasetV2.pbtxt new file mode 100644 index 00000000000..9135d8f5c99 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelMapDatasetV2.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "ParallelMapDatasetV2" + visibility: VISIBLE + endpoint { + name: "data.ParallelMapDataset" + } +} 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/api/api_def_ParseExampleDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseExampleDatasetV2.pbtxt new file mode 100644 index 00000000000..4ce175177f6 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseExampleDatasetV2.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "ParseExampleDatasetV2" + visibility: VISIBLE + endpoint { + name: "data.ParseExampleDataset" + } +} 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/api/api_def_PrefetchDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_PrefetchDataset.pbtxt new file mode 100644 index 00000000000..a8a3423123d --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_PrefetchDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "PrefetchDataset" + visibility: VISIBLE + endpoint { + name: "data.PrefetchDataset" + } +} 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 86% 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 index 7c9d509b163..a5e8f99de23 100644 --- 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 @@ -1,5 +1,6 @@ op { graph_op_name: "PrependFromQueueAndPaddedBatchDataset" + visibility: VISIBLE endpoint { name: "data.PrependFromQueueAndPaddedBatchDataset" } 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/api/api_def_PrivateThreadPoolDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_PrivateThreadPoolDataset.pbtxt new file mode 100644 index 00000000000..4c0cfbe6698 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_PrivateThreadPoolDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "PrivateThreadPoolDataset" + visibility: VISIBLE + endpoint { + name: "data.PrivateThreadPoolDataset" + } +} 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/api/api_def_RebatchDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RebatchDataset.pbtxt new file mode 100644 index 00000000000..61d010ff033 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RebatchDataset.pbtxt @@ -0,0 +1,4 @@ +op { + graph_op_name: "RebatchDataset" + visibility: SKIP +} diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RebatchDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RebatchDatasetV2.pbtxt new file mode 100644 index 00000000000..42ab3bc1a6e --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RebatchDatasetV2.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "RebatchDatasetV2" + visibility: VISIBLE + endpoint { + name: "data.RebatchDatasetV2" + } +} 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/api/api_def_ReduceDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReduceDataset.pbtxt new file mode 100644 index 00000000000..4493b8a20ac --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReduceDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "ReduceDataset" + visibility: VISIBLE + endpoint { + name: "data.ReduceDataset" + } +} 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/api/api_def_SamplingDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_SamplingDataset.pbtxt new file mode 100644 index 00000000000..6b33a96d9e8 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_SamplingDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "SamplingDataset" + visibility: VISIBLE + endpoint { + name: "data.SamplingDataset" + } +} 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/api/api_def_ScanDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScanDataset.pbtxt new file mode 100644 index 00000000000..838de863044 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScanDataset.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "ScanDataset" + visibility: VISIBLE + endpoint { + name: "data.ScanDataset" + } +} 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: <

    \n") << "
  • \n"; - in_list = true; - } else if (in_list) { - // end of list - javadoc_text << "
  • \n
\n"; - in_list = false; - } else if (!absl::StartsWith(input, "```")) { - // new paragraph (not required if a
 block follows)
-        javadoc_text << "

\n"; - } - } else if (absl::StartsWith(markup, "```")) { - // code blocks - if (FindAndCut(&input, "(```\\s*\n*)", &text)) { - javadoc_text << "

{@code\n" << text << "}
\n"; - } else { - javadoc_text << markup; - } - } else if (absl::StartsWith("(" + markup + ")", "`")) { - // inlined code - if (FindAndCut(&input, markup, &text)) { - javadoc_text << "{@code " << text << "}"; - } else { - javadoc_text << markup; - } - } else if (markup == "**") { - // text emphasis (strong) - if (FindAndCut(&input, "(\\b\\*{2})", &text)) { - javadoc_text << "" << ParseDocumentation(text) << ""; - } else { - javadoc_text << markup; - } - } else if (markup == "*") { - // text emphasis (normal) - if (FindAndCut(&input, "(\\b\\*{1})", &text)) { - javadoc_text << "" << ParseDocumentation(text) << ""; - } else { - javadoc_text << markup; - } - } else if (absl::StartsWith(markup, "[")) { - // hyperlinks - string label; - string link; - if (RE2::PartialMatch(input, "([^\\[]+)\\]\\((http.+)\\)", &label, - &link) && - absl::StartsWith(input, label + link)) { - input = input.substr(label.size() + link.size()); - javadoc_text << "" - << ParseDocumentation(label) << ""; - } else { - javadoc_text << markup; - } - } else { - // safe fallback - javadoc_text << markup; - } - } - return javadoc_text.str(); -} - -ArgumentSpec CreateInput(const OpDef_ArgDef& input_def, - const ApiDef::Arg& input_api_def, - TypeResolver* type_resolver) { - bool iterable = false; - Type type = type_resolver->TypeOf(input_def, &iterable); - Type var_type = - Type::Interface("Operand", "org.tensorflow").add_parameter(type); - if (iterable) { - var_type = Type::IterableOf(var_type); - } - return ArgumentSpec( - input_api_def.name(), - Variable::Create(SnakeToCamelCase(input_api_def.rename_to()), var_type), - type, ParseDocumentation(input_api_def.description()), iterable); -} - -AttributeSpec CreateAttribute(const OpDef_AttrDef& attr_def, - const ApiDef::Attr& attr_api_def, - TypeResolver* type_resolver) { - bool iterable = false; - std::pair types = type_resolver->TypesOf(attr_def, &iterable); - Type var_type = types.first.kind() == Type::GENERIC - ? Type::ClassOf(types.first) - : types.first; - if (iterable) { - var_type = Type::ListOf(var_type); - } - return AttributeSpec( - attr_api_def.name(), - Variable::Create(SnakeToCamelCase(attr_api_def.rename_to()), var_type), - types.first, types.second, ParseDocumentation(attr_api_def.description()), - iterable, - attr_def.has_default_value() ? &attr_def.default_value() : nullptr); -} - -ArgumentSpec CreateOutput(const OpDef_ArgDef& output_def, - const ApiDef::Arg& output_api, - TypeResolver* type_resolver) { - bool iterable = false; - Type type = type_resolver->TypeOf(output_def, &iterable); - Type var_type = Type::Class("Output", "org.tensorflow").add_parameter(type); - if (iterable) { - var_type = Type::ListOf(var_type); - } - return ArgumentSpec( - output_api.name(), - Variable::Create(SnakeToCamelCase(output_api.rename_to()), var_type), - type, ParseDocumentation(output_api.description()), iterable); -} - -EndpointSpec CreateEndpoint(const OpDef& op_def, const ApiDef& api_def, - const ApiDef_Endpoint& endpoint_def) { - const string& endpoint_name = endpoint_def.name(); - string package; - string name; - size_t name_pos = endpoint_name.find_last_of('.'); - if (name_pos != string::npos) { - package = endpoint_name.substr(0, name_pos); - name = endpoint_name.substr(name_pos + 1); - } else { - package = "core"; // generate unclassified ops in the 'core' package - name = endpoint_def.name(); - } - return EndpointSpec(package, name, - Javadoc::Create(ParseDocumentation(api_def.summary())) - .details(ParseDocumentation(api_def.description()))); -} - -} // namespace - -OpSpec OpSpec::Create(const OpDef& op_def, const ApiDef& api_def) { - OpSpec op(api_def.graph_op_name(), api_def.visibility() == ApiDef::HIDDEN, - op_def.deprecation().explanation()); - TypeResolver type_resolver(op_def); - for (const string& next_input_name : api_def.arg_order()) { - for (int i = 0; i < op_def.input_arg().size(); ++i) { - if (op_def.input_arg(i).name() == next_input_name) { - op.inputs_.push_back(CreateInput(op_def.input_arg(i), api_def.in_arg(i), - &type_resolver)); - break; - } - } - } - for (int i = 0; i < op_def.attr().size(); ++i) { - // do not parse attributes already visited, they have probably been inferred - // before as an input argument type - if (!type_resolver.IsAttributeVisited(op_def.attr(i).name())) { - AttributeSpec attr = - CreateAttribute(op_def.attr(i), api_def.attr(i), &type_resolver); - // attributes with a default value are optional - if (attr.has_default_value() && attr.type().kind() != Type::GENERIC) { - op.optional_attributes_.push_back(attr); - } else { - op.attributes_.push_back(attr); - } - } - } - for (int i = 0; i < op_def.output_arg().size(); ++i) { - op.outputs_.push_back( - CreateOutput(op_def.output_arg(i), api_def.out_arg(i), &type_resolver)); - } - for (const auto& endpoint_def : api_def.endpoint()) { - op.endpoints_.push_back(CreateEndpoint(op_def, api_def, endpoint_def)); - } - op.RemoveExtraGenerics(); - return op; -} - -void OpSpec::RemoveExtraGenerics() { - std::map generics; - - for (const ArgumentSpec& output : this->outputs()) { - if (output.type().kind() == Type::GENERIC && !output.type().wildcard()) { - if (generics.find(output.type().name()) == generics.end()) { - generics[output.type().name()] = 1; - } else { - generics[output.type().name()] = generics.find(output.type().name())->second + 1; - } - } - } - - for (const ArgumentSpec& input : this->inputs()) { - if (input.type().kind() == Type::GENERIC && !input.type().wildcard()) { - if (generics.find(input.type().name()) == generics.end()) { - generics[input.type().name()] = 1; - } else { - generics[input.type().name()] = generics.find(input.type().name())->second + 1; - } - } - } - - for (ArgumentSpec& output : this->outputs_) { - if (output.type().kind() == Type::GENERIC && !output.type().wildcard()) { - if (generics[output.type().name()] <= 1) { - output.toUpperBound(); - } - } - } - - for (ArgumentSpec& input : this->inputs_) { - if (generics[input.type().name()] <= 1) { - input.toUpperBound(); - } - } -} - -void ArgumentSpec::toUpperBound() { - if(this->type().kind() == Type::GENERIC && this->var().type().name() == "Operand" && - this->type().supertypes().size() == 1){ - Type newType = Type::Wildcard().add_supertype(this->type().supertypes().front()); - Type varType = Type::Interface("Operand", "org.tensorflow").add_parameter(newType); - - if(this->var().variadic()){ - this->var_ = Variable::Varargs(this->var().name(), varType); - } else { - this->var_ = Variable::Create(this->var().name(), varType); - } - - this->type_ = newType; - } -} - -} // namespace java -} // namespace tensorflow diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/op_specs.h b/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/op_specs.h deleted file mode 100644 index 493dc777384..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/op_specs.h +++ /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. -==============================================================================*/ - -#ifndef TENSORFLOW_JAVA_OP_GENERATOR_OP_SPECS_H_ -#define TENSORFLOW_JAVA_OP_GENERATOR_OP_SPECS_H_ - -#include -#include - -#include "tensorflow/core/framework/api_def.pb.h" -#include "tensorflow/core/framework/attr_value.pb.h" -#include "tensorflow/core/framework/op_def.pb.h" - -#include "java_defs.h" - -namespace tensorflow { -namespace java { - -constexpr const char kDefaultEndpointPackage[] = "core"; - -class EndpointSpec { - public: - // A specification for an operation endpoint - // - // package: package of this endpoint (from which also derives its package) - // name: name of this endpoint class - // javadoc: the endpoint class documentation - // TODO(annarev): hardcode depcreated to false until deprecated is possible - EndpointSpec(const string& package, const string& name, - const Javadoc& javadoc) - : package_(package), name_(name), javadoc_(javadoc), deprecated_(false) {} - - const string& package() const { return package_; } - const string& name() const { return name_; } - const Javadoc& javadoc() const { return javadoc_; } - bool deprecated() const { return deprecated_; } - - private: - const string package_; - const string name_; - const Javadoc javadoc_; - const bool deprecated_; -}; - -class ArgumentSpec { - public: - // A specification for an operation argument - // - // op_def_name: argument name, as known by TensorFlow core - // var: a variable to represent this argument in Java - // type: the tensor type of this argument - // description: a description of this argument, in javadoc - // iterable: true if this argument is a list - ArgumentSpec(const string& op_def_name, const Variable& var, const Type& type, - const string& description, bool iterable) - : op_def_name_(op_def_name), - var_(var), - type_(type), - description_(description), - iterable_(iterable) {} - - const string& op_def_name() const { return op_def_name_; } - const Variable& var() const { return var_; } - const Type& type() const { return type_; } - void toUpperBound(); - const string& description() const { return description_; } - bool iterable() const { return iterable_; } - - private: - const string op_def_name_; - Variable var_; - Type type_; - const string description_; - const bool iterable_; -}; - -class AttributeSpec { - public: - // A specification for an operation attribute - // - // op_def_name: attribute name, as known by TensorFlow core - // var: a variable to represent this attribute in Java - // type: the type of this attribute - // jni_type: the type of this attribute in JNI layer (see OperationBuilder) - // description: a description of this attribute, in javadoc - // iterable: true if this attribute is a list - // default_value: default value for this attribute or nullptr if none. Any - // value referenced by this pointer must outlive the lifetime - // of the AttributeSpec. This is guaranteed if the value is - // issued by an OpDef of the global OpRegistry. - AttributeSpec(const string& op_def_name, const Variable& var, - const Type& type, const Type& jni_type, - const string& description, bool iterable, - const AttrValue* default_value) - : op_def_name_(op_def_name), - var_(var), - type_(type), - description_(description), - iterable_(iterable), - jni_type_(jni_type), - default_value_(default_value) {} - - const string& op_def_name() const { return op_def_name_; } - const Variable& var() const { return var_; } - const Type& type() const { return type_; } - const string& description() const { return description_; } - bool iterable() const { return iterable_; } - const Type& jni_type() const { return jni_type_; } - bool has_default_value() const { return default_value_ != nullptr; } - const AttrValue* default_value() const { return default_value_; } - - private: - const string op_def_name_; - const Variable var_; - const Type type_; - const string description_; - const bool iterable_; - const Type jni_type_; - const AttrValue* default_value_; -}; - -class OpSpec { - public: - // Parses an op definition and its API to produce a specification used for - // rendering its Java wrapper - // - // op_def: Op definition - // api_def: Op API definition - static OpSpec Create(const OpDef& op_def, const ApiDef& api_def); - - const string& graph_op_name() const { return graph_op_name_; } - bool hidden() const { return hidden_; } - const string& deprecation_explanation() const { - return deprecation_explanation_; - } - const std::vector endpoints() const { return endpoints_; } - const std::vector& inputs() const { return inputs_; } - const std::vector& outputs() const { return outputs_; } - const std::vector& attributes() const { return attributes_; } - const std::vector& optional_attributes() const { - return optional_attributes_; - } - - private: - // A specification for an operation - // - // graph_op_name: name of this op, as known by TensorFlow core engine - // hidden: true if this op should not be visible through the Graph Ops API - // deprecation_explanation: message to show if all endpoints are deprecated - explicit OpSpec(const string& graph_op_name, bool hidden, - const string& deprecation_explanation) - : graph_op_name_(graph_op_name), - hidden_(hidden), - deprecation_explanation_(deprecation_explanation) {} - - void RemoveExtraGenerics(); - - const string graph_op_name_; - const bool hidden_; - const string deprecation_explanation_; - std::vector endpoints_; - std::vector inputs_; - std::vector outputs_; - std::vector attributes_; - std::vector optional_attributes_; -}; - -} // namespace java -} // namespace tensorflow - -#endif // TENSORFLOW_JAVA_OP_GENERATOR_OP_SPECS_H_ diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/source_writer.cc b/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/source_writer.cc deleted file mode 100644 index 37315f0dff3..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/source_writer.cc +++ /dev/null @@ -1,393 +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. -==============================================================================*/ - -#include -#include -#include - -#include "source_writer.h" - -namespace tensorflow { -namespace java { - -SourceWriter::SourceWriter() { - // Push an empty generic namespace at start, for simplification. - generic_namespaces_.push(new GenericNamespace()); -} - -SourceWriter::~SourceWriter() { - // Remove empty generic namespace added at start as well as any other - // namespace objects that haven't been removed. - while (!generic_namespaces_.empty()) { - GenericNamespace* generic_namespace = generic_namespaces_.top(); - generic_namespaces_.pop(); - delete generic_namespace; - } -} - -SourceWriter& SourceWriter::Indent(int tab) { - left_margin_.resize( - std::max(static_cast(left_margin_.size() + tab), 0), ' '); - return *this; -} - -SourceWriter& SourceWriter::Prefix(const char* line_prefix) { - line_prefix_ = line_prefix; - return *this; -} - -SourceWriter& SourceWriter::Write(const StringPiece& str) { - size_t line_pos = 0; - do { - size_t start_pos = line_pos; - line_pos = str.find('\n', start_pos); - if (line_pos != string::npos) { - ++line_pos; - Append(str.substr(start_pos, line_pos - start_pos)); - newline_ = true; - } else { - Append(str.substr(start_pos, str.size() - start_pos)); - } - } while (line_pos != string::npos && line_pos < str.size()); - - return *this; -} - -SourceWriter& SourceWriter::WriteFromFile(const string& fname, Env* env) { - string data_; - TF_CHECK_OK(ReadFileToString(env, fname, &data_)); - return Write(data_); -} - -SourceWriter& SourceWriter::Append(const StringPiece& str) { - if (!str.empty()) { - if (newline_) { - DoAppend(left_margin_ + line_prefix_); - newline_ = false; - } - DoAppend(str); - } - return *this; -} - -SourceWriter& SourceWriter::AppendType(const Type& type) { - if (type.wildcard()) { - Append("?"); - WriteTypeBounds(type.supertypes()); - } else { - Append(type.name()); - if (!type.parameters().empty()) { - Append("<"); - bool first = true; - for (const Type& t : type.parameters()) { - if (!first) { - Append(", "); - } - AppendType(t); - first = false; - } - Append(">"); - } - } - return *this; -} - -SourceWriter& SourceWriter::EndLine() { - Append("\n"); - newline_ = true; - return *this; -} - -SourceWriter& SourceWriter::BeginBlock(const string& expression) { - if (!expression.empty()) { - Append(expression + " {"); - } else { - Append(newline_ ? "{" : " {"); - } - return EndLine().Indent(2); -} - -SourceWriter& SourceWriter::EndBlock() { - return Indent(-2).Append("}").EndLine(); -} - -SourceWriter& SourceWriter::BeginMethod(const Method& method, int modifiers, - const Javadoc* javadoc) { - GenericNamespace* generic_namespace = PushGenericNamespace(modifiers); - if (!method.constructor()) { - generic_namespace->Visit(method.return_type()); - } - for (const Variable& v : method.arguments()) { - generic_namespace->Visit(v.type()); - } - EndLine(); - if (javadoc != nullptr) { - WriteJavadoc(*javadoc); - } - if (!method.annotations().empty()) { - WriteAnnotations(method.annotations()); - } - WriteModifiers(modifiers); - if (!generic_namespace->declared_types().empty()) { - WriteGenerics(generic_namespace->declared_types()); - Append(" "); - } - if (!method.constructor()) { - AppendType(method.return_type()).Append(" "); - } - Append(method.name()).Append("("); - bool first = true; - for (const Variable& v : method.arguments()) { - if (!first) { - Append(", "); - } - AppendType(v.type()).Append(v.variadic() ? "... " : " ").Append(v.name()); - first = false; - } - return Append(")").BeginBlock(); -} - -SourceWriter& SourceWriter::EndMethod() { - EndBlock(); - PopGenericNamespace(); - return *this; -} - -SourceWriter& SourceWriter::BeginType(const Type& type, int modifiers, - const std::list* extra_dependencies, - const Javadoc* javadoc) { - if (!type.package().empty()) { - Append("package ").Append(type.package()).Append(";").EndLine(); - } - TypeImporter type_importer(type.package()); - type_importer.Visit(type); - if (extra_dependencies != nullptr) { - for (const Type& t : *extra_dependencies) { - type_importer.Visit(t); - } - } - if (!type_importer.imports().empty()) { - EndLine(); - for (const string& s : type_importer.imports()) { - Append("import ").Append(s).Append(";").EndLine(); - } - } - return BeginInnerType(type, modifiers, javadoc); -} - -SourceWriter& SourceWriter::BeginInnerType(const Type& type, int modifiers, - const Javadoc* javadoc) { - GenericNamespace* generic_namespace = PushGenericNamespace(modifiers); - generic_namespace->Visit(type); - EndLine(); - if (javadoc != nullptr) { - WriteJavadoc(*javadoc); - } - if (!type.annotations().empty()) { - WriteAnnotations(type.annotations()); - } - WriteModifiers(modifiers); - CHECK_EQ(Type::Kind::CLASS, type.kind()) << ": Not supported yet"; - Append("class ").Append(type.name()); - if (!generic_namespace->declared_types().empty()) { - WriteGenerics(generic_namespace->declared_types()); - } - if (!type.supertypes().empty()) { - bool first_interface = true; - for (const Type& t : type.supertypes()) { - if (t.kind() == Type::CLASS) { // superclass is always first in list - Append(" extends "); - } else if (first_interface) { - Append(" implements "); - first_interface = false; - } else { - Append(", "); - } - AppendType(t); - } - } - return BeginBlock(); -} - -SourceWriter& SourceWriter::EndType() { - EndBlock(); - PopGenericNamespace(); - return *this; -} - -SourceWriter& SourceWriter::WriteField(const Variable& field, int modifiers, - const Javadoc* javadoc) { - // If present, write field javadoc only as one brief line - if (javadoc != nullptr && !javadoc->brief().empty()) { - Append("/** ").Append(javadoc->brief()).Append(" */").EndLine(); - } - WriteModifiers(modifiers); - AppendType(field.type()).Append(" ").Append(field.name()).Append(";"); - EndLine(); - return *this; -} - -SourceWriter& SourceWriter::WriteFieldWithInitializer(const Variable& field, - int modifiers, const Javadoc* javadoc, const string& initializer) { - // If present, write field javadoc only as one brief line - if (javadoc != nullptr && !javadoc->brief().empty()) { - Append("/** ").Append(javadoc->brief()).Append(" */").EndLine(); - } - WriteModifiers(modifiers); - if (!initializer.empty()) - AppendType(field.type()).Append(" ").Append(field.name()). - Append(" = ").Append(initializer).Append(";"); - else - AppendType(field.type()).Append(" ").Append(field.name()).Append(";"); - EndLine(); - return *this; -} - -SourceWriter& SourceWriter::WriteModifiers(int modifiers) { - if (modifiers & PUBLIC) { - Append("public "); - } else if (modifiers & PROTECTED) { - Append("protected "); - } else if (modifiers & PRIVATE) { - Append("private "); - } - if (modifiers & STATIC) { - Append("static "); - } - if (modifiers & FINAL) { - Append("final "); - } - return *this; -} - -SourceWriter& SourceWriter::WriteJavadoc(const Javadoc& javadoc) { - Append("/**").Prefix(" * ").EndLine(); - bool do_line_break = false; - if (!javadoc.brief().empty()) { - Write(javadoc.brief()).EndLine(); - do_line_break = true; - } - if (!javadoc.details().empty()) { - if (do_line_break) { - Append("

").EndLine(); - } - Write(javadoc.details()).EndLine(); - do_line_break = true; - } - if (!javadoc.tags().empty()) { - if (do_line_break) { - EndLine(); - } - for (const auto& p : javadoc.tags()) { - Append("@" + p.first); - if (!p.second.empty()) { - Append(" ").Write(p.second); - } - EndLine(); - } - } - return Prefix("").Append(" */").EndLine(); -} - -SourceWriter& SourceWriter::WriteAnnotations( - const std::list& annotations) { - for (const Annotation& a : annotations) { - Append("@" + a.name()); - if (!a.attributes().empty()) { - Append("(").Append(a.attributes()).Append(")"); - } - EndLine(); - } - return *this; -} - -SourceWriter& SourceWriter::WriteGenerics( - const std::list& generics) { - Append("<"); - bool first = true; - for (const Type* pt : generics) { - if (!first) { - Append(", "); - } - Append(pt->name()); - WriteTypeBounds(pt->supertypes()); - first = false; - } - return Append(">"); -} - -SourceWriter& SourceWriter::WriteTypeBounds( - const std::list& bounds) { - bool first = true; - for (const Type& bound : bounds) { - if (first) { - Append(" extends "); - first = false; - } else { - Append(" & "); - } - AppendType(bound); - } - return *this; -} - -SourceWriter::GenericNamespace* SourceWriter::PushGenericNamespace( - int modifiers) { - GenericNamespace* generic_namespace; - if (modifiers & STATIC) { - generic_namespace = new GenericNamespace(); - } else { - generic_namespace = new GenericNamespace(generic_namespaces_.top()); - } - generic_namespaces_.push(generic_namespace); - return generic_namespace; -} - -void SourceWriter::PopGenericNamespace() { - GenericNamespace* generic_namespace = generic_namespaces_.top(); - generic_namespaces_.pop(); - delete generic_namespace; -} - -void SourceWriter::TypeVisitor::Visit(const Type& type) { - DoVisit(type); - for (const Type& t : type.parameters()) { - Visit(t); - } - for (const Annotation& t : type.annotations()) { - DoVisit(t); - } - for (const Type& t : type.supertypes()) { - Visit(t); - } -} - -void SourceWriter::GenericNamespace::DoVisit(const Type& type) { - // ignore non-generic parameters, wildcards and generics already declared - if (type.kind() == Type::GENERIC && !type.wildcard() && - generic_names_.find(type.name()) == generic_names_.end()) { - declared_types_.push_back(&type); - generic_names_.insert(type.name()); - } -} - -void SourceWriter::TypeImporter::DoVisit(const Type& type) { - if (!type.package().empty() && type.package() != current_package_) { - imports_.insert(type.canonical_name()); - } -} - -} // namespace java -} // namespace tensorflow diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/source_writer.h b/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/source_writer.h deleted file mode 100644 index 26b97f7a9c4..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/source_writer.h +++ /dev/null @@ -1,263 +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. -==============================================================================*/ - -#ifndef TENSORFLOW_JAVA_OP_GENERATOR_SOURCE_WRITER_H_ -#define TENSORFLOW_JAVA_OP_GENERATOR_SOURCE_WRITER_H_ - -#include -#include -#include -#include - -#include "tensorflow/core/lib/core/stringpiece.h" -#include "tensorflow/core/platform/env.h" - -#include "java_defs.h" - -namespace tensorflow { -namespace java { - -// A class for writing Java source code. -class SourceWriter { - public: - SourceWriter(); - - virtual ~SourceWriter(); - - // Indents following lines with white spaces. - // - // Indentation is cumulative, i.e. the provided tabulation is added to the - // current indentation value. If the tabulation is negative, the operation - // will outdent the source code, until the indentation reaches 0 again. - // - // For example, calling Indent(2) twice will indent code with 4 white - // spaces. Then calling Indent(-2) will outdent the code back to 2 white - // spaces. - SourceWriter& Indent(int tab); - - // Prefixes following lines with provided character(s). - // - // A common use case of a prefix is for commenting or documenting the code. - // - // The prefix is written after the indentation, For example, invoking - // Indent(2)->Prefix("//") will result in prefixing lines with " //". - // - // An empty value ("") will remove any line prefix that was previously set. - SourceWriter& Prefix(const char* line_prefix); - - // Writes a source code snippet. - // - // The data might potentially contain newline characters, therefore it will - // be scanned to ensure that each line is indented and prefixed properly, - // making it a bit slower than Append(). - SourceWriter& Write(const StringPiece& str); - - // Writes a source code snippet read from a file. - // - // All lines of the file at the provided path will be read and written back - // to the output of this writer in regard of its current attributes (e.g. - // the indentation, prefix, etc.) - SourceWriter& WriteFromFile(const string& fname, Env* env = Env::Default()); - - // Appends a piece of source code. - // - // It is expected that no newline character is present in the data provided, - // otherwise Write() must be used. - SourceWriter& Append(const StringPiece& str); - - // Appends a type to the current line. - // - // The type is written in its simple form (i.e. not prefixed by its package) - // and followed by any parameter types it has enclosed in brackets (<>). - SourceWriter& AppendType(const Type& type); - - // Appends a newline character. - // - // Data written after calling this method will start on a new line, in respect - // of the current indentation. - SourceWriter& EndLine(); - - // Begins a block of source code. - // - // This method appends a new opening brace to the current data and indent the - // next lines according to Google Java Style Guide. The block can optionally - // be preceded by an expression (e.g. Append("if(true)").BeginBlock();) - SourceWriter& BeginBlock(const string& expression = ""); - - // Ends the current block of source code. - // - // This method appends a new closing brace to the current data and outdent the - // next lines back to the margin used before BeginBlock() was invoked. - SourceWriter& EndBlock(); - - // Begins to write a method. - // - // This method outputs the signature of the Java method from the data passed - // in the 'method' parameter and starts a new block. Modifiers are also passed - // in parameter to define the access scope of this method and, optionally, - // a Javadoc. - SourceWriter& BeginMethod(const Method& method, int modifiers, - const Javadoc* javadoc = nullptr); - - // Ends the current method. - // - // This method ends the block of code that has begun when invoking - // BeginMethod() prior to this. - SourceWriter& EndMethod(); - - // Begins to write the main type of a source file. - // - // This method outputs the declaration of the Java type from the data passed - // in the 'type' parameter and starts a new block. Modifiers are also passed - // in parameter to define the access scope of this type and, optionally, - // a Javadoc. - // - // If not null, all types found in the 'extra_dependencies' list will be - // imported before declaring the new type. - SourceWriter& BeginType(const Type& type, int modifiers, - const std::list* extra_dependencies = nullptr, - const Javadoc* javadoc = nullptr); - - // Begins to write a new inner type. - // - // This method outputs the declaration of the Java type from the data passed - // in the 'type' parameter and starts a new block. Modifiers are also passed - // in parameter to define the accesses and the scope of this type and, - // optionally, a Javadoc. - SourceWriter& BeginInnerType(const Type& type, int modifiers, - const Javadoc* javadoc = nullptr); - - // Ends the current type. - // - // This method ends the block of code that has begun when invoking - // BeginType() or BeginInnerType() prior to this. - SourceWriter& EndType(); - - // Writes a variable as fields of a type. - // - // This method must be called within the definition of a type (see BeginType() - // or BeginInnerType()). Modifiers are also be passed in parameter to define - // the accesses and the scope of this field and, optionally, a Javadoc. - SourceWriter& WriteField(const Variable& field, int modifiers, - const Javadoc* javadoc = nullptr); - - SourceWriter& WriteFieldWithInitializer(const Variable& field, - int modifiers, const Javadoc* javadoc = nullptr, const string& initializer = nullptr); - - protected: - virtual void DoAppend(const StringPiece& str) = 0; - - private: - // A utility base class for visiting elements of a type. - class TypeVisitor { - public: - virtual ~TypeVisitor() = default; - void Visit(const Type& type); - - protected: - virtual void DoVisit(const Type& type) = 0; - }; - - // A utility class for keeping track of declared generics in a given scope. - class GenericNamespace : public TypeVisitor { - public: - GenericNamespace() = default; - explicit GenericNamespace(const GenericNamespace* parent) - : generic_names_(parent->generic_names_) {} - std::list declared_types() { - return declared_types_; - } - protected: - virtual void DoVisit(const Type& type); - - private: - std::list declared_types_; - std::set generic_names_; - }; - - // A utility class for collecting a list of import statements to declare. - class TypeImporter : public TypeVisitor { - public: - explicit TypeImporter(const string& current_package) - : current_package_(current_package) {} - virtual ~TypeImporter() = default; - const std::set imports() { - return imports_; - } - protected: - virtual void DoVisit(const Type& type); - - private: - string current_package_; - std::set imports_; - }; - - string left_margin_; - string line_prefix_; - bool newline_ = true; - std::stack generic_namespaces_; - - SourceWriter& WriteModifiers(int modifiers); - SourceWriter& WriteJavadoc(const Javadoc& javadoc); - SourceWriter& WriteAnnotations(const std::list& annotations); - SourceWriter& WriteGenerics(const std::list& generics); - SourceWriter& WriteTypeBounds(const std::list& bounds); - GenericNamespace* PushGenericNamespace(int modifiers); - void PopGenericNamespace(); -}; - -// A writer that outputs source code into a file. -// -// Note: the writer does not acquire the ownership of the file being passed in -// parameter. -class SourceFileWriter : public SourceWriter { - public: - explicit SourceFileWriter(WritableFile* file) : file_(file) {} - virtual ~SourceFileWriter() = default; - - protected: - void DoAppend(const StringPiece& str) override { - TF_CHECK_OK(file_->Append(str)); - } - - private: - WritableFile* file_; -}; - -// A writer that outputs source code into a string buffer. -class SourceBufferWriter : public SourceWriter { - public: - SourceBufferWriter() : owns_buffer_(true), buffer_(new string()) {} - explicit SourceBufferWriter(string* buffer) - : owns_buffer_(false), buffer_(buffer) {} - virtual ~SourceBufferWriter() { - if (owns_buffer_) delete buffer_; - } - const string& str() { return *buffer_; } - - protected: - void DoAppend(const StringPiece& str) override { - buffer_->append(str.begin(), str.end()); - } - - private: - bool owns_buffer_; - string* buffer_; -}; - -} // namespace java -} // namespace tensorflow - -#endif // TENSORFLOW_JAVA_OP_GENERATOR_SOURCE_WRITER_H_ diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/test/my_test_op.cc b/tensorflow-core/tensorflow-core-api/src/bazel/test/my_test_op.cc deleted file mode 100644 index eb755901ed8..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/bazel/test/my_test_op.cc +++ /dev/null @@ -1,21 +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. -==============================================================================*/ - -#include "tensorflow/core/framework/common_shape_fns.h" -#include "tensorflow/core/framework/op.h" - -REGISTER_OP("MyTest") - .Doc("Custom operation for testing.") - .SetShapeFn(tensorflow::shape_inference::UnknownShape); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/AudioOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/AudioOps.java index ca9f4fe8443..d6bcfc10c45 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/AudioOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/AudioOps.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. @@ -29,7 +29,7 @@ /** * An API for building {@code audio} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class AudioOps { private final Scope scope; @@ -43,30 +43,25 @@ public final class AudioOps { /** * Produces a visualization of audio data over time. - *

* Spectrograms are a standard way of representing audio information as a series of * slices of frequency information, one slice for each window of time. By joining * these together into a sequence, they form a distinctive fingerprint of the sound * over time. - *

- * This op expects to receive audio data as an input, stored as floats in the range + *

This op expects to receive audio data as an input, stored as floats in the range * -1 to 1, together with a window width in samples, and a stride specifying how * far to move the window between slices. From this it generates a three * dimensional output. The first dimension is for the channels in the input, so a * stereo audio input would have two here for example. The second dimension is time, * with successive frequency slices. The third dimension has an amplitude value for * each frequency during that time slice. - *

- * This means the layout when converted and saved as an image is rotated 90 degrees + *

This means the layout when converted and saved as an image is rotated 90 degrees * clockwise from a typical spectrogram. Time is descending down the Y axis, and * the frequency decreases from left to right. - *

- * Each value in the result represents the square root of the sum of the real and + *

Each value in the result represents the square root of the sum of the real and * imaginary parts of an FFT on the current window of samples. In this way, the * lowest dimension represents the power of each frequency in the current window, * and adjacent windows are concatenated in the next dimension. - *

- * To get a more intuitive and visual look at what this operation does, you can run + *

To get a more intuitive and visual look at what this operation does, you can run * tensorflow/examples/wav_to_spectrogram to read in an audio file and save out the * resulting spectrogram as a PNG image. * @@ -74,7 +69,7 @@ public final class AudioOps { * @param windowSize How wide the input window is in samples. For the highest efficiency * this should be a power of two, but other values are accepted. * @param stride How widely apart the center of adjacent sample windows should be. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of AudioSpectrogram */ public AudioSpectrogram audioSpectrogram(Operand input, Long windowSize, Long stride, @@ -84,24 +79,20 @@ public AudioSpectrogram audioSpectrogram(Operand input, Long windowSiz /** * Decode a 16-bit PCM WAV file to a float tensor. - *

* The -32768 to 32767 signed 16-bit values will be scaled to -1.0 to 1.0 in float. - *

- * When desired_channels is set, if the input contains fewer channels than this + *

When desired_channels is set, if the input contains fewer channels than this * then the last channel will be duplicated to give the requested number, else if * the input has more channels than requested then the additional channels will be * ignored. - *

- * If desired_samples is set, then the audio will be cropped or padded with zeroes + *

If desired_samples is set, then the audio will be cropped or padded with zeroes * to the requested length. - *

- * The first output contains a Tensor with the content of the audio samples. The + *

The first output contains a Tensor with the content of the audio samples. The * lowest dimension will be the number of channels, and the second will be the * number of samples. For example, a ten-sample-long stereo WAV file should give an * output shape of [10, 2]. * * @param contents The WAV-encoded audio, usually from a file. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of DecodeWav */ public DecodeWav decodeWav(Operand contents, DecodeWav.Options... options) { @@ -110,16 +101,14 @@ public DecodeWav decodeWav(Operand contents, DecodeWav.Options... optio /** * Encode audio data using the WAV file format. - *

* This operation will generate a string suitable to be saved out to create a .wav * audio file. It will be encoded in the 16-bit PCM format. It takes in float * values in the range -1.0f to 1.0f, and any outside that value will be clamped to * that range. - *

- * `audio` is a 2-D float Tensor of shape `[length, channels]`. - * `sample_rate` is a scalar Tensor holding the rate to use (e.g. 44100). + *

{@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). * - * @param audio 2-D with shape `[length, channels]`. + * @param audio 2-D with shape {@code [length, channels]}. * @param sampleRate Scalar containing the sample frequency. * @return a new instance of EncodeWav */ @@ -129,7 +118,6 @@ public EncodeWav encodeWav(Operand audio, Operand sampleRate) /** * Transforms a spectrogram into a form that's useful for speech recognition. - *

* Mel Frequency Cepstral Coefficients are a way of representing audio data that's * been effective as an input feature for machine learning. They are created by * taking the spectrum of a spectrogram (a 'cepstrum'), and discarding some of the @@ -140,7 +128,7 @@ public EncodeWav encodeWav(Operand audio, Operand sampleRate) * @param spectrogram Typically produced by the Spectrogram op, with magnitude_squared * set to true. * @param sampleRate How many samples per second the source audio used. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Mfcc */ public Mfcc mfcc(Operand spectrogram, Operand sampleRate, diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/BitwiseOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/BitwiseOps.java index c023586f94e..5cf8e620d72 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/BitwiseOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/BitwiseOps.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. @@ -29,7 +29,7 @@ /** * An API for building {@code bitwise} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class BitwiseOps { private final Scope scope; @@ -42,13 +42,11 @@ public final class BitwiseOps { } /** - * Elementwise computes the bitwise AND of `x` and `y`. - *

- * The result will have those bits set, that are set in both `x` and `y`. The - * computation is performed on the underlying representations of `x` and `y`. - *

- * For example: - *

{@code
+   * Elementwise computes the bitwise AND of {@code x} and {@code y}.
+   *  The result will have those bits set, that are set in both {@code x} and {@code y}. The
+   *  computation is performed on the underlying representations of {@code x} and {@code y}.
+   *  

For example: + *

    *  import tensorflow as tf
    *  from tensorflow.python.ops import bitwise_ops
    *  dtype_list = [tf.int8, tf.int16, tf.int32, tf.int64,
@@ -61,11 +59,11 @@ public final class BitwiseOps {
    *
    *    res = bitwise_ops.bitwise_and(lhs, rhs)
    *    tf.assert_equal(tf.cast(res, tf.float32), exp) # TRUE
-   *  }
+ *
* - * @param data type for {@code z()} output - * @param x - * @param y + * @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 */ public BitwiseAnd bitwiseAnd(Operand x, Operand y) { @@ -73,13 +71,11 @@ public BitwiseAnd bitwiseAnd(Operand x, Operand y) } /** - * Elementwise computes the bitwise OR of `x` and `y`. - *

- * The result will have those bits set, that are set in `x`, `y` or both. The - * computation is performed on the underlying representations of `x` and `y`. - *

- * For example: - *

{@code
+   * Elementwise computes the bitwise OR of {@code x} and {@code y}.
+   *  The result will have those bits set, that are set in {@code x}, {@code y} or both. The
+   *  computation is performed on the underlying representations of {@code x} and {@code y}.
+   *  

For example: + *

    *  import tensorflow as tf
    *  from tensorflow.python.ops import bitwise_ops
    *  dtype_list = [tf.int8, tf.int16, tf.int32, tf.int64,
@@ -92,11 +88,11 @@ public  BitwiseAnd bitwiseAnd(Operand x, Operand y)
    *
    *    res = bitwise_ops.bitwise_or(lhs, rhs)
    *    tf.assert_equal(tf.cast(res,  tf.float32), exp)  # TRUE
-   *  }
+ *
* - * @param data type for {@code z()} output - * @param x - * @param y + * @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 */ public BitwiseOr bitwiseOr(Operand x, Operand y) { @@ -104,13 +100,11 @@ public BitwiseOr bitwiseOr(Operand x, Operand y) { } /** - * Elementwise computes the bitwise XOR of `x` and `y`. - *

- * The result will have those bits set, that are different in `x` and `y`. The - * computation is performed on the underlying representations of `x` and `y`. - *

- * For example: - *

{@code
+   * Elementwise computes the bitwise XOR of {@code x} and {@code y}.
+   *  The result will have those bits set, that are different in {@code x} and {@code y}. The
+   *  computation is performed on the underlying representations of {@code x} and {@code y}.
+   *  

For example: + *

    *  import tensorflow as tf
    *  from tensorflow.python.ops import bitwise_ops
    *  dtype_list = [tf.int8, tf.int16, tf.int32, tf.int64,
@@ -123,11 +117,11 @@ public  BitwiseOr bitwiseOr(Operand x, Operand y) {
    *
    *    res = bitwise_ops.bitwise_xor(lhs, rhs)
    *    tf.assert_equal(tf.cast(res, tf.float32), exp) # TRUE
-   *  }
+ *
* - * @param data type for {@code z()} output - * @param x - * @param y + * @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 */ public BitwiseXor bitwiseXor(Operand x, Operand y) { @@ -135,13 +129,11 @@ public BitwiseXor bitwiseXor(Operand x, Operand y) } /** - * Invert (flip) each bit of supported types; for example, type `uint8` value 01010101 becomes 10101010. - *

- * Flip each bit of supported types. For example, type `int8` (decimal 2) binary 00000010 becomes (decimal -3) binary 11111101. - * This operation is performed on each element of the tensor argument `x`. - *

- * Example: - *

{@code
+   * Invert (flip) each bit of supported types; for example, type {@code uint8} value 01010101 becomes 10101010.
+   *  Flip each bit of supported types.  For example, type {@code int8} (decimal 2) binary 00000010 becomes (decimal -3) binary 11111101.
+   *  This operation is performed on each element of the tensor argument {@code x}.
+   *  

Example: + *

    *  import tensorflow as tf
    *  from tensorflow.python.ops import bitwise_ops
    *
@@ -175,10 +167,10 @@ public  BitwiseXor bitwiseXor(Operand x, Operand y)
    *      inverted = bitwise_ops.invert(input_tensor)
    *      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 - * @param x + * @param x The x value + * @param data type for {@code Invert} output and operands * @return a new instance of Invert */ public Invert invert(Operand x) { @@ -186,13 +178,11 @@ public Invert invert(Operand x) { } /** - * Elementwise computes the bitwise left-shift of `x` and `y`. - *

- * If `y` is negative, or greater than or equal to the width of `x` in bits the + * Elementwise computes the bitwise left-shift of {@code x} and {@code y}. + * If {@code y} is negative, or greater than or equal to the width of {@code x} in bits the * result is implementation defined. - *

- * Example: - *

{@code
+   *  

Example: + *

    *  import tensorflow as tf
    *  from tensorflow.python.ops import bitwise_ops
    *  import numpy as np
@@ -215,12 +205,12 @@ public  Invert invert(Operand x) {
    *  lhs = np.array([-2, 64, 101, 32], dtype=np.int8)
    *  rhs = np.array([-1, -5, -3, -14], dtype=np.int8)
    *  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 - * @param x - * @param y + * @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 */ public LeftShift leftShift(Operand x, Operand y) { @@ -228,16 +218,13 @@ public LeftShift leftShift(Operand x, Operand y) { } /** - * Elementwise computes the bitwise right-shift of `x` and `y`. - *

+ * Elementwise computes the bitwise right-shift of {@code x} and {@code y}. * Performs a logical shift for unsigned integer types, and an arithmetic shift * for signed integer types. - *

- * If `y` is negative, or greater than or equal to than the width of `x` in bits + *

If {@code y} is negative, or greater than or equal to than the width of {@code x} in bits * the result is implementation defined. - *

- * Example: - *

{@code
+   *  

Example: + *

    *  import tensorflow as tf
    *  from tensorflow.python.ops import bitwise_ops
    *  import numpy as np
@@ -260,12 +247,12 @@ public  LeftShift leftShift(Operand x, Operand y) {
    *  lhs = np.array([-2, 64, 101, 32], dtype=np.int8)
    *  rhs = np.array([-1, -5, -3, -14], dtype=np.int8)
    *  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 - * @param x - * @param y + * @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 */ public RightShift rightShift(Operand x, Operand y) { 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 index ab4089a045d..b5b1ee3750f 100644 --- 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 @@ -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,9 +18,47 @@ 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.DataServiceDataset; +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; @@ -28,7 +66,7 @@ /** * An API for building {@code data.experimental} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class DataExperimentalOps { private final Scope scope; @@ -41,25 +79,653 @@ public final class DataExperimentalOps { } /** + * The ExperimentalAssertNextDataset operation * - * @param datasetId - * @param processingMode - * @param address - * @param protocol - * @param jobName - * @param maxOutstandingRequests - * @param iterationCounter - * @param outputTypes - * @param outputShapes - * @param options carries optional attributes values - * @return a new instance of DataServiceDataset + * @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 DataServiceDataset dataServiceDataset(Operand datasetId, - Operand processingMode, Operand address, Operand protocol, - Operand jobName, Operand maxOutstandingRequests, Operand iterationCounter, + 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, - DataServiceDataset.Options... options) { - return DataServiceDataset.create(scope, datasetId, processingMode, address, protocol, jobName, maxOutstandingRequests, iterationCounter, outputTypes, outputShapes, options); + 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. + * @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); } /** 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 56f85b0ea9b..0f8695568db 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. @@ -18,41 +18,145 @@ 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.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; +import org.tensorflow.op.data.CSVDataset; +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.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; +import org.tensorflow.op.data.FixedLengthRecordDataset; +import org.tensorflow.op.data.FlatMapDataset; +import org.tensorflow.op.data.GeneratorDataset; +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; +import org.tensorflow.op.data.MapDataset; +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; import org.tensorflow.op.data.OptionalFromValue; import org.tensorflow.op.data.OptionalGetValue; import org.tensorflow.op.data.OptionalHasValue; import org.tensorflow.op.data.OptionalNone; +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; +import org.tensorflow.op.data.PrefetchDataset; +import org.tensorflow.op.data.PrivateThreadPoolDataset; +import org.tensorflow.op.data.RandomDataset; import org.tensorflow.op.data.RangeDataset; +import org.tensorflow.op.data.RebatchDatasetV2; +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; import org.tensorflow.op.data.SerializeIterator; +import org.tensorflow.op.data.SetStatsAggregatorDataset; +import org.tensorflow.op.data.ShardDataset; +import org.tensorflow.op.data.ShuffleAndRepeatDataset; +import org.tensorflow.op.data.ShuffleDataset; 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; import org.tensorflow.op.data.TensorSliceDataset; 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; import org.tensorflow.types.family.TType; /** * 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; @@ -70,8 +174,8 @@ public final class DataOps { /** * A container for an iterator resource. * - * @param outputTypes - * @param outputShapes + * @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, @@ -80,35 +184,349 @@ public AnonymousIterator anonymousIterator(List> outputTy } /** - * Creates a dataset that batches `batch_size` elements from `input_dataset`. + * The AnonymousMemoryCache operation * - * @param inputDataset + * @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 attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of AssertCardinalityDataset + */ + public AssertCardinalityDataset assertCardinalityDataset(Operand inputDataset, + Operand cardinality, List> outputTypes, + List outputShapes) { + return AssertCardinalityDataset.create(scope, inputDataset, cardinality, outputTypes, outputShapes); + } + + /** + * A transformation that asserts which transformations happen next. + * This transformation checks whether the camel-case names (i.e. "FlatMap", not + * "flat_map") of the transformations following this transformation match the list + * of names in the {@code transformations} argument. 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.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 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); + } + + /** + * 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 + * 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); + } + + /** + * Creates a dataset that batches {@code batch_size} elements from {@code input_dataset}. + * + * @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 - * @param outputShapes - * @param options carries optional attributes values + * @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 */ - public BatchDataset batchDataset(Operand inputDataset, Operand batchSize, + public BatchDataset batchDataset(Operand inputDataset, Operand batchSize, Operand dropRemainder, List> outputTypes, List outputShapes, BatchDataset.Options... options) { return BatchDataset.create(scope, inputDataset, batchSize, dropRemainder, outputTypes, outputShapes, options); } /** - * Creates a dataset that concatenates `input_dataset` with `another_dataset`. + * Records the bytes size of each element of {@code input_dataset} in a StatsAggregator. * - * @param inputDataset - * @param anotherDataset - * @param outputTypes - * @param outputShapes - * @return a new instance of ConcatenateDataset + * @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 CSVDatasetV2 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 excludeCols The excludeCols value + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of CSVDataset */ - public ConcatenateDataset concatenateDataset(Operand inputDataset, Operand anotherDataset, + public CSVDataset cSVDataset(Operand filenames, Operand compressionType, + Operand bufferSize, Operand header, Operand fieldDelim, + Operand useQuoteDelim, Operand naValue, Operand selectCols, + Iterable> recordDefaults, Operand excludeCols, List outputShapes) { + return CSVDataset.create(scope, filenames, compressionType, bufferSize, header, fieldDelim, useQuoteDelim, naValue, selectCols, recordDefaults, excludeCols, outputShapes); + } + + /** + * 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 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, 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 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( + Operand inputDataset, Operand ratioNumerator, + Operand ratioDenominator, Iterable> otherArguments, + Long numElementsPerBranch, List branches, List otherArgumentsLengths, List> outputTypes, List outputShapes) { - return ConcatenateDataset.create(scope, inputDataset, anotherDataset, outputTypes, outputShapes); + return ChooseFastestBranchDataset.create(scope, inputDataset, ratioNumerator, ratioDenominator, otherArguments, numElementsPerBranch, branches, otherArgumentsLengths, outputTypes, outputShapes); + } + + /** + * The ChooseFastestDataset 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); + } + + /** + * Compresses a dataset element. + * + * @param components The components value + * @return a new instance of CompressElement + */ + public CompressElement compressElement(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 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, 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 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, + ConcreteFunction uncompressFn, DataServiceDataset.Options... options) { + return DataServiceDataset.create(scope, datasetId, processingMode, address, protocol, jobName, consumerIndex, numConsumers, maxOutstandingRequests, iterationCounter, outputTypes, outputShapes, uncompressFn, options); + } + + /** + * 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. + * @param options carries optional attribute values + * @return a new instance of DatasetCardinality + */ + 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); + } + + /** + * Creates a dataset from the given {@code graph_def}. + * Creates a dataset from the provided {@code graph_def}. + * + * @param graphDef The graph representation of the dataset (as serialized GraphDef). + * @return a new instance of DatasetFromGraph + */ + public DatasetFromGraph datasetFromGraph(Operand graphDef) { + return DatasetFromGraph.create(scope, graphDef); + } + + /** + * Returns a serialized GraphDef representing {@code input_dataset}. + * Returns a graph representation for {@code input_dataset}. + * + * @param inputDataset A variant tensor representing the dataset to return the graph representation for. + * @param options carries optional attribute values + * @return a new instance of DatasetToGraph + */ + public DatasetToGraph datasetToGraph(Operand inputDataset, + DatasetToGraph.Options... options) { + return DatasetToGraph.create(scope, inputDataset, options); + } + + /** + * 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 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, + DatasetToSingleElement.Options... options) { + return DatasetToSingleElement.create(scope, dataset, outputTypes, outputShapes, options); + } + + /** + * 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); } /** @@ -118,10 +536,56 @@ public ConcatenateDataset concatenateDataset(Operand inputDataset, Operand * @param deleter A variant deleter. * @return a new instance of DeleteIterator */ - public DeleteIterator deleteIterator(Operand handle, Operand deleter) { + public DeleteIterator deleteIterator(Operand handle, + Operand deleter) { 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. + * + * @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); + } + /** * Converts the given variant tensor to an iterator and stores it in the given resource. * @@ -130,95 +594,757 @@ public DeleteIterator deleteIterator(Operand handle, Operand deleter) { * resource. * @return a new instance of DeserializeIterator */ - public DeserializeIterator deserializeIterator(Operand resourceHandle, Operand serialized) { - return DeserializeIterator.create(scope, resourceHandle, serialized); + public DeserializeIterator deserializeIterator(Operand resourceHandle, + Operand serialized) { + return DeserializeIterator.create(scope, resourceHandle, serialized); + } + + /** + * 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 + * @param options carries optional attribute values + * @return a new instance of DirectedInterleaveDataset + */ + public DirectedInterleaveDataset directedInterleaveDataset( + Operand selectorInputDataset, + Iterable> dataInputDatasets, + List> outputTypes, List outputShapes, + DirectedInterleaveDataset.Options... options) { + 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 attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of FilterByLastComponentDataset + */ + public FilterByLastComponentDataset filterByLastComponentDataset( + Operand inputDataset, List> outputTypes, + List outputShapes) { + return FilterByLastComponentDataset.create(scope, inputDataset, outputTypes, outputShapes); + } + + /** + * 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}.
  • + *
+ * + * @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 + * @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, + 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 attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of FinalizeDataset + */ + public FinalizeDataset finalizeDataset(Operand inputDataset, + List> outputTypes, List outputShapes, + FinalizeDataset.Options... options) { + return FinalizeDataset.create(scope, inputDataset, outputTypes, outputShapes, options); + } + + /** + * 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 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, + FixedLengthRecordDataset.Options... options) { + return FixedLengthRecordDataset.create(scope, filenames, headerBytes, recordBytes, footerBytes, bufferSize, compressionType, options); + } + + /** + * Creates a dataset that applies {@code f} to the outputs of {@code input_dataset}. + * Unlike MapDataset, the {@code f} in FlatMapDataset is expected to return a + * Dataset variant, and FlatMapDataset will flatten successive results + * into a single Dataset. + * + * @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 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, + 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 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, + GeneratorDataset.Options... options) { + return GeneratorDataset.create(scope, initFuncOtherArgs, nextFuncOtherArgs, finalizeFuncOtherArgs, initFunc, nextFunc, finalizeFunc, outputTypes, outputShapes, options); + } + + /** + * 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 + * @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, + 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 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); + } + + /** + * 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 + * @return a new instance of InitializeTableFromDataset + */ + public InitializeTableFromDataset initializeTableFromDataset(Operand tableHandle, + Operand dataset) { + return InitializeTableFromDataset.create(scope, tableHandle, dataset); + } + + /** + * Creates a dataset that applies {@code f} to the outputs of {@code input_dataset}. + * Unlike MapDataset, the {@code f} in InterleaveDataset is expected to return + * a Dataset variant, and InterleaveDataset will flatten successive + * results into a single Dataset. Unlike FlatMapDataset, + * InterleaveDataset will interleave sequences of up to {@code block_length} + * consecutive elements from {@code cycle_length} input elements. + * + * @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 attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of InterleaveDataset + */ + public InterleaveDataset interleaveDataset(Operand inputDataset, + Iterable> otherArguments, Operand cycleLength, Operand blockLength, + 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 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, + List> outputTypes, List outputShapes) { + 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 attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of IteratorGetNext + */ + public IteratorGetNext iteratorGetNext(Operand iterator, + List> outputTypes, List outputShapes) { + return IteratorGetNext.create(scope, iterator, outputTypes, outputShapes); + } + + /** + * Gets the next output from the given iterator as an Optional variant. + * + * @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, + List> outputTypes, List outputShapes) { + return IteratorGetNextAsOptional.create(scope, iterator, outputTypes, outputShapes); + } + + /** + * Gets the next output from the given iterator. + * This operation is a synchronous version IteratorGetNext. It should only be used + * in situations where the iterator does not block the calling thread, or where + * the calling thread is not a member of the thread pool used to execute parallel + * operations (e.g. in eager mode). + * + * @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 + */ + public IteratorGetNextSync iteratorGetNextSync(Operand iterator, + List> outputTypes, List outputShapes) { + return IteratorGetNextSync.create(scope, iterator, outputTypes, outputShapes); + } + + /** + * Converts the given {@code resource_handle} representing an iterator to a string. + * + * @param resourceHandle A handle to an iterator resource. + * @return a new instance of IteratorToStringHandle + */ + public IteratorToStringHandle iteratorToStringHandle(Operand resourceHandle) { + return IteratorToStringHandle.create(scope, resourceHandle); + } + + /** + * Creates a dataset that emits the key-value pairs in one or more LMDB files. + * The Lightning Memory-Mapped Database Manager, or LMDB, is an embedded binary + * key-value database. This dataset can read the contents of LMDB database files, + * the names of which generally have the {@code .mdb} suffix. + *

Each output element consists of a key-value pair represented as a pair of + * scalar string {@code Tensor}s, where the first {@code Tensor} contains the key and the + * second {@code Tensor} contains the value. + *

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. + * + * @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 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); + } + + /** + * 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); + } + + /** + * 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 + * 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 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 + * @param options carries optional attribute values + * @return a new instance of LegacyParallelInterleaveDataset + */ + public LegacyParallelInterleaveDataset legacyParallelInterleaveDataset( + Operand inputDataset, Iterable> otherArguments, + Operand cycleLength, Operand blockLength, + Operand bufferOutputElements, Operand prefetchInputElements, + ConcreteFunction f, List> outputTypes, List outputShapes, + LegacyParallelInterleaveDataset.Options... options) { + 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 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 + */ + public LoadDataset loadDataset(Operand path, Iterable> readerFuncOtherArgs, + List> outputTypes, List outputShapes, + ConcreteFunction readerFunc, LoadDataset.Options... options) { + return LoadDataset.create(scope, path, readerFuncOtherArgs, outputTypes, outputShapes, readerFunc, options); + } + + /** + * Makes a new iterator from the given {@code dataset} and stores it in {@code iterator}. + * 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 + * @return a new instance of MakeIterator + */ + public MakeIterator makeIterator(Operand dataset, + Operand iterator) { + return MakeIterator.create(scope, dataset, iterator); + } + + /** + * 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 MatchingFilesDataset 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); + } + + /** + * Identity transformation that models performance. + * Identity transformation that models performance. + * + * @param inputDataset A variant tensor representing the 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 ModelDataset + */ + public ModelDataset modelDataset(Operand inputDataset, + List> outputTypes, List outputShapes, + ModelDataset.Options... options) { + 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 sharedName - * @param container - * @param outputTypes - * @param outputShapes - * @return a new instance of Iterator + * @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 Iterator iterator(String sharedName, String container, - List> outputTypes, List outputShapes) { - return Iterator.create(scope, sharedName, container, outputTypes, outputShapes); + public MultiDeviceIteratorGetNextFromShard multiDeviceIteratorGetNextFromShard( + Operand multiDeviceIterator, Operand shardNum, + Operand incarnationId, List> outputTypes, + List outputShapes) { + return MultiDeviceIteratorGetNextFromShard.create(scope, multiDeviceIterator, shardNum, incarnationId, outputTypes, outputShapes); } /** - * Gets the next output from the given iterator . + * Initializes the multi device iterator with the given dataset. * - * @param iterator - * @param outputTypes - * @param outputShapes - * @return a new instance of IteratorGetNext + * @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 IteratorGetNext iteratorGetNext(Operand iterator, - List> outputTypes, List outputShapes) { - return IteratorGetNext.create(scope, iterator, outputTypes, outputShapes); + public MultiDeviceIteratorInit multiDeviceIteratorInit(Operand dataset, + Operand multiDeviceIterator, Operand maxBufferSize) { + return MultiDeviceIteratorInit.create(scope, dataset, multiDeviceIterator, maxBufferSize); } /** - * Gets the next output from the given iterator as an Optional variant. + * Produces a string handle for the given MultiDeviceIterator. * - * @param iterator - * @param outputTypes - * @param outputShapes - * @return a new instance of IteratorGetNextAsOptional + * @param multiDeviceIterator A MultiDeviceIterator resource. + * @return a new instance of MultiDeviceIteratorToStringHandle */ - public IteratorGetNextAsOptional iteratorGetNextAsOptional(Operand iterator, - List> outputTypes, List outputShapes) { - return IteratorGetNextAsOptional.create(scope, iterator, outputTypes, outputShapes); + public MultiDeviceIteratorToStringHandle multiDeviceIteratorToStringHandle( + Operand multiDeviceIterator) { + return MultiDeviceIteratorToStringHandle.create(scope, multiDeviceIterator); } /** - * Gets the next output from the given iterator. - *

- * This operation is a synchronous version IteratorGetNext. It should only be used - * in situations where the iterator does not block the calling thread, or where - * the calling thread is not a member of the thread pool used to execute parallel - * operations (e.g. in eager mode). + * The NonSerializableDataset operation * - * @param iterator - * @param outputTypes - * @param outputShapes - * @return a new instance of IteratorGetNextSync + * @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 IteratorGetNextSync iteratorGetNextSync(Operand iterator, + public NonSerializableDataset nonSerializableDataset(Operand inputDataset, List> outputTypes, List outputShapes) { - return IteratorGetNextSync.create(scope, iterator, outputTypes, outputShapes); + return NonSerializableDataset.create(scope, inputDataset, outputTypes, outputShapes); } /** - * Converts the given `resource_handle` representing an iterator to a string. + * Makes a "one-shot" iterator that can be iterated only once. + * A one-shot iterator bundles the logic for defining the dataset and + * the state of the iterator in a single op, which allows simple input + * pipelines to be defined without an additional initialization + * ("MakeIterator") step. + *

One-shot iterators have the following limitations: + *

    + *
  • They do not support parameterization: all logic for creating the underlying + * dataset must be bundled in the {@code dataset_factory} function.
  • + *
  • They are not resettable. Once a one-shot iterator reaches the end of its + * underlying dataset, subsequent "IteratorGetNext" operations on that + * iterator will always produce an {@code OutOfRange} error.
  • + *
+ *

For greater flexibility, use "Iterator" and "MakeIterator" to define + * an iterator using an arbitrary subgraph, which may capture tensors + * (including fed values) as parameters, and which may be reset multiple + * times by rerunning "MakeIterator". * - * @param resourceHandle A handle to an iterator resource. - * @return a new instance of IteratorToStringHandle + * @param datasetFactory A function of type {@code () -> DT_VARIANT}, where the returned + * DT_VARIANT is a 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 OneShotIterator */ - public IteratorToStringHandle iteratorToStringHandle(Operand resourceHandle) { - return IteratorToStringHandle.create(scope, resourceHandle); + public OneShotIterator oneShotIterator(ConcreteFunction datasetFactory, + List> outputTypes, List outputShapes, + OneShotIterator.Options... options) { + return OneShotIterator.create(scope, datasetFactory, outputTypes, outputShapes, options); } /** - * Makes a new iterator from the given `dataset` and stores it in `iterator`. - *

- * This operation may be executed multiple times. Each execution will reset the - * iterator in `iterator` to the first element of `dataset`. + * Creates a dataset by applying related optimizations to {@code input_dataset}. + * Creates a dataset by applying related optimizations to {@code input_dataset}. * - * @param dataset - * @param iterator - * @return a new instance of MakeIterator + * @param inputDataset A variant tensor representing the input dataset. + * @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 attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of OptimizeDataset */ - public MakeIterator makeIterator(Operand dataset, Operand iterator) { - return MakeIterator.create(scope, dataset, iterator); + public OptimizeDataset optimizeDataset(Operand inputDataset, + Operand optimizationsEnabled, Operand optimizationsDisabled, + Operand optimizationsDefault, List> outputTypes, + List outputShapes, OptimizeDataset.Options... options) { + return OptimizeDataset.create(scope, inputDataset, optimizationsEnabled, optimizationsDisabled, optimizationsDefault, outputTypes, outputShapes, options); } /** * Constructs an Optional variant from a tuple of tensors. * - * @param components + * @param components The components value * @return a new instance of OptionalFromValue */ public OptionalFromValue optionalFromValue(Iterable> components) { @@ -228,12 +1354,12 @@ public OptionalFromValue optionalFromValue(Iterable> components) { /** * Returns the value stored in an Optional variant or raises an error if none exists. * - * @param optional - * @param outputTypes - * @param outputShapes + * @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, + public OptionalGetValue optionalGetValue(Operand optional, List> outputTypes, List outputShapes) { return OptionalGetValue.create(scope, optional, outputTypes, outputShapes); } @@ -241,10 +1367,10 @@ public OptionalGetValue optionalGetValue(Operand optional, /** * Returns true if and only if the given Optional variant has a value. * - * @param optional + * @param optional The optional value * @return a new instance of OptionalHasValue */ - public OptionalHasValue optionalHasValue(Operand optional) { + public OptionalHasValue optionalHasValue(Operand optional) { return OptionalHasValue.create(scope, optional); } @@ -257,89 +1383,760 @@ public OptionalNone optionalNone() { return OptionalNone.create(scope); } + /** + * Creates a dataset by attaching tf.data.Options to {@code input_dataset}. + * + * @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 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, + 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 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 + * 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. + * @param paddingValues A list of scalars containing the padding value to use for + * 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 attribute + * @param options carries optional attribute values + * @return a new instance of PaddedBatchDataset + */ + public PaddedBatchDataset paddedBatchDataset(Operand inputDataset, + Operand batchSize, Iterable> paddedShapes, + Iterable> paddingValues, Operand dropRemainder, List outputShapes, + PaddedBatchDataset.Options... options) { + return PaddedBatchDataset.create(scope, inputDataset, batchSize, paddedShapes, paddingValues, dropRemainder, outputShapes, options); + } + + /** + * 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 attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of ParallelBatchDataset + */ + public ParallelBatchDataset parallelBatchDataset(Operand inputDataset, + Operand batchSize, Operand numParallelCalls, Operand dropRemainder, + List> outputTypes, List outputShapes, + ParallelBatchDataset.Options... options) { + 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 + * dataset will fetch records from the interleaved datasets in parallel. + *

The {@code tf.data} Python API creates instances of this op from + * {@code Dataset.interleave()} when the {@code num_parallel_calls} parameter of that method + * is set to any value other than {@code None}. + *

By default, the output of this dataset will be deterministic, which may result + * in the dataset blocking if the next data item to be returned isn't available. + * In order to avoid head-of-line blocking, one can either set the {@code deterministic} + * attribute to "false", or leave it as "default" and set the + * {@code experimental_deterministic} parameter of {@code tf.data.Options} to {@code False}. + * This can improve performance at the expense of non-determinism. + * + * @param inputDataset Dataset that produces a stream of arguments for the function {@code f}. + * @param otherArguments Additional arguments to pass to {@code f} beyond those produced by {@code input_dataset}. + * Evaluated once when the dataset is instantiated. + * @param cycleLength 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. + * @param blockLength Number of elements at a time to produce from each interleaved invocation of a + * dataset returned by {@code f}. + * @param bufferOutputElements The number of elements each iterator being interleaved should buffer (similar + * to the {@code .prefetch()} transformation for each interleaved iterator). + * @param prefetchInputElements Determines the number of iterators to prefetch, allowing buffers to warm up and + * data to be pre-fetched without blocking the main thread. + * @param numParallelCalls 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. + * @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 + * @param options carries optional attribute values + * @return a new instance of ParallelInterleaveDataset + */ + public ParallelInterleaveDataset parallelInterleaveDataset(Operand inputDataset, + Iterable> otherArguments, Operand cycleLength, Operand blockLength, + Operand bufferOutputElements, Operand prefetchInputElements, + Operand numParallelCalls, ConcreteFunction f, + List> outputTypes, List outputShapes, + ParallelInterleaveDataset.Options... options) { + return ParallelInterleaveDataset.create(scope, inputDataset, otherArguments, cycleLength, blockLength, bufferOutputElements, prefetchInputElements, numParallelCalls, f, outputTypes, outputShapes, options); + } + + /** + * Creates a dataset that applies {@code f} to the outputs of {@code input_dataset}. + * Unlike a "MapDataset", which applies {@code f} sequentially, this dataset invokes up + * to {@code num_parallel_calls} copies of {@code f} in parallel. + * + * @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 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 + */ + public ParallelMapDataset parallelMapDataset(Operand inputDataset, + Iterable> otherArguments, Operand numParallelCalls, ConcreteFunction f, + List> outputTypes, List outputShapes, + ParallelMapDataset.Options... options) { + return ParallelMapDataset.create(scope, inputDataset, otherArguments, numParallelCalls, f, outputTypes, outputShapes, options); + } + + /** + * 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 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 + */ + public ParseExampleDataset parseExampleDataset(Operand inputDataset, + Operand numParallelCalls, Iterable> denseDefaults, List sparseKeys, + List denseKeys, List> sparseTypes, List denseShapes, + List> outputTypes, List outputShapes, + List> raggedValueTypes, + List> raggedSplitTypes, ParseExampleDataset.Options... options) { + return ParseExampleDataset.create(scope, inputDataset, numParallelCalls, denseDefaults, sparseKeys, denseKeys, sparseTypes, denseShapes, outputTypes, outputShapes, raggedValueTypes, raggedSplitTypes, options); + } + + /** + * Creates a dataset that asynchronously prefetches elements from {@code input_dataset}. + * + * @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 attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of PrefetchDataset + */ + public PrefetchDataset prefetchDataset(Operand inputDataset, + Operand bufferSize, List> outputTypes, + List outputShapes, PrefetchDataset.Options... options) { + return PrefetchDataset.create(scope, inputDataset, bufferSize, 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. + * Creates a Dataset that returns a stream of uniformly distributed + * 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.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 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, + Operand seedGenerator, List> outputTypes, + List outputShapes, RandomDataset.Options... options) { + return RandomDataset.create(scope, seed, seed2, seedGenerator, outputTypes, outputShapes, options); + } + /** * Creates a dataset with a range of values. Corresponds to python's xrange. * * @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 - * @param outputShapes + * @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); + } + + /** + * Creates a dataset that changes the batch size. + * Creates a dataset that rebatches elements from {@code input_dataset} into new batch + * sizes. + * + * @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 attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of RebatchDatasetV2 + */ + public RebatchDatasetV2 rebatchDatasetV2(Operand inputDataset, + Operand batchSizes, Operand dropRemainder, + List> outputTypes, List outputShapes) { + return RebatchDatasetV2.create(scope, inputDataset, batchSizes, dropRemainder, outputTypes, outputShapes); + } + + /** + * Reduces the input dataset to a singleton using a reduce function. + * + * @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 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 attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of ReduceDataset + */ + public ReduceDataset reduceDataset(Operand inputDataset, + Iterable> initialState, Iterable> otherArguments, ConcreteFunction f, + List> outputTypes, List outputShapes, + ReduceDataset.Options... options) { + return ReduceDataset.create(scope, inputDataset, initialState, otherArguments, f, outputTypes, outputShapes, options); + } + + /** + * 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 attribute + * @param options carries optional attribute values + * @return a new instance of RegisterDataset + */ + public RegisterDataset registerDataset(Operand dataset, Operand address, + Operand protocol, Long externalStatePolicy, RegisterDataset.Options... options) { + return RegisterDataset.create(scope, dataset, address, protocol, externalStatePolicy, options); } /** - * Creates a dataset that emits the outputs of `input_dataset` `count` times. + * Creates a dataset that emits the outputs of {@code input_dataset} {@code count} times. * - * @param inputDataset - * @param count A scalar representing the number of times that `input_dataset` should - * be repeated. A value of `-1` indicates that it should be repeated infinitely. - * @param outputTypes - * @param outputShapes + * @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 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, + public RepeatDataset repeatDataset(Operand inputDataset, Operand count, + 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); + } + + /** + * Creates a dataset that takes a Bernoulli sample of the contents of another dataset. + * There is no transformation in the {@code tf.data} Python API for creating this dataset. + * Instead, it is created as a result of the {@code filter_with_random_uniform_fusion} + * static optimization. Whether this optimization is performed is determined by the + * {@code experimental_optimization.filter_with_random_uniform_fusion} option of + * {@code tf.data.Options}. + * + * @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 attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of SamplingDataset + */ + public SamplingDataset samplingDataset(Operand inputDataset, + Operand rate, Operand seed, Operand seed2, List> outputTypes, List outputShapes) { - return RepeatDataset.create(scope, inputDataset, count, outputTypes, outputShapes); + return SamplingDataset.create(scope, inputDataset, rate, seed, seed2, outputTypes, outputShapes); + } + + /** + * 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 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, 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); } /** - * Converts the given `resource_handle` representing an iterator to a variant tensor. + * Converts the given {@code resource_handle} representing an iterator to a variant tensor. * * @param resourceHandle A handle to an iterator resource. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of SerializeIterator */ - public SerializeIterator serializeIterator(Operand resourceHandle, + public SerializeIterator serializeIterator(Operand resourceHandle, SerializeIterator.Options... options) { return SerializeIterator.create(scope, resourceHandle, options); } /** - * Creates a dataset that skips `count` elements from the `input_dataset`. + * 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 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); + } + + /** + * Creates a {@code Dataset} that includes only 1/{@code num_shards} of this dataset. + * + * @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 attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of ShardDataset + */ + public ShardDataset shardDataset(Operand inputDataset, Operand numShards, + Operand index, List> outputTypes, List outputShapes, + ShardDataset.Options... options) { + return ShardDataset.create(scope, inputDataset, numShards, index, outputTypes, outputShapes, options); + } + + /** + * 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 attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of ShuffleAndRepeatDataset + */ + public ShuffleAndRepeatDataset shuffleAndRepeatDataset(Operand inputDataset, + Operand bufferSize, Operand seed, Operand seed2, + Operand count, Operand seedGenerator, + List> outputTypes, List outputShapes, + ShuffleAndRepeatDataset.Options... options) { + return ShuffleAndRepeatDataset.create(scope, inputDataset, bufferSize, seed, seed2, count, seedGenerator, outputTypes, outputShapes, options); + } + + /** + * The ShuffleDatasetV3 operation * - * @param inputDataset - * @param count A scalar representing the number of elements from the `input_dataset` + * @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 + */ + public ShuffleDataset shuffleDataset(Operand inputDataset, + Operand bufferSize, Operand seed, Operand seed2, + Operand seedGenerator, List> outputTypes, + List outputShapes, ShuffleDataset.Options... options) { + return ShuffleDataset.create(scope, inputDataset, bufferSize, seed, seed2, seedGenerator, outputTypes, outputShapes, options); + } + + /** + * Creates a dataset that skips {@code count} elements from the {@code input_dataset}. + * + * @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 - * @param outputShapes + * @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); + public SkipDataset skipDataset(Operand inputDataset, Operand count, + 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 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 + * @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, + 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); + } + + /** + * Creates a dataset that will write to / read from a snapshot. + * This dataset attempts to determine whether a valid snapshot exists at the + * {@code snapshot_path}, and reads from the snapshot in lieu of using {@code input_dataset}. + * If not, it will run the preprocessing pipeline as usual, and write out a + * snapshot of the data processed for future use. + * + * @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 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 + * @return a new instance of SnapshotDataset + */ + public SnapshotDataset snapshotDataset(Operand inputDataset, + Operand path, Iterable> readerFuncOtherArgs, + Iterable> shardFuncOtherArgs, List> outputTypes, + List outputShapes, ConcreteFunction readerFunc, ConcreteFunction shardFunc, + SnapshotDataset.Options... options) { + 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 + * @return a new instance of SparseTensorSliceDataset + */ + public SparseTensorSliceDataset sparseTensorSliceDataset(Operand indices, + Operand values, Operand denseShape) { + return SparseTensorSliceDataset.create(scope, indices, values, denseShape); + } + + /** + * 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); + } + + /** + * 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 `count` elements from the `input_dataset`. + * Creates a dataset that contains {@code count} elements from the {@code input_dataset}. * - * @param inputDataset - * @param count A scalar representing the number of elements from the `input_dataset` - * that should be taken. A value of `-1` indicates that all of `input_dataset` + * @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 - * @param outputShapes + * @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); + public TakeDataset takeDataset(Operand inputDataset, Operand count, + List> outputTypes, List outputShapes, + TakeDataset.Options... options) { + return TakeDataset.create(scope, inputDataset, count, outputTypes, outputShapes, options); + } + + /** + * 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 + * @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, + TakeWhileDataset.Options... options) { + return TakeWhileDataset.create(scope, inputDataset, otherArguments, predicate, outputTypes, outputShapes, options); } /** - * Creates a dataset that emits each dim-0 slice of `components` once. + * Creates a dataset that emits {@code components} as a tuple of tensors once. * - * @param components - * @param outputShapes + * @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, + 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 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); } /** @@ -348,13 +2145,15 @@ public TensorSliceDataset tensorSliceDataset(Iterable> components, * @param filenames A scalar or a vector containing the name(s) of the file(s) to be * read. * @param compressionType A scalar containing either (i) the empty string (no - * compression), (ii) "ZLIB", or (iii) "GZIP". + * 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); } /** @@ -363,33 +2162,203 @@ public TextLineDataset textLineDataset(Operand filenames, * @param filenames A scalar or vector containing the name(s) of the file(s) to be * read. * @param compressionType A scalar containing either (i) the empty string (no - * compression), (ii) "ZLIB", or (iii) "GZIP". + * 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 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. + * @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 + * @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 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 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, + UniqueDataset.Options... options) { + return UniqueDataset.create(scope, inputDataset, outputTypes, outputShapes, options); + } + + /** + * The UnwrapDatasetVariant operation + * + * @param inputHandle The inputHandle value + * @return a new instance of UnwrapDatasetVariant + */ + public UnwrapDatasetVariant unwrapDatasetVariant(Operand inputHandle) { + return UnwrapDatasetVariant.create(scope, inputHandle); + } + + /** + * Combines (nests of) input elements into a dataset of (nests of) windows. + *

A "window" is a finite dataset of flat elements of size {@code size} (or possibly + * fewer if there are not enough input elements to fill the window and + * {@code drop_remainder} evaluates to false). + *

The {@code shift} argument determines the number of input elements by which + * the window moves on each iteration. The first element in the {@code k}th window + * will be element + *

+   *  1 + (k-1) * shift
+   *  
+ *

of the input dataset. In particular, the first element of the first window + * will always be the first element of the input dataset. + *

If the {@code stride} parameter is greater than 1, then each window will skip + * {@code (stride - 1)} input elements between each element that appears in the + * window. Output windows will still contain {@code size} elements regardless of + * the value of {@code stride}. + *

The {@code stride} argument determines the stride of the input elements, and the + * {@code shift} argument determines the shift of the window. + *

For example, letting {@code {...}} to represent a Dataset: + *

    + *
  • {@code tf.data.Dataset.range(7).window(2)} produces + * {@code {{0, 1}, {2, 3}, {4, 5}, {6}}}
  • + *
  • {@code tf.data.Dataset.range(7).window(3, 2, 1, True)} produces + * {@code {{0, 1, 2}, {2, 3, 4}, {4, 5, 6}}}
  • + *
  • {@code tf.data.Dataset.range(7).window(3, 1, 2, True)} produces + * {@code {{0, 2, 4}, {1, 3, 5}, {2, 4, 6}}}
  • + *
+ *

Note that when the {@code window} transformation is applied to a dataset of + * nested elements, it produces a dataset of nested windows. + *

For example: + *

    + *
  • {@code tf.data.Dataset.from_tensor_slices((range(4), range(4))).window(2)} + * produces {@code {({0, 1}, {0, 1}), ({2, 3}, {2, 3})}}
  • + *
  • {@code tf.data.Dataset.from_tensor_slices({"a": range(4)}).window(2)} + * produces {@code {{"a": {0, 1}}, {"a": {2, 3}}}}
  • + *
+ * + * @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 + * by which the window moves in each iteration. Defaults to {@code size}. + * Must be positive. + * @param stride 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". + * @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 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 WindowOp.create(scope, inputs, outputTypes, outputShapes); + } + + /** + * The WrapDatasetVariant operation + * + * @param inputHandle The inputHandle value + * @return a new instance of WrapDatasetVariant + */ + public WrapDatasetVariant wrapDatasetVariant(Operand inputHandle) { + return WrapDatasetVariant.create(scope, inputHandle); } /** - * Creates a dataset that zips together `input_datasets`. - *

+ * Creates a dataset that zips together {@code input_datasets}. * The elements of the resulting dataset are created by zipping corresponding * elements from each of the input datasets. - *

- * The size of the resulting dataset will match the size of the smallest input + *

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. * - * @param inputDatasets List of `N` variant Tensors representing datasets to be zipped together. - * @param outputTypes - * @param outputShapes + * @param inputDatasets List of {@code N} variant Tensors representing datasets to be zipped together. + * @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); + public ZipDataset zipDataset(Iterable> inputDatasets, + 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 b4a7373e862..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; @@ -41,22 +42,24 @@ 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) + *

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

- * Examples: - *

- * >>> tf.strings.as_string([3, 2]) - * - * >>> tf.strings.as_string([3.1415926, 2.71828], precision=2).numpy() + *

Examples: + *

+ *
+ *
+ *

tf.strings.as_string([3, 2]) + * <tf.Tensor: shape=(2,), dtype=string, numpy=array([b'3', b'2'], dtype=object)> + * tf.strings.as_string([3.1415926, 2.71828], precision=2).numpy() * array([b'3.14', b'2.72'], dtype=object) + *

+ *
+ *
* - * @param input - * @param options carries optional attributes values + * @param input The input value + * @param options carries optional attribute values * @return a new instance of AsString */ public AsString asString(Operand input, AsString.Options... options) { @@ -66,10 +69,10 @@ 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 - * @param DstT - * @param options carries optional attributes values + * @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 */ public Cast cast(Operand x, Class DstT, @@ -79,25 +82,23 @@ public Cast cast(Operand x, Class DstT, /** * Converts two real numbers to a complex number. - *

- * Given a tensor `real` representing the real part of a complex number, and a - * tensor `imag` representing the imaginary part of a complex number, this - * operation returns complex numbers elementwise of the form \\(a + bj\\), where - * a represents the `real` part and b represents the `imag` part. - *

- * The input tensors `real` and `imag` must have the same shape. - *

- * For example: - *

{@code
+   *  Given a tensor {@code real} representing the real part of a complex number, and a
+   *  tensor {@code imag} representing the imaginary part of a complex number, this
+   *  operation returns complex numbers elementwise of the form \(a + bj\), where
+   *  a represents the {@code real} part and b represents the {@code imag} part.
+   *  

The input tensors {@code real} and {@code imag} must have the same shape. + *

For example: + *

    *  # tensor 'real' is [2.25, 3.25]
    *  # tensor `imag` is [4.75, 5.75]
-   *  tf.complex(real, imag) ==> [[2.25 + 4.75j], [3.25 + 5.75j]]
-   *  }
+ * tf.complex(real, imag) ==> [[2.25 + 4.75j], [3.25 + 5.75j]] + *
* - * @param data type for {@code out()} output - * @param real - * @param imag - * @param Tout + * @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 */ public Complex complex(Operand real, Operand imag, @@ -105,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 bd9ed2907ec..471e1435cb6 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; @@ -76,20 +86,17 @@ public final class ImageOps { /** * Adjust the contrast of one or more images. - *

- * `images` is a tensor of at least 3 dimensions. The last 3 dimensions are - * interpreted as `[height, width, channels]`. The other dimensions only - * represent a collection of images, such as `[batch, height, width, channels].` - *

- * Contrast is adjusted independently for each channel of each image. - *

- * For each channel, the Op first computes the mean of the image pixels in the + * {@code images} is a tensor of at least 3 dimensions. The last 3 dimensions are + * interpreted as {@code [height, width, channels]}. The other dimensions only + * represent a collection of images, such as {@code [batch, height, width, channels].} + *

Contrast is adjusted independently for each channel of each image. + *

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 - * `(x - mean) * contrast_factor + mean`. + * {@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 * @return a new instance of AdjustContrast */ public AdjustContrast adjustContrast(Operand images, @@ -99,17 +106,15 @@ public AdjustContrast adjustContrast(Operand images, /** * Adjust the hue of one or more images. - *

- * `images` is a tensor of at least 3 dimensions. The last dimension is + * {@code images} is a tensor of at least 3 dimensions. The last dimension is * interpreted as channels, and must be three. - *

- * The input image is considered in the RGB colorspace. Conceptually, the RGB + *

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 * @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 * @return a new instance of AdjustHue */ public AdjustHue adjustHue(Operand images, Operand delta) { @@ -118,17 +123,15 @@ public AdjustHue adjustHue(Operand images, Operand - * `images` is a tensor of at least 3 dimensions. The last dimension is + * {@code images} is a tensor of at least 3 dimensions. The last dimension is * interpreted as channels, and must be three. - *

- * The input image is considered in the RGB colorspace. Conceptually, the RGB + *

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 * @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 * @return a new instance of AdjustSaturation */ public AdjustSaturation adjustSaturation(Operand images, @@ -138,7 +141,6 @@ public AdjustSaturation adjustSaturation(Operand image /** * Greedily selects a subset of bounding boxes in descending order of score, - *

* This operation performs non_max_suppression on the inputs per batch, across * all classes. * Prunes away boxes that have high intersection-over-union (IOU) overlap @@ -153,19 +155,21 @@ public AdjustSaturation adjustSaturation(Operand image * The output of this operation is the final boxes, scores and classes tensor * returned after performing non_max_suppression. * - * @param boxes A 4-D float tensor of shape `[batch_size, num_boxes, q, 4]`. If `q` is 1 then - * same boxes are used for all classes otherwise, if `q` is equal to number of + * @param boxes 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. - * @param scores A 3-D float tensor of shape `[batch_size, num_boxes, num_classes]` + * @param scores 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). * @param maxOutputSizePerClass A scalar integer tensor representing the maximum number of * boxes to be selected by non max suppression per class - * @param maxTotalSize A scalar representing maximum number of boxes retained over all classes. + * @param maxTotalSize 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. * @param iouThreshold A 0-D float tensor representing the threshold for deciding whether * boxes overlap too much with respect to IOU. * @param scoreThreshold A 0-D float tensor representing the threshold for deciding when to remove * boxes based on score. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of CombinedNonMaxSuppression */ public CombinedNonMaxSuppression combinedNonMaxSuppression(Operand boxes, @@ -177,42 +181,40 @@ public CombinedNonMaxSuppression combinedNonMaxSuppression(Operand box /** * Extracts crops from the input image tensor and resizes them. - *

* Extracts crops from the input image tensor and resizes them using bilinear * sampling or nearest neighbor sampling (possibly with aspect ratio change) to a - * common output size specified by `crop_size`. This is more general than the - * `crop_to_bounding_box` op which extracts a fixed size slice from the input image + * common output size specified by {@code crop_size}. This is more general than the + * {@code crop_to_bounding_box} op which extracts a fixed size slice from the input image * and does not allow resizing or aspect ratio change. - *

- * Returns a tensor with `crops` from the input `image` at positions defined at the - * bounding box locations in `boxes`. The cropped boxes are all resized (with + *

Returns a tensor with {@code crops} from the input {@code image} at positions defined at the + * bounding box locations in {@code boxes}. The cropped boxes are all resized (with * bilinear or nearest neighbor interpolation) to a fixed - * `size = [crop_height, crop_width]`. The result is a 4-D tensor - * `[num_boxes, crop_height, crop_width, depth]`. The resizing is corner aligned. - * In particular, if `boxes = [[0, 0, 1, 1]]`, the method will give identical - * results to using `tf.image.resize_bilinear()` or - * `tf.image.resize_nearest_neighbor()`(depends on the `method` argument) with - * `align_corners=True`. + * {@code size = [crop_height, crop_width]}. The result is a 4-D tensor + * {@code [num_boxes, crop_height, crop_width, depth]}. The resizing is corner aligned. + * In particular, if {@code boxes = [[0, 0, 1, 1]]}, the method will give identical + * results to using {@code tf.image.resize_bilinear()} or + * {@code tf.image.resize_nearest_neighbor()}(depends on the {@code method} argument) with + * {@code align_corners=True}. * - * @param image A 4-D tensor of shape `[batch, image_height, image_width, depth]`. - * Both `image_height` and `image_width` need to be positive. - * @param boxes A 2-D tensor of shape `[num_boxes, 4]`. The `i`-th row of the tensor - * specifies the coordinates of a box in the `box_ind[i]` image and is specified - * in normalized coordinates `[y1, x1, y2, x2]`. A normalized coordinate value of - * `y` is mapped to the image coordinate at `y * (image_height - 1)`, so as the - * `[0, 1]` interval of normalized image height is mapped to - * `[0, image_height - 1]` in image height coordinates. We do allow `y1` > `y2`, in + * @param image 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. + * @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 + * 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 `[0, 1]` range are allowed, in which case we use - * `extrapolation_value` to extrapolate the input image values. - * @param boxInd A 1-D tensor of shape `[num_boxes]` with int32 values in `[0, batch)`. - * The value of `box_ind[i]` specifies the image that the `i`-th box refers to. - * @param cropSize A 1-D tensor of 2 elements, `size = [crop_height, crop_width]`. All + * outside the {@code [0, 1]} range are allowed, in which case we use + * {@code extrapolation_value} to extrapolate the input image values. + * @param boxInd 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. + * @param cropSize 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 `crop_height` and `crop_width` need to be + * content is not preserved. Both {@code crop_height} and {@code crop_width} need to be * positive. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of CropAndResize */ public CropAndResize cropAndResize(Operand image, Operand boxes, @@ -223,22 +225,18 @@ public CropAndResize cropAndResize(Operand image, Operand 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]` range are allowed, in which case we use - * `extrapolation_value` to extrapolate the input image values. - * @param boxInd A 1-D tensor of shape `[num_boxes]` with int32 values in `[0, batch)`. - * The value of `box_ind[i]` specifies the image that the `i`-th box refers to. - * @param options carries optional attributes values + * @param grads A 4-D tensor of shape {@code [num_boxes, crop_height, crop_width, depth]}. + * @param image 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. + * @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 + * 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. + * @param boxInd 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. + * @param options carries optional attribute values * @return a new instance of CropAndResizeGradBoxes */ public CropAndResizeGradBoxes cropAndResizeGradBoxes(Operand grads, @@ -250,25 +248,21 @@ 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 `[num_boxes, crop_height, crop_width, depth]`. - * @param boxes A 2-D tensor of shape `[num_boxes, 4]`. The `i`-th row of the tensor - * specifies the coordinates of a box in the `box_ind[i]` image and is specified - * in normalized coordinates `[y1, x1, y2, x2]`. A normalized coordinate value of - * `y` is mapped to the image coordinate at `y * (image_height - 1)`, so as the - * `[0, 1]` interval of normalized image height is mapped to - * `[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]` range are allowed, in which case we use - * `extrapolation_value` to extrapolate the input image values. - * @param boxInd A 1-D tensor of shape `[num_boxes]` with int32 values in `[0, batch)`. - * The value of `box_ind[i]` specifies the image that the `i`-th box refers to. - * @param imageSize A 1-D tensor with value `[batch, image_height, image_width, depth]` - * containing the original image size. Both `image_height` and `image_width` need + * @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 + * 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. + * @param boxInd 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. + * @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 - * @param options carries optional attributes values + * @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 */ public CropAndResizeGradImage cropAndResizeGradImage( @@ -279,35 +273,25 @@ public CropAndResizeGradImage cropAndResizeGradImage( /** * Decode and Crop a JPEG-encoded image to a uint8 tensor. - *

- * The attr `channels` indicates the desired number of color channels for the + * The attr {@code channels} indicates the desired number of color channels for the * decoded image. - *

- * Accepted values are: + *

Accepted values are: *

    - *
  • - * 0: Use the number of channels in the JPEG-encoded image. - *
  • - *
  • - * 1: output a grayscale image. - *
  • - *
  • - * 3: output an RGB image. - *
  • + *
  • 0: Use the number of channels in the JPEG-encoded image.
  • + *
  • 1: output a grayscale image.
  • + *
  • 3: output an RGB image.
  • *
- * If needed, the JPEG-encoded image is transformed to match the requested number + *

If needed, the JPEG-encoded image is transformed to match the requested number * of color channels. - *

- * The attr `ratio` allows downscaling the image by an integer factor during + *

The attr {@code ratio} allows downscaling the image by an integer factor during * decoding. Allowed values are: 1, 2, 4, and 8. This is much faster than * downscaling the image later. - *

- * It is equivalent to a combination of decode and crop, but much faster by only + *

It is equivalent to a combination of decode and crop, but much faster by only * decoding partial jpeg image. * * @param contents 0-D. The JPEG-encoded image. * @param cropWindow 1-D. The crop window: [crop_y, crop_x, crop_height, crop_width]. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of DecodeAndCropJpeg */ public DecodeAndCropJpeg decodeAndCropJpeg(Operand contents, Operand cropWindow, @@ -317,23 +301,17 @@ public DecodeAndCropJpeg decodeAndCropJpeg(Operand contents, Operand - * The attr `channels` indicates the desired number of color channels for the + * The attr {@code channels} indicates the desired number of color channels for the * decoded image. - *

- * Accepted values are: + *

Accepted values are: *

    - *
  • - * 0: Use the number of channels in the BMP-encoded image. - *
  • - *
  • - * 3: output an RGB image. - *
  • - *
  • - * 4: output an RGBA image. + *
  • 0: Use the number of channels in the BMP-encoded image.
  • + *
  • 3: output an RGB image.
  • + *
  • 4: output an RGBA image.
  • + *
* * @param contents 0-D. The BMP-encoded image. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of DecodeBmp */ public DecodeBmp decodeBmp(Operand contents, DecodeBmp.Options... options) { @@ -342,15 +320,14 @@ public DecodeBmp decodeBmp(Operand contents, DecodeBmp.Options... optio /** * Decode the frame(s) of a GIF-encoded image to a uint8 tensor. - *

* GIF images with frame or transparency compression are not supported. * On Linux and MacOS systems, convert animated GIFs from compressed to * uncompressed by running: - *

- * convert $src.gif -coalesce $dst.gif - *

- * This op also supports decoding JPEGs and PNGs, though it is cleaner to use - * `tf.io.decode_image`. + *

+   *  convert $src.gif -coalesce $dst.gif
+   *  
+ *

This op also supports decoding JPEGs and PNGs, though it is cleaner to use + * {@code tf.io.decode_image}. * * @param contents 0-D. The GIF-encoded image. * @return a new instance of DecodeGif @@ -360,30 +337,27 @@ 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 - * appropriate operation to convert the input bytes string into a Tensor of type - * dtype. - *

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

- * NOTE: If the first frame of an animated GIF does not occupy the entire + * Function for decode_bmp, decode_gif, decode_jpeg, decode_jxl, decode_webp, and decode_png. + * Detects whether an image is a BMP, GIF, JPEG, JPEG XL, WebP, or PNG, and + * performs the appropriate operation to convert the input bytes string into a + * Tensor of type dtype. + *

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 attributes values - * @return a new instance of DecodeImage + * @param options carries optional attribute values + * @return a new instance of DecodeImage, with default output types */ public DecodeImage decodeImage(Operand contents, DecodeImage.Options... options) { @@ -391,30 +365,28 @@ public DecodeImage decodeImage(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 - * appropriate operation to convert the input bytes string into a Tensor of type - * dtype. - *

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

- * NOTE: If the first frame of an animated GIF does not occupy the entire + * Function for decode_bmp, decode_gif, decode_jpeg, decode_jxl, decode_webp, and decode_png. + * Detects whether an image is a BMP, GIF, JPEG, JPEG XL, WebP, or PNG, and + * performs the appropriate operation to convert the input bytes string into a + * Tensor of type dtype. + *

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 attributes values + * @param options carries optional attribute values + * @param data type for {@code DecodeImage} output and operands * @return a new instance of DecodeImage */ public DecodeImage decodeImage(Operand contents, Class dtype, @@ -424,34 +396,24 @@ public DecodeImage decodeImage(Operand contents, /** * Decode a JPEG-encoded image to a uint8 tensor. - *

- * The attr `channels` indicates the desired number of color channels for the + * The attr {@code channels} indicates the desired number of color channels for the * decoded image. - *

- * Accepted values are: + *

Accepted values are: *

    - *
  • - * 0: Use the number of channels in the JPEG-encoded image. - *
  • - *
  • - * 1: output a grayscale image. - *
  • - *
  • - * 3: output an RGB image. - *
  • + *
  • 0: Use the number of channels in the JPEG-encoded image.
  • + *
  • 1: output a grayscale image.
  • + *
  • 3: output an RGB image.
  • *
- * If needed, the JPEG-encoded image is transformed to match the requested number + *

If needed, the JPEG-encoded image is transformed to match the requested number * of color channels. - *

- * The attr `ratio` allows downscaling the image by an integer factor during + *

The attr {@code ratio} allows downscaling the image by an integer factor during * decoding. Allowed values are: 1, 2, 4, and 8. This is much faster than * downscaling the image later. - *

- * This op also supports decoding PNGs and non-animated GIFs since the interface is - * the same, though it is cleaner to use `tf.io.decode_image`. + *

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}. * * @param contents 0-D. The JPEG-encoded image. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of DecodeJpeg */ public DecodeJpeg decodeJpeg(Operand contents, DecodeJpeg.Options... options) { @@ -460,35 +422,23 @@ public DecodeJpeg decodeJpeg(Operand contents, DecodeJpeg.Options... op /** * Decode a PNG-encoded image to a uint8 or uint16 tensor. - *

- * The attr `channels` indicates the desired number of color channels for the + * The attr {@code channels} indicates the desired number of color channels for the * decoded image. - *

- * Accepted values are: + *

Accepted values are: *

    - *
  • - * 0: Use the number of channels in the PNG-encoded image. - *
  • - *
  • - * 1: output a grayscale image. - *
  • - *
  • - * 3: output an RGB image. - *
  • - *
  • - * 4: output an RGBA image. - *
  • + *
  • 0: Use the number of channels in the PNG-encoded image.
  • + *
  • 1: output a grayscale image.
  • + *
  • 3: output an RGB image.
  • + *
  • 4: output an RGBA image.
  • *
- * If needed, the PNG-encoded image is transformed to match the requested number + *

If needed, the PNG-encoded image is transformed to match the requested number * 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 `tf.io.decode_image`. + *

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 attributes values - * @return a new instance of DecodePng + * @param options carries optional attribute values + * @return a new instance of DecodePng, with default output types */ public DecodePng decodePng(Operand contents, DecodePng.Options... options) { return DecodePng.create(scope, contents, options); @@ -496,35 +446,24 @@ public DecodePng decodePng(Operand contents, DecodePng.Options. /** * Decode a PNG-encoded image to a uint8 or uint16 tensor. - *

- * The attr `channels` indicates the desired number of color channels for the + * The attr {@code channels} indicates the desired number of color channels for the * decoded image. - *

- * Accepted values are: + *

Accepted values are: *

    - *
  • - * 0: Use the number of channels in the PNG-encoded image. - *
  • - *
  • - * 1: output a grayscale image. - *
  • - *
  • - * 3: output an RGB image. - *
  • - *
  • - * 4: output an RGBA image. - *
  • + *
  • 0: Use the number of channels in the PNG-encoded image.
  • + *
  • 1: output a grayscale image.
  • + *
  • 3: output an RGB image.
  • + *
  • 4: output an RGBA image.
  • *
- * If needed, the PNG-encoded image is transformed to match the requested number + *

If needed, the PNG-encoded image is transformed to match the requested number * 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 `tf.io.decode_image`. + *

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 - * @param options carries optional attributes values + * @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 */ public DecodePng decodePng(Operand contents, Class dtype, @@ -532,26 +471,68 @@ 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 `images` but draws on top of the pixels zero or more bounding - * boxes specified by the locations in `boxes`. The coordinates of the each - * bounding box in `boxes` are encoded as `[y_min, x_min, y_max, x_max]`. The - * bounding box coordinates are floats in `[0.0, 1.0]` relative to the width and + * Outputs a copy of {@code images} but draws on top of the pixels zero or more bounding + * boxes specified by the locations in {@code boxes}. The coordinates of the each + * bounding box in {@code boxes} are encoded as {@code [y_min, x_min, y_max, x_max]}. The + * bounding box coordinates are floats in {@code [0.0, 1.0]} relative to the width and * height of the underlying image. - *

- * For example, if an image is 100 x 200 pixels (height x width) and the bounding - * box is `[0.1, 0.2, 0.5, 0.9]`, the upper-left and bottom-right coordinates of - * the bounding box will be `(40, 10)` to `(100, 50)` (in (x,y) coordinates). - *

- * Parts of the bounding box may fall outside the image. + *

For example, if an image is 100 x 200 pixels (height x width) and the bounding + * 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 - * @param images 4-D with shape `[batch, height, width, depth]`. A batch of images. - * @param boxes 3-D with shape `[batch, num_bounding_boxes, 4]` containing bounding + * @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. * @param colors 2-D. A list of RGBA colors to cycle through for the boxes. + * @param data type for {@code DrawBoundingBoxesV2} output and operands * @return a new instance of DrawBoundingBoxes */ public DrawBoundingBoxes drawBoundingBoxes(Operand images, @@ -561,35 +542,25 @@ public DrawBoundingBoxes drawBoundingBoxes(Operand ima /** * JPEG-encode an image. - *

- * `image` is a 3-D uint8 Tensor of shape `[height, width, channels]`. - *

- * The attr `format` can be used to override the color format of the encoded + * {@code image} is a 3-D uint8 Tensor of shape {@code [height, width, channels]}. + *

The attr {@code format} can be used to override the color format of the encoded * output. Values can be: *

    - *
  • - * `''`: Use a default format based on the number of channels in the image. - *
  • - *
  • - * `grayscale`: Output a grayscale JPEG image. The `channels` dimension - * of `image` must be 1. - *
  • - *
  • - * `rgb`: Output an RGB JPEG image. The `channels` dimension - * of `image` must be 3. - *
  • + *
  • {@code ''}: Use a default format based on the number of channels in the image.
  • + *
  • {@code grayscale}: Output a grayscale JPEG image. The {@code channels} dimension + * of {@code image} must be 1.
  • + *
  • {@code rgb}: Output an RGB JPEG image. The {@code channels} dimension + * of {@code image} must be 3.
  • *
- * If `format` is not specified or is the empty string, a default format is picked - * in function of the number of channels in `image`: + *

If {@code format} is not specified or is the empty string, a default format is picked + * in function of the number of channels in {@code image}: *

    - *
  • - * 1: Output a grayscale image. - *
  • - *
  • - * 3: Output an RGB image. + *
  • 1: Output a grayscale image.
  • + *
  • 3: Output an RGB image.
  • + *
* - * @param image 3-D with shape `[height, width, channels]`. - * @param options carries optional attributes values + * @param image 3-D with shape {@code [height, width, channels]}. + * @param options carries optional attribute values * @return a new instance of EncodeJpeg */ public EncodeJpeg encodeJpeg(Operand image, EncodeJpeg.Options... options) { @@ -598,9 +569,8 @@ public EncodeJpeg encodeJpeg(Operand image, EncodeJpeg.Options... option /** * JPEG encode input image with provided compression quality. - *

- * `image` is a 3-D uint8 Tensor of shape `[height, width, channels]`. - * `quality` is an int32 jpeg compression quality value between 0 and 100. + * {@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. * * @param images Images to adjust. At least 3-D. * @param quality An int quality to encode to. @@ -613,29 +583,20 @@ public EncodeJpegVariableQuality encodeJpegVariableQuality(Operand image /** * PNG-encode an image. - *

- * `image` is a 3-D uint8 or uint16 Tensor of shape `[height, width, channels]` - * where `channels` is: + * {@code image} is a 3-D uint8 or uint16 Tensor of shape {@code [height, width, channels]} + * where {@code channels} is: *

    - *
  • - * 1: for grayscale. - *
  • - *
  • - * 2: for grayscale + alpha. - *
  • - *
  • - * 3: for RGB. - *
  • - *
  • - * 4: for RGBA. - *
  • + *
  • 1: for grayscale.
  • + *
  • 2: for grayscale + alpha.
  • + *
  • 3: for RGB.
  • + *
  • 4: for RGBA.
  • *
- * The ZLIB compression level, `compression`, can be -1 for the PNG-encoder + *

The ZLIB compression level, {@code compression}, can be -1 for the PNG-encoder * default or a value from 0 to 9. 9 is the highest compression level, generating * the smallest output, but is slower. * - * @param image 3-D with shape `[height, width, channels]`. - * @param options carries optional attributes values + * @param image 3-D with shape {@code [height, width, channels]}. + * @param options carries optional attribute values * @return a new instance of EncodePng */ public EncodePng encodePng(Operand image, EncodePng.Options... options) { @@ -643,20 +604,56 @@ public EncodePng encodePng(Operand image, EncodePng.Options.. } /** - * Extract `patches` from `images` and put them in the "depth" output dimension. + * 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 `[batch, in_rows, in_cols, depth]`. - * @param ksizes The size of the sliding window for each dimension of `images`. + * @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 - * the images. Must be: `[1, stride_rows, stride_cols, 1]`. - * @param rates Must be: `[1, rate_rows, rate_cols, 1]`. This is the + * the images. Must be: {@code [1, stride_rows, stride_cols, 1]}. + * @param rates 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 - * `patch_sizes_eff = patch_sizes + (patch_sizes - 1) * (rates - 1)`, followed by - * subsampling them spatially by a factor of `rates`. This is equivalent to - * `rate` in dilated (a.k.a. Atrous) convolutions. + * {@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. * @param padding The type of padding algorithm to use. + * @param data type for {@code ExtractImagePatches} output and operands * @return a new instance of ExtractImagePatches */ public ExtractImagePatches extractImagePatches(Operand images, @@ -666,12 +663,10 @@ 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 imageShape()} output * @param contents 0-D. The JPEG-encoded image. - * @return a new instance of ExtractJpegShape + * @return a new instance of ExtractJpegShape, with default output types */ public ExtractJpegShape extractJpegShape(Operand contents) { return ExtractJpegShape.create(scope, contents); @@ -679,13 +674,12 @@ 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 imageShape()} output * @param contents 0-D. The JPEG-encoded image. * @param outputType (Optional) The output type of the operation (int32 or int64). * Defaults to int32. + * @param data type for {@code ExtractJpegShape} output and operands * @return a new instance of ExtractJpegShape */ public ExtractJpegShape extractJpegShape(Operand contents, @@ -693,29 +687,127 @@ 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 `images` tensor, containing the RGB - * value of the pixels. The output is only well defined if the value in `images` - * are in `[0,1]`. - *

- * See `rgb_to_hsv` for a description of the HSV encoding. + * Outputs a tensor of the same shape as the {@code images} tensor, containing the RGB + * 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 * @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 */ 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 * with previously selected boxes. Bounding boxes with score less than - * `score_threshold` are removed. Bounding boxes are supplied as + * {@code score_threshold} are removed. Bounding boxes are supplied as * [y1, x1, y2, x2], where (y1, x1) and (y2, x2) are the coordinates of any * diagonal pair of box corners and the coordinates can be provided as normalized * (i.e., lying in the interval [0, 1]) or absolute. Note that this algorithm @@ -726,19 +818,18 @@ public HsvToRgb hsvToRgb(Operand images) { * The output of this operation is a set of integers indexing into the input * collection of bounding boxes representing the selected boxes. The bounding * box coordinates corresponding to the selected indices can then be obtained - * using the `tf.gather operation`. For example: - * selected_indices = tf.image.non_max_suppression_v2( - * boxes, scores, max_output_size, iou_threshold, score_threshold) - * selected_boxes = tf.gather(boxes, selected_indices) + * using the {@code tf.gather operation}. For example: + * selected_indices = tf.image.non_max_suppression_v2( + * boxes, scores, max_output_size, iou_threshold, score_threshold) + * selected_boxes = tf.gather(boxes, selected_indices) * This op also supports a Soft-NMS (with Gaussian weighting) mode (c.f. * Bodla et al, https://arxiv.org/abs/1704.04503) where boxes reduce the score * of other overlapping boxes instead of directly causing them to be pruned. - * To enable this Soft-NMS mode, set the `soft_nms_sigma` parameter to be + * To enable this Soft-NMS mode, set the {@code soft_nms_sigma} parameter to be * larger than 0. * - * @param data type for {@code selectedScores()} output - * @param boxes A 2-D float tensor of shape `[num_boxes, 4]`. - * @param scores A 1-D float tensor of shape `[num_boxes]` representing a single + * @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). * @param maxOutputSize A scalar integer tensor representing the maximum number of * boxes to be selected by non max suppression. @@ -747,9 +838,10 @@ public HsvToRgb hsvToRgb(Operand images) { * @param scoreThreshold A 0-D float tensor representing the threshold for deciding when to remove * boxes based on score. * @param softNmsSigma 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 `soft_nms_sigma=0.0` (which + * 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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code NonMaxSuppressionV5} output and operands * @return a new instance of NonMaxSuppression */ public NonMaxSuppression nonMaxSuppression(Operand boxes, @@ -760,25 +852,22 @@ public NonMaxSuppression nonMaxSuppression(Operand box /** * Greedily selects a subset of bounding boxes in descending order of score, - *

* pruning away boxes that have high overlaps * with previously selected boxes. Bounding boxes with score less than - * `score_threshold` are removed. N-by-n overlap values are supplied as square matrix, + * {@code score_threshold} are removed. N-by-n overlap values are supplied as square matrix, * which allows for defining a custom overlap criterium (eg. intersection over union, * intersection over area, etc.). - *

- * The output of this operation is a set of integers indexing into the input + *

The output of this operation is a set of integers indexing into the input * collection of bounding boxes representing the selected boxes. The bounding * box coordinates corresponding to the selected indices can then be obtained - * using the `tf.gather operation`. For example: - *

- * selected_indices = tf.image.non_max_suppression_with_overlaps( - * overlaps, scores, max_output_size, overlap_threshold, score_threshold) - * selected_boxes = tf.gather(boxes, selected_indices) + * using the {@code tf.gather operation}. For example: + *

selected_indices = tf.image.non_max_suppression_with_overlaps( + * overlaps, scores, max_output_size, overlap_threshold, score_threshold) + * selected_boxes = tf.gather(boxes, selected_indices) * - * @param overlaps A 2-D float tensor of shape `[num_boxes, num_boxes]` representing + * @param overlaps A 2-D float tensor of shape {@code [num_boxes, num_boxes]} representing * the n-by-n box overlap values. - * @param scores A 1-D float tensor of shape `[num_boxes]` representing a single + * @param scores A 1-D float tensor of shape {@code [num_boxes]} representing a single * score corresponding to each box (each row of boxes). * @param maxOutputSize A scalar integer tensor representing the maximum number of * boxes to be selected by non max suppression. @@ -795,143 +884,182 @@ public NonMaxSuppressionWithOverlaps nonMaxSuppressionWithOverlaps(Operand + * 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 resizedImages()} output - * @param images 4-D with shape `[batch, height, width, channels]`. - * @param size = A 1-D int32 Tensor of 2 elements: `new_height, new_width`. The + * @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 - * @param max - * @param options carries optional attributes values + * @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 */ - public QuantizedResizeBilinear quantizedResizeBilinear(Operand images, - Operand size, Operand min, Operand max, + public QuantizedResizeBilinear quantizedResizeBilinear(Operand images, + Operand sizeOutput, Operand min, Operand max, QuantizedResizeBilinear.Options... options) { - return QuantizedResizeBilinear.create(scope, images, size, min, max, options); + return QuantizedResizeBilinear.create(scope, images, sizeOutput, min, max, options); } /** - * Randomly crop `image`. - *

- * `size` is a 1-D int64 tensor with 2 elements representing the crop height and + * Randomly crop {@code image}. + * {@code size} is a 1-D int64 tensor with 2 elements representing the crop height and * width. The values must be non negative. - *

- * This Op picks a random location in `image` and crops a `height` by `width` + *

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 - * @param image 3-D of shape `[height, width, channels]`. - * @param size 1-D of length 2 containing: `crop_height`, `crop_width`.. - * @param options carries optional attributes values + * @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 + * @param data type for {@code RandomCrop} output and operands * @return a new instance of RandomCrop */ - public RandomCrop randomCrop(Operand image, Operand size, + public RandomCrop randomCrop(Operand image, Operand sizeOutput, RandomCrop.Options... options) { - return RandomCrop.create(scope, image, size, options); + return RandomCrop.create(scope, image, sizeOutput, options); } /** - * Resize `images` to `size` using area interpolation. - *

+ * Resize {@code images} to {@code size} using area interpolation. * Input images can be of different types but output images are always float. - *

- * The range of pixel values for the output image might be slightly different + *

The range of pixel values for the output image might be slightly different * from the range for the input image because of limited numerical precision. - * To guarantee an output range, for example `[0.0, 1.0]`, apply - * `tf.clip_by_value` to the output. - *

- * Each output pixel is computed by first transforming the pixel's footprint into + * To guarantee an output range, for example {@code [0.0, 1.0]}, apply + * {@code tf.clip_by_value} to the output. + *

Each output pixel is computed by first transforming the pixel's footprint into * the input tensor and then averaging the pixels that intersect the footprint. An * 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. * - * @param images 4-D with shape `[batch, height, width, channels]`. - * @param size = A 1-D int32 Tensor of 2 elements: `new_height, new_width`. The + * @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 options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ResizeArea */ - public ResizeArea resizeArea(Operand images, Operand size, + public ResizeArea resizeArea(Operand images, Operand sizeOutput, ResizeArea.Options... options) { - return ResizeArea.create(scope, images, size, options); + return ResizeArea.create(scope, images, sizeOutput, options); } /** - * Resize `images` to `size` using bicubic interpolation. - *

+ * Resize {@code images} to {@code size} using bicubic interpolation. * Input images can be of different types but output images are always float. * - * @param images 4-D with shape `[batch, height, width, channels]`. - * @param size = A 1-D int32 Tensor of 2 elements: `new_height, new_width`. The + * @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 options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ResizeBicubic */ - public ResizeBicubic resizeBicubic(Operand images, Operand size, + public ResizeBicubic resizeBicubic(Operand images, Operand sizeOutput, ResizeBicubic.Options... options) { - return ResizeBicubic.create(scope, images, size, options); + return ResizeBicubic.create(scope, images, sizeOutput, options); + } + + /** + * Computes the gradient of bicubic 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 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 `images` to `size` using bilinear interpolation. - *

+ * Resize {@code images} to {@code size} using bilinear interpolation. * Input images can be of different types but output images are always float. * - * @param images 4-D with shape `[batch, height, width, channels]`. - * @param size = A 1-D int32 Tensor of 2 elements: `new_height, new_width`. The + * @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 options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ResizeBilinear */ - public ResizeBilinear resizeBilinear(Operand images, Operand size, - ResizeBilinear.Options... options) { - return ResizeBilinear.create(scope, images, size, options); + public ResizeBilinear resizeBilinear(Operand images, + Operand sizeOutput, ResizeBilinear.Options... options) { + return ResizeBilinear.create(scope, images, sizeOutput, options); } /** - * Resize `images` to `size` using nearest neighbor interpolation. + * Computes the gradient of bilinear interpolation. * - * @param data type for {@code resizedImages()} output - * @param images 4-D with shape `[batch, height, width, channels]`. - * @param size = A 1-D int32 Tensor of 2 elements: `new_height, new_width`. The + * @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 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 options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResizeNearestNeighbor} output and operands * @return a new instance of ResizeNearestNeighbor */ public ResizeNearestNeighbor resizeNearestNeighbor(Operand images, - Operand size, ResizeNearestNeighbor.Options... options) { - return ResizeNearestNeighbor.create(scope, images, size, options); + Operand sizeOutput, ResizeNearestNeighbor.Options... options) { + 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 `images` tensor, containing the HSV - * value of the pixels. The output is only well defined if the value in `images` - * are in `[0,1]`. - *

- * `output[..., 0]` contains hue, `output[..., 1]` contains saturation, and - * `output[..., 2]` contains value. All HSV values are in `[0,1]`. A hue of 0 + * Outputs a tensor of the same shape as the {@code images} tensor, containing the HSV + * value of the pixels. The output is only well defined if the value in {@code images} + * are in {@code [0,1]}. + *

{@code output[..., 0]} contains hue, {@code output[..., 1]} contains saturation, and + * {@code output[..., 2]} contains value. All HSV values are in {@code [0,1]}. A hue of 0 * corresponds to pure red, hue 1/3 is pure green, and 2/3 is pure blue. - *

- * Usage Example: - *

- * >>> blue_image = tf.stack([ + *

Usage Example: + *

+ *
+ *
+ *

blue_image = tf.stack([ * ... tf.zeros([5,5]), * ... tf.zeros([5,5]), * ... tf.ones([5,5])], * ... axis=-1) - * >>> blue_hsv_image = tf.image.rgb_to_hsv(blue_image) - * >>> blue_hsv_image[0,0].numpy() + * blue_hsv_image = tf.image.rgb_to_hsv(blue_image) + * blue_hsv_image[0,0].numpy() * array([0.6666667, 1. , 1. ], dtype=float32) + *

+ *
+ *
* - * @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 */ public RgbToHsv rgbToHsv(Operand images) { @@ -940,26 +1068,22 @@ public RgbToHsv rgbToHsv(Operand images) { /** * Generate a single randomly distorted bounding box for an image. - *

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

- * The output of this Op is a single bounding box that may be used to crop the - * original image. The output is returned as 3 tensors: `begin`, `size` and - * `bboxes`. The first 2 tensors can be fed directly into `tf.slice` to crop the - * image. The latter may be supplied to `tf.image.draw_bounding_boxes` to visualize + * its content, i.e. data augmentation. This Op outputs a randomly distorted + * localization of an object, i.e. bounding box, given an {@code image_size}, + * {@code bounding_boxes} and a series of constraints. + *

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

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

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

- * For example, - *

{@code
+   *  

For example, + *

    *      # Generate a single distorted bounding box.
    *      begin, size, bbox_for_draw = tf.image.sample_distorted_bounding_box(
    *          tf.shape(image),
@@ -972,21 +1096,21 @@ public  RgbToHsv rgbToHsv(Operand images) {
    *
    *      # Employ the bounding box to distort the image.
    *      distorted_image = tf.slice(image, begin, size)
-   *  }
- * Note that if no bounding box information is available, setting - * `use_image_if_no_bounding_boxes = true` will assume there is a single implicit - * bounding box covering the whole image. If `use_image_if_no_bounding_boxes` is + *
+ *

Note that if no bounding box information is available, setting + * {@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 - * @param imageSize 1-D, containing `[height, width, channels]`. - * @param boundingBoxes 3-D with shape `[batch, N, 4]` describing the N bounding boxes + * @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. * @param minObjectCovered The cropped area of the image must contain at least this * fraction of any bounding box supplied. The value of this parameter should be * non-negative. In the case of 0, the cropped area does not need to overlap * any of the bounding boxes supplied. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SampleDistortedBoundingBoxV2} output and operands * @return a new instance of SampleDistortedBoundingBox */ public SampleDistortedBoundingBox sampleDistortedBoundingBox( @@ -996,93 +1120,110 @@ public SampleDistortedBoundingBox sampleDistortedBounding } /** + * The ScaleAndTranslate operation * - * @param images - * @param size - * @param scale - * @param translation - * @param options carries optional attributes values + * @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 */ public ScaleAndTranslate scaleAndTranslate(Operand images, - Operand size, Operand scale, Operand translation, + Operand sizeOutput, Operand scale, Operand translation, ScaleAndTranslate.Options... options) { - return ScaleAndTranslate.create(scope, images, size, scale, translation, options); + 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 * in image recognition or object localization tasks. A common technique for * training such a system is to randomly distort an image while preserving its - * content, i.e. data augmentation. This Op, given the same `seed`, + * content, i.e. data augmentation. This Op, given the same {@code seed}, * deterministically outputs a randomly distorted localization of an object, i.e. - * bounding box, given an `image_size`, `bounding_boxes` and a series of + * bounding box, given an {@code image_size}, {@code bounding_boxes} and a series of * constraints. - *

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

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

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

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

- * The output of this Op is guaranteed to be the same given the same `seed` and is + *

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

- * Example usage: - *

- * >>> image = np.array([[[1], [2], [3]], [[4], [5], [6]], [[7], [8], [9]]]) - * >>> bbox = tf.constant( + * seed settings (e.g. {@code tf.random.set_seed}). + *

Example usage: + *

+ *
+ *
+ *

image = np.array([[[1], [2], [3]], [[4], [5], [6]], [[7], [8], [9]]]) + * bbox = tf.constant( * ... [0.0, 0.0, 1.0, 1.0], dtype=tf.float32, shape=[1, 1, 4]) - * >>> seed = (1, 2) - * >>> # Generate a single distorted bounding box. - * >>> bbox_begin, bbox_size, bbox_draw = ( + * seed = (1, 2) + * Generate a single distorted bounding box.
+ *

bbox_begin, bbox_size, bbox_draw = ( * ... tf.image.stateless_sample_distorted_bounding_box( * ... tf.shape(image), bounding_boxes=bbox, seed=seed)) - * >>> # Employ the bounding box to distort the image. - * >>> tf.slice(image, bbox_begin, bbox_size) - * Employ the bounding box to distort the image.
+ *

tf.slice(image, bbox_begin, bbox_size) + * <tf.Tensor: shape=(2, 2, 1), dtype=int64, numpy= * array([[[1], - * [2]], - * [[4], - * [5]]])> - * >>> # Draw the bounding box in an image summary. - * >>> colors = np.array([[1.0, 0.0, 0.0], [0.0, 0.0, 1.0]]) - * >>> tf.image.draw_bounding_boxes( + * [2]], + * [[4], + * [5]]])> + * Draw the bounding box in an image summary.
+ *

colors = np.array([[1.0, 0.0, 0.0], [0.0, 0.0, 1.0]]) + * tf.image.draw_bounding_boxes( * ... tf.expand_dims(tf.cast(image, tf.float32),0), bbox_draw, colors) - * - *

- * Note that if no bounding box information is available, setting - * `use_image_if_no_bounding_boxes = true` will assume there is a single implicit - * bounding box covering the whole image. If `use_image_if_no_bounding_boxes` is + * [1.], + * [3.]], + * [[1.], + * [1.], + * [6.]], + * [[7.], + * [8.], + * [9.]]]], dtype=float32)> + *

+ *
+ *
+ *

Note that if no bounding box information is available, setting + * {@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 - * @param imageSize 1-D, containing `[height, width, channels]`. - * @param boundingBoxes 3-D with shape `[batch, N, 4]` describing the N bounding boxes + * @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. * @param minObjectCovered The cropped area of the image must contain at least this * fraction of any bounding box supplied. The value of this parameter should be * non-negative. In the case of 0, the cropped area does not need to overlap * any of the bounding boxes supplied. - * @param seed 1-D with shape `[2]`. The seed to the random number generator. Must have dtype - * `int32` or `int64`. (When using XLA, only `int32` is allowed.) - * @param options carries optional attributes values + * @param seed 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.) + * @param options carries optional attribute values + * @param data type for {@code StatelessSampleDistortedBoundingBox} output and operands * @return a new instance of StatelessSampleDistortedBoundingBox */ public StatelessSampleDistortedBoundingBox statelessSampleDistortedBoundingBox( 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 f73859d91b9..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,9 +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 @@ -103,16 +105,14 @@ public DecodeBase64 decodeBase64(Operand input) { /** * Decompress strings. - *

- * This op decompresses each element of the `bytes` input `Tensor`, which - * is assumed to be compressed using the given `compression_type`. - *

- * The `output` is a string `Tensor` of the same shape as `bytes`, + * This op decompresses each element of the {@code bytes} input {@code Tensor}, which + * is assumed to be compressed using the given {@code compression_type}. + *

The {@code output} is a string {@code Tensor} of the same shape as {@code bytes}, * each element containing the decompressed data from the corresponding - * element in `bytes`. + * element in {@code bytes}. * * @param bytes A Tensor of string which is compressed. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of DecodeCompressed */ public DecodeCompressed decodeCompressed(Operand bytes, @@ -122,7 +122,6 @@ public DecodeCompressed decodeCompressed(Operand bytes, /** * Convert CSV records to tensors. Each column maps to one tensor. - *

* RFC 4180 format is expected for the CSV records. * (https://tools.ietf.org/html/rfc4180) * Note that we allow leading and trailing spaces with int or float field. @@ -132,7 +131,7 @@ public DecodeCompressed decodeCompressed(Operand bytes, * @param recordDefaults 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. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of DecodeCsv */ public DecodeCsv decodeCsv(Operand records, Iterable> recordDefaults, @@ -142,13 +141,13 @@ public DecodeCsv decodeCsv(Operand records, Iterable> record /** * Convert JSON-encoded Example records to binary protocol buffer strings. - *

- * This op translates a tensor containing Example records, encoded using - * the [standard JSON - * mapping](https://developers.google.com/protocol-buffers/docs/proto3#json), - * into a tensor containing the same records encoded as binary protocol - * buffers. The resulting tensor can then be fed to any of the other - * Example-parsing ops. + * Note: This is not a general purpose JSON parsing op. + *

This op converts JSON-serialized + * {@code tf.train.Example} (created with {@code json_format.MessageToJson}, following the + * standard JSON mapping ) + * to a binary-serialized {@code tf.train.Example} (equivalent to + * {@code Example.SerializeToString()}) suitable for conversion to tensors with + * {@code tf.io.parse_example}. * * @param jsonExamples Each string is a JSON object serialized according to the JSON * mapping of the Example proto. @@ -161,12 +160,12 @@ 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 - * @param options carries optional attributes values + * @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 */ public DecodePaddedRaw decodePaddedRaw(Operand inputBytes, @@ -177,10 +176,10 @@ 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 - * @param options carries optional attributes values + * @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 */ public DecodeRaw decodeRaw(Operand bytes, Class outType, @@ -189,54 +188,51 @@ public DecodeRaw decodeRaw(Operand bytes, Class } /** - * Deserialize and concatenate `SparseTensors` from a serialized minibatch. - *

- * The input `serialized_sparse` must be a string matrix of shape `[N x 3]` where - * `N` is the minibatch size and the rows correspond to packed outputs of - * `SerializeSparse`. The ranks of the original `SparseTensor` objects - * must all match. When the final `SparseTensor` is created, it has rank one - * higher than the ranks of the incoming `SparseTensor` objects + * Deserialize and concatenate {@code SparseTensors} from a serialized minibatch. + * The input {@code serialized_sparse} must be a string matrix of shape {@code [N x 3]} where + * {@code N} is the minibatch size and the rows correspond to packed outputs of + * {@code SerializeSparse}. The ranks of the original {@code SparseTensor} objects + * must all match. When the final {@code SparseTensor} is created, it has rank one + * higher than the ranks of the incoming {@code SparseTensor} objects * (they have been concatenated along a new row dimension). - *

- * The output `SparseTensor` object's shape values for all dimensions but the - * first are the max across the input `SparseTensor` objects' shape values - * for the corresponding dimensions. Its first shape value is `N`, the minibatch + *

The output {@code SparseTensor} object's shape values for all dimensions but the + * first are the max across the input {@code SparseTensor} objects' shape values + * for the corresponding dimensions. Its first shape value is {@code N}, the minibatch * size. - *

- * The input `SparseTensor` objects' indices are assumed ordered in + *

The input {@code SparseTensor} objects' indices are assumed ordered in * standard lexicographic order. If this is not the case, after this - * step run `SparseReorder` to restore index ordering. - *

- * For example, if the serialized input is a `[2 x 3]` matrix representing two - * original `SparseTensor` objects: - *

- * index = [ 0] - * [10] - * [20] - * values = [1, 2, 3] - * shape = [50] - *

- * and - *

- * index = [ 2] - * [10] - * values = [4, 5] - * shape = [30] - *

- * then the final deserialized `SparseTensor` will be: - *

- * index = [0 0] - * [0 10] - * [0 20] - * [1 2] - * [1 10] - * values = [1, 2, 3, 4, 5] - * shape = [2 50] + * step run {@code SparseReorder} to restore index ordering. + *

For example, if the serialized input is a {@code [2 x 3]} matrix representing two + * original {@code SparseTensor} objects: + *

+   *  index = [ 0]
+   *          [10]
+   *          [20]
+   *  values = [1, 2, 3]
+   *  shape = [50]
+   *  
+ *

and + *

+   *  index = [ 2]
+   *          [10]
+   *  values = [4, 5]
+   *  shape = [30]
+   *  
+ *

then the final deserialized {@code SparseTensor} will be: + *

+   *  index = [0  0]
+   *          [0 10]
+   *          [0 20]
+   *          [1  2]
+   *          [1 10]
+   *  values = [1, 2, 3, 4, 5]
+   *  shape = [2 50]
+   *  
* - * @param data type for {@code sparseValues()} output - * @param serializedSparse 2-D, The `N` serialized `SparseTensor` objects. + * @param serializedSparse 2-D, The {@code N} serialized {@code SparseTensor} objects. * Must have 3 columns. - * @param dtype The `dtype` of the serialized `SparseTensor` objects. + * @param dtype The {@code dtype} of the serialized {@code SparseTensor} objects. + * @param data type for {@code DeserializeManySparse} output and operands * @return a new instance of DeserializeManySparse */ public DeserializeManySparse deserializeManySparse( @@ -244,29 +240,48 @@ 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 /. + *

Web-safe means that the encoder uses - and _ instead of + and /. * * @param input Strings to be encoded. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of EncodeBase64 */ public EncodeBase64 encodeBase64(Operand input, EncodeBase64.Options... 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. * * @param componentTypes The type of each component in a value. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of FifoQueue */ public FifoQueue fifoQueue(List> componentTypes, @@ -278,7 +293,7 @@ public FifoQueue fifoQueue(List> componentTypes, * A Reader that outputs fixed-length records from a file. * * @param recordBytes Number of bytes in the record. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of FixedLengthRecordReader */ public FixedLengthRecordReader fixedLengthRecordReader(Long recordBytes, @@ -288,11 +303,10 @@ public FixedLengthRecordReader fixedLengthRecordReader(Long recordBytes, /** * A Reader that outputs the queued work as both the key and value. - *

* To use, enqueue strings in a Queue. ReaderRead will take the front * work string and output (work, work). * - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of IdentityReader */ public IdentityReader identityReader(IdentityReader.Options... options) { @@ -302,7 +316,7 @@ public IdentityReader identityReader(IdentityReader.Options... options) { /** * A Reader that outputs the records from a LMDB file. * - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of LmdbReader */ public LmdbReader lmdbReader(LmdbReader.Options... options) { @@ -311,7 +325,6 @@ public LmdbReader lmdbReader(LmdbReader.Options... options) { /** * Returns the set of files matching one or more glob patterns. - *

* Note that this routine only supports wildcard characters in the * basename portion of the pattern, not in the directory portion. * Note also that the order of filenames returned is deterministic. @@ -325,13 +338,12 @@ public MatchingFiles matchingFiles(Operand pattern) { /** * A queue that produces elements in first-in first-out order. - *

* Variable-size shapes are allowed by setting the corresponding shape dimensions * 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. * * @param componentTypes The type of each component in a value. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of PaddingFifoQueue */ public PaddingFifoQueue paddingFifoQueue(List> componentTypes, @@ -344,19 +356,19 @@ public PaddingFifoQueue paddingFifoQueue(List> componentT * * @param serialized A scalar or vector containing binary serialized Example protos. * @param names A tensor containing the names of the serialized protos. - * Corresponds 1:1 with the `serialized` tensor. + * 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". + * If non-empty, this tensor must have the same shape as "serialized". * @param sparseKeys Vector of strings. * The keys expected in the Examples' features associated with sparse values. * @param denseKeys Vector of strings. * The keys expected in the Examples' features associated with dense values. * @param raggedKeys Vector of strings. * The keys expected in the Examples' features associated with ragged values. - * @param denseDefaults A list of Tensors (some may be empty). Corresponds 1:1 with `dense_keys`. + * @param denseDefaults 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. @@ -367,19 +379,19 @@ public PaddingFifoQueue paddingFifoQueue(List> componentT * feature), dense_defaults[j] must contain a single element: * the padding element. * @param numSparse The number of sparse keys. - * @param sparseTypes A list of `num_sparse` types; the data types of data in each Feature + * @param sparseTypes 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). - * @param raggedValueTypes A list of `num_ragged` types; the data types of data in each Feature - * given in ragged_keys (where `num_ragged = sparse_keys.size()`). + * @param raggedValueTypes 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). - * @param raggedSplitTypes A list of `num_ragged` types; the data types of row_splits in each Feature - * given in ragged_keys (where `num_ragged = sparse_keys.size()`). + * @param raggedSplitTypes 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. - * @param denseShapes A list of `num_dense` shapes; the shapes of data in each Feature - * given in dense_keys (where `num_dense = dense_keys.size()`). + * @param denseShapes 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 @@ -439,14 +451,14 @@ 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 + * @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), * DT_INT64 (Int64List), and DT_STRING (BytesList). * @param featureListRaggedValueTypes RaggedTensor.value dtypes for the ragged FeatureList features. * @param featureListRaggedSplitTypes RaggedTensor.row_split dtypes for the ragged FeatureList features. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ParseSequenceExample */ public ParseSequenceExample parseSequenceExample(Operand serialized, @@ -470,7 +482,7 @@ public ParseSequenceExample parseSequenceExample(Operand serialized, * * @param serialized A vector containing a batch of binary serialized Example protos. * @param denseDefaults A list of Tensors (some may be empty), whose length matches - * the length of `dense_keys`. dense_defaults[j] provides default values + * 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. @@ -480,17 +492,17 @@ public ParseSequenceExample parseSequenceExample(Operand serialized, * feature), dense_defaults[j] must contain a single element: * the padding element. * @param numSparse The number of sparse features to be parsed from the example. This - * must match the lengths of `sparse_keys` and `sparse_types`. - * @param sparseKeys A list of `num_sparse` strings. + * must match the lengths of {@code sparse_keys} and {@code sparse_types}. + * @param sparseKeys A list of {@code num_sparse} strings. * The keys expected in the Examples' features associated with sparse values. * @param denseKeys The keys expected in the Examples' features associated with dense * values. - * @param sparseTypes A list of `num_sparse` types; the data types of data in each + * @param sparseTypes 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). * @param denseShapes The shapes of data in each Feature given in dense_keys. - * The length of this list must match the length of `dense_keys`. The + * 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] @@ -543,12 +555,12 @@ 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 + * @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), * DT_INT64 (Int64List), and DT_STRING (BytesList). - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ParseSingleSequenceExample */ public ParseSingleSequenceExample parseSingleSequenceExample(Operand serialized, @@ -566,10 +578,10 @@ 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. + * @param data type for {@code ParseTensor} output and operands * @return a new instance of ParseTensor */ public ParseTensor parseTensor(Operand serialized, @@ -579,7 +591,6 @@ public ParseTensor parseTensor(Operand serialized, /** * A queue that produces elements sorted by the first component value. - *

* Note that the PriorityQueue requires the first component of any element * to be a scalar int64, in addition to the other elements declared by * component_types. Therefore calls to Enqueue and EnqueueMany (resp. Dequeue @@ -591,7 +602,7 @@ public ParseTensor parseTensor(Operand serialized, * 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. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of PriorityQueue */ public PriorityQueue priorityQueue(List> componentTypes, @@ -601,7 +612,6 @@ public PriorityQueue priorityQueue(List> componentTypes, /** * Closes the given queue. - *

* This operation signals that no more elements will be enqueued in the * given queue. Subsequent Enqueue(Many) operations will fail. * Subsequent Dequeue(Many) operations will continue to succeed if @@ -609,146 +619,130 @@ public PriorityQueue priorityQueue(List> componentTypes, * operations that would block will fail immediately. * * @param handle The handle to a queue. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of QueueClose */ - public QueueClose queueClose(Operand handle, QueueClose.Options... options) { + public QueueClose queueClose(Operand handle, QueueClose.Options... options) { return QueueClose.create(scope, handle, options); } /** * Dequeues a tuple of one or more tensors from the given queue. - *

* This operation has k outputs, where k is the number of components * in the tuples stored in the given queue, and output i is the ith * component of the dequeued tuple. - *

- * N.B. If the queue is empty, this operation will block until an element + *

N.B. If the queue is empty, this operation will block until an element * has been dequeued (or 'timeout_ms' elapses, if specified). * * @param handle The handle to a queue. * @param componentTypes The type of each component in a tuple. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of QueueDequeue */ - public QueueDequeue queueDequeue(Operand handle, List> componentTypes, - QueueDequeue.Options... options) { + public QueueDequeue queueDequeue(Operand handle, + List> componentTypes, QueueDequeue.Options... options) { return QueueDequeue.create(scope, handle, componentTypes, options); } /** - * Dequeues `n` tuples of one or more tensors from the given queue. - *

- * If the queue is closed and there are fewer than `n` elements, then an + * Dequeues {@code n} tuples of one or more tensors from the given queue. + * If the queue is closed and there are fewer than {@code n} elements, then an * OutOfRange error is returned. - *

- * This operation concatenates queue-element component tensors along the + *

This operation concatenates queue-element component tensors along the * 0th dimension to make a single component tensor. All of the components - * in the dequeued tuple will have size `n` in the 0th dimension. - *

- * This operation has `k` outputs, where `k` is the number of components in - * the tuples stored in the given queue, and output `i` is the ith + * in the dequeued tuple will have size {@code n} in the 0th dimension. + *

This operation has {@code k} outputs, where {@code k} is the number of components in + * the tuples stored in the given queue, and output {@code i} is the ith * component of the dequeued tuple. - *

- * N.B. If the queue is empty, this operation will block until `n` elements + *

N.B. If the queue is empty, this operation will block until {@code n} elements * have been dequeued (or 'timeout_ms' elapses, if specified). * * @param handle The handle to a queue. * @param n The number of tuples to dequeue. * @param componentTypes The type of each component in a tuple. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of QueueDequeueMany */ - public QueueDequeueMany queueDequeueMany(Operand handle, Operand n, + public QueueDequeueMany queueDequeueMany(Operand handle, Operand n, List> componentTypes, QueueDequeueMany.Options... options) { return QueueDequeueMany.create(scope, handle, n, componentTypes, options); } /** - * Dequeues `n` tuples of one or more tensors from the given queue. - *

+ * Dequeues {@code n} tuples of one or more tensors from the given queue. * This operation is not supported by all queues. If a queue does not support * DequeueUpTo, then an Unimplemented error is returned. - *

- * If the queue is closed and there are more than 0 but less than `n` + *

If the queue is closed and there are more than 0 but less than {@code n} * elements remaining, then instead of returning an OutOfRange error like - * QueueDequeueMany, less than `n` elements are returned immediately. If + * QueueDequeueMany, less than {@code n} elements are returned immediately. If * the queue is closed and there are 0 elements left in the queue, then * an OutOfRange error is returned just like in QueueDequeueMany. * Otherwise the behavior is identical to QueueDequeueMany: - *

- * This operation concatenates queue-element component tensors along the + *

This operation concatenates queue-element component tensors along the * 0th dimension to make a single component tensor. All of the components * in the dequeued tuple will have size n in the 0th dimension. - *

- * This operation has `k` outputs, where `k` is the number of components in - * the tuples stored in the given queue, and output `i` is the ith + *

This operation has {@code k} outputs, where {@code k} is the number of components in + * the tuples stored in the given queue, and output {@code i} is the ith * component of the dequeued tuple. * * @param handle The handle to a queue. * @param n The number of tuples to dequeue. * @param componentTypes The type of each component in a tuple. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of QueueDequeueUpTo */ - public QueueDequeueUpTo queueDequeueUpTo(Operand handle, Operand n, + public QueueDequeueUpTo queueDequeueUpTo(Operand handle, Operand n, List> componentTypes, QueueDequeueUpTo.Options... options) { return QueueDequeueUpTo.create(scope, handle, n, componentTypes, options); } /** * Enqueues a tuple of one or more tensors in the given queue. - *

* The components input has k elements, which correspond to the components of * tuples stored in the given queue. - *

- * N.B. If the queue is full, this operation will block until the given + *

N.B. If the queue is full, this operation will block until the given * element has been enqueued (or 'timeout_ms' elapses, if specified). * * @param handle The handle to a queue. * @param components One or more tensors from which the enqueued tensors should be taken. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of QueueEnqueue */ - public QueueEnqueue queueEnqueue(Operand handle, Iterable> components, + public QueueEnqueue queueEnqueue(Operand handle, Iterable> components, QueueEnqueue.Options... options) { return QueueEnqueue.create(scope, handle, components, options); } /** * Enqueues zero or more tuples of one or more tensors in the given queue. - *

* This operation slices each component tensor along the 0th dimension to * make multiple queue elements. All of the tuple components must have the * same size in the 0th dimension. - *

- * The components input has k elements, which correspond to the components of + *

The components input has k elements, which correspond to the components of * tuples stored in the given queue. - *

- * N.B. If the queue is full, this operation will block until the given + *

N.B. If the queue is full, this operation will block until the given * elements have been enqueued (or 'timeout_ms' elapses, if specified). * * @param handle The handle to a queue. * @param components One or more tensors from which the enqueued tensors should * be taken. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of QueueEnqueueMany */ - public QueueEnqueueMany queueEnqueueMany(Operand handle, Iterable> components, - QueueEnqueueMany.Options... options) { + public QueueEnqueueMany queueEnqueueMany(Operand handle, + Iterable> components, QueueEnqueueMany.Options... options) { return QueueEnqueueMany.create(scope, handle, components, options); } /** * Returns true if queue is closed. - *

* This operation returns true if the queue is closed and false if the queue * is open. * * @param handle The handle to a queue. * @return a new instance of QueueIsClosed */ - public QueueIsClosed queueIsClosed(Operand handle) { + public QueueIsClosed queueIsClosed(Operand handle) { return QueueIsClosed.create(scope, handle); } @@ -758,7 +752,7 @@ public QueueIsClosed queueIsClosed(Operand handle) { * @param handle The handle to a queue. * @return a new instance of QueueSize */ - public QueueSize queueSize(Operand handle) { + public QueueSize queueSize(Operand handle) { return QueueSize.create(scope, handle); } @@ -766,7 +760,7 @@ public QueueSize queueSize(Operand handle) { * A queue that randomizes the order of elements. * * @param componentTypes The type of each component in a value. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of RandomShuffleQueue */ public RandomShuffleQueue randomShuffleQueue(List> componentTypes, @@ -777,7 +771,7 @@ public RandomShuffleQueue randomShuffleQueue(List> compon /** * Reads and outputs the entire contents of the input filename. * - * @param filename + * @param filename The filename value * @return a new instance of ReadFile */ public ReadFile readFile(Operand filename) { @@ -786,14 +780,13 @@ public ReadFile readFile(Operand filename) { /** * Returns the number of records this Reader has produced. - *

* This is the same as the number of ReaderRead executions that have * succeeded. * * @param readerHandle Handle to a Reader. * @return a new instance of ReaderNumRecordsProduced */ - public ReaderNumRecordsProduced readerNumRecordsProduced(Operand readerHandle) { + public ReaderNumRecordsProduced readerNumRecordsProduced(Operand readerHandle) { return ReaderNumRecordsProduced.create(scope, readerHandle); } @@ -803,13 +796,13 @@ public ReaderNumRecordsProduced readerNumRecordsProduced(Operand readerHandle * @param readerHandle Handle to a Reader. * @return a new instance of ReaderNumWorkUnitsCompleted */ - public ReaderNumWorkUnitsCompleted readerNumWorkUnitsCompleted(Operand readerHandle) { + public ReaderNumWorkUnitsCompleted readerNumWorkUnitsCompleted( + Operand readerHandle) { return ReaderNumWorkUnitsCompleted.create(scope, readerHandle); } /** * Returns the next record (key, value pair) produced by a Reader. - *

* Will dequeue from the input queue if necessary (e.g. when the * Reader needs to start reading from a new file since it has finished * with the previous file). @@ -818,25 +811,25 @@ public ReaderNumWorkUnitsCompleted readerNumWorkUnitsCompleted(Operand reader * @param queueHandle Handle to a Queue, with string work items. * @return a new instance of ReaderRead */ - public ReaderRead readerRead(Operand readerHandle, Operand queueHandle) { + public ReaderRead readerRead(Operand readerHandle, + Operand queueHandle) { return ReaderRead.create(scope, readerHandle, queueHandle); } /** - * Returns up to `num_records` (key, value) pairs produced by a Reader. - *

+ * Returns up to {@code num_records} (key, value) pairs produced by a Reader. * Will dequeue from the input queue if necessary (e.g. when the * Reader needs to start reading from a new file since it has finished * with the previous file). - * It may return less than `num_records` even before the last batch. + * It may return less than {@code num_records} even before the last batch. * - * @param readerHandle Handle to a `Reader`. - * @param queueHandle Handle to a `Queue`, with string work items. - * @param numRecords number of records to read from `Reader`. + * @param readerHandle Handle to a {@code Reader}. + * @param queueHandle Handle to a {@code Queue}, with string work items. + * @param numRecords number of records to read from {@code Reader}. * @return a new instance of ReaderReadUpTo */ - public ReaderReadUpTo readerReadUpTo(Operand readerHandle, Operand queueHandle, - Operand numRecords) { + public ReaderReadUpTo readerReadUpTo(Operand readerHandle, + Operand queueHandle, Operand numRecords) { return ReaderReadUpTo.create(scope, readerHandle, queueHandle, numRecords); } @@ -846,13 +839,12 @@ public ReaderReadUpTo readerReadUpTo(Operand readerHandle, Operand queueHa * @param readerHandle Handle to a Reader. * @return a new instance of ReaderReset */ - public ReaderReset readerReset(Operand readerHandle) { + public ReaderReset readerReset(Operand readerHandle) { return ReaderReset.create(scope, readerHandle); } /** * Restore a reader to a previously saved state. - *

* Not all Readers support being restored, so this can produce an * Unimplemented error. * @@ -861,39 +853,36 @@ public ReaderReset readerReset(Operand readerHandle) { * matching reader_handle. * @return a new instance of ReaderRestoreState */ - public ReaderRestoreState readerRestoreState(Operand readerHandle, Operand state) { + public ReaderRestoreState readerRestoreState(Operand readerHandle, + Operand state) { return ReaderRestoreState.create(scope, readerHandle, state); } /** * Produce a string tensor that encodes the state of a Reader. - *

* Not all Readers support being serialized, so this can produce an * Unimplemented error. * * @param readerHandle Handle to a Reader. * @return a new instance of ReaderSerializeState */ - public ReaderSerializeState readerSerializeState(Operand readerHandle) { + public ReaderSerializeState readerSerializeState(Operand readerHandle) { return ReaderSerializeState.create(scope, readerHandle); } /** - * Serialize an `N`-minibatch `SparseTensor` into an `[N, 3]` `Tensor` object. - *

- * The `SparseTensor` must have rank `R` greater than 1, and the first dimension - * is treated as the minibatch dimension. Elements of the `SparseTensor` + * Serialize an {@code N}-minibatch {@code SparseTensor} into an {@code [N, 3]} {@code Tensor} object. + * The {@code SparseTensor} must have rank {@code R} greater than 1, and the first dimension + * is treated as the minibatch dimension. Elements of the {@code SparseTensor} * must be sorted in increasing order of this first dimension. The serialized - * `SparseTensor` objects going into each row of `serialized_sparse` will have - * rank `R-1`. - *

- * The minibatch size `N` is extracted from `sparse_shape[0]`. + * {@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 serializedSparse()} output - * @param sparseIndices 2-D. The `indices` of the minibatch `SparseTensor`. - * @param sparseValues 1-D. The `values` of the minibatch `SparseTensor`. - * @param sparseShape 1-D. The `shape` of the minibatch `SparseTensor`. - * @return a new instance of SerializeManySparse + * @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}. + * @return a new instance of SerializeManySparse, with default output types */ public SerializeManySparse serializeManySparse(Operand sparseIndices, Operand sparseValues, Operand sparseShape) { @@ -901,22 +890,20 @@ public SerializeManySparse serializeManySparse(Operand sparseIn } /** - * Serialize an `N`-minibatch `SparseTensor` into an `[N, 3]` `Tensor` object. - *

- * The `SparseTensor` must have rank `R` greater than 1, and the first dimension - * is treated as the minibatch dimension. Elements of the `SparseTensor` + * Serialize an {@code N}-minibatch {@code SparseTensor} into an {@code [N, 3]} {@code Tensor} object. + * The {@code SparseTensor} must have rank {@code R} greater than 1, and the first dimension + * is treated as the minibatch dimension. Elements of the {@code SparseTensor} * must be sorted in increasing order of this first dimension. The serialized - * `SparseTensor` objects going into each row of `serialized_sparse` will have - * rank `R-1`. - *

- * The minibatch size `N` is extracted from `sparse_shape[0]`. + * {@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 serializedSparse()} output - * @param sparseIndices 2-D. The `indices` of the minibatch `SparseTensor`. - * @param sparseValues 1-D. The `values` of the minibatch `SparseTensor`. - * @param sparseShape 1-D. The `shape` of the minibatch `SparseTensor`. - * @param outType The `dtype` to use for serialization; the supported types are `string` - * (default) and `variant`. + * @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}. + * @param outType The {@code dtype} to use for serialization; the supported types are {@code string} + * (default) and {@code variant}. + * @param data type for {@code SerializeManySparse} output and operands * @return a new instance of SerializeManySparse */ public SerializeManySparse serializeManySparse(Operand sparseIndices, @@ -925,13 +912,12 @@ public SerializeManySparse serializeManySparse(Operand data type for {@code serializedSparse()} output - * @param sparseIndices 2-D. The `indices` of the `SparseTensor`. - * @param sparseValues 1-D. The `values` of the `SparseTensor`. - * @param sparseShape 1-D. The `shape` of the `SparseTensor`. - * @return a new instance of SerializeSparse + * @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}. + * @return a new instance of SerializeSparse, with default output types */ public SerializeSparse serializeSparse(Operand sparseIndices, Operand sparseValues, Operand sparseShape) { @@ -939,14 +925,14 @@ public SerializeSparse serializeSparse(Operand sparseIndices, } /** - * Serialize a `SparseTensor` into a `[3]` `Tensor` object. + * Serialize a {@code SparseTensor} into a {@code [3]} {@code Tensor} object. * - * @param data type for {@code serializedSparse()} output - * @param sparseIndices 2-D. The `indices` of the `SparseTensor`. - * @param sparseValues 1-D. The `values` of the `SparseTensor`. - * @param sparseShape 1-D. The `shape` of the `SparseTensor`. - * @param outType The `dtype` to use for serialization; the supported types are `string` - * (default) and `variant`. + * @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}. + * @param outType The {@code dtype} to use for serialization; the supported types are {@code string} + * (default) and {@code variant}. + * @param data type for {@code SerializeSparse} output and operands * @return a new instance of SerializeSparse */ public SerializeSparse serializeSparse(Operand sparseIndices, @@ -957,7 +943,7 @@ public SerializeSparse serializeSparse(Operand spar /** * Transforms a Tensor into a serialized TensorProto proto. * - * @param tensor A Tensor of type `T`. + * @param tensor A Tensor of type {@code T}. * @return a new instance of SerializeTensor */ public SerializeTensor serializeTensor(Operand tensor) { @@ -966,12 +952,11 @@ public SerializeTensor serializeTensor(Operand tensor) { /** * Generate a sharded filename. The filename is printf formatted as - *

- * %s-%05d-of-%05d, basename, shard, num_shards. + * %s-%05d-of-%05d, basename, shard, num_shards. * - * @param basename - * @param shard - * @param numShards + * @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, @@ -982,8 +967,8 @@ public ShardedFilename shardedFilename(Operand basename, Operand basename, Operand numShards) { @@ -993,7 +978,7 @@ public ShardedFilespec shardedFilespec(Operand basename, Operand * To use, enqueue filenames in a Queue. The output of ReaderRead will * be a filename (key) and the contents of that file (value). * - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of WholeFileReader */ public WholeFileReader wholeFileReader(WholeFileReader.Options... options) { @@ -1024,9 +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 a8e9c0d8a4c..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,52 +92,48 @@ public final class LinalgOps { LinalgOps(Ops ops) { this.scope = ops.scope(); this.ops = ops; + sparse = new LinalgSparseOps(ops); } /** * Copy a tensor setting everything outside a central band in each innermost matrix to zero. - *

- * The `band` part is computed as follows: - * Assume `input` has `k` dimensions `[I, J, K, ..., M, N]`, then the output is a + * The {@code band} part is computed as follows: + * Assume {@code input} has {@code k} dimensions {@code [I, J, K, ..., M, N]}, then the output is a * tensor with the same shape where - *

- * `band[i, j, k, ..., m, n] = in_band(m, n) * input[i, j, k, ..., m, n]`. - *

- * The indicator function - *

- * `in_band(m, n) = (num_lower < 0 || (m-n) <= num_lower)) && - * (num_upper < 0 || (n-m) <= num_upper)`. - *

- * For example: - *

{@code
+   *  

{@code band[i, j, k, ..., m, n] = in_band(m, n) * input[i, j, k, ..., m, n]}. + *

The indicator function + *

{@code in_band(m, n) = (num_lower < 0 || (m-n) <= num_lower)) && (num_upper < 0 || (n-m) <= num_upper)}. + *

For example: + *

    *  # if 'input' is [[ 0,  1,  2, 3]
-   *                   [-1,  0,  1, 2]
-   *                   [-2, -1,  0, 1]
-   *                   [-3, -2, -1, 0]],
+   *  #                [-1,  0,  1, 2]
+   *  #                [-2, -1,  0, 1]
+   *  #                [-3, -2, -1, 0]],
    *
-   *  tf.matrix_band_part(input, 1, -1) ==> [[ 0,  1,  2, 3]
+   *  tf.linalg.band_part(input, 1, -1) ==> [[ 0,  1,  2, 3]
    *                                         [-1,  0,  1, 2]
    *                                         [ 0, -1,  0, 1]
    *                                         [ 0,  0, -1, 0]],
    *
-   *  tf.matrix_band_part(input, 2, 1) ==> [[ 0,  1,  0, 0]
+   *  tf.linalg.band_part(input, 2, 1) ==> [[ 0,  1,  0, 0]
    *                                        [-1,  0,  1, 0]
    *                                        [-2, -1,  0, 1]
    *                                        [ 0, -2, -1, 0]]
-   *  }
- * Useful special cases: - *
{@code
-   *   tf.matrix_band_part(input, 0, -1) ==> Upper triangular part.
-   *   tf.matrix_band_part(input, -1, 0) ==> Lower triangular part.
-   *   tf.matrix_band_part(input, 0, 0) ==> Diagonal.
-   *  }
- * - * @param data type for {@code band()} output - * @param input Rank `k` tensor. + *
+ *

Useful special cases: + *

+   *   tf.linalg.band_part(input, 0, -1) ==> Upper triangular part.
+   *   tf.linalg.band_part(input, -1, 0) ==> Lower triangular part.
+   *   tf.linalg.band_part(input, 0, 0) ==> Diagonal.
+   *  
+ * + * @param input Rank {@code k} tensor. * @param numLower 0-D tensor. Number of subdiagonals to keep. If negative, keep entire * lower triangle. * @param numUpper 0-D tensor. Number of superdiagonals to keep. If negative, keep * entire upper triangle. + * @param data type for {@code MatrixBandPart} output and operands + * @param data type for {@code MatrixBandPart} output and operands * @return a new instance of BandPart */ public BandPart bandPart(Operand input, @@ -136,9 +142,24 @@ public BandPart bandPart(Operand inpu } /** + * 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 + * @param input The input value + * @param data type for {@code BatchCholesky} output and operands * @return a new instance of BatchCholesky */ public BatchCholesky batchCholesky(Operand input) { @@ -146,10 +167,11 @@ public BatchCholesky batchCholesky(Operand input) { } /** + * The BatchCholeskyGrad operation * - * @param data type for {@code output()} output - * @param l - * @param grad + * @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 */ public BatchCholeskyGrad batchCholeskyGrad(Operand l, Operand grad) { @@ -157,11 +179,12 @@ public BatchCholeskyGrad batchCholeskyGrad(Operand l, } /** + * The BatchMatrixBandPart operation * - * @param data type for {@code band()} output - * @param input - * @param numLower - * @param numUpper + * @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 */ public BatchMatrixBandPart batchMatrixBandPart(Operand input, @@ -170,9 +193,10 @@ public BatchMatrixBandPart batchMatrixBandPart(Operand i } /** + * The BatchMatrixDeterminant operation * - * @param data type for {@code output()} output - * @param input + * @param input The input value + * @param data type for {@code BatchMatrixDeterminant} output and operands * @return a new instance of BatchMatrixDeterminant */ public BatchMatrixDeterminant batchMatrixDeterminant(Operand input) { @@ -180,9 +204,10 @@ public BatchMatrixDeterminant batchMatrixDeterminant(Operan } /** + * The BatchMatrixDiag operation * - * @param data type for {@code output()} output - * @param diagonal + * @param diagonal The diagonal value + * @param data type for {@code BatchMatrixDiag} output and operands * @return a new instance of BatchMatrixDiag */ public BatchMatrixDiag batchMatrixDiag(Operand diagonal) { @@ -190,9 +215,10 @@ public BatchMatrixDiag batchMatrixDiag(Operand diagonal) } /** + * The BatchMatrixDiagPart operation * - * @param data type for {@code diagonal()} output - * @param input + * @param input The input value + * @param data type for {@code BatchMatrixDiagPart} output and operands * @return a new instance of BatchMatrixDiagPart */ public BatchMatrixDiagPart batchMatrixDiagPart(Operand input) { @@ -200,10 +226,15 @@ public BatchMatrixDiagPart batchMatrixDiagPart(Operand i } /** - * - * @param data type for {@code output()} output - * @param input - * @param options carries optional attributes values + * 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 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 */ public BatchMatrixInverse batchMatrixInverse(Operand input, @@ -212,10 +243,11 @@ public BatchMatrixInverse batchMatrixInverse(Operand i } /** + * The BatchMatrixSetDiag operation * - * @param data type for {@code output()} output - * @param input - * @param diagonal + * @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 */ public BatchMatrixSetDiag batchMatrixSetDiag(Operand input, @@ -224,11 +256,12 @@ public BatchMatrixSetDiag batchMatrixSetDiag(Operand inp } /** + * The BatchMatrixSolve operation * - * @param data type for {@code output()} output - * @param matrix - * @param rhs - * @param options carries optional attributes values + * @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 */ public BatchMatrixSolve batchMatrixSolve(Operand matrix, Operand rhs, @@ -237,12 +270,13 @@ public BatchMatrixSolve batchMatrixSolve(Operand matri } /** + * The BatchMatrixSolveLs operation * - * @param data type for {@code output()} output - * @param matrix - * @param rhs - * @param l2Regularizer - * @param options carries optional attributes values + * @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 */ public BatchMatrixSolveLs batchMatrixSolveLs(Operand matrix, @@ -251,11 +285,12 @@ public BatchMatrixSolveLs batchMatrixSolveLs(Operand m } /** + * The BatchMatrixTriangularSolve operation * - * @param data type for {@code output()} output - * @param matrix - * @param rhs - * @param options carries optional attributes values + * @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 */ public BatchMatrixTriangularSolve batchMatrixTriangularSolve( @@ -264,10 +299,11 @@ public BatchMatrixTriangularSolve batchMatrixTriangularSo } /** + * The BatchSelfAdjointEigV2 operation * - * @param data type for {@code e()} output - * @param input - * @param options carries optional attributes values + * @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 */ public BatchSelfAdjointEig batchSelfAdjointEig(Operand input, @@ -276,10 +312,11 @@ public BatchSelfAdjointEig batchSelfAdjointEig(Operand } /** + * The BatchSvd operation * - * @param data type for {@code s()} output - * @param input - * @param options carries optional attributes values + * @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 */ public BatchSvd batchSvd(Operand input, BatchSvd.Options... options) { @@ -288,23 +325,19 @@ public BatchSvd batchSvd(Operand input, BatchSvd.Options /** * Computes the Cholesky decomposition of one or more square matrices. - *

- * The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions + * The input is a tensor of shape {@code [..., M, M]} whose inner-most 2 dimensions * form square matrices. - *

- * The input has to be symmetric and positive definite. Only the lower-triangular + *

The input has to be symmetric and positive definite. Only the lower-triangular * part of the input will be used for this operation. The upper-triangular part * will not be read. - *

- * The output is a tensor of the same shape as the input - * containing the Cholesky decompositions for all input submatrices `[..., :, :]`. - *

- * Note: The gradient computation on GPU is faster for large matrices but + *

The output is a tensor of the same shape as the input + * containing the Cholesky decompositions for all input submatrices {@code [..., :, :]}. + *

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 - * @param input Shape is `[..., M, M]`. + * @param input Shape is {@code [..., M, M]}. + * @param data type for {@code Cholesky} output and operands * @return a new instance of Cholesky */ public Cholesky cholesky(Operand input) { @@ -313,17 +346,16 @@ public Cholesky cholesky(Operand input) { /** * Computes the reverse mode backpropagated gradient of the Cholesky algorithm. - *

- * For an explanation see "Differentiation of the Cholesky algorithm" by + * 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 `[..., M, M]`. + * @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. - * @param grad df/dl where f is some scalar function. Shape is `[..., M, M]`. + * @param grad 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. + * @param data type for {@code CholeskyGrad} output and operands * @return a new instance of CholeskyGrad */ public CholeskyGrad choleskyGrad(Operand l, Operand grad) { @@ -332,14 +364,13 @@ public CholeskyGrad choleskyGrad(Operand l, Operand /** * Shuffle dimensions of x according to a permutation and conjugate the result. - *

- * The output `y` has the same rank as `x`. The shapes of `x` and `y` satisfy: - * `y.shape[i] == x.shape[perm[i]] for i in [0, 1, ..., rank(x) - 1]` - * `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 - * @param perm + * 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 x The x value + * @param perm The perm value + * @param data type for {@code ConjugateTranspose} output and operands * @return a new instance of ConjugateTranspose */ public ConjugateTranspose conjugateTranspose(Operand x, @@ -349,14 +380,13 @@ public ConjugateTranspose conjugateTranspose(Operand x, /** * Compute the pairwise cross product. - *

- * `a` and `b` must be the same shape; they can either be simple 3-element vectors, + * {@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 * @param a A tensor containing 3-element vectors. - * @param b Another tensor, of same type and shape as `a`. + * @param b Another tensor, of same type and shape as {@code a}. + * @param data type for {@code Cross} output and operands * @return a new instance of Cross */ public Cross cross(Operand a, Operand b) { @@ -365,13 +395,12 @@ public Cross cross(Operand a, Operand b) { /** * Computes the determinant of one or more square matrices. - *

- * The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions + * 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 `[..., :, :]`. + * for all input submatrices {@code [..., :, :]}. * - * @param data type for {@code output()} output - * @param input Shape is `[..., M, M]`. + * @param input Shape is {@code [..., M, M]}. + * @param data type for {@code MatrixDeterminant} output and operands * @return a new instance of Det */ public Det det(Operand input) { @@ -380,22 +409,21 @@ public Det det(Operand input) { /** * Computes the eigen decomposition of one or more square matrices. - *

* Computes the eigenvalues and (optionally) right eigenvectors of each inner matrix in - * `input` such that `input[..., :, :] = v[..., :, :] * diag(e[..., :])`. The eigenvalues + * {@code input} such that {@code input[..., :, :] = v[..., :, :] * diag(e[..., :])}. The eigenvalues * are sorted in non-decreasing order. - *

{@code
+   *  
    *  # a is a tensor.
    *  # e is a tensor of eigenvalues.
    *  # v is a tensor of eigenvectors.
    *  e, v = eig(a)
    *  e = eig(a, compute_v=False)
-   *  }
+ *
* - * @param data type for {@code e()} output - * @param input `Tensor` input of shape `[N, N]`. - * @param Tout - * @param options carries optional attributes values + * @param input {@code Tensor} input of shape {@code [N, N]}. + * @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 */ public Eig eig(Operand input, Class Tout, @@ -405,85 +433,73 @@ public Eig eig(Operand input, Class Tou /** * Tensor contraction according to Einstein summation convention. - *

* Implements generalized Tensor contraction and reduction. Each input Tensor must * have a corresponding input subscript appearing in the comma-separated left-hand * side of the equation. The right-hand side of the equation consists of the * output subscript. The input subscripts and the output subscript should consist - * of zero or more named axis labels and at most one ellipsis (`...`). - *

- * The named axis labels may be any single character other than those having - * special meaning, namely `,.->`. The behavior of this Op is undefined if it + * of zero or more named axis labels and at most one ellipsis ({@code ...}). + *

The named axis labels may be any single character other than those having + * special meaning, namely {@code ,.->}. The behavior of this Op is undefined if it * receives an ill-formatted equation; since the validation is done at * graph-building time, we omit format validation checks at runtime. - *

- * Note: This Op is not intended to be called by the user; instead users should - * call `tf.einsum` directly. It is a hidden Op used by `tf.einsum`. - *

- * Operations are applied to the input(s) according to the following rules: - *

- * (a) Generalized Diagonals: For input dimensions corresponding to axis labels - * appearing more than once in the same input subscript, we take the - * generalized (`k`-dimensional) diagonal. - * For example, in the equation `iii->i` with input shape `[3, 3, 3]`, the - * generalized diagonal would consist of `3` elements at indices `(0, 0, 0)`, - * `(1, 1, 1)` and `(2, 2, 2)` to create a Tensor of shape `[3]`. - *

- * (b) Reduction: Axes corresponding to labels appearing only in one input - * subscript but not in the output subscript are summed over prior to Tensor - * contraction. - * For example, in the equation `ab,bc->b`, the axis labels `a` and `c` are - * the reduction axis labels. - *

- * (c) Batch Dimensions: Axes corresponding to labels appearing in each of the - * input subscripts and also in the output subscript make up the batch - * dimensions in Tensor contraction. Unnamed axis labels corresponding to - * ellipsis (`...`) also correspond to batch dimensions. - * For example, for the equation denoting batch matrix multiplication, - * `bij,bjk->bik`, the axis label `b` corresponds to a batch dimension. - *

- * (d) Contraction: In case of binary einsum, axes corresponding to labels - * appearing in two different inputs (and not in the output) are contracted - * against each other. - * Considering the batch matrix multiplication equation again - * (`bij,bjk->bik`), the contracted axis label is `j`. - *

- * (e) Expand Diagonal: If the output subscripts contain repeated (explicit) axis - * labels, the opposite operation of (a) is applied. For example, in the - * equation `i->iii`, and input shape `[3]`, the output of shape `[3, 3, 3]` - * are all zeros, except for the (generalized) diagonal which is populated - * with values from the input. - * Note: This operation is not supported by `np.einsum` or `tf.einsum`; it is - * provided to enable computing the symbolic gradient of `tf.einsum`. - *

- * The output subscripts must contain only labels appearing in at least one of the + *

Note: This Op is not intended to be called by the user; instead users should + * call {@code tf.einsum} directly. It is a hidden Op used by {@code tf.einsum}. + *

Operations are applied to the input(s) according to the following rules: + *

(a) Generalized Diagonals: For input dimensions corresponding to axis labels + * appearing more than once in the same input subscript, we take the + * generalized ({@code k}-dimensional) diagonal. + * For example, in the equation {@code iii->i} with input shape {@code [3, 3, 3]}, the + * generalized diagonal would consist of {@code 3} elements at indices {@code (0, 0, 0)}, + * {@code (1, 1, 1)} and {@code (2, 2, 2)} to create a Tensor of shape {@code [3]}. + *

(b) Reduction: Axes corresponding to labels appearing only in one input + * subscript but not in the output subscript are summed over prior to Tensor + * contraction. + * For example, in the equation {@code ab,bc->b}, the axis labels {@code a} and {@code c} are + * the reduction axis labels. + *

(c) Batch Dimensions: Axes corresponding to labels appearing in each of the + * input subscripts and also in the output subscript make up the batch + * dimensions in Tensor contraction. Unnamed axis labels corresponding to + * ellipsis ({@code ...}) also correspond to batch dimensions. + * For example, for the equation denoting batch matrix multiplication, + * {@code bij,bjk->bik}, the axis label {@code b} corresponds to a batch dimension. + *

(d) Contraction: In case of binary einsum, axes corresponding to labels + * appearing in two different inputs (and not in the output) are contracted + * against each other. + * Considering the batch matrix multiplication equation again + * ({@code bij,bjk->bik}), the contracted axis label is {@code j}. + *

(e) Expand Diagonal: If the output subscripts contain repeated (explicit) axis + * labels, the opposite operation of (a) is applied. For example, in the + * equation {@code i->iii}, and input shape {@code [3]}, the output of shape {@code [3, 3, 3]} + * are all zeros, except for the (generalized) diagonal which is populated + * with values from the input. + * Note: This operation is not supported by {@code np.einsum} or {@code tf.einsum}; it is + * provided to enable computing the symbolic gradient of {@code tf.einsum}. + *

The output subscripts must contain only labels appearing in at least one of the * input subscripts. Furthermore, all dimensions mapping to the same axis label * must be equal. - *

- * Any of the input and output subscripts may contain at most a single ellipsis - * (`...`). These ellipsis are mapped against dimensions not corresponding to any + *

Any of the input and output subscripts may contain at most a single ellipsis + * ({@code ...}). These ellipsis are mapped against dimensions not corresponding to any * named axis label. If two inputs contain ellipsis, then they are broadcasted * according to standard NumPy broadcasting - * [rules](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html). - *

- * The broadcasted dimensions are placed in the corresponding location of the + * rules . + *

The broadcasted dimensions are placed in the corresponding location of the * ellipsis in the output subscript. If the broadcasted dimensions are non-empty * and the output subscripts do not contain ellipsis, then an InvalidArgument error * is raised. - *

- * - * @compatibility(numpy) Similar to [`numpy.einsum`](https://docs.scipy.org/doc/numpy/reference/generated/numpy.einsum.html). - *

- * Comparison with `numpy.einsum`: - *

- * This Op only supports unary and binary forms of `numpy.einsum`. - * This Op does not support implicit form. (i.e. equations without `->`). - * This Op also supports repeated indices in the output subscript, which is not - * supported by `numpy.einsum`. - * @end_compatibility - * @param data type for {@code output()} output + *

{@literal @}compatibility(numpy)
+ * Similar to {@code numpy.einsum} . + *

Comparison with {@code numpy.einsum}: + *

    + *
  • This Op only supports unary and binary forms of {@code numpy.einsum}.
  • + *
  • This Op does not support implicit form. (i.e. equations without {@code ->}).
  • + *
  • This Op also supports repeated indices in the output subscript, which is not + * supported by {@code numpy.einsum}. + *
    {@literal @}end_compatibility
  • + *
+ * * @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 * @return a new instance of Einsum */ public Einsum einsum(Iterable> inputs, String equation) { @@ -492,17 +508,16 @@ public Einsum einsum(Iterable> inputs, String eq /** * Computes the euclidean norm of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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 * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values + * @param data type for {@code EuclideanNorm} output and operands * @return a new instance of EuclideanNorm */ public EuclideanNorm euclideanNorm(Operand input, @@ -512,21 +527,17 @@ public EuclideanNorm euclideanNorm(Operand input, /** * Computes the inverse of one or more square invertible matrices or their adjoints (conjugate transposes). - *

- * - * The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions + * 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 inverse for all input submatrices `[..., :, :]`. - *

- * The op uses LU decomposition with partial pivoting to compute the inverses. - *

- * If a matrix is not invertible there is no guarantee what the op does. It + * containing the inverse for all input submatrices {@code [..., :, :]}. + *

The op uses LU decomposition with partial pivoting to compute the inverses. + *

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 - * @param input Shape is `[..., M, M]`. - * @param options carries optional attributes values + * @param input Shape is {@code [..., M, M]}. + * @param options carries optional attribute values + * @param data type for {@code MatrixInverse} output and operands * @return a new instance of Inv */ public Inv inv(Operand input, Inv.Options... options) { @@ -534,65 +545,53 @@ public Inv inv(Operand input, Inv.Options... options) { } /** - * Loads a 2-D (matrix) `Tensor` with name `old_tensor_name` from the checkpoint - *

- * at `ckpt_path` and potentially reorders its rows and columns using the + * Loads a 2-D (matrix) {@code Tensor} with name {@code old_tensor_name} from the checkpoint + * at {@code ckpt_path} and potentially reorders its rows and columns using the * specified remappings. - *

- * Most users should use one of the wrapper initializers (such as - * `tf.contrib.framework.load_and_remap_matrix_initializer`) instead of this + *

Most users should use one of the wrapper initializers (such as + * {@code tf.contrib.framework.load_and_remap_matrix_initializer}) instead of this * function directly. - *

- * The remappings are 1-D tensors with the following properties: + *

The remappings are 1-D tensors with the following properties: *

    - *
  • - * `row_remapping` must have exactly `num_rows` entries. Row `i` of the output - * matrix will be initialized from the row corresponding to index - * `row_remapping[i]` in the old `Tensor` from the checkpoint. - *
  • - *
  • - * `col_remapping` must have either 0 entries (indicating that no column - * reordering is needed) or `num_cols` entries. If specified, column `j` of the - * output matrix will be initialized from the column corresponding to index - * `col_remapping[j]` in the old `Tensor` from the checkpoint. - *
  • - *
  • - * A value of -1 in either of the remappings signifies a "missing" entry. In that - * case, values from the `initializing_values` tensor will be used to fill that - * missing row or column. If `row_remapping` has `r` missing entries and - * `col_remapping` has `c` missing entries, then the following condition must be - * true: - *
  • + *
  • {@code row_remapping} must have exactly {@code num_rows} entries. Row {@code i} of the output + * matrix will be initialized from the row corresponding to index + * {@code row_remapping[i]} in the old {@code Tensor} from the checkpoint.
  • + *
  • {@code col_remapping} must have either 0 entries (indicating that no column + * reordering is needed) or {@code num_cols} entries. If specified, column {@code j} of the + * output matrix will be initialized from the column corresponding to index + * {@code col_remapping[j]} in the old {@code Tensor} from the checkpoint.
  • + *
  • A value of -1 in either of the remappings signifies a "missing" entry. In that + * case, values from the {@code initializing_values} tensor will be used to fill that + * missing row or column. If {@code row_remapping} has {@code r} missing entries and + * {@code col_remapping} has {@code c} missing entries, then the following condition must be + * true:
  • *
- * `(r * num_cols) + (c * num_rows) - (r * c) == len(initializing_values)` - *

- * The remapping tensors can be generated using the GenerateVocabRemapping op. - *

- * As an example, with row_remapping = [1, 0, -1], col_remapping = [0, 2, -1], + *

{@code (r * num_cols) + (c * num_rows) - (r * c) == len(initializing_values)} + *

The remapping tensors can be generated using the GenerateVocabRemapping op. + *

As an example, with row_remapping = [1, 0, -1], col_remapping = [0, 2, -1], * initializing_values = [0.5, -0.5, 0.25, -0.25, 42], and w(i, j) representing * the value from row i, column j of the old tensor in the checkpoint, the output * matrix will look like the following: - *

- * [[w(1, 0), w(1, 2), 0.5], - * [w(0, 0), w(0, 2), -0.5], - * [0.25, -0.25, 42]] - * - * @param ckptPath Path to the TensorFlow checkpoint (version 2, `TensorBundle`) from - * which the old matrix `Tensor` will be loaded. - * @param oldTensorName Name of the 2-D `Tensor` to load from checkpoint. - * @param rowRemapping An int `Tensor` of row remappings (generally created by - * `generate_vocab_remapping`). Even if no row remapping is needed, this must + *

[[w(1, 0), w(1, 2), 0.5], + * [w(0, 0), w(0, 2), -0.5], + * [0.25, -0.25, 42]] + * + * @param ckptPath Path to the TensorFlow checkpoint (version 2, {@code TensorBundle}) from + * which the old matrix {@code Tensor} will be loaded. + * @param oldTensorName Name of the 2-D {@code Tensor} to load from checkpoint. + * @param rowRemapping 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 `Tensor` (e.g. [8, 9, 10, ...], for partitioned `Variables`). - * @param colRemapping An int `Tensor` of column remappings (generally created by - * `generate_vocab_remapping`). May be a size-0 `Tensor` if only row remapping + * index-valued {@code Tensor} (e.g. [8, 9, 10, ...], for partitioned {@code Variables}). + * @param colRemapping 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). - * @param initializingValues A float `Tensor` containing values to fill in for cells + * @param initializingValues 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. * @param numRows Number of rows (length of the 1st dimension) in the output matrix. * @param numCols Number of columns (length of the 2nd dimension) in the output matrix. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of LoadAndRemapMatrix */ public LoadAndRemapMatrix loadAndRemapMatrix(Operand ckptPath, @@ -604,19 +603,17 @@ public LoadAndRemapMatrix loadAndRemapMatrix(Operand ckptPath, /** * Computes the sign and the log of the absolute value of the determinant of - *

* one or more square matrices. - *

- * The input is a tensor of shape `[N, M, M]` whose inner-most 2 dimensions + *

The input is a tensor of shape {@code [N, M, M]} whose inner-most 2 dimensions * form square matrices. The outputs are two tensors containing the signs and * absolute values of the log determinants for all N input submatrices - * `[..., :, :]` such that `determinant = sign*exp(log_abs_determinant)`. - * The `log_abs_determinant` is computed as `det(P)*sum(log(diag(LU)))` where `LU` - * is the `LU` decomposition of the input and `P` is the corresponding + * {@code [..., :, :]} such that {@code determinant = sign*exp(log_abs_determinant)}. + * 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 - * @param input Shape is `[N, M, M]`. + * @param input Shape is {@code [N, M, M]}. + * @param data type for {@code LogMatrixDeterminant} output and operands * @return a new instance of LogMatrixDeterminant */ public LogMatrixDeterminant logMatrixDeterminant(Operand input) { @@ -625,30 +622,24 @@ public LogMatrixDeterminant logMatrixDeterminant(Operand /** * Computes the LU decomposition of one or more square matrices. - *

- * The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions + * The input is a tensor of shape {@code [..., M, M]} whose inner-most 2 dimensions * form square matrices. - *

- * The input has to be invertible. - *

- * The output consists of two tensors LU and P containing the LU decomposition - * of all input submatrices `[..., :, :]`. LU encodes the lower triangular and + *

The input has to be invertible. + *

The output consists of two tensors LU and P containing the LU decomposition + * of all input submatrices {@code [..., :, :]}. LU encodes the lower triangular and * upper triangular factors. - *

- * For each input submatrix of shape `[M, M]`, L is a lower triangular matrix of - * shape `[M, M]` with unit diagonal whose entries correspond to the strictly lower - * triangular part of LU. U is a upper triangular matrix of shape `[M, M]` whose + *

For each input submatrix of shape {@code [M, M]}, L is a lower triangular matrix of + * shape {@code [M, M]} with unit diagonal whose entries correspond to the strictly lower + * triangular part of LU. U is a upper triangular matrix of shape {@code [M, M]} whose * entries correspond to the upper triangular part, including the diagonal, of LU. - *

- * P represents a permutation matrix encoded as a list of indices each between `0` - * and `M-1`, inclusive. If P_mat denotes the permutation matrix corresponding to + *

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 - * @param input A tensor of shape `[..., M, M]` whose inner-most 2 dimensions form matrices of - * size `[M, M]`. - * @return a new instance of Lu + * @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 + * @return a new instance of Lu, with default output types */ public Lu lu(Operand input) { return Lu.create(scope, input); @@ -656,30 +647,25 @@ public Lu lu(Operand input) { /** * Computes the LU decomposition of one or more square matrices. - *

- * The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions + * The input is a tensor of shape {@code [..., M, M]} whose inner-most 2 dimensions * form square matrices. - *

- * The input has to be invertible. - *

- * The output consists of two tensors LU and P containing the LU decomposition - * of all input submatrices `[..., :, :]`. LU encodes the lower triangular and + *

The input has to be invertible. + *

The output consists of two tensors LU and P containing the LU decomposition + * of all input submatrices {@code [..., :, :]}. LU encodes the lower triangular and * upper triangular factors. - *

- * For each input submatrix of shape `[M, M]`, L is a lower triangular matrix of - * shape `[M, M]` with unit diagonal whose entries correspond to the strictly lower - * triangular part of LU. U is a upper triangular matrix of shape `[M, M]` whose + *

For each input submatrix of shape {@code [M, M]}, L is a lower triangular matrix of + * shape {@code [M, M]} with unit diagonal whose entries correspond to the strictly lower + * triangular part of LU. U is a upper triangular matrix of shape {@code [M, M]} whose * entries correspond to the upper triangular part, including the diagonal, of LU. - *

- * P represents a permutation matrix encoded as a list of indices each between `0` - * and `M-1`, inclusive. If P_mat denotes the permutation matrix corresponding to + *

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 - * @param input A tensor of shape `[..., M, M]` whose inner-most 2 dimensions form matrices of - * size `[M, M]`. - * @param outputIdxType + * @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 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 */ public Lu lu(Operand input, @@ -688,20 +674,18 @@ public Lu lu(Operand input, } /** - * Multiply the matrix "a" by the matrix "b". - *

+ * Multiply the matrix "a" by the matrix "b". * The inputs must be two-dimensional matrices and the inner dimension of - * "a" (after being transposed if transpose_a is true) must match the - * outer dimension of "b" (after being transposed if transposed_b is + * "a" (after being transposed if transpose_a is true) must match the + * outer dimension of "b" (after being transposed if transposed_b is * true). - *

- * Note: The default kernel implementation for MatMul on GPUs uses + *

Note: The default kernel implementation for MatMul on GPUs uses * cublas. * - * @param data type for {@code product()} output - * @param a - * @param b - * @param options carries optional attributes values + * @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 */ public MatMul matMul(Operand a, Operand b, MatMul.Options... options) { @@ -710,43 +694,39 @@ public MatMul matMul(Operand a, Operand b, MatMul.Opt /** * Returns a batched diagonal tensor with given batched diagonal values. - *

- * Returns a tensor with the contents in `diagonal` as `k[0]`-th to `k[1]`-th - * diagonals of a matrix, with everything else padded with `padding`. `num_rows` - * and `num_cols` specify the dimension of the innermost matrix of the output. If + * Returns a tensor with the contents in {@code diagonal} as {@code k[0]}-th to {@code k[1]}-th + * diagonals of a matrix, with everything else padded with {@code padding}. {@code num_rows} + * and {@code num_cols} specify the dimension of the innermost matrix of the output. If * both are not specified, the op assumes the innermost matrix is square and infers - * its size from `k` and the innermost dimension of `diagonal`. If only one of them + * its size from {@code k} and the innermost dimension of {@code diagonal}. If only one of them * is specified, the op assumes the unspecified value is the smallest possible * based on other criteria. - *

- * Let `diagonal` have `r` dimensions `[I, J, ..., L, M, N]`. The output tensor has - * rank `r+1` with shape `[I, J, ..., L, M, num_rows, num_cols]` when only one - * diagonal is given (`k` is an integer or `k[0] == k[1]`). Otherwise, it has rank - * `r` with shape `[I, J, ..., L, num_rows, num_cols]`. - *

- * The second innermost dimension of `diagonal` has double meaning. - * When `k` is scalar or `k[0] == k[1]`, `M` is part of the batch size + *

Let {@code diagonal} have {@code r} dimensions {@code [I, J, ..., L, M, N]}. The output tensor has + * rank {@code r+1} with shape {@code [I, J, ..., L, M, num_rows, num_cols]} when only one + * diagonal is given ({@code k} is an integer or {@code k[0] == k[1]}). Otherwise, it has rank + * {@code r} with shape {@code [I, J, ..., L, num_rows, num_cols]}. + *

The second innermost dimension of {@code diagonal} has double meaning. + * When {@code k} is scalar or {@code k[0] == k[1]}, {@code M} is part of the batch size * [I, J, ..., M], and the output tensor is: - *

{@code
+   *  
    *  output[i, j, ..., l, m, n]
    *    = diagonal[i, j, ..., l, n-max(d_upper, 0)] ; if n - m == d_upper
    *      padding_value                             ; otherwise
-   *  }
- * Otherwise, `M` is treated as the number of diagonals for the matrix in the - * same batch (`M = k[1]-k[0]+1`), and the output tensor is: - *
{@code
+   *  
+ *

Otherwise, {@code M} is treated as the number of diagonals for the matrix in the + * same batch ({@code M = k[1]-k[0]+1}), and the output tensor is: + *

    *  output[i, j, ..., l, m, n]
-   *    = diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]
+   *    = diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]
    *      padding_value                                     ; otherwise
-   *  }
- * where `d = n - m`, `diag_index = k[1] - d`, and `index_in_diag = n - max(d, 0)`. - *

- * For example: - *

{@code
+   *  
+ *

where {@code d = n - m}, {@code diag_index = k[1] - d}, and {@code index_in_diag = n - max(d, 0)}. + *

For example: + *

    *  # The main diagonal.
    *  diagonal = np.array([[1, 2, 3, 4],            # Input shape: (2, 4)
    *                       [5, 6, 7, 8]])
-   *  tf.matrix_diag(diagonal) ==> [[[1, 0, 0, 0],  # Output shape: (2, 4, 4)
+   *  tf.matrix_diag(diagonal) ==> [[[1, 0, 0, 0],  # Output shape: (2, 4, 4)
    *                                 [0, 2, 0, 0],
    *                                 [0, 0, 3, 0],
    *                                 [0, 0, 0, 4]],
@@ -759,7 +739,7 @@ public  MatMul matMul(Operand a, Operand b, MatMul.Opt
    *  diagonal = np.array([[1, 2, 3],  # Input shape: (2, 3)
    *                       [4, 5, 6]])
    *  tf.matrix_diag(diagonal, k = 1)
-   *    ==> [[[0, 1, 0, 0],  # Output shape: (2, 4, 4)
+   *    ==> [[[0, 1, 0, 0],  # Output shape: (2, 4, 4)
    *          [0, 0, 2, 0],
    *          [0, 0, 0, 3],
    *          [0, 0, 0, 0]],
@@ -774,7 +754,7 @@ public  MatMul matMul(Operand a, Operand b, MatMul.Opt
    *                        [[6, 7, 9],
    *                         [9, 1, 0]]])
    *  tf.matrix_diag(diagonals, k = (-1, 0))
-   *    ==> [[[1, 0, 0],  # Output shape: (2, 3, 3)
+   *    ==> [[[1, 0, 0],  # Output shape: (2, 3, 3)
    *          [4, 2, 0],
    *          [0, 5, 3]],
    *         [[6, 0, 0],
@@ -784,31 +764,31 @@ public  MatMul matMul(Operand a, Operand b, MatMul.Opt
    *  # Rectangular matrix.
    *  diagonal = np.array([1, 2])  # Input shape: (2)
    *  tf.matrix_diag(diagonal, k = -1, num_rows = 3, num_cols = 4)
-   *    ==> [[0, 0, 0, 0],  # Output shape: (3, 4)
+   *    ==> [[0, 0, 0, 0],  # Output shape: (3, 4)
    *         [1, 0, 0, 0],
    *         [0, 2, 0, 0]]
    *
    *  # Rectangular matrix with inferred num_cols and padding_value = 9.
    *  tf.matrix_diag(diagonal, k = -1, num_rows = 3, padding_value = 9)
-   *    ==> [[9, 9],  # Output shape: (3, 2)
+   *    ==> [[9, 9],  # Output shape: (3, 2)
    *         [1, 9],
    *         [9, 2]]
-   *  }
+ *
* - * @param data type for {@code output()} output - * @param diagonal Rank `r`, where `r >= 1` + * @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. `k` can be a single integer + * 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. `k[0]` must not be larger than `k[1]`. + * of a matrix band. {@code k[0]} must not be larger than {@code k[1]}. * @param numRows 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 `diagonal`. + * innermost dimension of {@code diagonal}. * @param numCols 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 `diagonal`. + * k and the innermost dimension of {@code diagonal}. * @param paddingValue The number to fill the area outside the specified diagonal band with. * Default is 0. + * @param data type for {@code MatrixDiagV2} output and operands * @return a new instance of MatrixDiag */ public MatrixDiag matrixDiag(Operand diagonal, Operand k, @@ -818,38 +798,32 @@ public MatrixDiag matrixDiag(Operand diagonal, Operand - * Returns a tensor with the `k[0]`-th to `k[1]`-th diagonals of the batched - * `input`. - *

- * Assume `input` has `r` dimensions `[I, J, ..., L, M, N]`. - * Let `max_diag_len` be the maximum length among all diagonals to be extracted, - * `max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0))` - * Let `num_diags` be the number of diagonals to extract, - * `num_diags = k[1] - k[0] + 1`. - *

- * If `num_diags == 1`, the output tensor is of rank `r - 1` with shape - * `[I, J, ..., L, max_diag_len]` and values: - *

{@code
+   *  Returns a tensor with the {@code k[0]}-th to {@code k[1]}-th diagonals of the batched
+   *  {@code input}.
+   *  

Assume {@code input} has {@code r} dimensions {@code [I, J, ..., L, M, N]}. + * Let {@code max_diag_len} be the maximum length among all diagonals to be extracted, + * {@code max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0))} + * Let {@code num_diags} be the number of diagonals to extract, + * {@code num_diags = k[1] - k[0] + 1}. + *

If {@code num_diags == 1}, the output tensor is of rank {@code r - 1} with shape + * {@code [I, J, ..., L, max_diag_len]} and values: + *

    *  diagonal[i, j, ..., l, n]
-   *    = input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
+   *    = input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
    *      padding_value                 ; otherwise.
-   *  }
- * where `y = max(-k[1], 0)`, `x = max(k[1], 0)`. - *

- * Otherwise, the output tensor has rank `r` with dimensions - * `[I, J, ..., L, num_diags, max_diag_len]` with values: - *

{@code
+   *  
+ *

where {@code y = max(-k[1], 0)}, {@code x = max(k[1], 0)}. + *

Otherwise, the output tensor has rank {@code r} with dimensions + * {@code [I, J, ..., L, num_diags, max_diag_len]} with values: + *

    *  diagonal[i, j, ..., l, m, n]
-   *    = input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
+   *    = input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
    *      padding_value                 ; otherwise.
-   *  }
- * where `d = k[1] - m`, `y = max(-d, 0)`, and `x = max(d, 0)`. - *

- * The input must be at least a matrix. - *

- * For example: - *

{@code
+   *  
+ *

where {@code d = k[1] - m}, {@code y = max(-d, 0)}, and {@code x = max(d, 0)}. + *

The input must be at least a matrix. + *

For example: + *

    *  input = np.array([[[1, 2, 3, 4],  # Input shape: (2, 3, 4)
    *                     [5, 6, 7, 8],
    *                     [9, 8, 7, 6]],
@@ -858,17 +832,17 @@ public  MatrixDiag matrixDiag(Operand diagonal, Operand [[1, 6, 7],  # Output shape: (2, 3)
+   *  tf.matrix_diag_part(input) ==> [[1, 6, 7],  # Output shape: (2, 3)
    *                                  [5, 2, 7]]
    *
    *  # A superdiagonal from each batch.
    *  tf.matrix_diag_part(input, k = 1)
-   *    ==> [[2, 7, 6],  # Output shape: (2, 3)
+   *    ==> [[2, 7, 6],  # Output shape: (2, 3)
    *         [4, 3, 8]]
    *
    *  # A tridiagonal band from each batch.
    *  tf.matrix_diag_part(input, k = (-1, 1))
-   *    ==> [[[2, 7, 6],  # Output shape: (2, 3, 3)
+   *    ==> [[[2, 7, 6],  # Output shape: (2, 3, 3)
    *          [1, 6, 7],
    *          [5, 8, 0]],
    *         [[4, 3, 8],
@@ -877,22 +851,22 @@ public  MatrixDiag matrixDiag(Operand diagonal, Operand [[[4, 9, 9],  # Output shape: (2, 3, 3)
+   *    ==> [[[4, 9, 9],  # Output shape: (2, 3, 3)
    *          [3, 8, 9],
    *          [2, 7, 6]],
    *         [[2, 9, 9],
    *          [3, 4, 9],
    *          [4, 3, 8]]]
-   *  }
+ *
* - * @param data type for {@code diagonal()} output - * @param input Rank `r` tensor where `r >= 2`. + * @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. `k` can be a single integer + * 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. `k[0]` must not be larger than `k[1]`. + * of a matrix band. {@code k[0]} must not be larger than {@code k[1]}. * @param paddingValue The value to fill the area outside the specified diagonal band with. * Default is 0. + * @param data type for {@code MatrixDiagPartV2} output and operands * @return a new instance of MatrixDiagPart */ public MatrixDiagPart matrixDiagPart(Operand input, Operand k, @@ -902,48 +876,41 @@ public MatrixDiagPart matrixDiagPart(Operand input, Oper /** * Returns the batched diagonal part of a batched tensor. - *

- * Returns a tensor with the `k[0]`-th to `k[1]`-th diagonals of the batched - * `input`. - *

- * Assume `input` has `r` dimensions `[I, J, ..., L, M, N]`. - * Let `max_diag_len` be the maximum length among all diagonals to be extracted, - * `max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0))` - * Let `num_diags` be the number of diagonals to extract, - * `num_diags = k[1] - k[0] + 1`. - *

- * If `num_diags == 1`, the output tensor is of rank `r - 1` with shape - * `[I, J, ..., L, max_diag_len]` and values: - *

{@code
+   *  Returns a tensor with the {@code k[0]}-th to {@code k[1]}-th diagonals of the batched
+   *  {@code input}.
+   *  

Assume {@code input} has {@code r} dimensions {@code [I, J, ..., L, M, N]}. + * Let {@code max_diag_len} be the maximum length among all diagonals to be extracted, + * {@code max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0))} + * Let {@code num_diags} be the number of diagonals to extract, + * {@code num_diags = k[1] - k[0] + 1}. + *

If {@code num_diags == 1}, the output tensor is of rank {@code r - 1} with shape + * {@code [I, J, ..., L, max_diag_len]} and values: + *

    *  diagonal[i, j, ..., l, n]
-   *    = input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
+   *    = input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
    *      padding_value                 ; otherwise.
-   *  }
- * where `y = max(-k[1], 0)`, `x = max(k[1], 0)`. - *

- * Otherwise, the output tensor has rank `r` with dimensions - * `[I, J, ..., L, num_diags, max_diag_len]` with values: - *

{@code
+   *  
+ *

where {@code y = max(-k[1], 0)}, {@code x = max(k[1], 0)}. + *

Otherwise, the output tensor has rank {@code r} with dimensions + * {@code [I, J, ..., L, num_diags, max_diag_len]} with values: + *

    *  diagonal[i, j, ..., l, m, n]
-   *    = input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
+   *    = input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
    *      padding_value                 ; otherwise.
-   *  }
- * where `d = k[1] - m`, `y = max(-d, 0) - offset`, and `x = max(d, 0) - offset`. - *

- * `offset` is zero except when the alignment of the diagonal is to the right. - *

{@code
+   *  
+ *

where {@code d = k[1] - m}, {@code y = max(-d, 0) - offset}, and {@code x = max(d, 0) - offset}. + *

{@code offset} is zero except when the alignment of the diagonal is to the right. + *

    *  offset = max_diag_len - diag_len(d) ; if (`align` in {RIGHT_LEFT, RIGHT_RIGHT}
-   *                                             and `d >= 0`) or
+   *                                             and `d >= 0`) or
    *                                           (`align` in {LEFT_RIGHT, RIGHT_RIGHT}
-   *                                             and `d <= 0`)
+   *                                             and `d <= 0`)
    *           0                          ; otherwise
-   *  }
- * where `diag_len(d) = min(cols - max(d, 0), rows + min(d, 0))`. - *

- * The input must be at least a matrix. - *

- * For example: - *

{@code
+   *  
+ *

where {@code diag_len(d) = min(cols - max(d, 0), rows + min(d, 0))}. + *

The input must be at least a matrix. + *

For example: + *

    *  input = np.array([[[1, 2, 3, 4],  # Input shape: (2, 3, 4)
    *                     [5, 6, 7, 8],
    *                     [9, 8, 7, 6]],
@@ -952,17 +919,17 @@ public  MatrixDiagPart matrixDiagPart(Operand input, Oper
    *                     [5, 6, 7, 8]]])
    *
    *  # A main diagonal from each batch.
-   *  tf.matrix_diag_part(input) ==> [[1, 6, 7],  # Output shape: (2, 3)
+   *  tf.matrix_diag_part(input) ==> [[1, 6, 7],  # Output shape: (2, 3)
    *                                  [5, 2, 7]]
    *
    *  # A superdiagonal from each batch.
    *  tf.matrix_diag_part(input, k = 1)
-   *    ==> [[2, 7, 6],  # Output shape: (2, 3)
+   *    ==> [[2, 7, 6],  # Output shape: (2, 3)
    *         [4, 3, 8]]
    *
    *  # A band from each batch.
    *  tf.matrix_diag_part(input, k = (-1, 2))
-   *    ==> [[[0, 3, 8],  # Output shape: (2, 4, 3)
+   *    ==> [[[0, 3, 8],  # Output shape: (2, 4, 3)
    *          [2, 7, 6],
    *          [1, 6, 7],
    *          [5, 8, 0]],
@@ -972,8 +939,8 @@ public  MatrixDiagPart matrixDiagPart(Operand input, Oper
    *          [1, 6, 0]]]
    *
    *  # LEFT_RIGHT alignment.
-   *  tf.matrix_diag_part(input, k = (-1, 2), align="LEFT_RIGHT")
-   *    ==> [[[3, 8, 0],  # Output shape: (2, 4, 3)
+   *  tf.matrix_diag_part(input, k = (-1, 2), align="LEFT_RIGHT")
+   *    ==> [[[3, 8, 0],  # Output shape: (2, 4, 3)
    *          [2, 7, 6],
    *          [1, 6, 7],
    *          [0, 5, 8]],
@@ -984,31 +951,31 @@ public  MatrixDiagPart matrixDiagPart(Operand input, Oper
    *
    *  # max_diag_len can be shorter than the main diagonal.
    *  tf.matrix_diag_part(input, k = (-2, -1))
-   *    ==> [[[5, 8],
+   *    ==> [[[5, 8],
    *          [9, 0]],
    *         [[1, 6],
    *          [5, 0]]]
    *
    *  # padding_value = 9
    *  tf.matrix_diag_part(input, k = (1, 3), padding_value = 9)
-   *    ==> [[[9, 9, 4],  # Output shape: (2, 3, 3)
+   *    ==> [[[9, 9, 4],  # Output shape: (2, 3, 3)
    *          [9, 3, 8],
    *          [2, 7, 6]],
    *         [[9, 9, 2],
    *          [9, 3, 4],
    *          [4, 3, 8]]]
    *
-   *  }
+ *
* - * @param data type for {@code diagonal()} output - * @param input Rank `r` tensor where `r >= 2`. + * @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. `k` can be a single integer + * 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. `k[0]` must not be larger than `k[1]`. + * of a matrix band. {@code k[0]} must not be larger than {@code k[1]}. * @param paddingValue The value to fill the area outside the specified diagonal band with. * Default is 0. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MatrixDiagPartV3} output and operands * @return a new instance of MatrixDiagPartV3 */ public MatrixDiagPartV3 matrixDiagPartV3(Operand input, Operand k, @@ -1018,54 +985,49 @@ public MatrixDiagPartV3 matrixDiagPartV3(Operand input, /** * Returns a batched diagonal tensor with given batched diagonal values. - *

- * Returns a tensor with the contents in `diagonal` as `k[0]`-th to `k[1]`-th - * diagonals of a matrix, with everything else padded with `padding`. `num_rows` - * and `num_cols` specify the dimension of the innermost matrix of the output. If + * Returns a tensor with the contents in {@code diagonal} as {@code k[0]}-th to {@code k[1]}-th + * diagonals of a matrix, with everything else padded with {@code padding}. {@code num_rows} + * and {@code num_cols} specify the dimension of the innermost matrix of the output. If * both are not specified, the op assumes the innermost matrix is square and infers - * its size from `k` and the innermost dimension of `diagonal`. If only one of them + * its size from {@code k} and the innermost dimension of {@code diagonal}. If only one of them * is specified, the op assumes the unspecified value is the smallest possible * based on other criteria. - *

- * Let `diagonal` have `r` dimensions `[I, J, ..., L, M, N]`. The output tensor has - * rank `r+1` with shape `[I, J, ..., L, M, num_rows, num_cols]` when only one - * diagonal is given (`k` is an integer or `k[0] == k[1]`). Otherwise, it has rank - * `r` with shape `[I, J, ..., L, num_rows, num_cols]`. - *

- * The second innermost dimension of `diagonal` has double meaning. - * When `k` is scalar or `k[0] == k[1]`, `M` is part of the batch size + *

Let {@code diagonal} have {@code r} dimensions {@code [I, J, ..., L, M, N]}. The output tensor has + * rank {@code r+1} with shape {@code [I, J, ..., L, M, num_rows, num_cols]} when only one + * diagonal is given ({@code k} is an integer or {@code k[0] == k[1]}). Otherwise, it has rank + * {@code r} with shape {@code [I, J, ..., L, num_rows, num_cols]}. + *

The second innermost dimension of {@code diagonal} has double meaning. + * When {@code k} is scalar or {@code k[0] == k[1]}, {@code M} is part of the batch size * [I, J, ..., M], and the output tensor is: - *

{@code
+   *  
    *  output[i, j, ..., l, m, n]
    *    = diagonal[i, j, ..., l, n-max(d_upper, 0)] ; if n - m == d_upper
    *      padding_value                             ; otherwise
-   *  }
- * Otherwise, `M` is treated as the number of diagonals for the matrix in the - * same batch (`M = k[1]-k[0]+1`), and the output tensor is: - *
{@code
+   *  
+ *

Otherwise, {@code M} is treated as the number of diagonals for the matrix in the + * same batch ({@code M = k[1]-k[0]+1}), and the output tensor is: + *

    *  output[i, j, ..., l, m, n]
-   *    = diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]
+   *    = diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]
    *      padding_value                                     ; otherwise
-   *  }
- * where `d = n - m`, `diag_index = [k] - d`, and - * `index_in_diag = n - max(d, 0) + offset`. - *

- * `offset` is zero except when the alignment of the diagonal is to the right. - *

{@code
+   *  
+ *

where {@code d = n - m}, {@code diag_index = [k] - d}, and + * {@code index_in_diag = n - max(d, 0) + offset}. + *

{@code offset} is zero except when the alignment of the diagonal is to the right. + *

    *  offset = max_diag_len - diag_len(d) ; if (`align` in {RIGHT_LEFT, RIGHT_RIGHT}
-   *                                             and `d >= 0`) or
+   *                                             and `d >= 0`) or
    *                                           (`align` in {LEFT_RIGHT, RIGHT_RIGHT}
-   *                                             and `d <= 0`)
+   *                                             and `d <= 0`)
    *           0                          ; otherwise
-   *  }
- * where `diag_len(d) = min(cols - max(d, 0), rows + min(d, 0))`. - *

- * For example: - *

{@code
+   *  
+ *

where {@code diag_len(d) = min(cols - max(d, 0), rows + min(d, 0))}. + *

For example: + *

    *  # The main diagonal.
    *  diagonal = np.array([[1, 2, 3, 4],            # Input shape: (2, 4)
    *                       [5, 6, 7, 8]])
-   *  tf.matrix_diag(diagonal) ==> [[[1, 0, 0, 0],  # Output shape: (2, 4, 4)
+   *  tf.matrix_diag(diagonal) ==> [[[1, 0, 0, 0],  # Output shape: (2, 4, 4)
    *                                 [0, 2, 0, 0],
    *                                 [0, 0, 3, 0],
    *                                 [0, 0, 0, 4]],
@@ -1078,7 +1040,7 @@ public  MatrixDiagPartV3 matrixDiagPartV3(Operand input,
    *  diagonal = np.array([[1, 2, 3],  # Input shape: (2, 3)
    *                       [4, 5, 6]])
    *  tf.matrix_diag(diagonal, k = 1)
-   *    ==> [[[0, 1, 0, 0],  # Output shape: (2, 4, 4)
+   *    ==> [[[0, 1, 0, 0],  # Output shape: (2, 4, 4)
    *          [0, 0, 2, 0],
    *          [0, 0, 0, 3],
    *          [0, 0, 0, 0]],
@@ -1095,7 +1057,7 @@ public  MatrixDiagPartV3 matrixDiagPartV3(Operand input,
    *                         [6, 7, 9],
    *                         [9, 1, 0]]])
    *  tf.matrix_diag(diagonals, k = (-1, 1))
-   *    ==> [[[1, 8, 0],  # Output shape: (2, 3, 3)
+   *    ==> [[[1, 8, 0],  # Output shape: (2, 3, 3)
    *          [4, 2, 9],
    *          [0, 5, 3]],
    *         [[6, 2, 0],
@@ -1109,8 +1071,8 @@ public  MatrixDiagPartV3 matrixDiagPartV3(Operand input,
    *                        [[2, 3, 0],
    *                         [6, 7, 9],
    *                         [0, 9, 1]]])
-   *  tf.matrix_diag(diagonals, k = (-1, 1), align="LEFT_RIGHT")
-   *    ==> [[[1, 8, 0],  # Output shape: (2, 3, 3)
+   *  tf.matrix_diag(diagonals, k = (-1, 1), align="LEFT_RIGHT")
+   *    ==> [[[1, 8, 0],  # Output shape: (2, 3, 3)
    *          [4, 2, 9],
    *          [0, 5, 3]],
    *         [[6, 2, 0],
@@ -1120,33 +1082,33 @@ public  MatrixDiagPartV3 matrixDiagPartV3(Operand input,
    *  # Rectangular matrix.
    *  diagonal = np.array([1, 2])  # Input shape: (2)
    *  tf.matrix_diag(diagonal, k = -1, num_rows = 3, num_cols = 4)
-   *    ==> [[0, 0, 0, 0],  # Output shape: (3, 4)
+   *    ==> [[0, 0, 0, 0],  # Output shape: (3, 4)
    *         [1, 0, 0, 0],
    *         [0, 2, 0, 0]]
    *
    *  # Rectangular matrix with inferred num_cols and padding_value = 9.
    *  tf.matrix_diag(diagonal, k = -1, num_rows = 3, padding_value = 9)
-   *    ==> [[9, 9],  # Output shape: (3, 2)
+   *    ==> [[9, 9],  # Output shape: (3, 2)
    *         [1, 9],
    *         [9, 2]]
    *
-   *  }
+ *
* - * @param data type for {@code output()} output - * @param diagonal Rank `r`, where `r >= 1` + * @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. `k` can be a single integer + * 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. `k[0]` must not be larger than `k[1]`. + * of a matrix band. {@code k[0]} must not be larger than {@code k[1]}. * @param numRows 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 `diagonal`. + * innermost dimension of {@code diagonal}. * @param numCols 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 `diagonal`. + * k and the innermost dimension of {@code diagonal}. * @param paddingValue The number to fill the area outside the specified diagonal band with. * Default is 0. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MatrixDiagV3} output and operands * @return a new instance of MatrixDiagV3 */ public MatrixDiagV3 matrixDiagV3(Operand diagonal, Operand k, @@ -1155,48 +1117,76 @@ 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 `input` and `diagonal`, this operation returns a tensor with the - * same shape and values as `input`, except for the specified diagonals of the - * innermost matrices. These will be overwritten by the values in `diagonal`. - *

- * `input` has `r+1` dimensions `[I, J, ..., L, M, N]`. When `k` is scalar or - * `k[0] == k[1]`, `diagonal` has `r` dimensions `[I, J, ..., L, max_diag_len]`. - * Otherwise, it has `r+1` dimensions `[I, J, ..., L, num_diags, max_diag_len]`. - * `num_diags` is the number of diagonals, `num_diags = k[1] - k[0] + 1`. - * `max_diag_len` is the longest diagonal in the range `[k[0], k[1]]`, - * `max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0))` - *

- * The output is a tensor of rank `k+1` with dimensions `[I, J, ..., L, M, N]`. - * If `k` is scalar or `k[0] == k[1]`: - *

{@code
+   *  Given {@code input} and {@code diagonal}, this operation returns a tensor with the
+   *  same shape and values as {@code input}, except for the specified diagonals of the
+   *  innermost matrices. These will be overwritten by the values in {@code diagonal}.
+   *  

{@code input} has {@code r+1} dimensions {@code [I, J, ..., L, M, N]}. When {@code k} is scalar or + * {@code k[0] == k[1]}, {@code diagonal} has {@code r} dimensions {@code [I, J, ..., L, max_diag_len]}. + * Otherwise, it has {@code r+1} dimensions {@code [I, J, ..., L, num_diags, max_diag_len]}. + * {@code num_diags} is the number of diagonals, {@code num_diags = k[1] - k[0] + 1}. + * {@code max_diag_len} is the longest diagonal in the range {@code [k[0], k[1]]}, + * {@code max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0))} + *

The output is a tensor of rank {@code k+1} with dimensions {@code [I, J, ..., L, M, N]}. + * If {@code k} is scalar or {@code k[0] == k[1]}: + *

    *  output[i, j, ..., l, m, n]
    *    = diagonal[i, j, ..., l, n-max(k[1], 0)] ; if n - m == k[1]
    *      input[i, j, ..., l, m, n]              ; otherwise
-   *  }
- * Otherwise, - *
{@code
+   *  
+ *

Otherwise, + *

    *  output[i, j, ..., l, m, n]
-   *    = diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]
+   *    = diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]
    *      input[i, j, ..., l, m, n]                         ; otherwise
-   *  }
- * where `d = n - m`, `diag_index = k[1] - d`, and - * `index_in_diag = n - max(d, 0) + offset`. - *

- * `offset` is zero except when the alignment of the diagonal is to the right. - *

{@code
+   *  
+ *

where {@code d = n - m}, {@code diag_index = k[1] - d}, and + * {@code index_in_diag = n - max(d, 0) + offset}. + *

{@code offset} is zero except when the alignment of the diagonal is to the right. + *

    *  offset = max_diag_len - diag_len(d) ; if (`align` in {RIGHT_LEFT, RIGHT_RIGHT}
-   *                                             and `d >= 0`) or
+   *                                             and `d >= 0`) or
    *                                           (`align` in {LEFT_RIGHT, RIGHT_RIGHT}
-   *                                             and `d <= 0`)
+   *                                             and `d <= 0`)
    *           0                          ; otherwise
-   *  }
- * where `diag_len(d) = min(cols - max(d, 0), rows + min(d, 0))`. - *

- * For example: - *

{@code
+   *  
+ *

where {@code diag_len(d) = min(cols - max(d, 0), rows + min(d, 0))}. + *

For example: + *

    *  # The main diagonal.
    *  input = np.array([[[7, 7, 7, 7],              # Input shape: (2, 3, 4)
    *                     [7, 7, 7, 7],
@@ -1207,7 +1197,7 @@ public  MatrixDiagV3 matrixDiagV3(Operand diagonal, Opera
    *  diagonal = np.array([[1, 2, 3],               # Diagonal shape: (2, 3)
    *                       [4, 5, 6]])
    *  tf.matrix_set_diag(input, diagonal)
-   *    ==> [[[1, 7, 7, 7],  # Output shape: (2, 3, 4)
+   *    ==> [[[1, 7, 7, 7],  # Output shape: (2, 3, 4)
    *          [7, 2, 7, 7],
    *          [7, 7, 3, 7]],
    *         [[4, 7, 7, 7],
@@ -1216,7 +1206,7 @@ public  MatrixDiagV3 matrixDiagV3(Operand diagonal, Opera
    *
    *  # A superdiagonal (per batch).
    *  tf.matrix_set_diag(input, diagonal, k = 1)
-   *    ==> [[[7, 1, 7, 7],  # Output shape: (2, 3, 4)
+   *    ==> [[[7, 1, 7, 7],  # Output shape: (2, 3, 4)
    *          [7, 7, 2, 7],
    *          [7, 7, 7, 3]],
    *         [[7, 4, 7, 7],
@@ -1233,7 +1223,7 @@ public  MatrixDiagV3 matrixDiagV3(Operand diagonal, Opera
    *                         [6, 1, 2],
    *                         [3, 4, 0]]])
    *  tf.matrix_set_diag(input, diagonals, k = (-1, 2))
-   *    ==> [[[1, 6, 9, 7],  # Output shape: (2, 3, 4)
+   *    ==> [[[1, 6, 9, 7],  # Output shape: (2, 3, 4)
    *          [4, 2, 5, 1],
    *          [7, 5, 3, 8]],
    *         [[6, 5, 1, 7],
@@ -1249,25 +1239,25 @@ public  MatrixDiagV3 matrixDiagV3(Operand diagonal, Opera
    *                         [5, 6, 4],
    *                         [6, 1, 2],
    *                         [0, 3, 4]]])
-   *  tf.matrix_set_diag(input, diagonals, k = (-1, 2), align="LEFT_RIGHT")
-   *    ==> [[[1, 6, 9, 7],  # Output shape: (2, 3, 4)
+   *  tf.matrix_set_diag(input, diagonals, k = (-1, 2), align="LEFT_RIGHT")
+   *    ==> [[[1, 6, 9, 7],  # Output shape: (2, 3, 4)
    *          [4, 2, 5, 1],
    *          [7, 5, 3, 8]],
    *         [[6, 5, 1, 7],
    *          [3, 1, 6, 2],
    *          [7, 4, 2, 4]]]
    *
-   *  }
+ *
* - * @param data type for {@code output()} output - * @param input Rank `r+1`, where `r >= 1`. - * @param diagonal Rank `r` when `k` is an integer or `k[0] == k[1]`. Otherwise, it has rank `r+1`. - * `k >= 1`. + * @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}. * @param k Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main - * diagonal, and negative value means subdiagonals. `k` can be a single integer + * 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. `k[0]` must not be larger than `k[1]`. - * @param options carries optional attributes values + * of a matrix band. {@code k[0]} must not be larger than {@code k[1]}. + * @param options carries optional attribute values + * @param data type for {@code MatrixSetDiagV3} output and operands * @return a new instance of MatrixSetDiag */ public MatrixSetDiag matrixSetDiag(Operand input, Operand diagonal, @@ -1277,50 +1267,45 @@ public MatrixSetDiag matrixSetDiag(Operand input, Operan /** * Solves one or more linear least-squares problems. - *

- * `matrix` is a tensor of shape `[..., M, N]` whose inner-most 2 dimensions - * form real or complex matrices of size `[M, N]`. `Rhs` is a tensor of the same - * type as `matrix` and shape `[..., M, K]`. - * The output is a tensor shape `[..., N, K]` where each output matrix solves + * {@code matrix} is a tensor of shape {@code [..., M, N]} whose inner-most 2 dimensions + * form real or complex matrices of size {@code [M, N]}. {@code Rhs} is a tensor of the same + * type as {@code matrix} and shape {@code [..., M, K]}. + * The output is a tensor shape {@code [..., N, K]} where each output matrix solves * each of the equations - * `matrix[..., :, :]` * `output[..., :, :]` = `rhs[..., :, :]` + * {@code matrix[..., :, :]} * {@code output[..., :, :]} = {@code rhs[..., :, :]} * in the least squares sense. - *

- * We use the following notation for (complex) matrix and right-hand sides + *

We use the following notation for (complex) matrix and right-hand sides * in the batch: - *

- * `matrix`=\\(A \in \mathbb{C}^{m \times n}\\), - * `rhs`=\\(B \in \mathbb{C}^{m \times k}\\), - * `output`=\\(X \in \mathbb{C}^{n \times k}\\), - * `l2_regularizer`=\\(\lambda \in \mathbb{R}\\). - *

- * If `fast` is `True`, then the solution is computed by solving the normal - * equations using Cholesky decomposition. Specifically, if \\(m \ge n\\) then - * \\(X = (A^H A + \lambda I)^{-1} A^H B\\), which solves the least-squares - * problem \\(X = \mathrm{argmin}_{Z \in \Re^{n \times k} } ||A Z - B||_F^2 + \lambda ||Z||_F^2\\). - * If \\(m \lt n\\) then `output` is computed as - * \\(X = A^H (A A^H + \lambda I)^{-1} B\\), which (for \\(\lambda = 0\\)) is the + *

{@code matrix}=\(A \in \mathbb{C}^{m \times n}\), + * {@code rhs}=\(B \in \mathbb{C}^{m \times k}\), + * {@code output}=\(X \in \mathbb{C}^{n \times k}\), + * {@code l2_regularizer}=\(\lambda \in \mathbb{R}\). + *

If {@code fast} is {@code True}, then the solution is computed by solving the normal + * equations using Cholesky decomposition. Specifically, if \(m \ge n\) then + * \(X = (A^H A + \lambda I)^{-1} A^H B\), which solves the least-squares + * problem \(X = \mathrm{argmin}_{Z \in \Re^{n \times k} } ||A Z - B||_F^2 + \lambda ||Z||F^2\). + * If \(m \lt n\) then {@code output} is computed as + * \(X = A^H (A A^H + \lambda I)^{-1} B\), which (for \(\lambda = 0\)) is the * minimum-norm solution to the under-determined linear system, i.e. - * \\(X = \mathrm{argmin}_{Z \in \mathbb{C}^{n \times k} } ||Z||_F^2 \\), - * subject to \\(A Z = B\\). Notice that the fast path is only numerically stable - * when \\(A\\) is numerically full rank and has a condition number - * \\(\mathrm{cond}(A) \lt \frac{1}{\sqrt{\epsilon_{mach} } }\\) or \\(\lambda\\) is + * \(X = \mathrm{argmin}{Z \in \mathbb{C}^{n \times k} } ||Z||F^2 \), + * subject to \(A Z = B\). Notice that the fast path is only numerically stable + * when \(A\) is numerically full rank and has a condition number + * \(\mathrm{cond}(A) \lt \frac{1}{\sqrt{\epsilon{mach} } }\) or \(\lambda\) is * sufficiently large. - *

- * If `fast` is `False` an algorithm based on the numerically robust complete + *

If {@code fast} is {@code False} an algorithm based on the numerically robust complete * orthogonal decomposition is used. This computes the minimum-norm - * least-squares solution, even when \\(A\\) is rank deficient. This path is - * typically 6-7 times slower than the fast path. If `fast` is `False` then - * `l2_regularizer` is ignored. + * 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 - * @param matrix Shape is `[..., M, N]`. - * @param rhs Shape is `[..., M, K]`. + * @param matrix Shape is {@code [..., M, N]}. + * @param rhs Shape is {@code [..., M, K]}. * @param l2Regularizer Scalar tensor. - *

- * @compatibility(numpy) Equivalent to np.linalg.lstsq - * @end_compatibility - * @param options carries optional attributes values + *

{@literal @}compatibility(numpy)
+ * Equivalent to np.linalg.lstsq + *
{@literal @}end_compatibility + * @param options carries optional attribute values + * @param data type for {@code MatrixSolveLs} output and operands * @return a new instance of MatrixSolveLs */ public MatrixSolveLs matrixSolveLs(Operand matrix, Operand rhs, @@ -1330,25 +1315,23 @@ public MatrixSolveLs matrixSolveLs(Operand matrix, Opera /** * Computes the QR decompositions of one or more matrices. - *

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

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

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

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

    *  # a is a tensor.
    *  # q is a tensor of orthonormal matrices.
    *  # r is a tensor of upper triangular matrices.
    *  q, r = qr(a)
    *  q_full, r_full = qr(a, full_matrices=True)
-   *  }
+ *
* - * @param data type for {@code q()} output - * @param input A tensor of shape `[..., M, N]` whose inner-most 2 dimensions - * form matrices of size `[M, N]`. Let `P` be the minimum of `M` and `N`. - * @param options carries optional attributes values + * @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 + * @param data type for {@code Qr} output and operands * @return a new instance of Qr */ public Qr qr(Operand input, Qr.Options... options) { @@ -1356,50 +1339,143 @@ public Qr qr(Operand input, Qr.Options... options) { } /** - * Perform a quantized matrix multiplication of `a` by the matrix `b`. - *

+ * Perform a quantized matrix multiplication of {@code a} by the matrix {@code b}. * The inputs must be two-dimensional matrices and the inner dimension of - * `a` (after being transposed if `transpose_a` is non-zero) must match the - * outer dimension of `b` (after being transposed if `transposed_b` is + * {@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 * @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 `a` value represents. - * @param maxA The float value that the highest quantized `a` value represents. - * @param minB The float value that the lowest quantized `b` value represents. - * @param maxB The float value that the highest quantized `b` value represents. - * @param Toutput + * @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 Tactivation The type of output produced by activation function * following this operation. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code QuantizedMatMul} output and operands + * @param data type for {@code QuantizedMatMul} output and operands * @return a new instance of QuantizedMatMul */ - public QuantizedMatMul quantizedMatMul( - Operand a, Operand b, Operand minA, + public QuantizedMatMul quantizedMatMul( + Operand a, Operand b, Operand minA, Operand maxA, Operand minB, Operand maxB, Class Toutput, Class Tactivation, QuantizedMatMul.Options... options) { 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 - * `input` such that `input[..., :, :] = v[..., :, :] * diag(e[..., :])`. The eigenvalues + * {@code input} such that {@code input[..., :, :] = v[..., :, :] * diag(e[..., :])}. The eigenvalues * are sorted in non-decreasing order. - *

{@code
+   *  
    *  # a is a tensor.
    *  # e is a tensor of eigenvalues.
    *  # v is a tensor of eigenvectors.
    *  e, v = self_adjoint_eig(a)
    *  e = self_adjoint_eig(a, compute_v=False)
-   *  }
+ *
* - * @param data type for {@code e()} output - * @param input `Tensor` input of shape `[N, N]`. - * @param options carries optional attributes values + * @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 * @return a new instance of SelfAdjointEig */ public SelfAdjointEig selfAdjointEig(Operand input, @@ -1409,18 +1485,17 @@ public SelfAdjointEig selfAdjointEig(Operand input, /** * Solves systems of linear equations. - *

- * `Matrix` is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions - * form square matrices. `Rhs` is a tensor of shape `[..., M, K]`. The `output` is - * a tensor shape `[..., M, K]`. If `adjoint` is `False` then each output matrix - * satisfies `matrix[..., :, :] * output[..., :, :] = rhs[..., :, :]`. - * If `adjoint` is `True` then each output matrix satisfies - * `adjoint(matrix[..., :, :]) * output[..., :, :] = rhs[..., :, :]`. - * - * @param data type for {@code output()} output - * @param matrix Shape is `[..., M, M]`. - * @param rhs Shape is `[..., M, K]`. - * @param options carries optional attributes values + * {@code Matrix} is a tensor of shape {@code [..., M, M]} whose inner-most 2 dimensions + * form square matrices. {@code Rhs} is a tensor of shape {@code [..., M, K]}. The {@code output} is + * a tensor shape {@code [..., M, K]}. If {@code adjoint} is {@code False} then each output matrix + * satisfies {@code matrix[..., :, :] * output[..., :, :] = rhs[..., :, :]}. + * If {@code adjoint} is {@code True} then each output matrix satisfies + * {@code adjoint(matrix[..., :, :]) * output[..., :, :] = rhs[..., :, :]}. + * + * @param matrix Shape is {@code [..., M, M]}. + * @param rhs Shape is {@code [..., M, K]}. + * @param options carries optional attribute values + * @param data type for {@code MatrixSolve} output and operands * @return a new instance of Solve */ public Solve solve(Operand matrix, Operand rhs, @@ -1430,25 +1505,21 @@ public Solve solve(Operand matrix, Operand rhs, /** * Computes the matrix square root of one or more square matrices: - *

* matmul(sqrtm(A), sqrtm(A)) = A - *

- * The input matrix should be invertible. If the input matrix is real, it should + *

The input matrix should be invertible. If the input matrix is real, it should * have no eigenvalues which are real and negative (pairs of complex conjugate * eigenvalues are allowed). - *

- * The matrix square root is computed by first reducing the matrix to + *

The matrix square root is computed by first reducing the matrix to * quasi-triangular form with the real Schur decomposition. The square root * of the quasi-triangular matrix is then computed directly. Details of - * the algorithm can be found in: Nicholas J. Higham, "Computing real - * square roots of a real matrix", Linear Algebra Appl., 1987. - *

- * The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions + * the algorithm can be found in: Nicholas J. Higham, "Computing real + * square roots of a real matrix", Linear Algebra Appl., 1987. + *

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 `[..., :, :]`. + * containing the matrix square root for all input submatrices {@code [..., :, :]}. * - * @param data type for {@code output()} output - * @param input Shape is `[..., M, M]`. + * @param input Shape is {@code [..., M, M]}. + * @param data type for {@code MatrixSquareRoot} output and operands * @return a new instance of Sqrtm */ public Sqrtm sqrtm(Operand input) { @@ -1457,22 +1528,21 @@ public Sqrtm sqrtm(Operand input) { /** * Computes the singular value decompositions of one or more matrices. - *

- * Computes the SVD of each inner matrix in `input` such that - * `input[..., :, :] = u[..., :, :] * diag(s[..., :, :]) * transpose(v[..., :, :])` - *

{@code
+   *  Computes the SVD of each inner matrix in {@code input} such that
+   *  {@code input[..., :, :] = u[..., :, :] * diag(s[..., :, :]) * transpose(v[..., :, :])}
+   *  
    *  # a is a tensor containing a batch of matrices.
    *  # s is a tensor of singular values for each matrix.
    *  # u is the tensor containing the left singular vectors for each matrix.
    *  # v is the tensor containing the right singular vectors for each matrix.
    *  s, u, v = svd(a)
    *  s, _, _ = svd(a, compute_uv=False)
-   *  }
+ *
* - * @param data type for {@code s()} output - * @param input A tensor of shape `[..., M, N]` whose inner-most 2 dimensions - * form matrices of size `[M, N]`. Let `P` be the minimum of `M` and `N`. - * @param options carries optional attributes values + * @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 + * @param data type for {@code Svd} output and operands * @return a new instance of Svd */ public Svd svd(Operand input, Svd.Options... options) { @@ -1481,26 +1551,22 @@ public Svd svd(Operand input, Svd.Options... options) { /** * Returns a diagonal tensor with a given diagonal values. - *

- * Given a `diagonal`, this operation returns a tensor with the `diagonal` and + * Given a {@code diagonal}, this operation returns a tensor with the {@code diagonal} and * everything else padded with zeros. The diagonal is computed as follows: - *

- * Assume `diagonal` has dimensions [D1,..., Dk], then the output is a tensor of + *

Assume {@code diagonal} has dimensions [D1,..., Dk], then the output is a tensor of * rank 2k with dimensions [D1,..., Dk, D1,..., Dk] where: - *

- * `output[i1,..., ik, i1,..., ik] = diagonal[i1, ..., ik]` and 0 everywhere else. - *

- * For example: - *

{@code
+   *  

{@code output[i1,..., ik, i1,..., ik] = diagonal[i1, ..., ik]} and 0 everywhere else. + *

For example: + *

    *  # 'diagonal' is [1, 2, 3, 4]
-   *  tf.diag(diagonal) ==> [[1, 0, 0, 0]
+   *  tf.diag(diagonal) ==> [[1, 0, 0, 0]
    *                         [0, 2, 0, 0]
    *                         [0, 0, 3, 0]
    *                         [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 */ public TensorDiag tensorDiag(Operand diagonal) { @@ -1509,27 +1575,23 @@ public TensorDiag tensorDiag(Operand diagonal) { /** * Returns the diagonal part of the tensor. - *

- * This operation returns a tensor with the `diagonal` part - * of the `input`. The `diagonal` part is computed as follows: - *

- * Assume `input` has dimensions `[D1,..., Dk, D1,..., Dk]`, then the output is a - * tensor of rank `k` with dimensions `[D1,..., Dk]` where: - *

- * `diagonal[i1,..., ik] = input[i1, ..., ik, i1,..., ik]`. - *

- * For example: - *

{@code
+   *  This operation returns a tensor with the {@code diagonal} part
+   *  of the {@code input}. The {@code diagonal} part is computed as follows:
+   *  

Assume {@code input} has dimensions {@code [D1,..., Dk, D1,..., Dk]}, then the output is a + * tensor of rank {@code k} with dimensions {@code [D1,..., Dk]} where: + *

{@code diagonal[i1,..., ik] = input[i1, ..., ik, i1,..., ik]}. + *

For example: + *

    *  # 'input' is [[1, 0, 0, 0]
    *                [0, 2, 0, 0]
    *                [0, 0, 3, 0]
    *                [0, 0, 0, 4]]
    *
-   *  tf.diag_part(input) ==> [1, 2, 3, 4]
-   *  }
+ * 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 */ public TensorDiagPart tensorDiagPart(Operand input) { @@ -1538,13 +1600,12 @@ public TensorDiagPart tensorDiagPart(Operand input) { /** * Shuffle dimensions of x according to a permutation. - *

- * The output `y` has the same rank as `x`. The shapes of `x` and `y` satisfy: - * `y.shape[i] == x.shape[perm[i]] for i in [0, 1, ..., rank(x) - 1]` + * 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 - * @param perm + * @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 */ public Transpose transpose(Operand x, Operand perm) { @@ -1553,26 +1614,22 @@ public Transpose transpose(Operand x, Operand - * - * `matrix` is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions form - * square matrices. If `lower` is `True` then the strictly upper triangular part + * {@code matrix} is a tensor of shape {@code [..., M, M]} whose inner-most 2 dimensions form + * square matrices. If {@code lower} is {@code True} then the strictly upper triangular part * of each inner-most matrix is assumed to be zero and not accessed. - * If `lower` is False then the strictly lower triangular part of each inner-most + * If {@code lower} is False then the strictly lower triangular part of each inner-most * matrix is assumed to be zero and not accessed. - * `rhs` is a tensor of shape `[..., M, N]`. - *

- * The output is a tensor of shape `[..., M, N]`. If `adjoint` is - * `True` then the innermost matrices in `output` satisfy matrix equations - * `matrix[..., :, :] * output[..., :, :] = rhs[..., :, :]`. - * If `adjoint` is `False` then the strictly then the innermost matrices in - * `output` satisfy matrix equations - * `adjoint(matrix[..., i, k]) * output[..., k, j] = rhs[..., i, j]`. - *

- * Note, the batch shapes for the inputs only need to broadcast. - *

- * Example: - *

{@code
+   *  {@code rhs} is a tensor of shape {@code [..., M, N]}.
+   *  

The output is a tensor of shape {@code [..., M, N]}. If {@code adjoint} is + * {@code True} then the innermost matrices in {@code output} satisfy matrix equations + * {@code matrix[..., :, :] * output[..., :, :] = rhs[..., :, :]}. + * If {@code adjoint} is {@code False} then the strictly then the innermost matrices in + * {@code output} satisfy matrix equations + * {@code adjoint(matrix[..., i, k]) * output[..., k, j] = rhs[..., i, j]}. + *

Note, the batch shapes for the inputs only need to broadcast. + *

Example: + *

+   *
    *  a = tf.constant([[3,  0,  0,  0],
    *                   [2,  1,  0,  0],
    *                   [1,  0,  1,  0],
@@ -1585,25 +1642,25 @@ public  Transpose transpose(Operand x, Operand
+   *  #        [-1.3333331 ]], dtype=float32)>
    *
    *  # in python3 one can use `a@x`
    *  tf.matmul(a, x)
-   *  # 
-   *  }
+ * # [1.9999999]], dtype=float32)> + *
* - * @param data type for {@code output()} output - * @param matrix Shape is `[..., M, M]`. - * @param rhs Shape is `[..., M, K]`. - * @param options carries optional attributes values + * @param matrix Shape is {@code [..., M, M]}. + * @param rhs Shape is {@code [..., M, K]}. + * @param options carries optional attribute values + * @param data type for {@code MatrixTriangularSolve} output and operands * @return a new instance of TriangularSolve */ public TriangularSolve triangularSolve(Operand matrix, Operand rhs, @@ -1611,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 a70e6d72717..9b67c49c2d4 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,16 +34,20 @@ 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; -import org.tensorflow.op.math.CompareAndBitpack; import org.tensorflow.op.math.ComplexAbs; import org.tensorflow.op.math.Conj; import org.tensorflow.op.math.Cos; 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; @@ -60,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; @@ -92,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; @@ -132,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; @@ -142,17 +159,17 @@ public final class MathOps { MathOps(Ops ops) { this.scope = ops.scope(); this.ops = ops; + special = new MathSpecialOps(ops); } /** * Computes the absolute value of a tensor. - *

- * Given a tensor `x`, this operation returns a tensor containing the absolute - * value of each element in `x`. For example, if x is an input element and y is - * an output element, this operation computes \\(y = |x|\\). + * 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 - * @param x + * @param x The x value + * @param data type for {@code Abs} output and operands * @return a new instance of Abs */ public Abs abs(Operand x) { @@ -161,19 +178,16 @@ public Abs abs(Operand x) { /** * Returns the element-wise sum of a list of tensors. - *

- * `tf.accumulate_n_v2` performs the same operation as `tf.add_n`, but does not + * {@code tf.accumulate_n_v2} performs the same operation as {@code tf.add_n}, but does not * wait for all of its inputs to be ready before beginning to sum. This can * save memory if inputs are ready at different times, since minimum temporary * storage is proportional to the output size rather than the inputs size. - *

- * Unlike the original `accumulate_n`, `accumulate_n_v2` is differentiable. - *

- * Returns a `Tensor` of same shape and type as the elements of `inputs`. - * - * @param data type for {@code sum()} output - * @param inputs A list of `Tensor` objects, each with same shape and type. - * @param shape Shape of elements of `inputs`. + *

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 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 * @return a new instance of AccumulateN */ public AccumulateN accumulateN(Iterable> inputs, Shape shape) { @@ -182,14 +196,11 @@ public AccumulateN accumulateN(Iterable> inputs, /** * Computes acos of x element-wise. - *

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

- * Input range is `[-1, 1]` and the output has a range of `[0, pi]`. + * 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 + * @param x The x value + * @param data type for {@code Acos} output and operands * @return a new instance of Acos */ public Acos acos(Operand x) { @@ -198,16 +209,15 @@ public Acos acos(Operand x) { /** * Computes inverse hyperbolic cosine of x element-wise. - *

* Given an input tensor, the function computes inverse hyperbolic cosine of every element. - * Input range is `[1, inf]`. It returns `nan` if the input lies outside the range. - *

{@code
-   *  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 - * @param x + * Input range is {@code [1, inf]}. It returns {@code nan} if the input lies outside the range. + *
+   *  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 x The x value + * @param data type for {@code Acosh} output and operands * @return a new instance of Acosh */ public Acosh acosh(Operand x) { @@ -216,17 +226,14 @@ public Acosh acosh(Operand x) { /** * Returns x + y element-wise. - *

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

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

- * Both input and output have a range `(-inf, inf)`. - * - * @param data type for {@code z()} output - * @param x - * @param y + * NOTE: {@code math.Add} supports broadcasting. {@code AddN} does not. More about broadcasting + * 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 x The x value + * @param y The y value + * @param data type for {@code Add} output and operands * @return a new instance of Add */ public Add add(Operand x, Operand y) { @@ -235,16 +242,14 @@ public Add add(Operand x, Operand y) { /** * Add all input tensors element wise. - *

- * Inputs must be of same size and shape. - *

- *

{@code
-   *    x = [9, 7, 10]
-   *    tf.math.add_n(x) ==> 26
-   *    }
- * - * @param data type for {@code sum()} output - * @param inputs + * Inputs must be of same size and shape. + *
+   *  x = [9, 7, 10]
+   *  tf.math.add_n(x) ==> 26
+   *  
+ * + * @param inputs The inputs value + * @param data type for {@code AddN} output and operands * @return a new instance of AddN */ public AddN addN(Iterable> inputs) { @@ -253,25 +258,22 @@ public AddN addN(Iterable> inputs) { /** * Returns the argument of a complex number. - *

- * Given a tensor `input` of complex numbers, this operation returns a tensor of - * type `float` that is the argument of each element in `input`. All elements in - * `input` must be complex numbers of the form \\(a + bj\\), where a - * is the real part and b is the imaginary part. - *

- * The argument returned by this operation is of the form \\(atan2(b, a)\\). - *

- * For example: - *

{@code
+   *  Given a tensor {@code input} of complex numbers, this operation returns a tensor of
+   *  type {@code float} that is the argument of each element in {@code input}. All elements in
+   *  {@code input} must be complex numbers of the form \(a + bj\), where a
+   *  is the real part and b is the imaginary part.
+   *  

The argument returned by this operation is of the form \(atan2(b, a)\). + *

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 * - * @compatibility(numpy) Equivalent to np.angle. - * @end_compatibility - * @param data type for {@code output()} output - * @param input - * @return a new instance of Angle + * @param input The input value + * @return a new instance of Angle, with default output types */ public Angle angle(Operand input) { return Angle.create(scope, input); @@ -279,25 +281,23 @@ public Angle angle(Operand input) { /** * Returns the argument of a complex number. - *

- * Given a tensor `input` of complex numbers, this operation returns a tensor of - * type `float` that is the argument of each element in `input`. All elements in - * `input` must be complex numbers of the form \\(a + bj\\), where a - * is the real part and b is the imaginary part. - *

- * The argument returned by this operation is of the form \\(atan2(b, a)\\). - *

- * For example: - *

{@code
+   *  Given a tensor {@code input} of complex numbers, this operation returns a tensor of
+   *  type {@code float} that is the argument of each element in {@code input}. All elements in
+   *  {@code input} must be complex numbers of the form \(a + bj\), where a
+   *  is the real part and b is the imaginary part.
+   *  

The argument returned by this operation is of the form \(atan2(b, a)\). + *

For example: + *

    *  # tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j]
-   *  tf.angle(input) ==> [2.0132, 1.056]
-   *  }
- * - * @compatibility(numpy) Equivalent to np.angle. - * @end_compatibility - * @param data type for {@code output()} output - * @param input - * @param Tout + * tf.math.angle(input) ==> [2.0132, 1.056] + *
+ *

{@literal @}compatibility(numpy)
+ * Equivalent to np.angle. + *
{@literal @}end_compatibility + * + * @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 */ public Angle angle(Operand input, Class Tout) { @@ -305,11 +305,12 @@ public Angle angle(Operand input, Class< } /** - * Returns the truth value of abs(x-y) < tolerance element-wise. + * Returns the truth value of abs(x-y) < tolerance element-wise. * - * @param x - * @param y - * @param options carries optional attributes values + * @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 */ public ApproximateEqual approximateEqual(Operand x, Operand y, @@ -319,25 +320,22 @@ public ApproximateEqual approximateEqual(Operand x, Operand /** * Returns the index with the largest value across dimensions of a tensor. - *

* Note that in case of ties the identity of the return value is not guaranteed. - *

- * Usage: - *

{@code
-   *    import tensorflow as tf
-   *    a = [1, 10, 26.9, 2.8, 166.32, 62.3]
-   *    b = tf.math.argmax(input = a)
-   *    c = tf.keras.backend.eval(b)
-   *    # c = 4
-   *    # here a[4] = 166.32 which is the largest element of a across axis 0
-   *    }
- * - * @param data type for {@code output()} output - * @param input - * @param dimension int32 or int64, must be in the range `[-rank(input), rank(input))`. + *

Usage: + *

+   *  import tensorflow as tf
+   *  a = [1, 10, 26.9, 2.8, 166.32, 62.3]
+   *  b = tf.math.argmax(input = a)
+   *  c = tf.keras.backend.eval(b)
+   *  # c = 4
+   *  # here a[4] = 166.32 which is the largest element of a across axis 0
+   *  
+ * + * @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 + * @return a new instance of ArgMax, with default output types */ public ArgMax argMax(Operand input, Operand dimension) { @@ -346,25 +344,23 @@ public ArgMax argMax(Operand input, /** * Returns the index with the largest value across dimensions of a tensor. - *

* Note that in case of ties the identity of the return value is not guaranteed. - *

- * Usage: - *

{@code
-   *    import tensorflow as tf
-   *    a = [1, 10, 26.9, 2.8, 166.32, 62.3]
-   *    b = tf.math.argmax(input = a)
-   *    c = tf.keras.backend.eval(b)
-   *    # c = 4
-   *    # here a[4] = 166.32 which is the largest element of a across axis 0
-   *    }
- * - * @param data type for {@code output()} output - * @param input - * @param dimension int32 or int64, must be in the range `[-rank(input), rank(input))`. + *

Usage: + *

+   *  import tensorflow as tf
+   *  a = [1, 10, 26.9, 2.8, 166.32, 62.3]
+   *  b = tf.math.argmax(input = a)
+   *  c = tf.keras.backend.eval(b)
+   *  # c = 4
+   *  # here a[4] = 166.32 which is the largest element of a across axis 0
+   *  
+ * + * @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 + * @param outputType The value of the outputType attribute + * @param data type for {@code ArgMax} output and operands * @return a new instance of ArgMax */ public ArgMax argMax(Operand input, @@ -374,25 +370,22 @@ public ArgMax argMax(Operand input, /** * Returns the index with the smallest value across dimensions of a tensor. - *

* Note that in case of ties the identity of the return value is not guaranteed. - *

- * Usage: - *

{@code
-   *    import tensorflow as tf
-   *    a = [1, 10, 26.9, 2.8, 166.32, 62.3]
-   *    b = tf.math.argmin(input = a)
-   *    c = tf.keras.backend.eval(b)
-   *    # c = 0
-   *    # here a[0] = 1 which is the smallest element of a across axis 0
-   *    }
- * - * @param data type for {@code output()} output - * @param input - * @param dimension int32 or int64, must be in the range `[-rank(input), rank(input))`. + *

Usage: + *

+   *  import tensorflow as tf
+   *  a = [1, 10, 26.9, 2.8, 166.32, 62.3]
+   *  b = tf.math.argmin(input = a)
+   *  c = tf.keras.backend.eval(b)
+   *  # c = 0
+   *  # here a[0] = 1 which is the smallest element of a across axis 0
+   *  
+ * + * @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. - * @return a new instance of ArgMin + * @return a new instance of ArgMin, with default output types */ public ArgMin argMin(Operand input, Operand dimension) { @@ -401,25 +394,23 @@ public ArgMin argMin(Operand input, /** * Returns the index with the smallest value across dimensions of a tensor. - *

* Note that in case of ties the identity of the return value is not guaranteed. - *

- * Usage: - *

{@code
-   *    import tensorflow as tf
-   *    a = [1, 10, 26.9, 2.8, 166.32, 62.3]
-   *    b = tf.math.argmin(input = a)
-   *    c = tf.keras.backend.eval(b)
-   *    # c = 0
-   *    # here a[0] = 1 which is the smallest element of a across axis 0
-   *    }
- * - * @param data type for {@code output()} output - * @param input - * @param dimension int32 or int64, must be in the range `[-rank(input), rank(input))`. + *

Usage: + *

+   *  import tensorflow as tf
+   *  a = [1, 10, 26.9, 2.8, 166.32, 62.3]
+   *  b = tf.math.argmin(input = a)
+   *  c = tf.keras.backend.eval(b)
+   *  # c = 0
+   *  # here a[0] = 1 which is the smallest element of a across axis 0
+   *  
+ * + * @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 + * @param outputType The value of the outputType attribute + * @param data type for {@code ArgMin} output and operands * @return a new instance of ArgMin */ public ArgMin argMin(Operand input, @@ -429,24 +420,21 @@ public ArgMin argMin(Operand input, /** * Computes the trignometric inverse sine of x element-wise. - *

- * The `tf.math.asin` operation returns the inverse of `tf.math.sin`, such that - * if `y = tf.math.sin(x)` then, `x = tf.math.asin(y)`. - *

- * Note: The output of `tf.math.asin` will lie within the invertible range + * The {@code tf.math.asin} operation returns the inverse of {@code tf.math.sin}, such that + * if {@code y = tf.math.sin(x)} then, {@code x = tf.math.asin(y)}. + *

Note: The output of {@code tf.math.asin} will lie within the invertible range * of sine, i.e [-pi/2, pi/2]. - *

- * For example: - *

{@code
+   *  

For example: + *

    *  # Note: [1.047, 0.785] ~= [(pi/3), (pi/4)]
    *  x = tf.constant([1.047, 0.785])
    *  y = tf.math.sin(x) # [0.8659266, 0.7068252]
    *
    *  tf.math.asin(y) # [1.047, 0.785] = x
-   *  }
+ *
* - * @param data type for {@code y()} output - * @param x + * @param x The x value + * @param data type for {@code Asin} output and operands * @return a new instance of Asin */ public Asin asin(Operand x) { @@ -455,18 +443,16 @@ public Asin asin(Operand x) { /** * Computes inverse hyperbolic sine of x element-wise. - *

- * Given an input tensor, this function computes inverse hyperbolic sine - * for every element in the tensor. Both input and output has a range of - * `[-inf, inf]`. - *

- *

{@code
-   *    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 - * @param x + * Given an input tensor, this function computes inverse hyperbolic sine + * for every element in the tensor. Both input and output has a range of + * {@code [-inf, inf]}. + *
+   *  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 x The x value + * @param data type for {@code Asinh} output and operands * @return a new instance of Asinh */ public Asinh asinh(Operand x) { @@ -475,24 +461,21 @@ public Asinh asinh(Operand x) { /** * Computes the trignometric inverse tangent of x element-wise. - *

- * The `tf.math.atan` operation returns the inverse of `tf.math.tan`, such that - * if `y = tf.math.tan(x)` then, `x = tf.math.atan(y)`. - *

- * Note: The output of `tf.math.atan` will lie within the invertible range + * The {@code tf.math.atan} operation returns the inverse of {@code tf.math.tan}, such that + * if {@code y = tf.math.tan(x)} then, {@code x = tf.math.atan(y)}. + *

Note: The output of {@code tf.math.atan} will lie within the invertible range * of tan, i.e (-pi/2, pi/2). - *

- * For example: - *

{@code
+   *  

For example: + *

    *  # Note: [1.047, 0.785] ~= [(pi/3), (pi/4)]
    *  x = tf.constant([1.047, 0.785])
    *  y = tf.math.tan(x) # [1.731261, 0.99920404]
    *
    *  tf.math.atan(y) # [1.047, 0.785] = x
-   *  }
+ *
* - * @param data type for {@code y()} output - * @param x + * @param x The x value + * @param data type for {@code Atan} output and operands * @return a new instance of Atan */ public Atan atan(Operand x) { @@ -500,17 +483,27 @@ public Atan atan(Operand x) { } /** - * Computes arctangent of `y/x` element-wise, respecting signs of the arguments. - *

+ * Computes arctangent of {@code y/x} element-wise, respecting signs of the arguments. * This is the angle \( \theta \in [-\pi, \pi] \) such that * \[ x = r \cos(\theta) \] * and * \[ y = r \sin(\theta) \] - * where \(r = \sqrt(x^2 + y^2) \). - * - * @param data type for {@code z()} output - * @param y - * @param x + * where \(r = \sqrt{x^2 + y^2} \). + *

For example: + *

+ *
+ *
+ *

x = [1., 1.] + * y = [1., -1.] + * print((tf.math.atan2(y,x) * (180 / np.pi)).numpy()) + * [ 45. -45.] + *

+ *
+ *
+ * + * @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 */ public Atan2 atan2(Operand y, Operand x) { @@ -519,20 +512,18 @@ public Atan2 atan2(Operand y, Operand x) { /** * Computes inverse hyperbolic tangent of x element-wise. - *

- * Given an input tensor, this function computes inverse hyperbolic tangent - * for every element in the tensor. Input range is `[-1,1]` and output range is - * `[-inf, inf]`. If input is `-1`, output will be `-inf` and if the - * input is `1`, output will be `inf`. Values outside the range will have - * `nan` as output. - *

- *

{@code
-   *    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 - * @param x + * Given an input tensor, this function computes inverse hyperbolic tangent + * for every element in the tensor. Input range is {@code [-1,1]} and output range is + * {@code [-inf, inf]}. If input is {@code -1}, output will be {@code -inf} and if the + * input is {@code 1}, output will be {@code inf}. Values outside the range will have + * {@code nan} as output. + *
+   *  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 x The x value + * @param data type for {@code Atanh} output and operands * @return a new instance of Atanh */ public Atanh atanh(Operand x) { @@ -540,23 +531,62 @@ public Atanh atanh(Operand x) { } /** - * Compute the regularized incomplete beta integral \\(I_x(a, b)\\). - *

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

- * \\(I_x(a, b) = \frac{B(x; a, b)}{B(a, b)}\\) - *

- * where - *

- * \\(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 + *

\(I_x(a, b) = \frac{B(x; a, b)}{B(a, b)}\) + *

where + *

\(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 - * @param a - * @param b - * @param x + * @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 */ public Betainc betainc(Operand a, Operand b, Operand x) { @@ -565,84 +595,56 @@ public Betainc betainc(Operand a, Operand b, Operan /** * Counts the number of occurrences of each value in an integer array. - *

- * Outputs a vector with length `size` and the same dtype as `weights`. If - * `weights` are empty, then index `i` stores the number of times the value `i` is - * counted in `arr`. If `weights` are non-empty, then index `i` stores the sum of - * the value in `weights` at each index where the corresponding value in `arr` is - * `i`. - *

- * Values in `arr` outside of the range [0, size) are ignored. - * - * @param data type for {@code bins()} output - * @param arr int32 `Tensor`. - * @param size non-negative int32 scalar `Tensor`. - * @param weights is an int32, int64, float32, or float64 `Tensor` with the same - * shape as `arr`, or a length-0 `Tensor`, in which case it acts as all weights + * Outputs a vector with length {@code size} and the same dtype as {@code weights}. If + * {@code weights} are empty, then index {@code i} stores the number of times the value {@code i} is + * counted in {@code arr}. If {@code weights} are non-empty, then index {@code i} stores the sum of + * 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 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 + * shape as {@code arr}, or a length-0 {@code Tensor}, in which case it acts as all weights * equal to 1. + * @param data type for {@code Bincount} output and operands * @return a new instance of Bincount */ - public Bincount bincount(Operand arr, Operand size, + public Bincount bincount(Operand arr, Operand sizeOutput, Operand weights) { - return Bincount.create(scope, arr, size, weights); + return Bincount.create(scope, arr, sizeOutput, weights); } /** * Returns element-wise smallest integer not less than x. * - * @param data type for {@code y()} output - * @param x + * @param x The x value + * @param data type for {@code Ceil} output and operands * @return a new instance of Ceil */ public Ceil ceil(Operand x) { return Ceil.create(scope, x); } - /** - * Compare values of `input` to `threshold` and pack resulting bits into a `uint8`. - *

- * Each comparison returns a boolean `true` (if `input_value > threshold`) - * or and `false` otherwise. - *

- * This operation is useful for Locality-Sensitive-Hashing (LSH) and other - * algorithms that use hashing approximations of cosine and `L2` distances; - * codes can be generated from an input via: - *

{@code
-   *  codebook_size = 50
-   *  codebook_bits = codebook_size * 32
-   *  codebook = tf.get_variable('codebook', [x.shape[-1].value, codebook_bits],
-   *                             dtype=x.dtype,
-   *                             initializer=tf.orthogonal_initializer())
-   *  codes = compare_and_threshold(tf.matmul(x, codebook), threshold=0.)
-   *  codes = tf.bitcast(codes, tf.int32)  # go from uint8 to int32
-   *  # now codes has shape x.shape[:-1] + [codebook_size]
-   *  }
- * NOTE: Currently, the innermost dimension of the tensor must be divisible - * by 8. - *

- * Given an `input` shaped `[s0, s1, ..., s_n]`, the output is - * a `uint8` tensor shaped `[s0, s1, ..., s_n / 8]`. - * - * @param input Values to compare against `threshold` and bitpack. - * @param threshold Threshold to compare against. - * @return a new instance of CompareAndBitpack - */ - public CompareAndBitpack compareAndBitpack(Operand input, - Operand threshold) { - return CompareAndBitpack.create(scope, input, threshold); - } - /** * Computes the complex absolute value of a tensor. - *

- * Given a tensor `x` of complex numbers, this operation returns a tensor of type - * `float` or `double` that is the absolute value of each element in `x`. All - * elements in `x` must be complex numbers of the form \\(a + bj\\). The absolute - * value is computed as \\( \sqrt{a^2 + b^2}\\). - * - * @param data type for {@code y()} output - * @param x - * @return a new instance of ComplexAbs + * Given a tensor {@code x} of complex numbers, this operation returns a tensor of type + * {@code float} or {@code double} that is the absolute value of each element in {@code x}. All + * elements in {@code x} must be complex numbers of the form \(a + bj\). The absolute + * value is computed as \( \sqrt{a^2 + b^2}\). + *

For example: + *

+ *
+ *
+ *

x = tf.complex(3.0, 4.0) + * print((tf.raw_ops.ComplexAbs(x=x, Tout=tf.dtypes.float32, name=None)).numpy()) + * 5.0 + *

+ *
+ *
+ * + * @param x The x value + * @return a new instance of ComplexAbs, with default output types */ public ComplexAbs complexAbs(Operand x) { return ComplexAbs.create(scope, x); @@ -650,15 +652,25 @@ public ComplexAbs complexAbs(Operand x) { /** * Computes the complex absolute value of a tensor. - *

- * Given a tensor `x` of complex numbers, this operation returns a tensor of type - * `float` or `double` that is the absolute value of each element in `x`. All - * elements in `x` must be complex numbers of the form \\(a + bj\\). The absolute - * value is computed as \\( \sqrt{a^2 + b^2}\\). - * - * @param data type for {@code y()} output - * @param x - * @param Tout + * Given a tensor {@code x} of complex numbers, this operation returns a tensor of type + * {@code float} or {@code double} that is the absolute value of each element in {@code x}. All + * elements in {@code x} must be complex numbers of the form \(a + bj\). The absolute + * value is computed as \( \sqrt{a^2 + b^2}\). + *

For example: + *

+ *
+ *
+ *

x = tf.complex(3.0, 4.0) + * print((tf.raw_ops.ComplexAbs(x=x, Tout=tf.dtypes.float32, name=None)).numpy()) + * 5.0 + *

+ *
+ *
+ * + * @param x The x value + * @param Tout Need to be {@code tf.float32} when the type of {@code x} is {@code tf.complex64}. + * Need to be {@code tf.float64} when the type of {@code x} is {@code tf.complex128}. + * @param data type for {@code ComplexAbs} output and operands * @return a new instance of ComplexAbs */ public ComplexAbs complexAbs(Operand x, Class Tout) { @@ -667,22 +679,19 @@ public ComplexAbs complexAbs(Operand x, /** * Returns the complex conjugate of a complex number. - *

- * Given a tensor `input` of complex numbers, this operation returns a tensor of - * complex numbers that are the complex conjugate of each element in `input`. The - * complex numbers in `input` must be of the form \\(a + bj\\), where a is the - * real part and b is the imaginary part. - *

- * The complex conjugate returned by this operation is of the form \\(a - bj\\). - *

- * For example: - *

{@code
+   *  Given a tensor {@code input} of complex numbers, this operation returns a tensor of
+   *  complex numbers that are the complex conjugate of each element in {@code input}. The
+   *  complex numbers in {@code input} must be of the form \(a + bj\), where a is the
+   *  real part and b is the imaginary part.
+   *  

The complex conjugate returned by this operation is of the form \(a - bj\). + *

For example: + *

    *  # tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j]
-   *  tf.conj(input) ==> [-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 - * @param input + * @param input The input value + * @param data type for {@code Conj} output and operands * @return a new instance of Conj */ public Conj conj(Operand input) { @@ -691,19 +700,17 @@ public Conj conj(Operand input) { /** * Computes cos of x element-wise. - *

- * Given an input tensor, this function computes cosine of every - * element in the tensor. Input range is `(-inf, inf)` and - * output range is `[-1,1]`. If input lies outside the boundary, `nan` - * is returned. - *

- *

{@code
-   *    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 - * @param x + * Given an input tensor, this function computes cosine of every + * element in the tensor. Input range is {@code (-inf, inf)} and + * output range is {@code [-1,1]}. If input lies outside the boundary, {@code nan} + * is returned. + *
+   *  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 x The x value + * @param data type for {@code Cos} output and operands * @return a new instance of Cos */ public Cos cos(Operand x) { @@ -712,18 +719,16 @@ public Cos cos(Operand x) { /** * Computes hyperbolic cosine of x element-wise. - *

- * Given an input tensor, this function computes hyperbolic cosine of every - * element in the tensor. Input range is `[-inf, inf]` and output range - * is `[1, inf]`. - *

- *

{@code
-   *    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 - * @param x + * Given an input tensor, this function computes hyperbolic cosine of every + * element in the tensor. Input range is {@code [-inf, inf]} and output range + * is {@code [1, inf]}. + *
+   *  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 x The x value + * @param data type for {@code Cosh} output and operands * @return a new instance of Cosh */ public Cosh cosh(Operand x) { @@ -731,37 +736,35 @@ public Cosh cosh(Operand x) { } /** - * Compute the cumulative product of the tensor `x` along `axis`. - *

+ * Compute the cumulative product of the tensor {@code x} along {@code axis}. * By default, this op performs an inclusive cumprod, which means that the first * element of the input is identical to the first element of the output: - *

{@code
-   *  tf.cumprod([a, b, c])  # => [a, a * b, a * b * c]
-   *  }
- * By setting the `exclusive` kwarg to `True`, an exclusive cumprod is + *
+   *  tf.cumprod([a, b, c])  # => [a, a * b, a * b * c]
+   *  
+ *

By setting the {@code exclusive} kwarg to {@code True}, an exclusive cumprod is * performed instead: - *

{@code
-   *  tf.cumprod([a, b, c], exclusive=True)  # => [1, a, a * b]
-   *  }
- * By setting the `reverse` kwarg to `True`, the cumprod is performed in the + *
+   *  tf.cumprod([a, b, c], exclusive=True)  # => [1, a, a * b]
+   *  
+ *

By setting the {@code reverse} kwarg to {@code True}, the cumprod is performed in the * opposite direction: - *

{@code
-   *  tf.cumprod([a, b, c], reverse=True)  # => [a * b * c, b * c, c]
-   *  }
- * This is more efficient than using separate `tf.reverse` ops. - *

- * The `reverse` and `exclusive` kwargs can also be combined: - *

{@code
-   *  tf.cumprod([a, b, c], exclusive=True, reverse=True)  # => [b * c, c, 1]
-   *  }
- * - * @param data type for {@code out()} output - * @param x A `Tensor`. Must be one of the following types: `float32`, `float64`, - * `int64`, `int32`, `uint8`, `uint16`, `int16`, `int8`, `complex64`, - * `complex128`, `qint8`, `quint8`, `qint32`, `half`. - * @param axis A `Tensor` of type `int32` (default: 0). Must be in the range - * `[-rank(x), rank(x))`. - * @param options carries optional attributes values + *
+   *  tf.cumprod([a, b, c], reverse=True)  # => [a * b * c, b * c, c]
+   *  
+ *

This is more efficient than using separate {@code tf.reverse} ops. + *

The {@code reverse} and {@code exclusive} kwargs can also be combined: + *

+   *  tf.cumprod([a, b, c], exclusive=True, reverse=True)  # => [b * c, c, 1]
+   *  
+ * + * @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}. + * @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 Cumprod} output and operands * @return a new instance of Cumprod */ public Cumprod cumprod(Operand x, Operand axis, @@ -770,37 +773,35 @@ public Cumprod cumprod(Operand x, Operand + * Compute the cumulative sum of the tensor {@code x} along {@code axis}. * By default, this op performs an inclusive cumsum, which means that the first * element of the input is identical to the first element of the output: - *
{@code
-   *  tf.cumsum([a, b, c])  # => [a, a + b, a + b + c]
-   *  }
- * By setting the `exclusive` kwarg to `True`, an exclusive cumsum is + *
+   *  tf.cumsum([a, b, c])  # => [a, a + b, a + b + c]
+   *  
+ *

By setting the {@code exclusive} kwarg to {@code True}, an exclusive cumsum is * performed instead: - *

{@code
-   *  tf.cumsum([a, b, c], exclusive=True)  # => [0, a, a + b]
-   *  }
- * By setting the `reverse` kwarg to `True`, the cumsum is performed in the + *
+   *  tf.cumsum([a, b, c], exclusive=True)  # => [0, a, a + b]
+   *  
+ *

By setting the {@code reverse} kwarg to {@code True}, the cumsum is performed in the * opposite direction: - *

{@code
-   *  tf.cumsum([a, b, c], reverse=True)  # => [a + b + c, b + c, c]
-   *  }
- * This is more efficient than using separate `tf.reverse` ops. - *

- * The `reverse` and `exclusive` kwargs can also be combined: - *

{@code
-   *  tf.cumsum([a, b, c], exclusive=True, reverse=True)  # => [b + c, c, 0]
-   *  }
- * - * @param data type for {@code out()} output - * @param x A `Tensor`. Must be one of the following types: `float32`, `float64`, - * `int64`, `int32`, `uint8`, `uint16`, `int16`, `int8`, `complex64`, - * `complex128`, `qint8`, `quint8`, `qint32`, `half`. - * @param axis A `Tensor` of type `int32` (default: 0). Must be in the range - * `[-rank(x), rank(x))`. - * @param options carries optional attributes values + *
+   *  tf.cumsum([a, b, c], reverse=True)  # => [a + b + c, b + c, c]
+   *  
+ *

This is more efficient than using separate {@code tf.reverse} ops. + *

The {@code reverse} and {@code exclusive} kwargs can also be combined: + *

+   *  tf.cumsum([a, b, c], exclusive=True, reverse=True)  # => [b + c, c, 0]
+   *  
+ * + * @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}. + * @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 Cumsum} output and operands * @return a new instance of Cumsum */ public Cumsum cumsum(Operand x, Operand axis, @@ -808,38 +809,67 @@ 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 `size` and the same dtype as `weights`. If - * `weights` are empty, then index `i` stores the number of times the value `i` is - * counted in `arr`. If `weights` are non-empty, then index `i` stores the sum of - * the value in `weights` at each index where the corresponding value in `arr` is - * `i`. - *

- * Values in `arr` outside of the range [0, size) are ignored. - * - * @param data type for {@code output()} output - * @param input 1D or 2D int `Tensor`. - * @param size non-negative int scalar `Tensor`. - * @param weights is an int32, int64, float32, or float64 `Tensor` with the same - * shape as `arr`, or a length-0 `Tensor`, in which case it acts as all weights - * equal to 1. - * @param options carries optional attributes values + * Outputs a vector with length {@code size} and the same dtype as {@code weights}. If + * {@code weights} are empty, then index {@code i} stores the number of times the value {@code i} is + * counted in {@code arr}. If {@code weights} are non-empty, then index {@code i} stores the sum of + * 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 input 1D or 2D int {@code Tensor}. + * @param sizeOutput non-negative int scalar {@code Tensor}. + * @param weights {@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. + * Not supported by the GPU implementation of Bincount. + * @param options carries optional attribute values + * @param data type for {@code DenseBincount} output and operands + * @param data type for {@code DenseBincount} output and operands * @return a new instance of DenseBincount */ public DenseBincount denseBincount(Operand input, - Operand size, Operand weights, DenseBincount.Options... options) { - return DenseBincount.create(scope, input, size, weights, options); + Operand sizeOutput, Operand weights, DenseBincount.Options... options) { + return DenseBincount.create(scope, input, sizeOutput, weights, options); } /** * Computes Psi, the derivative of Lgamma (the log of the absolute value of - *

- * `Gamma(x)`), element-wise. + * {@code Gamma(x)}), element-wise. * - * @param data type for {@code y()} output - * @param x + * @param x The x value + * @param data type for {@code Digamma} output and operands * @return a new instance of Digamma */ public Digamma digamma(Operand x) { @@ -848,13 +878,12 @@ public Digamma digamma(Operand x) { /** * Returns x / y element-wise. - *

- * NOTE: `math.Div` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + * NOTE: {@code math.Div} supports broadcasting. More about broadcasting + * here * - * @param data type for {@code z()} output - * @param x - * @param y + * @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 */ public Div div(Operand x, Operand y) { @@ -863,14 +892,12 @@ public Div div(Operand x, Operand y) { /** * Returns 0 if the denominator is zero. - *

- * - * NOTE: `math.DivNoNan` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + * NOTE: {@code math.DivNoNan} supports broadcasting. More about broadcasting + * here * - * @param data type for {@code z()} output - * @param x - * @param y + * @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 */ public DivNoNan divNoNan(Operand x, Operand y) { @@ -879,22 +906,22 @@ public DivNoNan divNoNan(Operand x, Operand y) { /** * Returns the truth value of (x == y) element-wise. - *

- * NOTE: `math.Equal` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - *

{@code
+   *  NOTE: {@code math.Equal} supports broadcasting. More about broadcasting
+   *   here 
+   *  
    *  x = tf.constant([2, 4])
    *  y = tf.constant(2)
-   *  tf.math.equal(x, y) ==> array([True, False])
+   *  tf.math.equal(x, y) ==> array([True, False])
    *
    *  x = tf.constant([2, 4])
    *  y = tf.constant([2, 4])
-   *  tf.math.equal(x, y) ==> array([True,  True])
-   *  }
+ * tf.math.equal(x, y) ==> array([True, True]) + *
* - * @param x - * @param y - * @param options carries optional attributes values + * @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 */ public Equal equal(Operand x, Operand y, Equal.Options... options) { @@ -902,10 +929,10 @@ public Equal equal(Operand x, Operand y, Equal.Options.. } /** - * Computes the Gauss error function of `x` element-wise. + * 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 + * @param x The x value + * @param data type for {@code Erf} output and operands * @return a new instance of Erf */ public Erf erf(Operand x) { @@ -913,10 +940,10 @@ public Erf erf(Operand x) { } /** - * Computes the complementary error function of `x` element-wise. + * Computes the complementary error function of {@code x} element-wise. * - * @param data type for {@code y()} output - * @param x + * @param x The x value + * @param data type for {@code Erfc} output and operands * @return a new instance of Erfc */ public Erfc erfc(Operand x) { @@ -924,9 +951,10 @@ public Erfc erfc(Operand x) { } /** + * The Erfinv operation * - * @param data type for {@code y()} output - * @param x + * @param x The x value + * @param data type for {@code Erfinv} output and operands * @return a new instance of erfinv */ public erfinv erfinv(Operand x) { @@ -934,35 +962,31 @@ public erfinv erfinv(Operand x) { } /** - * Computes exponential of x element-wise. \\(y = e^x\\). - *

- * This function computes the exponential of every element in the input tensor. - * i.e. `exp(x)` or `e^(x)`, where `x` is the input tensor. - * `e` denotes Euler's number and is approximately equal to 2.718281. - * Output is positive for any real input. - *

- *

{@code
-   *    x = tf.constant(2.0)
-   *    tf.math.exp(x) ==> 7.389056
-   *
-   *    x = tf.constant([2.0, 8.0])
-   *    tf.math.exp(x) ==> array([7.389056, 2980.958], dtype=float32)
-   *    }
- * For complex numbers, the exponential value is calculated as follows: - *

- *

{@code
-   *    e^(x+iy) = e^x * e^iy = e^x * (cos y + i sin y)
-   *    }
- * Let's consider complex number 1+1j as an example. - * e^1 * (cos 1 + i sin 1) = 2.7182818284590 * (0.54030230586+0.8414709848j) - *

- *

{@code
-   *    x = tf.constant(1 + 1j)
-   *    tf.math.exp(x) ==> 1.4686939399158851+2.2873552871788423j
-   *    }
- * - * @param data type for {@code y()} output - * @param x + * Computes exponential of x element-wise. \(y = e^x\). + * This function computes the exponential of every element in the input tensor. + * i.e. {@code exp(x)} or {@code e^(x)}, where {@code x} is the input tensor. + * {@code e} denotes Euler's number and is approximately equal to 2.718281. + * Output is positive for any real input. + *
+   *  x = tf.constant(2.0)
+   *  tf.math.exp(x) ==> 7.389056
+   *
+   *  x = tf.constant([2.0, 8.0])
+   *  tf.math.exp(x) ==> array([7.389056, 2980.958], dtype=float32)
+   *  
+ *

For complex numbers, the exponential value is calculated as follows: + *

+   *  e^(x+iy) = e^x * e^iy = e^x * (cos y + i sin y)
+   *  
+ *

Let's consider complex number 1+1j as an example. + * e^1 * (cos 1 + i sin 1) = 2.7182818284590 * (0.54030230586+0.8414709848j) + *

+   *  x = tf.constant(1 + 1j)
+   *  tf.math.exp(x) ==> 1.4686939399158851+2.2873552871788423j
+   *  
+ * + * @param x The x value + * @param data type for {@code Exp} output and operands * @return a new instance of Exp */ public Exp exp(Operand x) { @@ -970,24 +994,22 @@ public Exp exp(Operand x) { } /** - * Computes `exp(x) - 1` element-wise. - *

- * i.e. `exp(x) - 1` or `e^(x) - 1`, where `x` is the input tensor. - * `e` denotes Euler's number and is approximately equal to 2.718281. - *

- *

{@code
-   *    x = tf.constant(2.0)
-   *    tf.math.expm1(x) ==> 6.389056
+   * Computes {@code exp(x) - 1} element-wise.
+   *  i.e. {@code exp(x) - 1} or {@code e^(x) - 1}, where {@code x} is the input tensor.
+   *  {@code e} denotes Euler's number and is approximately equal to 2.718281.
+   *  
+   *  x = tf.constant(2.0)
+   *  tf.math.expm1(x) ==> 6.389056
    *
-   *    x = tf.constant([2.0, 8.0])
-   *    tf.math.expm1(x) ==> array([6.389056, 2979.958], dtype=float32)
+   *  x = tf.constant([2.0, 8.0])
+   *  tf.math.expm1(x) ==> array([6.389056, 2979.958], dtype=float32)
    *
-   *    x = tf.constant(1 + 1j)
-   *    tf.math.expm1(x) ==> (0.46869393991588515+2.2873552871788423j)
-   *    }
+ * x = tf.constant(1 + 1j) + * tf.math.expm1(x) ==> (0.46869393991588515+2.2873552871788423j) + *
* - * @param data type for {@code y()} output - * @param x + * @param x The x value + * @param data type for {@code Expm1} output and operands * @return a new instance of Expm1 */ public Expm1 expm1(Operand x) { @@ -1006,8 +1028,8 @@ public Fact fact() { /** * Returns element-wise largest integer not greater than x. * - * @param data type for {@code y()} output - * @param x + * @param x The x value + * @param data type for {@code Floor} output and operands * @return a new instance of Floor */ public Floor floor(Operand x) { @@ -1016,13 +1038,12 @@ public Floor floor(Operand x) { /** * Returns x // y element-wise. - *

- * NOTE: `math.FloorDiv` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + * NOTE: {@code math.FloorDiv} supports broadcasting. More about broadcasting + * here * - * @param data type for {@code z()} output - * @param x - * @param y + * @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 */ public FloorDiv floorDiv(Operand x, Operand y) { @@ -1030,17 +1051,16 @@ public FloorDiv floorDiv(Operand x, Operand y) { } /** - * Returns element-wise remainder of division. When `x < 0` xor `y < 0` is - *

- * true, this follows Python semantics in that the result here is consistent - * with a flooring divide. E.g. `floor(x / y) * y + mod(x, y) = x`. - *

- * NOTE: `math.FloorMod` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + * 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 - * @param y + * @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 */ public FloorMod floorMod(Operand x, Operand y) { @@ -1048,24 +1068,23 @@ public FloorMod floorMod(Operand x, Operand y) { } /** - * Returns the truth value of (x > y) element-wise. - *

- * NOTE: `math.Greater` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - *

- * Example: - *

{@code
+   * Returns the truth value of (x > y) element-wise.
+   *  NOTE: {@code math.Greater} supports broadcasting. More about broadcasting
+   *   here 
+   *  

Example: + *

    *  x = tf.constant([5, 4, 6])
    *  y = tf.constant([5, 2, 5])
-   *  tf.math.greater(x, y) ==> [False, True, True]
+   *  tf.math.greater(x, y) ==> [False, True, True]
    *
    *  x = tf.constant([5, 4, 6])
    *  y = tf.constant([5])
-   *  tf.math.greater(x, y) ==> [False, False, True]
-   *  }
+ * tf.math.greater(x, y) ==> [False, False, True] + *
* - * @param x - * @param y + * @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 */ public Greater greater(Operand x, Operand y) { @@ -1073,24 +1092,23 @@ public Greater greater(Operand x, Operand y) { } /** - * Returns the truth value of (x >= y) element-wise. - *

- * NOTE: `math.GreaterEqual` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - *

- * Example: - *

{@code
+   * Returns the truth value of (x >= y) element-wise.
+   *  NOTE: {@code math.GreaterEqual} supports broadcasting. More about broadcasting
+   *   here 
+   *  

Example: + *

    *  x = tf.constant([5, 4, 6, 7])
    *  y = tf.constant([5, 2, 5, 10])
-   *  tf.math.greater_equal(x, y) ==> [True, True, True, False]
+   *  tf.math.greater_equal(x, y) ==> [True, True, True, False]
    *
    *  x = tf.constant([5, 4, 6, 7])
    *  y = tf.constant([5])
-   *  tf.math.greater_equal(x, y) ==> [True, False, True, True]
-   *  }
+ * tf.math.greater_equal(x, y) ==> [True, False, True, True] + *
* - * @param x - * @param y + * @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 */ public GreaterEqual greaterEqual(Operand x, Operand y) { @@ -1098,24 +1116,18 @@ public GreaterEqual greaterEqual(Operand x, Operand y) } /** - * Compute the lower regularized incomplete Gamma function `P(a, x)`. - *

+ * Compute the lower regularized incomplete Gamma function {@code P(a, x)}. * The lower regularized incomplete Gamma function is defined as: - *

- * \\(P(a, x) = gamma(a, x) / Gamma(a) = 1 - Q(a, x)\\) - *

- * where - *

- * \\(gamma(a, x) = \\int_{0}^{x} t^{a-1} exp(-t) dt\\) - *

- * is the lower incomplete Gamma function. - *

- * Note, above `Q(a, x)` (`Igammac`) is the upper regularized complete + *

\(P(a, x) = gamma(a, x) / Gamma(a) = 1 - Q(a, x)\) + *

where + *

\(gamma(a, x) = \int_{0}^{x} t^{a-1} exp(-t) dt\) + *

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 - * @param a - * @param x + * @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 */ public Igamma igamma(Operand a, Operand x) { @@ -1123,24 +1135,30 @@ public Igamma igamma(Operand a, Operand x) { } /** - * Compute the upper regularized incomplete Gamma function `Q(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: - *

- * \\(Q(a, x) = Gamma(a, x) / Gamma(a) = 1 - P(a, x)\\) - *

- * where - *

- * \\(Gamma(a, x) = int_{x}^{\infty} t^{a-1} exp(-t) dt\\) - *

- * is the upper incomplete Gama function. - *

- * Note, above `P(a, x)` (`Igamma`) is the lower regularized complete + *

\(Q(a, x) = Gamma(a, x) / Gamma(a) = 1 - P(a, x)\) + *

where + *

\(Gamma(a, x) = \int_{x}^{\infty} t^{a-1} exp(-t) dt\) + *

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 - * @param a - * @param x + * @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 */ public Igammac igammac(Operand a, Operand x) { @@ -1149,21 +1167,18 @@ public Igammac igammac(Operand a, Operand x) { /** * Returns the imaginary part of a complex number. - *

- * Given a tensor `input` of complex numbers, this operation returns a tensor of - * type `float` that is the imaginary part of each element in `input`. All - * elements in `input` must be complex numbers of the form \\(a + bj\\), where a - * is the real part and b is the imaginary part returned by this operation. - *

- * For example: - *

{@code
+   *  Given a tensor {@code input} of complex numbers, this operation returns a tensor of
+   *  type {@code float} that is the imaginary part of each element in {@code input}. All
+   *  elements in {@code input} must be complex numbers of the form \(a + bj\), where a
+   *  is the real part and b is the imaginary part returned by this operation.
+   *  

For example: + *

    *  # tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j]
-   *  tf.imag(input) ==> [4.75, 5.75]
-   *  }
+ * tf.imag(input) ==> [4.75, 5.75] + *
* - * @param data type for {@code output()} output - * @param input - * @return a new instance of Imag + * @param input The input value + * @return a new instance of Imag, with default output types */ public Imag imag(Operand input) { return Imag.create(scope, input); @@ -1171,21 +1186,20 @@ public Imag imag(Operand input) { /** * Returns the imaginary part of a complex number. - *

- * Given a tensor `input` of complex numbers, this operation returns a tensor of - * type `float` that is the imaginary part of each element in `input`. All - * elements in `input` must be complex numbers of the form \\(a + bj\\), where a - * is the real part and b is the imaginary part returned by this operation. - *

- * For example: - *

{@code
+   *  Given a tensor {@code input} of complex numbers, this operation returns a tensor of
+   *  type {@code float} that is the imaginary part of each element in {@code input}. All
+   *  elements in {@code input} must be complex numbers of the form \(a + bj\), where a
+   *  is the real part and b is the imaginary part returned by this operation.
+   *  

For example: + *

    *  # tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j]
-   *  tf.imag(input) ==> [4.75, 5.75]
-   *  }
+ * tf.imag(input) ==> [4.75, 5.75] + *
* - * @param data type for {@code output()} output - * @param input - * @param Tout + * @param input The input value + * @param Tout Need to be {@code tf.float32} when the type of {@code x} is {@code tf.complex64}. + * Need to be {@code tf.float64} when the type of {@code x} is {@code tf.complex128}. + * @param data type for {@code Imag} output and operands * @return a new instance of Imag */ public Imag imag(Operand input, Class Tout) { @@ -1194,24 +1208,20 @@ public Imag imag(Operand input, Class /** * Computes the inverse permutation of a tensor. - *

* This operation computes the inverse of an index permutation. It takes a 1-D - * integer tensor `x`, which represents the indices of a zero-based array, and + * integer tensor {@code x}, which represents the indices of a zero-based array, and * swaps each value with its index position. In other words, for an output tensor - * `y` and an input tensor `x`, this operation computes the following: - *

- * `y[x[i]] = i for i in [0, 1, ..., len(x) - 1]` - *

- * The values must include 0. There can be no duplicate values or negative values. - *

- * For example: - *

{@code
+   *  {@code y} and an input tensor {@code x}, this operation computes the following:
+   *  

{@code y[x[i]] = i for i in [0, 1, ..., len(x) - 1]} + *

The values must include 0. There can be no duplicate values or negative values. + *

For example: + *

    *  # tensor `x` is [3, 4, 0, 2, 1]
-   *  invert_permutation(x) ==> [2, 4, 3, 0, 1]
-   *  }
+ * 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 */ public InvertPermutation invertPermutation(Operand x) { @@ -1220,16 +1230,16 @@ public InvertPermutation invertPermutation(Operand x) /** * Returns which elements of x are finite. - *

- * - * @compatibility(numpy) Equivalent to np.isfinite - * @end_compatibility

- * Example: - *

{@code
+   *  {@literal @}compatibility(numpy)
+ * Equivalent to np.isfinite + *
{@literal @}end_compatibility + *

Example: + *

    *  x = tf.constant([5.0, 4.8, 6.8, np.inf, np.nan])
-   *  tf.math.is_finite(x) ==> [True, True, True, False, False]
-   *  }
- * @param x + * tf.math.is_finite(x) ==> [True, True, True, False, False] + *
+ * + * @param x The x value * @return a new instance of IsFinite */ public IsFinite isFinite(Operand x) { @@ -1238,16 +1248,16 @@ public IsFinite isFinite(Operand x) { /** * Returns which elements of x are Inf. - *

- * - * @compatibility(numpy) Equivalent to np.isinf - * @end_compatibility

- * Example: - *

{@code
+   *  {@literal @}compatibility(numpy)
+ * Equivalent to np.isinf + *
{@literal @}end_compatibility + *

Example: + *

    *  x = tf.constant([5.0, np.inf, 6.8, np.inf])
-   *  tf.math.is_inf(x) ==> [False, True, False, True]
-   *  }
- * @param x + * tf.math.is_inf(x) ==> [False, True, False, True] + *
+ * + * @param x The x value * @return a new instance of IsInf */ public IsInf isInf(Operand x) { @@ -1256,16 +1266,16 @@ public IsInf isInf(Operand x) { /** * Returns which elements of x are NaN. - *

- * - * @compatibility(numpy) Equivalent to np.isnan - * @end_compatibility

- * Example: - *

{@code
+   *  {@literal @}compatibility(numpy)
+ * Equivalent to np.isnan + *
{@literal @}end_compatibility + *

Example: + *

    *  x = tf.constant([5.0, np.nan, 6.8, np.nan, np.inf])
-   *  tf.math.is_nan(x) ==> [False, True, False, True, False]
-   *  }
- * @param x + * tf.math.is_nan(x) ==> [False, True, False, True, False] + *
+ * + * @param x The x value * @return a new instance of IsNan */ public IsNan isNan(Operand x) { @@ -1273,24 +1283,23 @@ public IsNan isNan(Operand x) { } /** - * Returns the truth value of (x < y) element-wise. - *

- * NOTE: `math.Less` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - *

- * Example: - *

{@code
+   * Returns the truth value of (x < y) element-wise.
+   *  NOTE: {@code math.Less} supports broadcasting. More about broadcasting
+   *   here 
+   *  

Example: + *

    *  x = tf.constant([5, 4, 6])
    *  y = tf.constant([5])
-   *  tf.math.less(x, y) ==> [False, True, False]
+   *  tf.math.less(x, y) ==> [False, True, False]
    *
    *  x = tf.constant([5, 4, 6])
    *  y = tf.constant([5, 6, 7])
-   *  tf.math.less(x, y) ==> [False, True, True]
-   *  }
+ * tf.math.less(x, y) ==> [False, True, True] + *
* - * @param x - * @param y + * @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 */ public Less less(Operand x, Operand y) { @@ -1298,24 +1307,23 @@ public Less less(Operand x, Operand y) { } /** - * Returns the truth value of (x <= y) element-wise. - *

- * NOTE: `math.LessEqual` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - *

- * Example: - *

{@code
+   * Returns the truth value of (x <= y) element-wise.
+   *  NOTE: {@code math.LessEqual} supports broadcasting. More about broadcasting
+   *   here 
+   *  

Example: + *

    *  x = tf.constant([5, 4, 6])
    *  y = tf.constant([5])
-   *  tf.math.less_equal(x, y) ==> [True, True, False]
+   *  tf.math.less_equal(x, y) ==> [True, True, False]
    *
    *  x = tf.constant([5, 4, 6])
    *  y = tf.constant([5, 6, 6])
-   *  tf.math.less_equal(x, y) ==> [True, True, True]
-   *  }
+ * tf.math.less_equal(x, y) ==> [True, True, True] + *
* - * @param x - * @param y + * @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 */ public LessEqual lessEqual(Operand x, Operand y) { @@ -1323,19 +1331,17 @@ public LessEqual lessEqual(Operand x, Operand y) { } /** - * Computes the log of the absolute value of `Gamma(x)` element-wise. - *

- * For positive numbers, this function computes log((input - 1)!) for every element in the tensor. - * `lgamma(5) = log((5-1)!) = log(4!) = log(24) = 3.1780539` - *

- * Example: - *

{@code
+   * Computes the log of the absolute value of {@code Gamma(x)} element-wise.
+   *  For positive numbers, this function computes log((input - 1)!) for every element in the tensor.
+   *  {@code lgamma(5) = log((5-1)!) = log(4!) = log(24) = 3.1780539}
+   *  

Example: + *

    *  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]
-   *  }
+ * tf.math.lgamma(x) ==> [inf, 0.5723649, 0., 2.4537368, inf, -4.6477685] + *
* - * @param data type for {@code y()} output - * @param x + * @param x The x value + * @param data type for {@code Lgamma} output and operands * @return a new instance of Lgamma */ public Lgamma lgamma(Operand x) { @@ -1344,17 +1350,15 @@ public Lgamma lgamma(Operand x) { /** * Computes natural logarithm of x element-wise. - *

- * I.e., \\(y = \log_e x\\). - *

- * Example: - *

{@code
+   *  I.e., \(y = \log_e x\).
+   *  

Example: + *

    *  x = tf.constant([0, 0.5, 1, 5])
-   *  tf.math.log(x) ==> [-inf, -0.6931472,  0. ,  1.609438]
-   *  }
+ * tf.math.log(x) ==> [-inf, -0.6931472, 0. , 1.609438] + *
* - * @param data type for {@code y()} output - * @param x + * @param x The x value + * @param data type for {@code Log} output and operands * @return a new instance of Log */ public Log log(Operand x) { @@ -1363,17 +1367,15 @@ public Log log(Operand x) { /** * Computes natural logarithm of (1 + x) element-wise. - *

- * I.e., \\(y = \log_e (1 + x)\\). - *

- * Example: - *

{@code
+   *  I.e., \(y = \log_e (1 + x)\).
+   *  

Example: + *

    *  x = tf.constant([0, 0.5, 1, 5])
-   *  tf.math.log1p(x) ==> [0., 0.4054651, 0.6931472, 1.7917595]
-   *  }
+ * tf.math.log1p(x) ==> [0., 0.4054651, 0.6931472, 1.7917595] + *
* - * @param data type for {@code y()} output - * @param x + * @param x The x value + * @param data type for {@code Log1p} output and operands * @return a new instance of Log1p */ public Log1p log1p(Operand x) { @@ -1382,12 +1384,11 @@ public Log1p log1p(Operand x) { /** * Returns the truth value of x AND y element-wise. - *

- * NOTE: `math.LogicalAnd` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + * NOTE: {@code math.LogicalAnd} supports broadcasting. More about broadcasting + * here * - * @param x - * @param y + * @param x The x value + * @param y The y value * @return a new instance of LogicalAnd */ public LogicalAnd logicalAnd(Operand x, Operand y) { @@ -1395,9 +1396,9 @@ public LogicalAnd logicalAnd(Operand x, Operand y) { } /** - * Returns the truth value of `NOT x` element-wise. + * Returns the truth value of {@code NOT x} element-wise. * - * @param x A `Tensor` of type `bool`. + * @param x A {@code Tensor} of type {@code bool}. * @return a new instance of LogicalNot */ public LogicalNot logicalNot(Operand x) { @@ -1406,12 +1407,11 @@ public LogicalNot logicalNot(Operand x) { /** * Returns the truth value of x OR y element-wise. - *

- * NOTE: `math.LogicalOr` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + * NOTE: {@code math.LogicalOr} supports broadcasting. More about broadcasting + * here * - * @param x - * @param y + * @param x The x value + * @param y The y value * @return a new instance of LogicalOr */ public LogicalOr logicalOr(Operand x, Operand y) { @@ -1419,14 +1419,13 @@ public LogicalOr logicalOr(Operand x, Operand y) { } /** - * Returns the max of x and y (i.e. x > y ? x : y) element-wise. - *

- * NOTE: `math.Maximum` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + * 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 - * @param x - * @param y + * @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 */ public Maximum maximum(Operand x, Operand y) { @@ -1435,17 +1434,16 @@ public Maximum maximum(Operand x, Operand y) { /** * Computes the mean of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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 * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values + * @param data type for {@code Mean} output and operands * @return a new instance of Mean */ public Mean mean(Operand input, Operand axis, @@ -1454,14 +1452,13 @@ public Mean mean(Operand input, Operand - * NOTE: `math.Minimum` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + * 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 - * @param x - * @param y + * @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 */ public Minimum minimum(Operand x, Operand y) { @@ -1470,16 +1467,14 @@ public Minimum minimum(Operand x, Operand y) { /** * Returns element-wise remainder of division. This emulates C semantics in that - *

* the result here is consistent with a truncating divide. E.g. - * `tf.truncatediv(x, y) * y + truncate_mod(x, y) = x`. - *

- * NOTE: `math.Mod` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - * - * @param data type for {@code z()} output - * @param x - * @param y + * {@code tf.truncatediv(x, y) * y + truncate_mod(x, y) = x}. + *

NOTE: {@code math.Mod} supports broadcasting. More about broadcasting + * here + * + * @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 */ public Mod mod(Operand x, Operand y) { @@ -1488,13 +1483,12 @@ public Mod mod(Operand x, Operand y) { /** * Returns x * y element-wise. - *

- * NOTE: `math.Mul` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + * NOTE: {@code math.Mul} supports broadcasting. More about broadcasting + * here * - * @param data type for {@code z()} output - * @param x - * @param y + * @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 */ public Mul mul(Operand x, Operand y) { @@ -1503,13 +1497,12 @@ public Mul mul(Operand x, Operand y) { /** * Returns x * y element-wise. Returns zero if y is zero, even if x if infinite or NaN. - *

- * NOTE: `math.MulNoNan` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + * NOTE: {@code math.MulNoNan} supports broadcasting. More about broadcasting + * here * - * @param data type for {@code z()} output - * @param x - * @param y + * @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 */ public MulNoNan mulNoNan(Operand x, Operand y) { @@ -1517,9 +1510,10 @@ public MulNoNan mulNoNan(Operand x, Operand y) { } /** + * The Ndtri operation * - * @param data type for {@code y()} output - * @param x + * @param x The x value + * @param data type for {@code Ndtri} output and operands * @return a new instance of Ndtri */ public Ndtri ndtri(Operand x) { @@ -1528,11 +1522,10 @@ public Ndtri ndtri(Operand x) { /** * Computes numerical negative value element-wise. - *

- * I.e., \\(y = -x\\). + * I.e., \(y = -x\). * - * @param data type for {@code y()} output - * @param x + * @param x The x value + * @param data type for {@code Neg} output and operands * @return a new instance of Neg */ public Neg neg(Operand x) { @@ -1540,18 +1533,16 @@ public Neg neg(Operand x) { } /** - * Returns the next representable value of `x1` in the direction of `x2`, element-wise. - *

+ * Returns the next representable value of {@code x1} in the direction of {@code x2}, element-wise. * This operation returns the same result as the C++ std::nextafter function. - *

- * It can also return a subnormal number. - *

- * - * @compatibility(cpp) Equivalent to C++ std::nextafter function. - * @end_compatibility - * @param data type for {@code output()} output - * @param x1 - * @param x2 + *

It can also return a subnormal number. + *

{@literal @}compatibility(cpp)
+ * Equivalent to C++ std::nextafter function. + *
{@literal @}end_compatibility + * + * @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 */ public NextAfter nextAfter(Operand x1, Operand x2) { @@ -1560,13 +1551,13 @@ public NextAfter nextAfter(Operand x1, Operand x2) /** * Returns the truth value of (x != y) element-wise. - *

- * NOTE: `math.NotEqual` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + * NOTE: {@code math.NotEqual} supports broadcasting. More about broadcasting + * here * - * @param x - * @param y - * @param options carries optional attributes values + * @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 */ public NotEqual notEqual(Operand x, Operand y, @@ -1575,18 +1566,15 @@ public NotEqual notEqual(Operand x, Operand y, } /** - * Compute the polygamma function \\(\psi^{(n)}(x)\\). - *

+ * Compute the polygamma function \(\psi^{(n)}(x)\). * The polygamma function is defined as: - *

- * \\(\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 - * @param a - * @param x + *

\(\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 a The a value + * @param x The x value + * @param data type for {@code Polygamma} output and operands * @return a new instance of Polygamma */ public Polygamma polygamma(Operand a, Operand x) { @@ -1595,15 +1583,13 @@ public Polygamma polygamma(Operand a, Operand x) { /** * Computes element-wise population count (a.k.a. popcount, bitsum, bitcount). - *

- * For each entry in `x`, calculates the number of `1` (on) bits in the binary + * For each entry in {@code x}, calculates the number of {@code 1} (on) bits in the binary * representation of that entry. - *

- * NOTE: It is more efficient to first `tf.bitcast` your tensors into - * `int32` or `int64` and perform the bitcount on the result, than to feed in + *

NOTE: It is more efficient to first {@code tf.bitcast} your tensors into + * {@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 + * @param x The x value * @return a new instance of PopulationCount */ public PopulationCount populationCount(Operand x) { @@ -1612,18 +1598,17 @@ public PopulationCount populationCount(Operand x) { /** * Computes the power of one value to another. - *

- * Given a tensor `x` and a tensor `y`, this operation computes \\(x^y\\) for - * corresponding elements in `x` and `y`. For example: - *

{@code
+   *  Given a tensor {@code x} and a tensor {@code y}, this operation computes \(x^y\) for
+   *  corresponding elements in {@code x} and {@code y}. For example:
+   *  
    *  # tensor 'x' is [[2, 2]], [3, 3]]
    *  # tensor 'y' is [[8, 16], [2, 3]]
-   *  tf.pow(x, y) ==> [[256, 65536], [9, 27]]
-   *  }
+ * tf.pow(x, y) ==> [[256, 65536], [9, 27]] + *
* - * @param data type for {@code z()} output - * @param x - * @param y + * @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 */ public Pow pow(Operand x, Operand y) { @@ -1633,18 +1618,18 @@ 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 - * @param y - * @param minX The float value that the lowest quantized `x` value represents. - * @param maxX The float value that the highest quantized `x` value represents. - * @param minY The float value that the lowest quantized `y` value represents. - * @param maxY The float value that the highest quantized `y` value represents. - * @param Toutput + * @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 attribute + * @param data type for {@code QuantizedAdd} output and operands * @return a new instance of QuantizedAdd */ - public QuantizedAdd quantizedAdd(Operand x, - Operand y, Operand minX, Operand maxX, + public QuantizedAdd quantizedAdd(Operand x, + Operand y, Operand minX, Operand maxX, Operand minY, Operand maxY, Class Toutput) { return QuantizedAdd.create(scope, x, y, minX, maxX, minY, maxY, Toutput); } @@ -1652,39 +1637,36 @@ public QuantizedAdd quantizedAdd(Operand x /** * Returns x * y element-wise, working on quantized buffers. * - * @param data type for {@code z()} output - * @param x - * @param y - * @param minX The float value that the lowest quantized `x` value represents. - * @param maxX The float value that the highest quantized `x` value represents. - * @param minY The float value that the lowest quantized `y` value represents. - * @param maxY The float value that the highest quantized `y` value represents. - * @param Toutput + * @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 attribute + * @param data type for {@code QuantizedMul} output and operands * @return a new instance of QuantizedMul */ - public QuantizedMul quantizedMul(Operand x, - Operand y, Operand minX, Operand maxX, + public QuantizedMul quantizedMul(Operand x, + Operand y, Operand minX, Operand maxX, Operand minY, Operand maxY, Class Toutput) { return QuantizedMul.create(scope, x, y, minX, maxX, minY, maxY, Toutput); } /** * Returns the real part of a complex number. - *

- * Given a tensor `input` of complex numbers, this operation returns a tensor of - * type `float` that is the real part of each element in `input`. All elements in - * `input` must be complex numbers of the form \\(a + bj\\), where a is the real - * part returned by this operation and b is the imaginary part. - *

- * For example: - *

{@code
+   *  Given a tensor {@code input} of complex numbers, this operation returns a tensor of
+   *  type {@code float} that is the real part of each element in {@code input}. All elements in
+   *  {@code input} must be complex numbers of the form \(a + bj\), where a is the real
+   *  part returned by this operation and b is the imaginary part.
+   *  

For example: + *

    *  # tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j]
-   *  tf.real(input) ==> [-2.25, 3.25]
-   *  }
+ * tf.real(input) ==> [-2.25, 3.25] + *
* - * @param data type for {@code output()} output - * @param input - * @return a new instance of Real + * @param input The input value + * @return a new instance of Real, with default output types */ public Real real(Operand input) { return Real.create(scope, input); @@ -1692,21 +1674,19 @@ public Real real(Operand input) { /** * Returns the real part of a complex number. - *

- * Given a tensor `input` of complex numbers, this operation returns a tensor of - * type `float` that is the real part of each element in `input`. All elements in - * `input` must be complex numbers of the form \\(a + bj\\), where a is the real - * part returned by this operation and b is the imaginary part. - *

- * For example: - *

{@code
+   *  Given a tensor {@code input} of complex numbers, this operation returns a tensor of
+   *  type {@code float} that is the real part of each element in {@code input}. All elements in
+   *  {@code input} must be complex numbers of the form \(a + bj\), where a is the real
+   *  part returned by this operation and b is the imaginary part.
+   *  

For example: + *

    *  # tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j]
-   *  tf.real(input) ==> [-2.25, 3.25]
-   *  }
+ * tf.real(input) ==> [-2.25, 3.25] + *
* - * @param data type for {@code output()} output - * @param input - * @param Tout + * @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 */ public Real real(Operand input, Class Tout) { @@ -1715,15 +1695,13 @@ public Real real(Operand input, Class /** * Returns x / y element-wise for real types. - *

- * If `x` and `y` are reals, this will return the floating-point division. - *

- * NOTE: `Div` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - * - * @param data type for {@code z()} output - * @param x - * @param y + * 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 x The x value + * @param y The y value + * @param data type for {@code RealDiv} output and operands * @return a new instance of RealDiv */ public RealDiv realDiv(Operand x, Operand y) { @@ -1732,31 +1710,78 @@ public RealDiv realDiv(Operand x, Operand y) { /** * Computes the reciprocal of x element-wise. - *

- * I.e., \\(y = 1 / x\\). + * I.e., \(y = 1 / x\). * - * @param data type for {@code y()} output - * @param x + * @param x The x value + * @param data type for {@code Reciprocal} output and operands * @return a new instance of Reciprocal */ 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, * the even representable is chosen. * For example: - *

{@code
-   *  rint(-1.5) ==> -2.0
-   *  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 - * @param x + *
+   *  rint(-1.5) ==> -2.0
+   *  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 x The x value + * @param data type for {@code Rint} output and operands * @return a new instance of Rint */ public Rint rint(Operand x) { @@ -1765,12 +1790,11 @@ public Rint rint(Operand x) { /** * 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 - * @param x + * @param x The x value + * @param data type for {@code Round} output and operands * @return a new instance of Round */ public Round round(Operand x) { @@ -1779,83 +1803,123 @@ public Round round(Operand x) { /** * Computes reciprocal of square root of x element-wise. - *

- * I.e., \\(y = 1 / \sqrt{x}\\). + * I.e., \(y = 1 / \sqrt{x}\). * - * @param data type for {@code y()} output - * @param x + * @param x The x value + * @param data type for {@code Rsqrt} output and operands * @return a new instance of Rsqrt */ 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 - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * the section on segmentation * for an explanation of segments. - *

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

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

- *

- * - *
- *

- * For example: - *

{@code
+   *  

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 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 - * @param data - * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s + * test(c).numpy() + * array([[4, 3, 3, 4], + * [5, 6, 7, 8]], dtype=int32) + * + * + * + * + * @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. + * 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); } /** * Computes the mean along segments of a tensor. - *

* Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * the section on segmentation * for an explanation of segments. - *

- * Computes a tensor such that - * \\(output_i = \frac{\sum_j data_j}{N}\\) where `mean` is - * over `j` such that `segment_ids[j] == i` and `N` is the total number of + *

Computes a tensor such that + * \(output_i = \frac{\sum_j data_j}{N}\) where {@code mean} is + * 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 `i`, `output[i] = 0`. - *

+ *

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: - *

{@code
-   *  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 - * @param data - * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s + *

For example: + *

+ *
+ *
+ *

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 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 */ public SegmentMean segmentMean(Operand data, @@ -1865,138 +1929,176 @@ public SegmentMean segmentMean(Operand data, /** * Computes the minimum along segments of a tensor. - *

* Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * the section on segmentation * for an explanation of segments. - *

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

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

- *

- * - *
- *

- * For example: - *

{@code
+   *  

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 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 - * @param data - * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s + * test(c).numpy() + * array([[1, 2, 2, 1], + * [5, 6, 7, 8]], dtype=int32) + * + * + * + * + * @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. + * 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); } /** * Computes the product along segments of a tensor. - *

* Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * the section on segmentation * for an explanation of segments. - *

- * Computes a tensor such that - * \\(output_i = \prod_j data_j\\) where the product is over `j` such - * that `segment_ids[j] == i`. - *

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

- *

- * - *
- *

- * For example: - *

{@code
+   *  

Computes a tensor such that + * \(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 - * @param data - * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s + * test(c).numpy() + * array([[4, 6, 6, 4], + * [5, 6, 7, 8]], dtype=int32) + * + * + * + * + * @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. + * 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); } /** * Computes the sum along segments of a tensor. - *

* Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * the section on segmentation * for an explanation of segments. - *

- * Computes a tensor such that - * \\(output_i = \sum_j data_j\\) where sum is over `j` such - * that `segment_ids[j] == i`. - *

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

- *

- * - *
- *

- * For example: - *

{@code
-   *  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 - * @param data - * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s + *

Computes a tensor such that + * \(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}. + *

Note that this op is currently only supported with jit_compile=True. + * + * @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. + * 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 `x` element-wise. - *

- * Specifically, `y = 1 / (1 + exp(-x))`. + * Computes sigmoid of {@code x} element-wise. + * Specifically, {@code y = 1 / (1 + exp(-x))}. * - * @param data type for {@code y()} output - * @param x + * @param x The x value + * @param data type for {@code Sigmoid} output and operands * @return a new instance of Sigmoid */ 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. - *

- * `y = sign(x) = -1` if `x < 0`; 0 if `x == 0`; 1 if `x > 0`. - *

- * For complex numbers, `y = sign(x) = x / |x|` if `x != 0`, otherwise `y = 0`. - *

- * Example usage: - * >>> tf.math.sign([0., 2., -3.]) - * - * - * @param data type for {@code y()} output - * @param x + * {@code y = sign(x) = -1} if {@code x < 0}; 0 if {@code x == 0}; 1 if {@code x > 0}. + *

For complex numbers, {@code y = sign(x) = x / |x|} if {@code x != 0}, otherwise {@code y = 0}. + *

Example usage: + *

+ *
+ *
+ *

tf.math.sign([0., 2., -3.]) + * <tf.Tensor: shape=(3,), dtype=float32, numpy=array([ 0., 1., -1.], dtype=float32)> + *

+ *
+ *
+ * + * @param x The x value + * @param data type for {@code Sign} output and operands * @return a new instance of Sign */ public Sign sign(Operand x) { @@ -2005,18 +2107,16 @@ public Sign sign(Operand x) { /** * Computes sine of x element-wise. - *

- * Given an input tensor, this function computes sine of every - * element in the tensor. Input range is `(-inf, inf)` and - * output range is `[-1,1]`. - *

- *

{@code
-   *    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 - * @param x + * Given an input tensor, this function computes sine of every + * element in the tensor. Input range is {@code (-inf, inf)} and + * output range is {@code [-1,1]}. + *
+   *  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 x The x value + * @param data type for {@code Sin} output and operands * @return a new instance of Sin */ public Sin sin(Operand x) { @@ -2025,18 +2125,16 @@ public Sin sin(Operand x) { /** * Computes hyperbolic sine of x element-wise. - *

- * Given an input tensor, this function computes hyperbolic sine of every - * element in the tensor. Input range is `[-inf,inf]` and output range - * is `[-inf,inf]`. - *

- *

{@code
-   *    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 - * @param x + * Given an input tensor, this function computes hyperbolic sine of every + * element in the tensor. Input range is {@code [-inf,inf]} and output range + * is {@code [-inf,inf]}. + *
+   *  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 x The x value + * @param data type for {@code Sinh} output and operands * @return a new instance of Sinh */ public Sinh sinh(Operand x) { @@ -2044,36 +2142,97 @@ public Sinh sinh(Operand x) { } /** - * Computes softplus: `log(exp(features) + 1)`. + * 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 data type for {@code activations()} output - * @param features + * @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 features The features value + * @param data type for {@code Softplus} output and operands * @return a new instance of Softplus */ 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}\\). + * I.e., \(y = \sqrt{x} = x^{1/2}\). * - * @param data type for {@code y()} output - * @param x + * @param x The x value + * @param data type for {@code Sqrt} output and operands * @return a new instance of Sqrt */ 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\\). + * I.e., \(y = x * x = x^2\). * - * @param data type for {@code y()} output - * @param x + * @param x The x value + * @param data type for {@code Square} output and operands * @return a new instance of Square */ public Square square(Operand x) { @@ -2082,13 +2241,12 @@ public Square square(Operand x) { /** * Returns conj(x - y)(x - y) element-wise. - *

- * NOTE: `math.SquaredDifference` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + * NOTE: {@code math.SquaredDifference} supports broadcasting. More about broadcasting + * here * - * @param data type for {@code z()} output - * @param x - * @param y + * @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 */ public SquaredDifference squaredDifference(Operand x, Operand y) { @@ -2097,13 +2255,12 @@ public SquaredDifference squaredDifference(Operand x, Op /** * Returns x - y element-wise. - *

- * NOTE: `math.Sub` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + * NOTE: {@code math.Sub} supports broadcasting. More about broadcasting + * here * - * @param data type for {@code z()} output - * @param x - * @param y + * @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 */ public Sub sub(Operand x, Operand y) { @@ -2112,19 +2269,17 @@ public Sub sub(Operand x, Operand y) { /** * Computes tan of x element-wise. - *

- * Given an input tensor, this function computes tangent of every - * element in the tensor. Input range is `(-inf, inf)` and - * output range is `(-inf, inf)`. If input lies outside the boundary, `nan` - * is returned. - *

- *

{@code
-   *    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 - * @param x + * Given an input tensor, this function computes tangent of every + * element in the tensor. Input range is {@code (-inf, inf)} and + * output range is {@code (-inf, inf)}. If input lies outside the boundary, {@code nan} + * is returned. + *
+   *  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 x The x value + * @param data type for {@code Tan} output and operands * @return a new instance of Tan */ public Tan tan(Operand x) { @@ -2132,20 +2287,24 @@ public Tan tan(Operand x) { } /** - * Computes hyperbolic tangent of `x` element-wise. - *

- * Given an input tensor, this function computes hyperbolic tangent of every - * element in the tensor. Input range is `[-inf, inf]` and - * output range is `[-1,1]`. - *

- * >>> x = tf.constant([-float("inf"), -5, -0.5, 1, 1.2, 2, 3, float("inf")]) - * >>> tf.math.tanh(x) - * - * - * @param data type for {@code y()} output - * @param x + * Computes hyperbolic tangent of {@code x} element-wise. + * Given an input tensor, this function computes hyperbolic tangent of every + * element in the tensor. Input range is {@code [-inf, inf]} and + * output range is {@code [-1,1]}. + *

+ *
+ *
+ *

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, -0.99990916, -0.46211717, 0.7615942 , 0.8336547 , + * 0.9640276 , 0.9950547 , 1.0], dtype=float32)> + *

+ *
+ *
+ * + * @param x The x value + * @param data type for {@code Tanh} output and operands * @return a new instance of Tanh */ public Tanh tanh(Operand x) { @@ -2153,19 +2312,31 @@ 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 `FloorDiv` for a division function that matches + * than Python semantics. See {@code FloorDiv} for a division function that matches * Python Semantics. - *

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

NOTE: {@code math.TruncateDiv} supports broadcasting. More about broadcasting + * here * - * @param data type for {@code z()} output - * @param x - * @param y + * @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 */ public TruncateDiv truncateDiv(Operand x, Operand y) { @@ -2174,59 +2345,115 @@ public TruncateDiv truncateDiv(Operand x, Operand y) /** * Returns element-wise remainder of division. This emulates C semantics in that - *

- * the result here is consistent with a truncating divide. E.g. `truncate(x / y) * - * y + truncate_mod(x, y) = x`. - *

- * NOTE: `math.TruncateMod` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - * - * @param data type for {@code z()} output - * @param x - * @param y + * 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 x The x value + * @param y The y value + * @param data type for {@code TruncateMod} output and operands * @return a new instance of TruncateMod */ 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](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * the section on segmentation * for an explanation of segments. - *

- * This operator is similar to the unsorted segment sum operator found - * [(here)](../../../api_docs/python/math_ops.md#UnsortedSegmentSum). + *

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 `j...` such - * that `segment_ids[j...] == i`. - *

- * If the maximum is empty for a given segment ID `i`, it outputs the smallest + *

\(output_i = \max_{j...} data[j...]\) where max is over tuples {@code j...} such + * that {@code segment_ids[j...] == i}. + *

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

- * If the given segment ID `i` is negative, then the corresponding value is + * {@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: - *

{@code
-   *  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 - * @param data - * @param segmentIds A tensor whose shape is a prefix of `data.shape`. - * @param numSegments + *

For example: + *

+ *
+ *
+ *

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 The data value + * @param segmentIds 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. + * @param numSegments The numSegments value + * @param data type for {@code UnsortedSegmentMax} output and operands * @return a new instance of UnsortedSegmentMax */ public UnsortedSegmentMax unsortedSegmentMax(Operand data, @@ -2236,36 +2463,43 @@ public UnsortedSegmentMax unsortedSegmentMax(Operand d /** * Computes the minimum along segments of a tensor. - *

* Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * the section on segmentation * for an explanation of segments. - *

- * This operator is similar to the unsorted segment sum operator found - * [(here)](../../../api_docs/python/math_ops.md#UnsortedSegmentSum). + *

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 `j...` such - * that `segment_ids[j...] == i`. - *

- * If the minimum is empty for a given segment ID `i`, it outputs the largest + *

\(output_i = \min_{j...} data_[j...]\) where min is over tuples {@code j...} such + * that {@code segment_ids[j...] == i}. + *

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

- * For example: - *

{@code
-   *  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]]
-   *  }
- * If the given segment ID `i` is negative, then the corresponding value is + * {@code output[i] = numeric_limits::max()}. + *

For example: + *

+ *
+ *
+ *

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 - * @param segmentIds A tensor whose shape is a prefix of `data.shape`. - * @param numSegments + *

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}. + * 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 */ public UnsortedSegmentMin unsortedSegmentMin(Operand data, @@ -2275,35 +2509,42 @@ public UnsortedSegmentMin unsortedSegmentMin(Operand d /** * Computes the product along segments of a tensor. - *

* Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * the section on segmentation * for an explanation of segments. - *

- * This operator is similar to the unsorted segment sum operator found - * [(here)](../../../api_docs/python/math_ops.md#UnsortedSegmentSum). + *

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 - * `j...` such that `segment_ids[j...] == i`. - *

- * For example: - *

{@code
-   *  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]]
-   *  }
- * If there is no entry for a given segment ID `i`, it outputs 1. - *

- * If the given segment ID `i` is negative, then the corresponding value is + *

\(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.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 - * @param segmentIds A tensor whose shape is a prefix of `data.shape`. - * @param numSegments + * 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}. + * 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 */ public UnsortedSegmentProd unsortedSegmentProd(Operand data, @@ -2313,37 +2554,45 @@ public UnsortedSegmentProd unsortedSegmentProd(Operand d /** * Computes the sum along segments of a tensor. - *

* Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * the section on segmentation * for an explanation of segments. - *

- * Computes a tensor such that - * \\(output[i] = \sum_{j...} data[j...]\\) where the sum is over tuples `j...` such - * that `segment_ids[j...] == i`. Unlike `SegmentSum`, `segment_ids` + *

Computes a tensor such that + * \(output[i] = \sum_{j...} data[j...]\) where the sum is over tuples {@code j...} such + * that {@code segment_ids[j...] == i}. Unlike {@code SegmentSum}, {@code segment_ids} * need not be sorted and need not cover all values in the full * range of valid values. - *

- * If the sum is empty for a given segment ID `i`, `output[i] = 0`. - * If the given segment ID `i` is negative, the value is dropped and will not be + *

If the sum is empty for a given segment ID {@code i}, {@code output[i] = 0}. + * If the given segment ID {@code i} is negative, the value is dropped and will not be * added to the sum of the segment. - *

- * `num_segments` should equal the number of distinct segment IDs. - *

+ *

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

* *
- *
{@code
-   *  c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]])
-   *  tf.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 - * @param data - * @param segmentIds A tensor whose shape is a prefix of `data.shape`. - * @param numSegments + *
+ *
+ *
+ *

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 The data value + * @param segmentIds 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. + * @param numSegments The numSegments value + * @param data type for {@code UnsortedSegmentSum} output and operands * @return a new instance of UnsortedSegmentSum */ public UnsortedSegmentSum unsortedSegmentSum(Operand data, @@ -2354,9 +2603,9 @@ public UnsortedSegmentSum unsortedSegmentSum(Operand dat /** * Returns 0 if x == 0, and x / y otherwise, elementwise. * - * @param data type for {@code z()} output - * @param x - * @param y + * @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 */ public Xdivy xdivy(Operand x, Operand y) { @@ -2366,9 +2615,9 @@ 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 - * @param y + * @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 */ public Xlog1py xlog1py(Operand x, Operand y) { @@ -2378,9 +2627,9 @@ 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 - * @param y + * @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 */ public Xlogy xlogy(Operand x, Operand y) { @@ -2388,15 +2637,13 @@ public Xlogy xlogy(Operand x, Operand y) { } /** - * Compute the Hurwitz zeta function \\(\zeta(x, q)\\). - *

+ * 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}\\) + *

\(\zeta(x, q) = \sum_{n=0}^{\infty} (q + n)^{-x}\) * - * @param data type for {@code z()} output - * @param x - * @param q + * @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 */ public Zeta zeta(Operand x, Operand q) { 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 4f724578d14..91b5207edfa 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,15 +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.SigmoidCrossEntropyWithLogits; +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; @@ -100,11 +138,9 @@ /** * An API for building {@code nn} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class NnOps { - public final NnRawOps raw; - private final Scope scope; private final Ops ops; @@ -112,21 +148,19 @@ public final class NnOps { NnOps(Ops ops) { this.scope = ops.scope(); this.ops = ops; - raw = new NnRawOps(ops); } /** * Performs average pooling on the input. - *

- * Each entry in `output` is the mean of the corresponding size `ksize` - * window in `value`. - * - * @param data type for {@code output()} output - * @param value 4-D with shape `[batch, height, width, channels]`. - * @param ksize The size of the sliding window for each dimension of `value`. - * @param strides The stride of the sliding window for each dimension of `value`. + * Each entry in {@code output} is the mean of the corresponding size {@code ksize} + * window in {@code value}. + * + * @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}. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code AvgPool} output and operands * @return a new instance of AvgPool */ public AvgPool avgPool(Operand value, List ksize, @@ -136,18 +170,17 @@ public AvgPool avgPool(Operand value, List ksize /** * Performs 3D average pooling on the input. - *

- * Each entry in `output` is the mean of the corresponding size `ksize` window in - * `value`. + * 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 `[batch, depth, rows, cols, channels]` tensor to pool over. + * @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 `ksize[0] = ksize[4] = 1`. + * the input tensor. Must have {@code ksize[0] = ksize[4] = 1}. * @param strides 1-D tensor of length 5. The stride of the sliding window for each - * dimension of `input`. Must have `strides[0] = strides[4] = 1`. + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code AvgPool3D} output and operands * @return a new instance of AvgPool3d */ public AvgPool3d avgPool3d(Operand input, List ksize, @@ -158,15 +191,15 @@ 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 `[batch, depth, rows, cols, channels]`. + * @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 - * the input tensor. Must have `ksize[0] = ksize[4] = 1`. + * the input tensor. Must have {@code ksize[0] = ksize[4] = 1}. * @param strides 1-D tensor of length 5. The stride of the sliding window for each - * dimension of `input`. Must have `strides[0] = strides[4] = 1`. + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code AvgPool3DGrad} output and operands * @return a new instance of AvgPool3dGrad */ public AvgPool3dGrad avgPool3dGrad(Operand origInputShape, @@ -175,12 +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 `tf.nn.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, @@ -191,11 +241,12 @@ public AvgPool3dGrad avgPool3dGrad(Operand origIn * @param beta A 1D beta Tensor with size matching the last dimension of t. * An offset to be added to the normalized tensor. * @param gamma A 1D gamma Tensor with size matching the last dimension of t. - * If "scale_after_normalization" is true, this tensor will be multiplied + * If "scale_after_normalization" is true, this tensor will be multiplied * with the normalized tensor. * @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. + * @param data type for {@code BatchNormWithGlobalNormalization} output and operands * @return a new instance of BatchNormWithGlobalNormalization */ public BatchNormWithGlobalNormalization batchNormWithGlobalNormalization( @@ -206,10 +257,8 @@ public BatchNormWithGlobalNormalization batchNormWithGlobal /** * Gradients for batch normalization. - *

- * This op is deprecated. See `tf.nn.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, @@ -218,12 +267,13 @@ public BatchNormWithGlobalNormalization batchNormWithGlobal * This is the second output from tf.nn.moments, * or a saved moving average thereof. * @param gamma A 1D gamma Tensor with size matching the last dimension of t. - * If "scale_after_normalization" is true, this Tensor will be multiplied + * If "scale_after_normalization" is true, this Tensor will be multiplied * with the normalized Tensor. * @param backprop 4D backprop Tensor. * @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. + * @param data type for {@code BatchNormWithGlobalNormalizationGrad} output and operands * @return a new instance of BatchNormWithGlobalNormalizationGrad */ public BatchNormWithGlobalNormalizationGrad batchNormWithGlobalNormalizationGrad( @@ -233,15 +283,14 @@ public BatchNormWithGlobalNormalizationGrad batchNormWithGl } /** - * Adds `bias` to `value`. - *

- * This is a special case of `tf.add` where `bias` is restricted to be 1-D. - * Broadcasting is supported, so `value` may have any number of dimensions. + * 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 * @param value Any number of dimensions. - * @param bias 1-D with size the last dimension of `value`. - * @param options carries optional attributes values + * @param bias 1-D with size the last dimension of {@code value}. + * @param options carries optional attribute values + * @param data type for {@code BiasAdd} output and operands * @return a new instance of BiasAdd */ public BiasAdd biasAdd(Operand value, Operand bias, @@ -250,15 +299,14 @@ public BiasAdd biasAdd(Operand value, Operand bias, } /** - * The backward operation for "BiasAdd" on the "bias" tensor. - *

+ * The backward operation for "BiasAdd" on the "bias" tensor. * 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 * @param outBackprop Any number of dimensions. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code BiasAddGrad} output and operands * @return a new instance of BiasAddGrad */ public BiasAddGrad biasAddGrad(Operand outBackprop, @@ -266,9 +314,106 @@ 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 * SparseToDense op, then added to the logits of the sampled candidates. This has * the effect of 'removing' the sampled labels that match the true labels by @@ -277,7 +422,7 @@ public BiasAddGrad biasAddGrad(Operand outBackprop, * @param trueClasses The true_classes output of UnpackSparseLabels. * @param sampledCandidates The sampled_candidates output of CandidateSampler. * @param numTrue Number of true labels per context. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ComputeAccidentalHits */ public ComputeAccidentalHits computeAccidentalHits(Operand trueClasses, @@ -286,40 +431,64 @@ public ComputeAccidentalHits computeAccidentalHits(Operand trueClasses, } /** - * Computes a 2-D convolution given 4-D `input` and `filter` tensors. - *

- * Given an input tensor of shape `[batch, in_height, in_width, in_channels]` + * 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]} * and a filter / kernel tensor of shape - * `[filter_height, filter_width, in_channels, out_channels]`, this op + * {@code [filter_height, filter_width, in_channels, out_channels]}, this op * performs the following: - *

- * 1. Flattens the filter to a 2-D matrix with shape - * `[filter_height * filter_width * in_channels, output_channels]`. - * 2. Extracts image patches from the input tensor to form a virtual - * tensor of shape `[batch, out_height, out_width, - * filter_height * filter_width * in_channels]`. - * 3. For each patch, right-multiplies the filter matrix and the image patch - * vector. - *

- * In detail, with the default NHWC format, - *

- * output[b, i, j, k] = - * sum_{di, dj, q} input[b, strides[1] * i + di, strides[2] * j + dj, q] * - * filter[di, dj, q, k] - *

- * Must have `strides[0] = strides[3] = 1`. For the most common case of the same - * horizontal and vertices strides, `strides = [1, stride, stride, 1]`. - * - * @param data type for {@code output()} output + *

    + *
  1. Flattens the filter to a 2-D matrix with shape + * {@code [filter_height * filter_width * in_channels, output_channels]}.
  2. + *
  3. Extracts image patches from the input tensor to form a virtual + * tensor of shape {@code [batch, out_height, out_width, filter_height * filter_width * in_channels]}.
  4. + *
  5. For each patch, right-multiplies the filter matrix and the image patch + * vector.
  6. + *
+ *

In detail, with the default NHWC format, + *

+   *  output[b, i, j, k] =
+   *      sum_{di, dj, q} input[b, strides[1] * i + di, strides[2] * j + dj, q] *
+   *                      filter[di, dj, q, k]
+   *  
+ *

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 input A 4-D tensor. The dimension order is interpreted according to the value - * of `data_format`, see below for details. + * of {@code data_format}, see below for details. * @param filter A 4-D tensor of shape - * `[filter_height, filter_width, in_channels, out_channels]` + * {@code [filter_height, filter_width, in_channels, out_channels]} * @param strides 1-D tensor of length 4. The stride of the sliding window for each - * dimension of `input`. The dimension order is determined by the value of - * `data_format`, see below for details. + * dimension of {@code input}. The dimension order is determined by the value of + * {@code data_format}, see below for details. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Conv2D} output and operands * @return a new instance of Conv2d */ public Conv2d conv2d(Operand input, Operand filter, @@ -330,18 +499,18 @@ 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 `[batch, in_height, in_width, in_channels]`. - * @param filterSizes An integer vector representing the tensor shape of `filter`, - * where `filter` is a 4-D - * `[filter_height, filter_width, in_channels, out_channels]` tensor. - * @param outBackprop 4-D with shape `[batch, out_height, out_width, out_channels]`. + * @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 + * {@code [filter_height, filter_width, in_channels, out_channels]} tensor. + * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code Conv2DBackpropFilter} output and operands * @return a new instance of Conv2dBackpropFilter */ public Conv2dBackpropFilter conv2dBackpropFilter(Operand input, @@ -353,18 +522,18 @@ 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 `input`, - * where `input` is a 4-D `[batch, height, width, channels]` tensor. + * @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 - * `[filter_height, filter_width, in_channels, out_channels]`. - * @param outBackprop 4-D with shape `[batch, out_height, out_width, out_channels]`. + * {@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 attributes values + * @param options carries optional attribute values + * @param data type for {@code Conv2DBackpropInput} output and operands * @return a new instance of Conv2dBackpropInput */ public Conv2dBackpropInput conv2dBackpropInput(Operand inputSizes, @@ -374,22 +543,19 @@ public Conv2dBackpropInput conv2dBackpropInput(Operand + * Computes a 3-D convolution given 5-D {@code input} and {@code filter} tensors. * In signal processing, cross-correlation is a measure of similarity of * 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. + *

Our Conv3D implements a form of cross-correlation. * - * @param data type for {@code output()} output - * @param input Shape `[batch, in_depth, in_height, in_width, in_channels]`. - * @param filter Shape `[filter_depth, filter_height, filter_width, in_channels, - * out_channels]`. `in_channels` must match between `input` and `filter`. + * @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 - * dimension of `input`. Must have `strides[0] = strides[4] = 1`. + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Conv3D} output and operands * @return a new instance of Conv3d */ public Conv3d conv3d(Operand input, Operand filter, @@ -400,18 +566,17 @@ 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 `[batch, depth, rows, cols, in_channels]`. - * @param filterSizes An integer vector representing the tensor shape of `filter`, - * where `filter` is a 5-D - * `[filter_depth, filter_height, filter_width, in_channels, out_channels]` + * @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 + * {@code [filter_depth, filter_height, filter_width, in_channels, out_channels]} * tensor. - * @param outBackprop Backprop signal of shape `[batch, out_depth, out_rows, out_cols, - * out_channels]`. + * @param outBackprop Backprop signal of shape {@code [batch, out_depth, out_rows, out_cols, out_channels]}. * @param strides 1-D tensor of length 5. The stride of the sliding window for each - * dimension of `input`. Must have `strides[0] = strides[4] = 1`. + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Conv3DBackpropFilterV2} output and operands * @return a new instance of Conv3dBackpropFilter */ public Conv3dBackpropFilter conv3dBackpropFilter(Operand input, @@ -423,18 +588,17 @@ 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 `input`, - * where `input` is a 5-D - * `[batch, depth, rows, cols, in_channels]` tensor. - * @param filter Shape `[depth, rows, cols, in_channels, out_channels]`. - * `in_channels` must match between `input` and `filter`. - * @param outBackprop Backprop signal of shape `[batch, out_depth, out_rows, out_cols, - * out_channels]`. + * @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. + * @param filter Shape {@code [depth, rows, cols, in_channels, out_channels]}. + * {@code in_channels} must match between {@code input} and {@code filter}. + * @param outBackprop Backprop signal of shape {@code [batch, out_depth, out_rows, out_cols, out_channels]}. * @param strides 1-D tensor of length 5. The stride of the sliding window for each - * dimension of `input`. Must have `strides[0] = strides[4] = 1`. + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Conv3DBackpropInputV2} output and operands * @return a new instance of Conv3dBackpropInput */ public Conv3dBackpropInput conv3dBackpropInput( @@ -445,19 +609,18 @@ public Conv3dBackpropInput conv3dBackpropInput( /** * Performs beam search decoding on the logits given in input. - *

* A note about the attribute merge_repeated: For the beam search decoder, * this means that if consecutive entries in a beam are the same, only - * 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 + * 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 logProbability()} output - * @param inputs 3-D, shape: `(max_time x batch_size x num_classes)`, the logits. - * @param sequenceLength A vector containing sequence lengths, size `(batch)`. - * @param beamWidth A scalar >= 0 (beam search beam width). - * @param topPaths A scalar >= 0, <= beam_width (controls output size). - * @param options carries optional attributes values + * @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). + * @param topPaths A scalar >= 0, <= beam_width (controls output size). + * @param options carries optional attribute values + * @param data type for {@code CTCBeamSearchDecoder} output and operands * @return a new instance of CtcBeamSearchDecoder */ public CtcBeamSearchDecoder ctcBeamSearchDecoder(Operand inputs, @@ -468,21 +631,19 @@ public CtcBeamSearchDecoder ctcBeamSearchDecoder(Operand< /** * Performs greedy decoding on the logits given in inputs. - *

* A note about the attribute merge_repeated: if enabled, when * consecutive logits' maximum indices are the same, only the first of - * these is emitted. Labeling the blank '*', the sequence "A B B * B B" - * becomes "A B B" if merge_repeated = True and "A B B B B" if + * these is emitted. Labeling the blank '*', the sequence "A B B * B B" + * becomes "A B B" if merge_repeated = True and "A B B B B" if * merge_repeated = False. - *

- * Regardless of the value of merge_repeated, if the maximum index of a given - * time and batch corresponds to the blank, index `(num_classes - 1)`, no new + *

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 logProbability()} output - * @param inputs 3-D, shape: `(max_time x batch_size x num_classes)`, the logits. - * @param sequenceLength A vector containing sequence lengths, size `(batch_size)`. - * @param options carries optional attributes values + * @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 + * @param data type for {@code CTCGreedyDecoder} output and operands * @return a new instance of CtcGreedyDecoder */ public CtcGreedyDecoder ctcGreedyDecoder(Operand inputs, @@ -492,18 +653,17 @@ public CtcGreedyDecoder ctcGreedyDecoder(Operand input /** * 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 - * @param inputs 3-D, shape: `(max_time x batch_size x num_classes)`, the logits. - * @param labelsIndices The indices of a `SparseTensor`. - * `labels_indices(i, :) == [b, t]` means `labels_values(i)` stores the id for - * `(batch b, time t)`. + * @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 + * {@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 attributes values + * @param options carries optional attribute values + * @param data type for {@code CTCLoss} output and operands * @return a new instance of CtcLoss */ public CtcLoss ctcLoss(Operand inputs, Operand labelsIndices, @@ -511,47 +671,172 @@ 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 * upcoming training or inferences. - *

- * Note that the params buffer may not be compatible across different GPUs. So any + *

Note that the params buffer may not be compatible across different GPUs. So any * save and restoration should be converted to and from the canonical weights and * biases. - *

- * num_layers: Specifies the number of layers in the RNN model. + *

num_layers: Specifies the number of layers in the RNN model. * num_units: Specifies the size of the hidden state. * input_size: Specifies the size of the input state. * weights: the canonical form of weights that can be used for saving - * and restoration. They are more likely to be compatible across different - * generations. + * and restoration. They are more likely to be compatible across different + * generations. * biases: the canonical form of biases that can be used for saving - * and restoration. They are more likely to be compatible across different - * generations. + * and restoration. They are more likely to be compatible across different + * generations. * num_params_weights: number of weight parameter matrix for all layers. * num_params_biases: number of bias parameter vector for all layers. * rnn_mode: Indicates the type of the RNN model. * input_mode: Indicate 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'. + * 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. - * dir = (direction == bidirectional) ? 2 : 1 + * dir = (direction == bidirectional) ? 2 : 1 * 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. * 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 - * @param numUnits - * @param inputSize - * @param weights - * @param biases - * @param options carries optional attributes values + * no projection is performed. + * + * @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 */ public CudnnRNNCanonicalToParams cudnnRNNCanonicalToParams( @@ -563,46 +848,43 @@ public CudnnRNNCanonicalToParams cudnnRNNCanonicalToParam /** * Retrieves CudnnRNN params in canonical form. It supports the projection in LSTM. - *

* Retrieves a set of weights from the opaque params buffer that can be saved and * restored in a way compatible with future runs. - *

- * Note that the params buffer may not be compatible across different GPUs. So any + *

Note that the params buffer may not be compatible across different GPUs. So any * save and restoration should be converted to and from the canonical weights and * biases. - *

- * num_layers: Specifies the number of layers in the RNN model. + *

num_layers: Specifies the number of layers in the RNN model. * num_units: Specifies the size of the hidden state. * input_size: Specifies the size of the input state. * num_params_weights: number of weight parameter matrix for all layers. * num_params_biases: number of bias parameter vector for all layers. * weights: the canonical form of weights that can be used for saving - * and restoration. They are more likely to be compatible across different - * generations. + * and restoration. They are more likely to be compatible across different + * generations. * biases: the canonical form of biases that can be used for saving - * and restoration. They are more likely to be compatible across different - * generations. + * and restoration. They are more likely to be compatible across different + * generations. * rnn_mode: Indicates the type of the RNN model. * input_mode: Indicate 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'. + * 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. - * dir = (direction == bidirectional) ? 2 : 1 + * dir = (direction == bidirectional) ? 2 : 1 * 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. * 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 - * @param numUnits - * @param inputSize - * @param params - * @param numParamsWeights - * @param numParamsBiases - * @param options carries optional attributes values + * no projection is performed. + * + * @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 */ public CudnnRNNParamsToCanonical cudnnRNNParamsToCanonical( @@ -614,53 +896,51 @@ public CudnnRNNParamsToCanonical cudnnRNNParamsToCanonica /** * Computes size of weights that can be used by a Cudnn RNN model. - *

* Return the params size that can be used by the Cudnn RNN model. Subsequent * weight allocation and initialization should use this size. - *

- * num_layers: Specifies the number of layers in the RNN model. + *

num_layers: Specifies the number of layers in the RNN model. * num_units: Specifies the size of the hidden state. * input_size: Specifies the size of the input state. * rnn_mode: Indicates the type of the RNN model. * input_mode: Indicate 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'. + * 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. - * dir = (direction == bidirectional) ? 2 : 1 + * dir = (direction == bidirectional) ? 2 : 1 * 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. * params_size: The size of the params buffer that should be allocated and - * initialized for this RNN model. Note that this params buffer may not be - * 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 paramsSize()} output - * @param numLayers - * @param numUnits - * @param inputSize - * @param T - * @param S - * @param options carries optional attributes values + * initialized for this RNN model. Note that this params buffer may not be + * compatible across GPUs. Please use CudnnRNNParamsWeights and + * CudnnRNNParamsBiases to save and restore them in a way that is compatible + * across different runs. + * + * @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 * @return a new instance of CudnnRnnParamsSize */ - public CudnnRnnParamsSize cudnnRnnParamsSize( - Operand numLayers, Operand numUnits, Operand inputSize, Class T, - Class S, CudnnRnnParamsSize.Options... options) { + public CudnnRnnParamsSize cudnnRnnParamsSize( + Operand numLayers, Operand numUnits, Operand inputSize, Class T, + Class S, CudnnRnnParamsSize.Options... options) { return CudnnRnnParamsSize.create(scope, numLayers, numUnits, inputSize, T, S, options); } /** * 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code DataFormatDimMap} output and operands * @return a new instance of DataFormatDimMap */ public DataFormatDimMap dataFormatDimMap(Operand x, @@ -669,32 +949,40 @@ public DataFormatDimMap dataFormatDimMap(Operand x, } /** - * Permute input tensor from `src_format` to `dst_format`. - *

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

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

{@code
+   * Permute input tensor from {@code src_format} to {@code dst_format}.
+   *  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 - *
{@code
-   *  [[1, 2, 3, 4],
-   *   [5, 6, 7, 8]]
-   *  }
- * , the outputs will be (respectively): - *
{@code
+   *  
+ *

, the output will be: + *

    *  [1, 4, 2, 3]
-   *  }
- * and - *
{@code
-   *  [[1, 4, 2, 3],
-   *   [5, 8, 6, 7]]
-   *  }
- * - * @param data type for {@code y()} output - * @param x Vector of size 4 or Tensor of shape (4, 2) in source data format. - * @param options carries optional attributes values + *
+ *

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

+   *  [[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]
+   *  
+ *

, the output will be: + *

+   *  [1, 2]
+   *  
+ * + * @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 */ public DataFormatVecPermute dataFormatVecPermute(Operand x, @@ -704,90 +992,85 @@ public DataFormatVecPermute dataFormatVecPermute(Operand< /** * DepthToSpace for tensors of type T. - *

* Rearranges data from depth into blocks of spatial data. * This is the reverse transformation of SpaceToDepth. More specifically, - * this op outputs a copy of the input tensor where values from the `depth` - * dimension are moved in spatial blocks to the `height` and `width` dimensions. - * The attr `block_size` indicates the input block size and how the data is moved. - *

- * Chunks of data of size `block_size * block_size` from depth are rearranged - * into non-overlapping blocks of size `block_size x block_size` - * The width the output tensor is `input_depth * block_size`, whereas the - * height is `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. - * The depth of the input tensor must be divisible by - * `block_size * block_size`. - *

- * The `data_format` attr specifies the layout of the input and output tensors + * this op outputs a copy of the input tensor where values from the {@code depth} + * dimension are moved in spatial blocks to the {@code height} and {@code width} dimensions. + * The attr {@code block_size} indicates the input block size and how the data is moved. + *

    + *
  • 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 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.
  • + *
  • The depth of the input tensor must be divisible by + * {@code block_size * block_size}.
  • + *
+ *

The {@code data_format} attr specifies the layout of the input and output tensors * with the following options: - * "NHWC": `[ batch, height, width, channels ]` - * "NCHW": `[ batch, channels, height, width ]` - * "NCHW_VECT_C": - * `qint8 [ batch, channels / 4, height, width, 4 ]` - *

- * It is useful to consider the operation as transforming a 6-D Tensor. + * "NHWC": {@code [ batch, height, width, channels ]} + * "NCHW": {@code [ batch, channels, height, width ]} + * "NCHW_VECT_C": + * {@code qint8 [ batch, channels / 4, height, width, 4 ]} + *

It is useful to consider the operation as transforming a 6-D Tensor. * e.g. for data_format = NHWC, - * Each element in the input tensor can be specified via 6 coordinates, - * ordered by decreasing memory layout significance as: - * n,iY,iX,bY,bX,oC (where n=batch index, iX, iY means X or Y coordinates - * within the input image, bX, bY means coordinates - * within the output block, oC means output channels). - * The output would be the input transposed to the following layout: - * n,iY,bY,iX,bX,oC - *

- * This operation is useful for resizing the activations between convolutions + * Each element in the input tensor can be specified via 6 coordinates, + * ordered by decreasing memory layout significance as: + * n,iY,iX,bY,bX,oC (where n=batch index, iX, iY means X or Y coordinates + * within the input image, bX, bY means coordinates + * within the output block, oC means output channels). + * The output would be the input transposed to the following layout: + * n,iY,bY,iX,bX,oC + *

This operation is useful for resizing the activations between convolutions * (but keeping all data), e.g. instead of pooling. It is also useful for training * purely convolutional models. - *

- * For example, given an input of shape `[1, 1, 1, 4]`, data_format = "NHWC" and + *

For example, given an input of shape {@code [1, 1, 1, 4]}, data_format = "NHWC" and * block_size = 2: - *

{@code
+   *  
    *  x = [[[[1, 2, 3, 4]]]]
    *
-   *  }
- * This operation will output a tensor of shape `[1, 2, 2, 1]`: - *
{@code
+   *  
+ *

This operation will output a tensor of shape {@code [1, 2, 2, 1]}: + *

    *     [[[[1], [2]],
    *       [[3], [4]]]]
-   *  }
- * Here, the input has a batch of 1 and each batch element has shape `[1, 1, 4]`, + *
+ *

Here, the input has a batch of 1 and each batch element has shape {@code [1, 1, 4]}, * the corresponding output will have 2x2 elements and will have a depth of - * 1 channel (1 = `4 / (block_size * block_size)`). - * The output element shape is `[2, 2, 1]`. - *

- * For an input tensor with larger depth, here of shape `[1, 1, 1, 12]`, e.g. - *

{@code
+   *  1 channel (1 = {@code 4 / (block_size * block_size)}).
+   *  The output element shape is {@code [2, 2, 1]}.
+   *  

For an input tensor with larger depth, here of shape {@code [1, 1, 1, 12]}, e.g. + *

    *  x = [[[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]]]]
-   *  }
- * This operation, for block size of 2, will return the following tensor of shape - * `[1, 2, 2, 3]` - *
{@code
+   *  
+ *

This operation, for block size of 2, will return the following tensor of shape + * {@code [1, 2, 2, 3]} + *

    *     [[[[1, 2, 3], [4, 5, 6]],
    *       [[7, 8, 9], [10, 11, 12]]]]
    *
-   *  }
- * Similarly, for the following input of shape `[1 2 2 4]`, and a block size of 2: - *
{@code
+   *  
+ *

Similarly, for the following input of shape {@code [1 2 2 4]}, and a block size of 2: + *

    *  x =  [[[[1, 2, 3, 4],
    *         [5, 6, 7, 8]],
    *        [[9, 10, 11, 12],
    *         [13, 14, 15, 16]]]]
-   *  }
- * the operator will return the following tensor of shape `[1 4 4 1]`: - *
{@code
+   *  
+ *

the operator will return the following tensor of shape {@code [1 4 4 1]}: + *

    *  x = [[[ [1],   [2],  [5],  [6]],
    *        [ [3],   [4],  [7],  [8]],
    *        [ [9],  [10], [13],  [14]],
    *        [ [11], [12], [15],  [16]]]]
    *
-   *  }
+ *
* - * @param data type for {@code output()} output - * @param input + * @param input The input value * @param blockSize The size of the spatial block, same as in Space2Depth. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code DepthToSpace} output and operands * @return a new instance of DepthToSpace */ public DepthToSpace depthToSpace(Operand input, Long blockSize, @@ -796,32 +1079,31 @@ public DepthToSpace depthToSpace(Operand input, Long blo } /** - * Computes a 2-D depthwise convolution given 4-D `input` and `filter` tensors. - *

- * Given an input tensor of shape `[batch, in_height, in_width, in_channels]` + * Computes a 2-D depthwise convolution given 4-D {@code input} and {@code filter} tensors. + * Given an input tensor of shape {@code [batch, in_height, in_width, in_channels]} * and a filter / kernel tensor of shape - * `[filter_height, filter_width, in_channels, channel_multiplier]`, containing - * `in_channels` convolutional filters of depth 1, `depthwise_conv2d` applies + * {@code [filter_height, filter_width, in_channels, channel_multiplier]}, containing + * {@code in_channels} convolutional filters of depth 1, {@code depthwise_conv2d} applies * a different filter to each input channel (expanding from 1 channel to - * `channel_multiplier` channels for each), then concatenates the results - * together. Thus, the output has `in_channels * channel_multiplier` channels. - *

{@code
+   *  {@code channel_multiplier} channels for each), then concatenates the results
+   *  together. Thus, the output has {@code in_channels * channel_multiplier} channels.
+   *  
    *  for k in 0..in_channels-1
    *    for q in 0..channel_multiplier-1
    *      output[b, i, j, k * channel_multiplier + q] =
    *        sum_{di, dj} input[b, strides[1] * i + di, strides[2] * j + dj, k] *
    *                          filter[di, dj, k, q]
-   *  }
- * Must have `strides[0] = strides[3] = 1`. For the most common case of the same - * horizontal and vertices strides, `strides = [1, stride, stride, 1]`. + *
+ *

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 - * @param filter + * @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 `input`. + * of {@code input}. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code DepthwiseConv2dNative} output and operands * @return a new instance of DepthwiseConv2dNative */ public DepthwiseConv2dNative depthwiseConv2dNative(Operand input, @@ -833,21 +1115,20 @@ 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 `data_format`. For example, if - * `data_format` is 'NHWC' then `input` is a 4-D `[batch, in_height, - * in_width, in_channels]` tensor. - * @param filterSizes An integer vector representing the tensor shape of `filter`, - * where `filter` is a 4-D - * `[filter_height, filter_width, in_channels, depthwise_multiplier]` tensor. - * @param outBackprop 4-D with shape based on `data_format`. - * For example, if `data_format` is 'NHWC' then - * out_backprop shape is `[batch, out_height, out_width, out_channels]`. + * @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}, + * where {@code filter} is a 4-D + * {@code [filter_height, filter_width, in_channels, depthwise_multiplier]} tensor. + * @param outBackprop 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. * @param strides The stride of the sliding window for each dimension of the input * of the convolution. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code DepthwiseConv2dNativeBackpropFilter} output and operands * @return a new instance of DepthwiseConv2dNativeBackpropFilter */ public DepthwiseConv2dNativeBackpropFilter depthwiseConv2dNativeBackpropFilter( @@ -859,20 +1140,20 @@ 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 `input`, based - * on `data_format`. For example, if `data_format` is 'NHWC' then - * `input` is a 4-D `[batch, height, width, channels]` tensor. + * @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. * @param filter 4-D with shape - * `[filter_height, filter_width, in_channels, depthwise_multiplier]`. - * @param outBackprop 4-D with shape based on `data_format`. - * For example, if `data_format` is 'NHWC' then - * out_backprop shape is `[batch, out_height, out_width, out_channels]`. + * {@code [filter_height, filter_width, in_channels, depthwise_multiplier]}. + * @param outBackprop 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. * @param strides The stride of the sliding window for each dimension of the input * of the convolution. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code DepthwiseConv2dNativeBackpropInput} output and operands * @return a new instance of DepthwiseConv2dNativeBackpropInput */ public DepthwiseConv2dNativeBackpropInput depthwiseConv2dNativeBackpropInput( @@ -882,40 +1163,37 @@ public DepthwiseConv2dNativeBackpropInput depthwiseConv2d } /** - * Computes the grayscale dilation of 4-D `input` and 3-D `filter` tensors. - *

- * The `input` tensor has shape `[batch, in_height, in_width, depth]` and the - * `filter` tensor has shape `[filter_height, filter_width, depth]`, i.e., each + * Computes the grayscale dilation of 4-D {@code input} and 3-D {@code filter} tensors. + * The {@code input} tensor has shape {@code [batch, in_height, in_width, depth]} and the + * {@code filter} tensor has shape {@code [filter_height, filter_width, depth]}, i.e., each * input channel is processed independently of the others with its own structuring - * function. The `output` tensor has shape - * `[batch, out_height, out_width, depth]`. The spatial dimensions of the output - * tensor depend on the `padding` algorithm. We currently only support the default - * "NHWC" `data_format`. - *

- * In detail, the grayscale morphological 2-D dilation is the max-sum correlation - * (for consistency with `conv2d`, we use unmirrored filters): - *

- * output[b, y, x, c] = - * max_{dy, dx} input[b, - * strides[1] * y + rates[1] * dy, - * strides[2] * x + rates[2] * dx, - * c] + - * filter[dy, dx, c] - *

- * Max-pooling is a special case when the filter has size equal to the pooling + * function. The {@code output} tensor has shape + * {@code [batch, out_height, out_width, depth]}. The spatial dimensions of the output + * tensor depend on the {@code padding} algorithm. We currently only support the default + * "NHWC" {@code data_format}. + *

In detail, the grayscale morphological 2-D dilation is the max-sum correlation + * (for consistency with {@code conv2d}, we use unmirrored filters): + *

+   *  output[b, y, x, c] =
+   *     max_{dy, dx} input[b,
+   *                        strides[1] * y + rates[1] * dy,
+   *                        strides[2] * x + rates[2] * dx,
+   *                        c] +
+   *                  filter[dy, dx, c]
+   *  
+ *

Max-pooling is a special case when the filter has size equal to the pooling * kernel size and contains all zeros. - *

- * Note on duality: The dilation of `input` by the `filter` is equal to the - * negation of the erosion of `-input` by the reflected `filter`. + *

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 `[batch, in_height, in_width, depth]`. - * @param filter 3-D with shape `[filter_height, filter_width, depth]`. + * @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 - * tensor. Must be: `[1, stride_height, stride_width, 1]`. + * tensor. Must be: {@code [1, stride_height, stride_width, 1]}. * @param rates The input stride for atrous morphological dilation. Must be: - * `[1, rate_height, rate_width, 1]`. + * {@code [1, rate_height, rate_width, 1]}. * @param padding The type of padding algorithm to use. + * @param data type for {@code Dilation2D} output and operands * @return a new instance of Dilation2d */ public Dilation2d dilation2d(Operand input, Operand filter, @@ -926,15 +1204,15 @@ public Dilation2d dilation2d(Operand input, Operand /** * Computes the gradient of morphological 2-D dilation with respect to the filter. * - * @param data type for {@code filterBackprop()} output - * @param input 4-D with shape `[batch, in_height, in_width, depth]`. - * @param filter 3-D with shape `[filter_height, filter_width, depth]`. - * @param outBackprop 4-D with shape `[batch, out_height, out_width, depth]`. + * @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]}. * @param strides 1-D of length 4. The stride of the sliding window for each dimension of - * the input tensor. Must be: `[1, stride_height, stride_width, 1]`. + * the input tensor. Must be: {@code [1, stride_height, stride_width, 1]}. * @param rates 1-D of length 4. The input stride for atrous morphological dilation. - * Must be: `[1, rate_height, rate_width, 1]`. + * Must be: {@code [1, rate_height, rate_width, 1]}. * @param padding The type of padding algorithm to use. + * @param data type for {@code Dilation2DBackpropFilter} output and operands * @return a new instance of Dilation2dBackpropFilter */ public Dilation2dBackpropFilter dilation2dBackpropFilter(Operand input, @@ -946,15 +1224,15 @@ public Dilation2dBackpropFilter dilation2dBackpropFilter( /** * Computes the gradient of morphological 2-D dilation with respect to the input. * - * @param data type for {@code inBackprop()} output - * @param input 4-D with shape `[batch, in_height, in_width, depth]`. - * @param filter 3-D with shape `[filter_height, filter_width, depth]`. - * @param outBackprop 4-D with shape `[batch, out_height, out_width, depth]`. + * @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]}. * @param strides 1-D of length 4. The stride of the sliding window for each dimension of - * the input tensor. Must be: `[1, stride_height, stride_width, 1]`. + * the input tensor. Must be: {@code [1, stride_height, stride_width, 1]}. * @param rates 1-D of length 4. The input stride for atrous morphological dilation. - * Must be: `[1, rate_height, rate_width, 1]`. + * Must be: {@code [1, rate_height, rate_width, 1]}. * @param padding The type of padding algorithm to use. + * @param data type for {@code Dilation2DBackpropInput} output and operands * @return a new instance of Dilation2dBackpropInput */ public Dilation2dBackpropInput dilation2dBackpropInput(Operand input, @@ -964,33 +1242,58 @@ public Dilation2dBackpropInput dilation2dBackpropInput(Op } /** - * Computes exponential linear: `exp(features) - 1` if < 0, `features` otherwise. - *

- * See [Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs) - * ](http://arxiv.org/abs/1511.07289) - * - * @param data type for {@code activations()} output - * @param features + * Computes the exponential linear function. + * The ELU function is defined as: + *

    + *
  • $ e ^ x - 1 $ if $ x < 0 $
  • + *
  • $ x $ if $ x >= 0 $
  • + *
+ *

Examples: + *

+ *
+ *
+ *

tf.nn.elu(1.0) + * <tf.Tensor: shape=(), dtype=float32, numpy=1.0> + * tf.nn.elu(0.0) + * <tf.Tensor: shape=(), dtype=float32, numpy=0.0> + * tf.nn.elu(-1000.0) + * <tf.Tensor: shape=(), dtype=float32, numpy=-1.0> + *

+ *
+ *
+ *

See Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs) + * + * + * @param features The features value + * @param data type for {@code Elu} output and operands * @return a new instance of Elu */ 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 * file or passed in as an in-memory array instead of building up the distribution * from data on the fly. There is also an option to skew the distribution by * applying a distortion power to the weights. - *

- * The vocabulary file should be in CSV-like format, with the last field + *

The vocabulary file should be in CSV-like format, with the last field * being the weight associated with the word. - *

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

- * The advantages of sampling candidates per-batch are simplicity and the + *

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. @@ -1003,7 +1306,7 @@ public Elu elu(Operand features) { * 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 attributes values + * @param options carries optional attribute values * @return a new instance of FixedUnigramCandidateSampler */ public FixedUnigramCandidateSampler fixedUnigramCandidateSampler(Operand trueClasses, @@ -1014,21 +1317,20 @@ public FixedUnigramCandidateSampler fixedUnigramCandidateSampler(Operand /** * Performs fractional average pooling on the input. - *

* Fractional average pooling is similar to Fractional max pooling in the pooling * region generation step. The only difference is that after pooling regions are * 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 `[batch, height, width, channels]`. - * @param poolingRatio Pooling ratio for each dimension of `value`, currently only - * supports row and col dimension and should be >= 1.0. For example, a valid + * @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 * 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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code FractionalAvgPool} output and operands * @return a new instance of FractionalAvgPool */ public FractionalAvgPool fractionalAvgPool(Operand value, @@ -1036,47 +1338,70 @@ 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 * regular max pooling, you downsize an input set by taking the maximum value of * smaller N x N subsections of the set (often 2x2), and try to reduce the set by * a factor of N, where N is an integer. Fractional max pooling, as you might - * expect from the word "fractional", means that the overall reduction ratio N + * expect from the word "fractional", means that the overall reduction ratio N * does not have to be an integer. - *

- * The sizes of the pooling regions are generated randomly but are fairly uniform. + *

The sizes of the pooling regions are generated randomly but are fairly uniform. * For example, let's look at the height dimension, and the constraints on the * list of rows that will be pool boundaries. - *

- * First we define the following: - *

- * 1. input_row_length : the number of rows from the input set - * 2. output_row_length : which will be smaller than the input - * 3. alpha = input_row_length / output_row_length : our reduction ratio - * 4. K = floor(alpha) - * 5. row_pooling_sequence : this is the result list of pool boundary rows - *

- * Then, row_pooling_sequence should satisfy: - *

- * 1. a[0] = 0 : the first value of the sequence is 0 - * 2. a[end] = input_row_length : the last value of the sequence is the size - * 3. K <= (a[i+1] - a[i]) <= K+1 : all intervals are K or K+1 size - * 4. length(row_pooling_sequence) = output_row_length+1 - *

- * For more details on fractional max pooling, see this paper: - * [Benjamin Graham, Fractional Max-Pooling](http://arxiv.org/abs/1412.6071) - * - * @param data type for {@code output()} output - * @param value 4-D with shape `[batch, height, width, channels]`. - * @param poolingRatio Pooling ratio for each dimension of `value`, currently only - * supports row and col dimension and should be >= 1.0. For example, a valid + *

First we define the following: + *

    + *
  1. input_row_length : the number of rows from the input set
  2. + *
  3. output_row_length : which will be smaller than the input
  4. + *
  5. alpha = input_row_length / output_row_length : our reduction ratio
  6. + *
  7. K = floor(alpha)
  8. + *
  9. row_pooling_sequence : this is the result list of pool boundary rows
  10. + *
+ *

Then, row_pooling_sequence should satisfy: + *

    + *
  1. a[0] = 0 : the first value of the sequence is 0
  2. + *
  3. a[end] = input_row_length : the last value of the sequence is the size
  4. + *
  5. K <= (a[i+1] - a[i]) <= K+1 : all intervals are K or K+1 size
  6. + *
  7. length(row_pooling_sequence) = output_row_length+1
  8. + *
+ *

For more details on fractional max pooling, see this paper: + * Benjamin Graham, Fractional Max-Pooling + * + * @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 * 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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code FractionalMaxPool} output and operands * @return a new instance of FractionalMaxPool */ public FractionalMaxPool fractionalMaxPool(Operand value, @@ -1084,14 +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". + * 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 batchMean()} 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. @@ -1099,7 +1442,9 @@ public FractionalMaxPool fractionalMaxPool(Operand val * must be empty for training. * @param variance A 1D Tensor for population variance. Used for inference only; * must be empty for training. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code FusedBatchNormV3} output and operands + * @param data type for {@code FusedBatchNormV3} output and operands * @return a new instance of FusedBatchNorm */ public FusedBatchNorm fusedBatchNorm(Operand x, @@ -1110,12 +1455,9 @@ public FusedBatchNorm fusedBatchNor /** * Gradient for batch normalization. - *

- * Note that the size of 4D Tensors are defined by either "NHWC" or "NCHW". + * 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 xBackprop()} output - * @param data type for {@code scaleBackprop()} 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. @@ -1131,7 +1473,9 @@ public FusedBatchNorm fusedBatchNor * @param reserveSpace3 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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code FusedBatchNormGradV3} output and operands + * @param data type for {@code FusedBatchNormGradV3} output and operands * @return a new instance of FusedBatchNormGrad */ public FusedBatchNormGrad fusedBatchNormGrad( @@ -1142,7 +1486,6 @@ public FusedBatchNormGrad fusedBatc /** * Performs a padding as a preprocess during a convolution. - *

* Similar to FusedResizeAndPadConv2d, this op allows for an optimized * implementation where the spatial padding transformation stage is fused with the * im2col lookup, but in this case without the bilinear filtering required for @@ -1155,16 +1498,16 @@ 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 `[batch, in_height, in_width, in_channels]`. + * @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 `input`. + * rows must be the same as the rank of {@code input}. * @param filter 4-D with shape - * `[filter_height, filter_width, in_channels, out_channels]`. - * @param mode + * {@code [filter_height, filter_width, in_channels, out_channels]}. + * @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 `input`. Must be in the same order as the dimension specified with format. + * of {@code input}. Must be in the same order as the dimension specified with format. * @param padding The type of padding algorithm to use. + * @param data type for {@code FusedPadConv2D} output and operands * @return a new instance of FusedPadConv2d */ public FusedPadConv2d fusedPadConv2d(Operand input, @@ -1175,7 +1518,6 @@ public FusedPadConv2d fusedPadConv2d(Operand input, /** * Performs a resize and padding as a preprocess during a convolution. - *

* It's often possible to do spatial transformations more efficiently as part of * the packing stage of a convolution, so this op allows for an optimized * implementation where these stages are fused together. This prevents the need to @@ -1187,48 +1529,195 @@ 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 `[batch, in_height, in_width, in_channels]`. - * @param size A 1-D int32 Tensor of 2 elements: `new_height, new_width`. The + * @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. * @param paddings A two-column matrix specifying the padding sizes. The number of - * rows must be the same as the rank of `input`. + * rows must be the same as the rank of {@code input}. * @param filter 4-D with shape - * `[filter_height, filter_width, in_channels, out_channels]`. - * @param mode + * {@code [filter_height, filter_width, in_channels, out_channels]}. + * @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 `input`. Must be in the same order as the dimension specified with format. + * of {@code input}. 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code FusedResizeAndPadConv2D} output and operands * @return a new instance of FusedResizeAndPadConv2d */ public FusedResizeAndPadConv2d fusedResizeAndPadConv2d(Operand input, - Operand size, Operand paddings, Operand filter, String mode, + Operand sizeOutput, Operand paddings, Operand filter, String mode, List strides, String padding, FusedResizeAndPadConv2d.Options... options) { - return FusedResizeAndPadConv2d.create(scope, input, size, paddings, filter, mode, strides, padding, options); - } - - /** - * Says whether the targets are in the top `K` predictions. - *

- * This outputs a `batch_size` bool array, an entry `out[i]` is `true` if the - * prediction for the target class is among the top `k` predictions among - * all predictions for example `i`. Note that the behavior of `InTopK` differs - * from the `TopK` op in its handling of ties; if multiple classes have the - * same prediction value and straddle the top-`k` boundary, all of those - * classes are considered to be in the top `k`. - *

- * More formally, let - *

- * \\(predictions_i\\) be the predictions for all classes for example `i`, - * \\(targets_i\\) be the target class for example `i`, - * \\(out_i\\) be the output for example `i`, - *

- * $$out_i = predictions_{i, targets_i} \in TopKIncludingTies(predictions_i)$$ - * - * @param predictions A `batch_size` x `classes` tensor. - * @param targets A `batch_size` vector of class ids. + 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 + * prediction for the target class is among the top {@code k} predictions among + * all predictions for example {@code i}. Note that the behavior of {@code InTopK} differs + * from the {@code TopK} op in its handling of ties; if multiple classes have the + * same prediction value and straddle the top-{@code k} boundary, all of those + * classes are considered to be in the top {@code k}. + *

More formally, let + *

\(predictions_i\) be the predictions for all classes for example {@code i}, + * \(targets_i\) be the target class for example {@code i}, + * \(out_i\) be the output for example {@code i}, + *

$$out_i = predictions_{i, targets_i} \in TopKIncludingTies(predictions_i)$$ + * + * @param predictions A {@code batch_size} x {@code classes} tensor. + * @param targets A {@code batch_size} vector of class ids. * @param k Number of top elements to look at for computing precision. + * @param data type for {@code InTopKV2} output and operands * @return a new instance of InTopK */ public InTopK inTopK(Operand predictions, Operand targets, @@ -1236,15 +1725,60 @@ 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 the output tensor. + *

Note on supported input-output type combinations: + *

    + *
  • For floating-point types, the output has the same dtype as the input.
  • + *
  • For 8-bit and 16-bit integer inputs, the output is a 32-bit float.
  • + *
  • For 32-bit and 64-bit integer inputs, the output is a 64-bit float.
  • + *
+ *

Using unsupported dtype pairs (for example, input=float64 with output=float32) + * will result in a "Could not find device for node" error. + * @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 `sqrt`: - *

- * output = sum(t ** 2) / 2 + * Computes half the L2 norm of a tensor without the {@code sqrt}: + *

+   *  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 */ public L2Loss l2Loss(Operand t) { @@ -1252,11 +1786,85 @@ public L2Loss l2Loss(Operand t) { } /** - * Computes rectified linear: `max(features, features * alpha)`. + * 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)
    *
-   * @param  data type for {@code activations()} output
-   * @param features
-   * @param options carries optional attributes values
+   *  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 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 */ public LeakyRelu leakyRelu(Operand features, @@ -1266,13 +1874,10 @@ public LeakyRelu leakyRelu(Operand features, /** * 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 + *

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. @@ -1285,7 +1890,7 @@ public LeakyRelu leakyRelu(Operand features, * 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 attributes values + * @param options carries optional attribute values * @return a new instance of LearnedUnigramCandidateSampler */ public LearnedUnigramCandidateSampler learnedUnigramCandidateSampler(Operand trueClasses, @@ -1296,22 +1901,21 @@ public LearnedUnigramCandidateSampler learnedUnigramCandidateSampler(Operand - * The 4-D `input` tensor is treated as a 3-D array of 1-D vectors (along the last + * The 4-D {@code input} tensor is treated as a 3-D array of 1-D vectors (along the last * dimension), and each vector is normalized independently. Within a given vector, * each component is divided by the weighted, squared sum of inputs within - * `depth_radius`. In detail, - *

- * sqr_sum[a, b, c, d] = - * sum(input[a, b, c, d - depth_radius : d + depth_radius + 1] ** 2) - * output = input / (bias + alpha * sqr_sum) ** beta - *

- * For details, see [Krizhevsky et al., ImageNet classification with deep - * convolutional neural networks (NIPS 2012)](http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks). - * - * @param data type for {@code output()} output + * {@code depth_radius}. In detail, + *

+   *  sqr_sum[a, b, c, d] =
+   *      sum(input[a, b, c, d - depth_radius : d + depth_radius + 1] ** 2)
+   *  output = input / (bias + alpha * sqr_sum) ** beta
+   *  
+ *

For details, see Krizhevsky et al., ImageNet classification with deep + * convolutional neural networks (NIPS 2012) . + * * @param input 4-D. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code LRN} output and operands * @return a new instance of LocalResponseNormalization */ public LocalResponseNormalization localResponseNormalization( @@ -1319,15 +1923,31 @@ 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 `i` and class `j` we have - *

- * logsoftmax[i, j] = logits[i, j] - log(sum(exp(logits[i]))) + * For each batch {@code i} and class {@code j} we have + *

+   *  logsoftmax[i, j] = logits[i, j] - log(sum(exp(logits[i])))
+   *  
* - * @param data type for {@code logsoftmax()} output - * @param logits 2-D with shape `[batch_size, num_classes]`. + * @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 */ public LogSoftmax logSoftmax(Operand logits) { @@ -1337,16 +1957,16 @@ 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 * input tensor. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MaxPoolV2} output and operands * @return a new instance of MaxPool */ - public MaxPool maxPool(Operand input, Operand ksize, + public MaxPool maxPool(Operand input, Operand ksize, Operand strides, String padding, MaxPool.Options... options) { return MaxPool.create(scope, input, ksize, strides, padding, options); } @@ -1354,14 +1974,14 @@ public MaxPool maxPool(Operand input, Operand ks /** * Performs 3D max pooling on the input. * - * @param data type for {@code output()} output - * @param input Shape `[batch, depth, rows, cols, channels]` tensor to pool over. + * @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 `ksize[0] = ksize[4] = 1`. + * the input tensor. Must have {@code ksize[0] = ksize[4] = 1}. * @param strides 1-D tensor of length 5. The stride of the sliding window for each - * dimension of `input`. Must have `strides[0] = strides[4] = 1`. + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MaxPool3D} output and operands * @return a new instance of MaxPool3d */ public MaxPool3d maxPool3d(Operand input, List ksize, @@ -1372,16 +1992,17 @@ 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 `[batch, depth, rows, cols, channels]`. + * @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 - * the input tensor. Must have `ksize[0] = ksize[4] = 1`. + * the input tensor. Must have {@code ksize[0] = ksize[4] = 1}. * @param strides 1-D tensor of length 5. The stride of the sliding window for each - * dimension of `input`. Must have `strides[0] = strides[4] = 1`. + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MaxPool3DGrad} output and operands + * @param data type for {@code MaxPool3DGrad} output and operands * @return a new instance of MaxPool3dGrad */ public MaxPool3dGrad maxPool3dGrad(Operand origInput, @@ -1393,16 +2014,16 @@ 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 `[batch, depth, rows, cols, channels]`. + * @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 - * the input tensor. Must have `ksize[0] = ksize[4] = 1`. + * the input tensor. Must have {@code ksize[0] = ksize[4] = 1}. * @param strides 1-D tensor of length 5. The stride of the sliding window for each - * dimension of `input`. Must have `strides[0] = strides[4] = 1`. + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MaxPool3DGradGrad} output and operands * @return a new instance of MaxPool3dGradGrad */ public MaxPool3dGradGrad maxPool3dGradGrad(Operand origInput, @@ -1414,15 +2035,15 @@ 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 `max_pool`. + * @param grad 4-D. Gradients w.r.t. the 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code MaxPoolGradV2} output and operands * @return a new instance of MaxPoolGrad */ public MaxPoolGrad maxPoolGrad(Operand origInput, Operand origOutput, @@ -1434,15 +2055,15 @@ 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 `max_pool`. + * @param grad 4-D. Gradients of gradients w.r.t. the input 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code MaxPoolGradGradV2} output and operands * @return a new instance of MaxPoolGradGrad */ public MaxPoolGradGrad maxPoolGradGrad(Operand origInput, @@ -1454,16 +2075,16 @@ 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 `[batch, height, width, channels]`. Gradients w.r.t. the - * input of `max_pool`. - * @param argmax The indices of the maximum values chosen for each output of `max_pool`. + * @param grad 4-D with shape {@code [batch, height, width, channels]}. Gradients w.r.t. the + * input 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code MaxPoolGradGradWithArgmax} output and operands * @return a new instance of MaxPoolGradGradWithArgmax */ public MaxPoolGradGradWithArgmax maxPoolGradGradWithArgmax( @@ -1472,28 +2093,46 @@ 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 `argmax` are flattened, so that a maximum value at position - * `[b, y, x, c]` becomes flattened index: - * `(y * width + x) * channels + c` if `include_batch_in_index` is False; - * `((b * height + y) * width + x) * channels + c` if `include_batch_in_index` is True. - *

- * The indices returned are always in `[0, height) x [0, width)` before flattening, + * The indices in {@code argmax} are flattened, so that a maximum value at position + * {@code [b, y, x, c]} becomes flattened index: + * {@code (y * width + x) * channels + c} if {@code include_batch_in_index} is False; + * {@code ((b * height + y) * width + x) * channels + c} if {@code include_batch_in_index} is True. + *

The indices returned are always in {@code [0, height) x [0, width)} before flattening, * 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 - * @param input 4-D with shape `[batch, height, width, channels]`. Input to pool over. + * @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 padding The type of padding algorithm to use. - * @param options carries optional attributes values - * @return a new instance of MaxPoolWithArgmax + * @param options carries optional attribute values + * @param data type for {@code MaxPoolWithArgmax} output and operands + * @return a new instance of MaxPoolWithArgmax, with default output types */ public MaxPoolWithArgmax maxPoolWithArgmax(Operand input, List ksize, List strides, String padding, MaxPoolWithArgmax.Options... options) { @@ -1502,26 +2141,24 @@ public MaxPoolWithArgmax maxPoolWithArgmax(Operan /** * Performs max pooling on the input and outputs both max values and indices. - *

- * The indices in `argmax` are flattened, so that a maximum value at position - * `[b, y, x, c]` becomes flattened index: - * `(y * width + x) * channels + c` if `include_batch_in_index` is False; - * `((b * height + y) * width + x) * channels + c` if `include_batch_in_index` is True. - *

- * The indices returned are always in `[0, height) x [0, width)` before flattening, + * The indices in {@code argmax} are flattened, so that a maximum value at position + * {@code [b, y, x, c]} becomes flattened index: + * {@code (y * width + x) * channels + c} if {@code include_batch_in_index} is False; + * {@code ((b * height + y) * width + x) * channels + c} if {@code include_batch_in_index} is True. + *

The indices returned are always in {@code [0, height) x [0, width)} before flattening, * 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 - * @param input 4-D with shape `[batch, height, width, channels]`. Input to pool over. + * @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 + * @param Targmax The value of the Targmax attribute * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MaxPoolWithArgmax} output and operands + * @param data type for {@code MaxPoolWithArgmax} output and operands * @return a new instance of MaxPoolWithArgmax */ public MaxPoolWithArgmax maxPoolWithArgmax( @@ -1531,21 +2168,20 @@ public MaxPoolWithArgmax maxPoolWit } /** - * Finds values of the `n`-th order statistic for the last dimension. - *

+ * Finds values of the {@code n}-th order statistic for the last dimension. * If the input is a vector (rank-1), finds the entries which is the nth-smallest * value in the vector and outputs their values as scalar tensor. - *

- * For matrices (resp. higher rank input), computes the entries which is the + *

For matrices (resp. higher rank input), computes the entries which is the * nth-smallest value in each row (resp. vector along the last dimension). Thus, - *

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

+   *  values.shape = input.shape[:-1]
+   *  
* - * @param data type for {@code values()} output - * @param input 1-D or higher with last dimension at least `n+1`. + * @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 `[0, input.shape[:-1])` - * @param options carries optional attributes values + * each row for matrices). Valid range of n is {@code [0, input.shape[:-1])} + * @param options carries optional attribute values + * @param data type for {@code NthElement} output and operands * @return a new instance of NthElement */ public NthElement nthElement(Operand input, Operand n, @@ -1556,8 +2192,7 @@ public NthElement nthElement(Operand input, Operand data type for {@code output()} output - * @param input 4-D with shape `[batch, height, width, channels]`. + * @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. * @param ksize The size of the window for each dimension of the input tensor. @@ -1565,9 +2200,10 @@ public NthElement nthElement(Operand input, Operand data type for {@code QuantizedAvgPool} output and operands * @return a new instance of QuantizedAvgPool */ - public QuantizedAvgPool quantizedAvgPool(Operand input, + public QuantizedAvgPool quantizedAvgPool(Operand input, Operand minInput, Operand maxInput, List ksize, List strides, String padding) { return QuantizedAvgPool.create(scope, input, minInput, maxInput, ksize, strides, padding); @@ -1575,11 +2211,9 @@ public QuantizedAvgPool quantizedAvgPool(Operand input, /** * Quantized Batch normalization. - *

* This op is deprecated and will be removed in the future. Prefer - * `tf.nn.batch_normalization`. + * {@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. @@ -1598,17 +2232,19 @@ public QuantizedAvgPool quantizedAvgPool(Operand input, * @param betaMin The value represented by the lowest quantized offset. * @param betaMax The value represented by the highest quantized offset. * @param gamma A 1D gamma Tensor with size matching the last dimension of t. - * If "scale_after_normalization" is true, this tensor will be multiplied + * If "scale_after_normalization" is true, this tensor will be multiplied * 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 + * @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. + * @param data type for {@code QuantizedBatchNormWithGlobalNormalization} output and operands + * @param data type for {@code QuantizedBatchNormWithGlobalNormalization} output and operands * @return a new instance of QuantizedBatchNormWithGlobalNormalization */ - public QuantizedBatchNormWithGlobalNormalization quantizedBatchNormWithGlobalNormalization( + public QuantizedBatchNormWithGlobalNormalization quantizedBatchNormWithGlobalNormalization( Operand t, Operand tMin, Operand tMax, Operand m, Operand mMin, Operand mMax, Operand v, Operand vMin, Operand vMax, Operand beta, Operand betaMin, Operand betaMax, @@ -1619,65 +2255,465 @@ public QuantizedBatchNormWithGlobalNormalizat /** * 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 + * @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 + * @param outType The value of the outType attribute + * @param data type for {@code QuantizedBiasAdd} output and operands * @return a new instance of QuantizedBiasAdd */ - public QuantizedBiasAdd quantizedBiasAdd(Operand input, - Operand bias, Operand minInput, Operand maxInput, + public QuantizedBiasAdd quantizedBiasAdd(Operand input, + Operand bias, Operand minInput, Operand maxInput, Operand minBias, Operand maxBias, Class outType) { return QuantizedBiasAdd.create(scope, input, bias, minInput, maxInput, minBias, maxBias, outType); } + /** + * The QuantizedConv2DAndRelu 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 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 + */ + 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 * 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 - * @param input + * @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 + * @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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2D} output and operands * @return a new instance of QuantizedConv2d */ - public QuantizedConv2d quantizedConv2d(Operand input, - Operand filter, Operand minInput, Operand maxInput, + public QuantizedConv2d quantizedConv2d(Operand input, + Operand filter, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Class outType, List strides, String padding, QuantizedConv2d.Options... options) { return QuantizedConv2d.create(scope, input, filter, minInput, maxInput, minFilter, maxFilter, outType, strides, padding, options); } + /** + * Computes quantized depthwise Conv2D. + * + * @param input The original input tensor. + * @param filter The original filter 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 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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code QuantizedInstanceNorm} output and operands * @return a new instance of QuantizedInstanceNorm */ - public QuantizedInstanceNorm quantizedInstanceNorm(Operand x, + public QuantizedInstanceNorm quantizedInstanceNorm(Operand x, Operand xMin, Operand xMax, QuantizedInstanceNorm.Options... options) { return QuantizedInstanceNorm.create(scope, x, xMin, xMax, options); } @@ -1685,7 +2721,6 @@ public QuantizedInstanceNorm quantizedInstanceNorm(Operand< /** * 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. @@ -1694,82 +2729,88 @@ public QuantizedInstanceNorm quantizedInstanceNorm(Operand< * @param strides 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. * @param padding The type of padding algorithm to use. + * @param data type for {@code QuantizedMaxPool} output and operands * @return a new instance of QuantizedMaxPool */ - public QuantizedMaxPool quantizedMaxPool(Operand input, + public QuantizedMaxPool quantizedMaxPool(Operand input, Operand minInput, Operand maxInput, List ksize, List strides, String padding) { return QuantizedMaxPool.create(scope, input, minInput, maxInput, ksize, strides, padding); } /** - * Computes Quantized Rectified Linear: `max(features, 0)` + * Computes Quantized Rectified Linear: {@code max(features, 0)} * - * @param data type for {@code activations()} output - * @param features + * @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 + * @param outType The value of the outType attribute + * @param data type for {@code QuantizedRelu} output and operands * @return a new instance of QuantizedRelu */ - public QuantizedRelu quantizedRelu(Operand features, + public QuantizedRelu quantizedRelu(Operand features, Operand minFeatures, Operand maxFeatures, Class outType) { return QuantizedRelu.create(scope, features, minFeatures, maxFeatures, outType); } /** - * Computes Quantized Rectified Linear 6: `min(max(features, 0), 6)` + * Computes Quantized Rectified Linear 6: {@code min(max(features, 0), 6)} * - * @param data type for {@code activations()} output - * @param features + * @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 + * @param outType The value of the outType attribute + * @param data type for {@code QuantizedRelu6} output and operands * @return a new instance of QuantizedRelu6 */ - public QuantizedRelu6 quantizedRelu6(Operand features, + public QuantizedRelu6 quantizedRelu6(Operand features, Operand minFeatures, Operand maxFeatures, Class outType) { return QuantizedRelu6.create(scope, features, minFeatures, maxFeatures, outType); } /** - * Computes Quantized Rectified Linear X: `min(max(features, 0), max_value)` + * Computes Quantized Rectified Linear X: {@code min(max(features, 0), max_value)} * - * @param data type for {@code activations()} output - * @param features - * @param maxValue + * @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 + * @param outType The value of the outType attribute + * @param data type for {@code QuantizedReluX} output and operands * @return a new instance of QuantizedReluX */ - public QuantizedReluX quantizedReluX(Operand features, + public QuantizedReluX quantizedReluX(Operand features, Operand maxValue, Operand minFeatures, Operand maxFeatures, Class outType) { return QuantizedReluX.create(scope, features, maxValue, minFeatures, maxFeatures, outType); } /** - * Computes rectified linear: `max(features, 0)`. - *

+ * Computes rectified linear: {@code max(features, 0)}. * See: https://en.wikipedia.org/wiki/Rectifier_(neural_networks) * Example usage: - * >>> tf.nn.relu([-2., 0., -0., 3.]).numpy() - * array([ 0., 0., -0., 3.], dtype=float32) - * - * @param data type for {@code activations()} output - * @param features + *

+ *
+ *
+ *

tf.nn.relu([-2., 0., 3.]).numpy() + * array([0., 0., 3.], dtype=float32) + *

+ *
+ *
+ * + * @param features The features value + * @param data type for {@code Relu} output and operands * @return a new instance of Relu */ - public Relu relu(Operand features) { + public Relu relu(Operand features) { return Relu.create(scope, features); } /** - * Computes rectified linear 6: `min(max(features, 0), 6)`. + * Computes rectified linear 6: {@code min(max(features, 0), 6)}. * - * @param data type for {@code activations()} output - * @param features + * @param features The features value + * @param data type for {@code Relu6} output and operands * @return a new instance of Relu6 */ public Relu6 relu6(Operand features) { @@ -1777,18 +2818,41 @@ public Relu6 relu6(Operand features) { } /** - * Computes scaled exponential linear: `scale * alpha * (exp(features) - 1)` - *

- * if < 0, `scale * features` otherwise. - *

- * To be used together with - * `initializer = tf.variance_scaling_initializer(factor=1.0, mode='FAN_IN')`. - * For correct dropout, use `tf.contrib.nn.alpha_dropout`. - *

- * See [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) + * 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. + *

To be used together with + * {@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 - * @param features + * @param features The features value + * @param data type for {@code Selu} output and operands * @return a new instance of Selu */ public Selu selu(Operand features) { @@ -1796,64 +2860,26 @@ public Selu selu(Operand features) { } /** - * Computes sigmoid cross entropy given logits. - * - *

Measures the probability error in discrete classification tasks in which each class is - * independent and not mutually exclusive. For instance, one could perform multilabel - * classification where a picture can contain both an elephant and a dog at the same time. - * - *

For brevity, let x = logits, z = labels. The logistic loss in - * pseudo-code is - * - *

-   *  z * -log(sigmoid(x)) + (1 - z) * -log(1 - sigmoid(x))
-   *   = z * -log(1 / (1 + exp(-x))) + (1 - z) * -log(exp(-x) / (1 + exp(-x)))
-   *   = z * log(1 + exp(-x)) + (1 - z) * (-log(exp(-x)) + log(1 + exp(-x)))
-   *   = z * log(1 + exp(-x)) + (1 - z) * (x + log(1 + exp(-x))
-   *   = (1 - z) * x + log(1 + exp(-x))
-   *   = x - x * z + log(1 + exp(-x))
-   *  
- * - *

For x < 0, to avoid overflow in exp(-x), we reformulate the above - * - *

-   *  x - x * z + log(1 + exp(-x))
-   *   = log(exp(x)) - x * z + log(1 + exp(-x))
-   *   = - x * z + log(1 + exp(x))
-   *  
- * - *

Hence, to ensure stability and avoid overflow, the implementation uses this equivalent - * formulation - * - *

-   *    max(x, 0) - x * z + log(1 + exp(-abs(x)))
-   *  
+ * Computes gradients for the scaled exponential linear (Selu) operation. * - *

- * - * @param scope The TensorFlow scope - * @param labels the labels - * @param logits the logits of type float32 or float64 - * @param the type of labels and logits - * @return the component-wise logistic losses. - * @throws IllegalArgumentException if logits' and labels' do not have the same shape + * @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 Operand sigmoidCrossEntropyWithLogits(Operand labels, - Operand logits) { - return SigmoidCrossEntropyWithLogits.sigmoidCrossEntropyWithLogits(scope, labels, logits); + public SeluGrad seluGrad(Operand gradients, Operand outputs) { + return SeluGrad.create(scope, gradients, outputs); } /** * Computes softmax activations. - *

- * For each batch `i` and class `j` we have - *

- * $$softmax[i, j] = exp(logits[i, j]) / sum_j(exp(logits[i, j]))$$ + * For each batch {@code i} and class {@code j} we have + *

+   *  $$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 `[batch_size, num_classes]`. + * @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 */ public Softmax softmax(Operand logits) { @@ -1861,150 +2887,125 @@ public Softmax softmax(Operand logits) { } /** - * Computes softmax cross entropy between logits and labels. - * - *

Measures the probability error in discrete classification tasks in which the classes are - * mutually exclusive (each entry is in exactly one class). For example, each CIFAR-10 image is - * labeled with one and only one label: an image can be a dog or a truck, but not both. - * - *

NOTE: - * - *

While the classes are mutually exclusive, their probabilities need not be. All that is - * required is that each row of labels is a valid probability distribution. If they - * are not, the computation of the gradient will be incorrect. - * - *

If using exclusive labels (wherein one and only one class is true at a time), - * see {@link org.tensorflow.op.NnOps#sparseSoftmaxCrossEntropyWithLogits} - * - *

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 }
-   *  
+ * Computes softmax cross entropy cost and gradients to backpropagate. + * Inputs are the logits, not probabilities. * - *

Backpropagation will happen into both logits and labels. To - * disallow backpropagation into labels, pass label tensors through - * tf.stopGradient before feeding it to this function. - * - * @param scope current scope - * @param labels Each vector along the class dimension should hold a valid probability - * distribution e.g. for the case in which labels are of shape [batch_size, num_classes] - * , each row of labels[i] must be a valid probability distribution. - * @param logits Per-label activations, typically a linear output. These activation energies are - * interpreted as unnormalized log probabilities. - * @param axis The class dimension. -1 is the last dimension. - * @param the number type of the operands - * @return the softmax cross entropy loss. Its type is the same as logits and its - * shape is the same as labels except that it does not have the last dimension of - * labels. + * @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 + * probability distribution. + * @param data type for {@code SoftmaxCrossEntropyWithLogits} output and operands + * @return a new instance of SoftmaxCrossEntropyWithLogits */ - public Operand softmaxCrossEntropyWithLogits( - Operand labels, Operand logits, int axis) { - return SoftmaxCrossEntropyWithLogits.softmaxCrossEntropyWithLogits(scope, labels, logits, axis); + public SoftmaxCrossEntropyWithLogits softmaxCrossEntropyWithLogits( + Operand features, Operand labels) { + return SoftmaxCrossEntropyWithLogits.create(scope, features, labels); } /** - * Computes softsign: `features / (abs(features) + 1)`. + * Computes softsign: {@code features / (abs(features) + 1)}. * - * @param data type for {@code activations()} output - * @param features + * @param features The features value + * @param data type for {@code Softsign} output and operands * @return a new instance of Softsign */ 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. - *

- * Zero-pads and then rearranges (permutes) blocks of spatial data into batch. + *

Zero-pads and then rearranges (permutes) blocks of spatial data into batch. * More specifically, this op outputs a copy of the input tensor where values from - * the `height` and `width` dimensions are moved to the `batch` dimension. After - * the zero-padding, both `height` and `width` of the input must be divisible by the + * the {@code height} and {@code width} dimensions are moved to the {@code batch} dimension. After + * the zero-padding, both {@code height} and {@code width} of the input must be divisible by the * block size. - * - * @param data type for {@code output()} output - * @param input 4-D with shape `[batch, height, width, depth]`. - * @param paddings 2-D tensor of non-negative integers with shape `[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 - *

- * The attr `block_size` must be greater than one. It indicates the block size. - *

- * Non-overlapping blocks of size `block_size x block size` in the height and - * width dimensions are rearranged into the batch dimension at each location. - * The batch of the output tensor is `batch * block_size * block_size`. - * Both height_pad and width_pad must be divisible by block_size. - *

- * The shape of the output will be: - *

- * [batchblock_sizeblock_size, height_pad/block_size, width_pad/block_size, - * depth] - *

- * Some examples: - *

- * (1) For the following input of shape `[1, 2, 2, 1]` and block_size of 2: - *

{@code
+   *  

The attr {@code block_size} must be greater than one. It indicates the block size. + *

    + *
  • Non-overlapping blocks of size {@code block_size x block size} in the height and + * width dimensions are rearranged into the batch dimension at each location.
  • + *
  • The batch of the output tensor is {@code batch * block_size * block_size}.
  • + *
  • Both height_pad and width_pad must be divisible by block_size.
  • + *
+ *

The shape of the output will be: + *

+   *  [batch*block_size*block_size, height_pad/block_size, width_pad/block_size,
+   *   depth]
+   *  
+ *

Some examples: + *

(1) For the following input of shape {@code [1, 2, 2, 1]} and block_size of 2: + *

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

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

    *  [[[[1]]], [[[2]]], [[[3]]], [[[4]]]]
-   *  }
- * (2) For the following input of shape `[1, 2, 2, 3]` and block_size of 2: - *
{@code
+   *  
+ *

(2) For the following input of shape {@code [1, 2, 2, 3]} and block_size of 2: + *

    *  x = [[[[1, 2, 3], [4, 5, 6]],
    *        [[7, 8, 9], [10, 11, 12]]]]
-   *  }
- * The output tensor has shape `[4, 1, 1, 3]` and value: - *
{@code
+   *  
+ *

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

    *  [[[[1, 2, 3]]], [[[4, 5, 6]]], [[[7, 8, 9]]], [[[10, 11, 12]]]]
-   *  }
- * (3) For the following input of shape `[1, 4, 4, 1]` and block_size of 2: - *
{@code
+   *  
+ *

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

    *  x = [[[[1],   [2],  [3],  [4]],
    *        [[5],   [6],  [7],  [8]],
    *        [[9],  [10], [11],  [12]],
    *        [[13], [14], [15],  [16]]]]
-   *  }
- * The output tensor has shape `[4, 2, 2, 1]` and value: - *
{@code
+   *  
+ *

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

    *  x = [[[[1], [3]], [[9], [11]]],
    *       [[[2], [4]], [[10], [12]]],
    *       [[[5], [7]], [[13], [15]]],
    *       [[[6], [8]], [[14], [16]]]]
-   *  }
- * (4) For the following input of shape `[2, 2, 4, 1]` and block_size of 2: - *
{@code
+   *  
+ *

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

    *  x = [[[[1],   [2],  [3],  [4]],
    *        [[5],   [6],  [7],  [8]]],
    *       [[[9],  [10], [11],  [12]],
    *        [[13], [14], [15],  [16]]]]
-   *  }
- * The output tensor has shape `[8, 1, 2, 1]` and value: - *
{@code
+   *  
+ *

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

    *  x = [[[[1], [3]]], [[[9], [11]]], [[[2], [4]]], [[[10], [12]]],
    *       [[[5], [7]]], [[[13], [15]]], [[[6], [8]]], [[[14], [16]]]]
-   *  }
- * Among others, this operation is useful for reducing atrous convolution into + *
+ *

Among others, this operation is useful for reducing atrous convolution into * regular convolution. - * @param blockSize + * + * @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: + *

+   *    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
+   *  
+ * @param blockSize The value of the blockSize attribute + * @param data type for {@code SpaceToBatch} output and operands * @return a new instance of SpaceToBatch */ public SpaceToBatch spaceToBatch(Operand input, @@ -2014,84 +3015,79 @@ public SpaceToBatch spaceToBatch(Operand input, /** * SpaceToDepth for tensors of type T. - *

* Rearranges blocks of spatial data, into depth. More specifically, - * this op outputs a copy of the input tensor where values from the `height` - * and `width` dimensions are moved to the `depth` dimension. - * The attr `block_size` indicates the input block size. - *

- * Non-overlapping blocks of size `block_size x block size` are rearranged - * into depth at each location. - * The depth of the output tensor is `block_size * block_size * input_depth`. - * The Y, X coordinates within each block of the input become the high order - * component of the output channel index. - * The input tensor's height and width must be divisible by block_size. - *

- * The `data_format` attr specifies the layout of the input and output tensors + * this op outputs a copy of the input tensor where values from the {@code height} + * and {@code width} dimensions are moved to the {@code depth} dimension. + * The attr {@code block_size} indicates the input block size. + *

    + *
  • Non-overlapping blocks of size {@code block_size x block size} are rearranged + * into depth at each location.
  • + *
  • The depth of the output tensor is {@code block_size * block_size * input_depth}.
  • + *
  • The Y, X coordinates within each block of the input become the high order + * component of the output channel index.
  • + *
  • The input tensor's height and width must be divisible by block_size.
  • + *
+ *

The {@code data_format} attr specifies the layout of the input and output tensors * with the following options: - * "NHWC": `[ batch, height, width, channels ]` - * "NCHW": `[ batch, channels, height, width ]` - * "NCHW_VECT_C": - * `qint8 [ batch, channels / 4, height, width, 4 ]` - *

- * It is useful to consider the operation as transforming a 6-D Tensor. + * "NHWC": {@code [ batch, height, width, channels ]} + * "NCHW": {@code [ batch, channels, height, width ]} + * "NCHW_VECT_C": + * {@code qint8 [ batch, channels / 4, height, width, 4 ]} + *

It is useful to consider the operation as transforming a 6-D Tensor. * e.g. for data_format = NHWC, - * Each element in the input tensor can be specified via 6 coordinates, - * ordered by decreasing memory layout significance as: - * n,oY,bY,oX,bX,iC (where n=batch index, oX, oY means X or Y coordinates - * within the output image, bX, bY means coordinates - * within the input block, iC means input channels). - * The output would be a transpose to the following layout: - * n,oY,oX,bY,bX,iC - *

- * This operation is useful for resizing the activations between convolutions + * Each element in the input tensor can be specified via 6 coordinates, + * ordered by decreasing memory layout significance as: + * n,oY,bY,oX,bX,iC (where n=batch index, oX, oY means X or Y coordinates + * within the output image, bX, bY means coordinates + * within the input block, iC means input channels). + * The output would be a transpose to the following layout: + * n,oY,oX,bY,bX,iC + *

This operation is useful for resizing the activations between convolutions * (but keeping all data), e.g. instead of pooling. It is also useful for training * purely convolutional models. - *

- * For example, given an input of shape `[1, 2, 2, 1]`, data_format = "NHWC" and + *

For example, given an input of shape {@code [1, 2, 2, 1]}, data_format = "NHWC" and * block_size = 2: - *

{@code
+   *  
    *  x = [[[[1], [2]],
    *        [[3], [4]]]]
-   *  }
- * This operation will output a tensor of shape `[1, 1, 1, 4]`: - *
{@code
+   *  
+ *

This operation will output a tensor of shape {@code [1, 1, 1, 4]}: + *

    *  [[[[1, 2, 3, 4]]]]
-   *  }
- * Here, the input has a batch of 1 and each batch element has shape `[2, 2, 1]`, + *
+ *

Here, the input has a batch of 1 and each batch element has shape {@code [2, 2, 1]}, * the corresponding output will have a single element (i.e. width and height are * both 1) and will have a depth of 4 channels (1 * block_size * block_size). - * The output element shape is `[1, 1, 4]`. - *

- * For an input tensor with larger depth, here of shape `[1, 2, 2, 3]`, e.g. - *

{@code
+   *  The output element shape is {@code [1, 1, 4]}.
+   *  

For an input tensor with larger depth, here of shape {@code [1, 2, 2, 3]}, e.g. + *

    *  x = [[[[1, 2, 3], [4, 5, 6]],
    *        [[7, 8, 9], [10, 11, 12]]]]
-   *  }
- * This operation, for block_size of 2, will return the following tensor of shape - * `[1, 1, 1, 12]` - *
{@code
+   *  
+ *

This operation, for block_size of 2, will return the following tensor of shape + * {@code [1, 1, 1, 12]} + *

    *  [[[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]]]]
-   *  }
- * Similarly, for the following input of shape `[1 4 4 1]`, and a block size of 2: - *
{@code
+   *  
+ *

Similarly, for the following input of shape {@code [1 4 4 1]}, and a block size of 2: + *

    *  x = [[[[1],   [2],  [5],  [6]],
    *        [[3],   [4],  [7],  [8]],
    *        [[9],  [10], [13],  [14]],
    *        [[11], [12], [15],  [16]]]]
-   *  }
- * the operator will return the following tensor of shape `[1 2 2 4]`: - *
{@code
+   *  
+ *

the operator will return the following tensor of shape {@code [1 2 2 4]}: + *

    *  x = [[[[1, 2, 3, 4],
    *         [5, 6, 7, 8]],
    *        [[9, 10, 11, 12],
    *         [13, 14, 15, 16]]]]
-   *  }
+ *
* - * @param data type for {@code output()} output - * @param input + * @param input The input value * @param blockSize The size of the spatial block. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SpaceToDepth} output and operands * @return a new instance of SpaceToDepth */ public SpaceToDepth spaceToDepth(Operand input, Long blockSize, @@ -2100,79 +3096,187 @@ public SpaceToDepth spaceToDepth(Operand input, Long blo } /** - * Computes sparse softmax cross entropy between logits and labels. - * - *

Measures the probability error in discrete classification tasks in which the classes are - * mutually exclusive (each entry is in exactly one class). For example, each CIFAR-10 image is - * labeled with one and only one label: an image can be a dog or a truck, but not both. + * Computes softmax cross entropy cost and gradients to backpropagate. + * Unlike {@code SoftmaxCrossEntropyWithLogits}, this operation does not accept + * a matrix of label probabilities, but rather a single label per row + * of features. This label is considered to have probability 1.0 for the + * given row. + *

Inputs are the logits, not probabilities. * - *

NOTE: - * - *

For this operation, the probability of a given label is considered exclusive. That is, soft - * classes are not allowed, and the labels vector must provide a single specific - * index for the true class for each row of logits (each minibatch entry). For soft - * softmax classification with a probability distribution for each entry, {@link - * org.tensorflow.op.NnOps#softmaxCrossEntropyWithLogits}. - * - *

WARNING: - * - *

This op expects unscaled logits, since it performs a softmax on logits - * internally for efficiency. Do not call this op with the output of softmax, - * as it will produce incorrect results. - * - *

A common use case is to have logits of shape [batchSize, numClasses] and have - * labels of shape [batchSize], but higher dimensions are supported, in which case - * the dim-th dimension is assumed to be of size numClasses. - * logits must have the dataType of TFloat16, TFloat32 - * , or TFloat64, and labels must have the dtype of TInt32 - * or TInt64. - * - * @param scope current scope - * @param labels Tensor of shape [d_0, d_1, ..., d_{r-1}] (where r - * is rank of labels and result) and the dataType is TInt32 - * or TInt64. Each entry in labels must be an index in [0, - * numClasses). Other values will raise an exception when this op is run on CPU, and - * return NaN for corresponding loss and gradient rows on GPU. - * @param logits Per-label activations (typically a linear output) of shape [d_0, d_1, ..., - * d_{r-1}, numClasses] and dataType of TFloat16, TFloat32, - * or TFloat64. These activation energies are interpreted as unnormalized log - * probabilities. - * @return A Tensor of the same shape as labels and of the same type as - * logits with the softmax cross entropy loss. - * @throws IllegalArgumentException If logits are scalars (need to have rank >= 1) or if the rank - * of the labels is not equal to the rank of the logits minus one. + * @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. + * @param data type for {@code SparseSoftmaxCrossEntropyWithLogits} output and operands + * @return a new instance of SparseSoftmaxCrossEntropyWithLogits */ - public Operand sparseSoftmaxCrossEntropyWithLogits( - Operand labels, Operand logits) { - return SparseSoftmaxCrossEntropyWithLogits.sparseSoftmaxCrossEntropyWithLogits(scope, labels, logits); + public SparseSoftmaxCrossEntropyWithLogits sparseSoftmaxCrossEntropyWithLogits( + Operand features, Operand labels) { + return SparseSoftmaxCrossEntropyWithLogits.create(scope, features, labels); } /** - * Finds values and indices of the `k` largest elements for the last dimension. - *

- * If the input is a vector (rank-1), finds the `k` largest entries in the vector - * and outputs their values and indices as vectors. Thus `values[j]` is the - * `j`-th largest entry in `input`, and its index is `indices[j]`. - *

- * For matrices (resp. higher rank input), computes the top `k` entries in each + * 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. + *

+   *  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 - * @param input 1-D or higher with last dimension at least `k`. + * @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 attributes values - * @return a new instance of TopK + * @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 */ - 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/NnRawOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/NnRawOps.java deleted file mode 100644 index 13c6baa651a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/NnRawOps.java +++ /dev/null @@ -1,84 +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. -// ============================================================================== -// -// This class has been generated, DO NOT EDIT! -// -package org.tensorflow.op; - -import org.tensorflow.Operand; -import org.tensorflow.op.nn.raw.SoftmaxCrossEntropyWithLogits; -import org.tensorflow.op.nn.raw.SparseSoftmaxCrossEntropyWithLogits; -import org.tensorflow.types.family.TNumber; - -/** - * An API for building {@code nn.raw} operations as {@link Op Op}s - * - * @see {@link Ops} - */ -public final class NnRawOps { - private final Scope scope; - - private final Ops ops; - - NnRawOps(Ops ops) { - this.scope = ops.scope(); - this.ops = ops; - } - - /** - * 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 - * probability distribution. - * @return a new instance of SoftmaxCrossEntropyWithLogits - */ - public SoftmaxCrossEntropyWithLogits softmaxCrossEntropyWithLogits( - Operand features, Operand labels) { - return SoftmaxCrossEntropyWithLogits.create(scope, features, labels); - } - - /** - * Computes softmax cross entropy cost and gradients to backpropagate. - *

- * Unlike `SoftmaxCrossEntropyWithLogits`, this operation does not accept - * a matrix of label probabilities, but rather a single label per row - * 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 - * @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. - * @return a new instance of SparseSoftmaxCrossEntropyWithLogits - */ - public SparseSoftmaxCrossEntropyWithLogits sparseSoftmaxCrossEntropyWithLogits( - Operand features, Operand labels) { - return SparseSoftmaxCrossEntropyWithLogits.create(scope, features, labels); - } - - /** - * 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/Ops.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/Ops.java index ea3ef31313e..40c5d8f1ace 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,11 +18,16 @@ 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; import org.tensorflow.DeviceSpec; 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; @@ -41,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; @@ -56,25 +66,36 @@ import org.tensorflow.op.core.BarrierReadySize; import org.tensorflow.op.core.BarrierTakeMany; import org.tensorflow.op.core.Batch; +import org.tensorflow.op.core.BatchFunction; import org.tensorflow.op.core.BatchToSpace; import org.tensorflow.op.core.BatchToSpaceNd; import org.tensorflow.op.core.Bitcast; 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; @@ -83,12 +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; @@ -96,10 +125,11 @@ 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; import org.tensorflow.op.core.ImmutableConst; -import org.tensorflow.op.core.Init; import org.tensorflow.op.core.InitializeTable; import org.tensorflow.op.core.InitializeTableFromTextFile; import org.tensorflow.op.core.InplaceAdd; @@ -107,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; @@ -125,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; @@ -146,24 +184,33 @@ import org.tensorflow.op.core.Pad; import org.tensorflow.op.core.ParallelConcat; import org.tensorflow.op.core.ParallelDynamicStitch; +import org.tensorflow.op.core.PartitionedCall; import org.tensorflow.op.core.Placeholder; import org.tensorflow.op.core.PlaceholderWithDefault; 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.RemoteFusedGraphExecute; +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; import org.tensorflow.op.core.ResourceGather; @@ -184,7 +231,6 @@ import org.tensorflow.op.core.Reverse; import org.tensorflow.op.core.ReverseSequence; import org.tensorflow.op.core.Roll; -import org.tensorflow.op.core.Rpc; import org.tensorflow.op.core.ScatterAdd; import org.tensorflow.op.core.ScatterDiv; import org.tensorflow.op.core.ScatterMax; @@ -192,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; @@ -210,10 +259,22 @@ 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; import org.tensorflow.op.core.StageSize; +import org.tensorflow.op.core.StatefulCase; +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.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; @@ -221,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; @@ -268,21 +330,21 @@ import org.tensorflow.op.core.Timestamp; import org.tensorflow.op.core.TopKUnique; import org.tensorflow.op.core.TopKWithUnique; -import org.tensorflow.op.core.TryRpc; import org.tensorflow.op.core.Unbatch; import org.tensorflow.op.core.UnbatchGrad; +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; import org.tensorflow.op.core.VariableShape; import org.tensorflow.op.core.Where; -import org.tensorflow.op.core.XlaSpmdFullToShardShape; -import org.tensorflow.op.core.XlaSpmdShardToFullShape; +import org.tensorflow.op.core.While; import org.tensorflow.op.core.Zeros; import org.tensorflow.op.core.ZerosLike; import org.tensorflow.types.TBool; @@ -330,35 +392,23 @@ 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; @@ -368,41 +418,63 @@ public final class Ops { public final QuantizationOps quantization; + 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); - summary = new SummaryOps(this); - image = new ImageOps(this); - ragged = new RaggedOps(this); + cluster = new ClusterOps(this); data = new DataOps(this); - shape = new ShapeOps(this); - io = new IoOps(this); - dtypes = new DtypesOps(this); - xla = new XlaOps(this); - linalg = new LinalgOps(this); + math = new MathOps(this); random = new RandomOps(this); strings = new StringsOps(this); - sparse = new SparseOps(this); - tpu = new TpuOps(this); bitwise = new BitwiseOps(this); - math = new MathOps(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); + ragged = new RaggedOps(this); + image = new ImageOps(this); + shape = new ShapeOps(this); + io = new IoOps(this); + dtypes = new DtypesOps(this); + linalg = new LinalgOps(this); + xla = new XlaOps(this); + sparse = new SparseOps(this); + tpu = new TpuOps(this); } /** * Raise a exception to abort the process when called. - *

* If exit_without_error is true, the process will exit normally, * otherwise it will exit with a SIGABORT signal. - *

- * Returns nothing but an exception. + *

Returns nothing but an exception. * - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Abort */ public Abort abort(Abort.Options... options) { @@ -410,17 +482,16 @@ public Abort abort(Abort.Options... options) { } /** - * Computes the "logical and" of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Computes the "logical and" of elements across dimensions of a tensor. + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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 input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values * @return a new instance of All */ public All all(Operand input, Operand axis, All.Options... options) { @@ -428,17 +499,115 @@ public All all(Operand input, Operand axis, All.Option } /** - * Computes the "logical or" of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * 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 + * {@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 input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values * @return a new instance of Any */ public Any any(Operand input, Operand axis, Any.Options... options) { @@ -446,64 +615,64 @@ public Any any(Operand input, Operand axis, Any.Option } /** - * Creates a constant of {@code int} elements. + * 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 scope is a scope used to add the underlying operation. - * @param data An array containing the values to put into the new constant. - * @return a float constant + * @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 Constant array(int... data) { - return Constant.arrayOf(scope, data); + public ApproxTopK approxTopK(Operand input, Long k, + ApproxTopK.Options... options) { + return ApproxTopK.create(scope, input, k, options); } /** - * Creates a constant of {@code String} elements, using the default UTF-8 charset. + * Creates a constant of {@code long} elements. * - * @param scope is a scope used to add the underlying operation. * @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 boolean} elements. + * Creates a constant of {@code float} elements. * - * @param scope is a scope used to add the underlying operation. * @param data An array containing the values to put into the new constant. - * @return a boolean constant + * @return a float constant */ - public Constant array(boolean... data) { + public Constant array(float... data) { return Constant.arrayOf(scope, data); } /** - * Creates a constant of {@code long} elements. + * Creates a constant of {@code String} elements, using the default UTF-8 charset. * - * @param scope is a scope used to add the underlying operation. * @param data An array containing the values to put into the new constant. - * @return a long constant + * @return the {@code String} constant */ - public Constant array(long... data) { + public Constant array(String... data) { return Constant.arrayOf(scope, data); } /** - * Creates a constant of {@code float} elements. + * Creates a constant of {@code int} elements. * - * @param scope is a scope used to add the underlying operation. * @param data An array containing the values to put into the new constant. * @return a float constant */ - public Constant array(float... data) { + public Constant array(int... data) { return Constant.arrayOf(scope, data); } /** * Creates a constant of {@code double} elements. * - * @param scope is a scope used to add the underlying operation. * @param data An array containing the values to put into the new constant. * @return a double constant */ @@ -514,7 +683,6 @@ public Constant array(double... data) { /** * Creates a constant of {@code byte} elements. * - * @param scope is a scope used to add the underlying operation. * @param data An array containing the values to put into the new constant. * @return a byte constant */ @@ -522,10 +690,19 @@ public Constant array(byte... data) { return Constant.arrayOf(scope, data); } + /** + * Creates a constant of {@code boolean} elements. + * + * @param data An array containing the values to put into the new constant. + * @return a boolean constant + */ + public Constant array(boolean... data) { + return Constant.arrayOf(scope, data); + } + /** * Creates a constant of {@code String} elements, using the given charset. * - * @param scope is a scope used to add the underlying operation. * @param charset charset for encoding/decoding strings bytes. * @param data An array containing the values to put into the new constant. String elements are * sequences of bytes from the last array dimension. @@ -537,13 +714,12 @@ public Constant array(Charset charset, String... data) { /** * Asserts that the given condition is true. - *

- * If `condition` evaluates to false, print the list of tensors in `data`. - * `summarize` determines how many entries of the tensors to print. + * 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. * * @param condition The condition to evaluate. * @param data The tensors to print out when condition is false. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of AssertThat */ public AssertThat assertThat(Operand condition, Iterable> data, @@ -553,14 +729,13 @@ public AssertThat assertThat(Operand condition, Iterable> data /** * Update 'ref' by assigning 'value' to it. - *

- * This operation outputs "ref" after the assignment is done. + * 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 outputRef()} output - * @param ref Should be from a `Variable` node. May be uninitialized. + * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code Assign} output and operands * @return a new instance of Assign */ public Assign assign(Operand ref, Operand value, @@ -570,14 +745,13 @@ public Assign assign(Operand ref, Operand value, /** * Update 'ref' by adding 'value' to it. - *

- * This operation outputs "ref" after the update is done. + * 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 outputRef()} output - * @param ref Should be from a `Variable` node. + * @param ref Should be from a {@code Variable} node. * @param value The value to be added to the variable. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code AssignAdd} output and operands * @return a new instance of AssignAdd */ public AssignAdd assignAdd(Operand ref, Operand value, @@ -587,7 +761,6 @@ public AssignAdd assignAdd(Operand ref, Operand value /** * Adds a value to the current value of a variable. - *

* Any ReadVariableOp with a control dependency on this op is guaranteed to * see the incremented value or a subsequent newer one. * @@ -595,21 +768,20 @@ public AssignAdd assignAdd(Operand ref, Operand value * @param value the value by which the variable will be incremented. * @return a new instance of AssignAddVariableOp */ - public AssignAddVariableOp assignAddVariableOp(Operand resource, + public AssignAddVariableOp assignAddVariableOp(Operand resource, Operand value) { return AssignAddVariableOp.create(scope, resource, value); } /** * Update 'ref' by subtracting 'value' from it. - *

- * This operation outputs "ref" after the update is done. + * 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 outputRef()} output - * @param ref Should be from a `Variable` node. + * @param ref Should be from a {@code Variable} node. * @param value The value to be subtracted to the variable. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code AssignSub} output and operands * @return a new instance of AssignSub */ public AssignSub assignSub(Operand ref, Operand value, @@ -619,7 +791,6 @@ public AssignSub assignSub(Operand ref, Operand value /** * Subtracts a value from the current value of a variable. - *

* Any ReadVariableOp with a control dependency on this op is guaranteed to * see the decremented value or a subsequent newer one. * @@ -627,39 +798,38 @@ public AssignSub assignSub(Operand ref, Operand value * @param value the value by which the variable will be incremented. * @return a new instance of AssignSubVariableOp */ - public AssignSubVariableOp assignSubVariableOp(Operand resource, + public AssignSubVariableOp assignSubVariableOp(Operand resource, Operand value) { return AssignSubVariableOp.create(scope, resource, value); } /** * Assigns a new value to a variable. - *

* Any ReadVariableOp with a control dependency on this op is guaranteed to return * this value or a subsequent newer value of the variable. * * @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); + public AssignVariableOp assignVariableOp(Operand resource, + Operand value, AssignVariableOp.Options... options) { + return AssignVariableOp.create(scope, resource, value, options); } /** * Defines a barrier that persists across different graph executions. - *

* A barrier represents a key-value map, where each key is a string, and * each value is a tuple of tensors. - *

- * At runtime, the barrier contains 'complete' and 'incomplete' + *

At runtime, the barrier contains 'complete' and 'incomplete' * elements. A complete element has defined tensors for all components of * its value tuple, and may be accessed using BarrierTakeMany. An * incomplete element has some undefined components in its value tuple, * and may be updated using BarrierInsertMany. * * @param componentTypes The type of each component in a value. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Barrier */ public Barrier barrier(List> componentTypes, Barrier.Options... options) { @@ -668,7 +838,6 @@ public Barrier barrier(List> componentTypes, Barrier.Opti /** * Closes the given barrier. - *

* This operation signals that no more new elements will be inserted in the * given barrier. Subsequent InsertMany that try to introduce a new key will fail. * Subsequent InsertMany operations that just add missing components to already @@ -677,7 +846,7 @@ public Barrier barrier(List> componentTypes, Barrier.Opti * Subsequent TakeMany operations that would block will fail immediately. * * @param handle The handle to a barrier. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of BarrierClose */ public BarrierClose barrierClose(Operand handle, BarrierClose.Options... options) { @@ -696,7 +865,6 @@ public BarrierIncompleteSize barrierIncompleteSize(Operand handle) { /** * For each key, assigns the respective value to the specified component. - *

* If a key is not found in the barrier, this operation will create a new * incomplete element. If a key is found in the barrier, and the element * already has a value at component_index, this operation will fail with @@ -726,11 +894,9 @@ public BarrierReadySize barrierReadySize(Operand handle) { /** * Takes the given number of completed elements from a barrier. - *

* This operation concatenates completed-element component tensors along * the 0th dimension to make a single component tensor. - *

- * Elements come out of the barrier when they are complete, and in the order + *

Elements come out of the barrier when they are complete, and in the order * in which they were placed into the barrier. The indices output provides * information about the batch in which each element was originally inserted * into the barrier. @@ -739,7 +905,7 @@ public BarrierReadySize barrierReadySize(Operand handle) { * @param numElements A single-element tensor containing the number of elements to * take. * @param componentTypes The type of each component in a value. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of BarrierTakeMany */ public BarrierTakeMany barrierTakeMany(Operand handle, Operand numElements, @@ -749,50 +915,44 @@ public BarrierTakeMany barrierTakeMany(Operand handle, Operand /** * Batches all input tensors nondeterministically. - *

* When many instances of this Op are being run concurrently with the same * container/shared_name in the same device, some will output zero-shaped Tensors * and others will output Tensors of size up to max_batch_size. - *

- * All Tensors in in_tensors are batched together (so, for example, labels and + *

All Tensors in in_tensors are batched together (so, for example, labels and * features should be batched with a single instance of this operation. - *

- * Each invocation of batch emits an `id` scalar which will be used to identify + *

Each invocation of batch emits an {@code id} scalar which will be used to identify * this particular invocation when doing unbatch or its gradient. - *

- * Each op which emits a non-empty batch will also emit a non-empty batch_index + *

Each op which emits a non-empty batch will also emit a non-empty batch_index * Tensor, which, is a [K, 3] matrix where each row contains the invocation's id, * start, and length of elements of each set of Tensors present in batched_tensors. - *

- * Batched tensors are concatenated along the first dimension, and all tensors in + *

Batched tensors are concatenated along the first dimension, and all tensors in * in_tensors must have the first dimension of the same size. - *

- * in_tensors: The tensors to be batched. + *

in_tensors: The tensors to be batched. * num_batch_threads: Number of scheduling threads for processing batches of work. - * Determines the number of batches processed in parallel. + * Determines the number of batches processed in parallel. * max_batch_size: Batch sizes will never be bigger than this. * batch_timeout_micros: Maximum number of microseconds to wait before outputting - * an incomplete batch. + * an incomplete batch. * allowed_batch_sizes: 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 equal max_batch_size. + * 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 equal max_batch_size. * grad_timeout_micros: The timeout to use for the gradient. See Unbatch. * batched_tensors: Either empty tensors or a batch of concatenated Tensors. * batch_index: If out_tensors is non-empty, has information to invert it. * container: Controls the scope of sharing of this batch. * id: always contains a scalar with a unique ID for this invocation of Batch. * shared_name: 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. + * same container and shared_name will batch their elements together. If left + * empty, the op name will be used as the shared name. * T: the types of tensors to be batched. * - * @param inTensors - * @param numBatchThreads - * @param maxBatchSize - * @param batchTimeoutMicros - * @param gradTimeoutMicros - * @param options carries optional attributes values + * @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 */ public Batch batch(Iterable> inTensors, Long numBatchThreads, Long maxBatchSize, @@ -800,28 +960,81 @@ public Batch batch(Iterable> inTensors, Long numBatchThreads, Long ma return Batch.create(scope, inTensors, numBatchThreads, maxBatchSize, batchTimeoutMicros, gradTimeoutMicros, options); } + /** + * Batches all the inputs tensors to the computation done by the function. + * So, for example, in the following code + *

+   *
+   *  # This input will be captured.
+   *  y = tf.placeholder_with_default(1.0, shape=[])
+   *
+   *  {@literal @}tf.Defun(tf.float32)
+   *  def computation(a):
+   *    return tf.matmul(a, a) + y
+   *
+   *  b = gen_batch_ops.batch_function(
+   *          f=computation
+   *          in_tensors=[a],
+   *          captured_tensors=computation.captured_inputs,
+   *          Tout=[o.type for o in computation.definition.signature.output_arg],
+   *          num_batch_threads=1,
+   *          max_batch_size=10,
+   *          batch_timeout_micros=100000,  # 100ms
+   *          allowed_batch_sizes=[3, 10],
+   *          batching_queue="")
+   *  
+ *

If more than one session.run call is simultaneously trying to compute {@code b} + * the values of {@code a} will be gathered, non-deterministically concatenated + * along the first axis, and only one thread will run the computation. + *

Assumes that all arguments of the function are Tensors which will be batched + * along their first dimension. + *

Arguments that are captured, are not batched. The session.run call which does + * the concatenation, will use the values of the captured tensors available to it. + * Therefore, typical uses of captured tensors should involve values which remain + * unchanged across session.run calls. Inference is a good example of this. + *

SparseTensor is not supported. The return value of the decorated function + * must be a Tensor or a list/tuple of Tensors. + * + * @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 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. + * @param batchTimeoutMicros Maximum number of microseconds to wait before outputting + * an incomplete batch. + * @param Tout the types of the output tensors. + * @param options carries optional attribute values + * @return a new instance of BatchFunction + */ + public BatchFunction batchFunction(Iterable> inTensors, + Iterable> capturedTensors, ConcreteFunction f, Long numBatchThreads, + Long maxBatchSize, Long batchTimeoutMicros, List> Tout, + BatchFunction.Options... options) { + return BatchFunction.create(scope, inTensors, capturedTensors, f, numBatchThreads, maxBatchSize, batchTimeoutMicros, Tout, options); + } + /** * BatchToSpace for 4-D tensors of type T. - *

* This is a legacy version of the more general BatchToSpaceND. - *

- * Rearranges (permutes) data from batch into blocks of spatial data, followed by + *

Rearranges (permutes) data from batch into blocks of spatial data, followed by * cropping. This is the reverse transformation of SpaceToBatch. More specifically, - * this op outputs a copy of the input tensor where values from the `batch` - * dimension are moved in spatial blocks to the `height` and `width` dimensions, - * followed by cropping along the `height` and `width` dimensions. + * 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 * @param input 4-D tensor with shape - * `[batchblock_sizeblock_size, height_pad/block_size, width_pad/block_size, - * depth]`. Note that the batch size of the input tensor must be divisible by - * `block_size * block_size`. - * @param crops 2-D tensor of non-negative integers with shape `[2, 2]`. It specifies + * {@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}. + * @param crops 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]] - * @param blockSize + *

+   *  crops = [[crop_top, crop_bottom], [crop_left, crop_right]]
+   *  
+ * @param blockSize The value of the blockSize attribute + * @param data type for {@code BatchToSpace} output and operands * @return a new instance of BatchToSpace */ public BatchToSpace batchToSpace(Operand input, @@ -831,112 +1044,108 @@ public BatchToSpace batchToSpace(Operand input, /** * BatchToSpace for N-D tensors of type T. - *

- * This operation reshapes the "batch" dimension 0 into `M + 1` dimensions of shape - * `block_shape + [batch]`, interleaves these blocks back into the grid defined by - * the spatial dimensions `[1, ..., M]`, to obtain a result with the same rank as + * This operation reshapes the "batch" dimension 0 into {@code M + 1} dimensions of shape + * {@code block_shape + [batch]}, interleaves these blocks back into the grid defined by + * the spatial dimensions {@code [1, ..., M]}, to obtain a result with the same rank as * the input. The spatial dimensions of this intermediate result are then - * optionally cropped according to `crops` to produce the output. This is the + * 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 `input_shape = [batch] + spatial_shape + remaining_shape`, + * @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 `[M]`, all values must be >= 1. - * @param crops 2-D with shape `[M, 2]`, all values must be >= 0. - * `crops[i] = [crop_start, crop_end]` specifies the amount to crop from input - * dimension `i + 1`, which corresponds to spatial dimension `i`. It is - * required that - * `crop_start[i] + crop_end[i] <= block_shape[i] * input_shape[i + 1]`. - *

- * This operation is equivalent to the following steps: - *

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

- * 2. Permute dimensions of `reshaped` to produce `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]] - *

- * 3. Reshape `permuted` to produce `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]] - *

- * 4. Crop the start and end of dimensions `[1, ..., M]` of - * `reshaped_permuted` according to `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]] - *

- * Some examples: - *

- * (1) For the following input of shape `[4, 1, 1, 1]`, `block_shape = [2, 2]`, and - * `crops = [[0, 0], [0, 0]]`: - *

{@code
+   * @param blockShape 1-D with shape {@code [M]}, all values must be >= 1.
+   * @param crops 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 `[1, 2, 2, 1]` and value: - *
{@code
+   *  
+ *

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

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

(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 `[1, 2, 2, 3]` and value: - *
{@code
+   *  
+ *

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 `[4, 2, 2, 1]`, `block_shape = [2, 2]`, and - * `crops = [[0, 0], [0, 0]]`: - *
{@code
+   *  
+ *

(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 `[1, 4, 4, 1]` and value: - *
{@code
+   *  
+ *

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 `[8, 1, 3, 1]`, `block_shape = [2, 2]`, and - * `crops = [[0, 0], [2, 0]]`: - *
{@code
+   *  
+ *

(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 `[2, 2, 4, 1]` and value: - *
{@code
+   *  
+ *

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]]]]
-   *  }
+ *
+ * @param data type for {@code BatchToSpaceND} output and operands * @return a new instance of BatchToSpaceNd */ public BatchToSpaceNd batchToSpaceNd(Operand input, @@ -946,61 +1155,70 @@ public BatchToSpaceNd batchToSpaceNd(Operand input, /** * Bitcasts a tensor from one type to another without copying data. - *

- * Given a tensor `input`, this operation returns a tensor that has the same buffer - * data as `input` with datatype `type`. - *

- * If the input datatype `T` is larger than the output datatype `type` then the - * shape changes from [...] to [..., sizeof(`T`)/sizeof(`type`)]. - *

- * If `T` is smaller than `type`, the operator requires that the rightmost - * dimension be equal to sizeof(`type`)/sizeof(`T`). The shape then goes from - * [..., sizeof(`type`)/sizeof(`T`)] to [...]. - *

- * tf.bitcast() and tf.cast() work differently when real dtype is casted as a complex dtype + * Given a tensor {@code input}, this operation returns a tensor that has the same buffer + * data as {@code input} with datatype {@code type}. + *

If the input datatype {@code T} is larger than the output datatype {@code type} then the + * shape changes from [...] to [..., sizeof({@code T})/sizeof({@code type})]. + *

If {@code T} is smaller than {@code type}, the operator requires that the rightmost + * dimension be equal to sizeof({@code type})/sizeof({@code T}). The shape then goes from + * [..., sizeof({@code type})/sizeof({@code T})] to [...]. + *

tf.bitcast() and tf.cast() work differently when real dtype is casted as a complex dtype * (e.g. tf.complex64 or tf.complex128) as tf.cast() make imaginary part 0 while tf.bitcast() * gives module error. * For example, - *

- * Example 1: - *

- * >>> a = [1., 2., 3.] - * >>> equality_bitcast = tf.bitcast(a, tf.complex128) + *

Example 1: + *

+ *
+ *
+ *

a = [1., 2., 3.] + * equality_bitcast = tf.bitcast(a, tf.complex128) * Traceback (most recent call last): * ... * InvalidArgumentError: Cannot bitcast from 1 to 18 [Op:Bitcast] - * >>> equality_cast = tf.cast(a, tf.complex128) - * >>> print(equality_cast) + * equality_cast = tf.cast(a, tf.complex128) + * print(equality_cast) * tf.Tensor([1.+0.j 2.+0.j 3.+0.j], shape=(3,), dtype=complex128) - *

- * Example 2: - *

- * >>> tf.bitcast(tf.constant(0xffffffff, dtype=tf.uint32), tf.uint8) - * - *

- * Example 3: - *

- * >>> x = [1., 2., 3.] - * >>> y = [0., 2., 3.] - * >>> equality= tf.equal(x,y) - * >>> equality_cast = tf.cast(equality,tf.float32) - * >>> equality_bitcast = tf.bitcast(equality_cast,tf.uint8) - * >>> print(equality) + *

+ *
+ *
+ *

Example 2: + *

+ *
+ *
+ *

tf.bitcast(tf.constant(0xffffffff, dtype=tf.uint32), tf.uint8) + * <tf.Tensor: shape=(4,), dtype=uint8, numpy=array([255, 255, 255, 255], dtype=uint8)> + *

+ *
+ *
+ *

Example 3: + *

+ *
+ *
+ *

x = [1., 2., 3.] + * y = [0., 2., 3.] + * equality= tf.equal(x,y) + * equality_cast = tf.cast(equality,tf.float32) + * equality_bitcast = tf.bitcast(equality_cast,tf.uint8) + * print(equality) * tf.Tensor([False True True], shape=(3,), dtype=bool) - * >>> print(equality_cast) + * print(equality_cast) * tf.Tensor([0. 1. 1.], shape=(3,), dtype=float32) - * >>> print(equality_bitcast) + * print(equality_bitcast) * tf.Tensor( - * [[ 0 0 0 0] - * [ 0 0 128 63] - * [ 0 0 128 63]], shape=(3, 4), dtype=uint8) - *

- * 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 - * @param input - * @param type + * [[ 0 0 0 0] + * [ 0 0 128 63] + * [ 0 0 128 63]], shape=(3, 4), dtype=uint8) + *

+ *
+ *
+ *

NOTE: Bitcast is implemented as a low-level cast, so machines with different + * 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 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 */ public Bitcast bitcast(Operand input, Class type) { @@ -1008,20 +1226,20 @@ 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 scope * @param tensor The tensor to mask. * @param mask The mask to apply. * @param options carries optional attributes values @@ -1033,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. @@ -1064,13 +1283,12 @@ public Operand booleanMaskUpdate(Operand tensor, Operand /** * Return the shape of s0 op s1 with broadcast. - *

- * Given `s0` and `s1`, tensors that represent shapes, compute `r0`, the - * broadcasted shape. `s0`, `s1` and `r0` are all integer vectors. + * 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 - * @param s1 + * @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 */ public BroadcastDynamicShape broadcastDynamicShape(Operand s0, @@ -1078,40 +1296,62 @@ 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, - *

- * >>> x = tf.constant([1, 2, 3]) - * >>> y = tf.broadcast_to(x, [3, 3]) - * >>> print(y) + * dimension pair they are either equal or one of them is one. + *

For example: + *

+ *
+ *
+ *

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) - *

- * In the above example, the input Tensor with the shape of `[1, 3]` - * is broadcasted to output Tensor with shape of `[3, 3]`. - *

- * When doing broadcasted operations such as multiplying a tensor + * [[1 2 3] + * [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 [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. - *

- * However, `broadcast_to` does not carry with it any such benefits. + *

However, {@code broadcast_to} does not carry with it any such benefits. * The newly-created tensor takes the full memory of the broadcasted - * shape. (In a graph context, `broadcast_to` might be fused to + * 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 `int` Tensor. The shape of the desired output. + * @param shape An 1-D {@code int} Tensor. The shape of the desired output. + * @param data type for {@code BroadcastTo} output and operands * @return a new instance of BroadcastTo */ public BroadcastTo broadcastTo(Operand input, @@ -1121,17 +1361,15 @@ public BroadcastTo broadcastTo(Operand input, /** * Bucketizes 'input' based on 'boundaries'. - *

* For example, if the inputs are - * boundaries = [0, 10, 100] - * input = [[-5, 10000] - * [150, 10] - * [5, 100]] - *

- * then the output will be - * output = [[0, 3] - * [3, 2] - * [1, 3]] + * boundaries = [0, 10, 100] + * input = [[-5, 10000] + * [150, 10] + * [5, 100]] + *

then the output will be + * output = [[0, 3] + * [3, 2] + * [1, 3]] * * @param input Any shape of Tensor contains with int or float type. * @param boundaries A sorted list of floats gives the boundary of the buckets. @@ -1142,19 +1380,97 @@ public Bucketize bucketize(Operand input, List boundar } /** - * Clips tensor values to a specified min and max. - *

- * Given a tensor `t`, this operation returns a tensor of the same type and - * shape as `t` with its values clipped to `clip_value_min` and `clip_value_max`. - * Any values less than `clip_value_min` are set to `clip_value_min`. Any values - * greater than `clip_value_max` are set to `clip_value_max`. + * Calls the function in an execution environment, adding its graph as a function if it isn't + * already present. Only works for functions with a single input and output. * - * @param data type for {@code output()} output - * @param t A `Tensor`. - * @param clipValueMin A 0-D (scalar) `Tensor`, or a `Tensor` with the same shape - * as `t`. The minimum value to clip by. - * @param clipValueMax A 0-D (scalar) `Tensor`, or a `Tensor` with the same shape - * as `t`. The maximum value to clip by. + * @param argument the argument to the call + * @return the output of the function + * @see ConcreteFunction#call(Ops, Operand) + */ + public Operand call(ConcreteFunction function, Operand argument) { + return Function.call(scope, function, argument); + } + + /** + * 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}. + * + * @param arguments the arguments to the call + * @return the outputs of the function + * @see ConcreteFunction#call(Ops, Map) + */ + public Map> call(ConcreteFunction function, + Map> arguments) { + return Function.call(scope, function, arguments); + } + + /** + * 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;
+   *  }
+   *  ```
+   *  
+ * + *

Selects between {@link StatefulCase} and {@link StatelessCase} based on the statefulness of the function arguments. + * + * @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 Case + */ + public Case caseOp(Operand branchIndex, Iterable> input, + List> Tout, List branches, Case.Options... options) { + 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 + * 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 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. + * @param clipValueMax A 0-D (scalar) {@code Tensor}, or a {@code Tensor} with the same shape + * as {@code t}. The maximum value to clip by. + * @param data type for {@code ClipByValue} output and operands * @return a new instance of ClipByValue */ public ClipByValue clipByValue(Operand t, Operand clipValueMin, @@ -1162,14 +1478,47 @@ 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 `N` Tensors to concatenate. Their ranks and types must match, - * and their sizes must match in all dimensions except `concat_dim`. + * @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 * range [-rank(values), rank(values)). + * @param data type for {@code ConcatV2} output and operands * @return a new instance of Concat */ public Concat concat(Iterable> values, @@ -1178,230 +1527,228 @@ public Concat concat(Iterable> values, } /** - * Creates a constant of {@code long} elements that is a copy of a given n-dimensional array. - * - * @param scope is a scope used to add the underlying operation. - * @param data an n-dimensional array of {@code long} elements. - * @return a long constant - */ - public Constant constant(LongNdArray data) { - return Constant.tensorOf(scope, data); + * 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 rank-1 constant of {@code int} elements. + * Creates a constant containing a single {@code int} element. * - * @param scope is a scope used to add the underlying operation. - * @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. + * @param data The value to put into the new constant. * @return an integer constant */ - public Constant constant(int[] data) { - return Constant.vectorOf(scope, data); + public Constant constant(int data) { + return Constant.scalarOf(scope, data); } /** - * Creates a rank-3 constant of {@code int} elements. + * Creates a rank-3 constant of {@code double} elements. * - * @param scope is a scope used to add the underlying operation. * @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 double constant */ - public Constant constant(int[][][] data) { + public Constant constant(double[][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a constant containing a single {@code double} element. + * Creates a rank-5 constant of {@code byte} elements. * - * @param scope is a scope used to add the underlying operation. - * @param data The value to put into the new constant. - * @return a double 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(double data) { - return Constant.scalarOf(scope, data); + public Constant constant(byte[][][][][] data) { + return Constant.tensorOf(scope, data); } /** - * Creates a rank-5 constant of {@code long} elements. + * Creates a rank-4 constant of {@code int} elements. * - * @param scope is a scope used to add the underlying operation. * @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 an integer constant */ - public Constant constant(long[][][][][] data) { + public Constant constant(int[][][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-5 constant of {@code boolean} elements. + * Creates a constant containing a single {@code byte} element. * - * @param scope is a scope used to add the underlying operation. - * @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 + * @param data The value to put into the new constant. + * @return a byte constant */ - public Constant constant(boolean[][][][][] data) { - return Constant.tensorOf(scope, data); + public Constant constant(byte 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 rank-6 constant of {@code float} elements. * - * @param scope is a scope used to add the underlying operation. - * @param data an n-dimensional array of {@code int} elements. - * @return an integer 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 float constant */ - public Constant constant(IntNdArray data) { + public Constant constant(float[][][][][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a constant of {@code double} elements that is a copy of a given n-dimensional array. + * Creates a rank-6 constant of {@code boolean} elements. * - * @param scope is a scope used to add the underlying operation. - * @param data an n-dimensional array of {@code double} elements. - * @return a double 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(DoubleNdArray data) { + public Constant constant(boolean[][][][][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-4 constant of {@code int} elements. + * Creates a rank-4 constant of {@code boolean} elements. * - * @param scope is a scope used to add the underlying operation. * @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 boolean constant */ - public Constant constant(int[][][][] data) { + public Constant constant(boolean[][][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-6 constant of {@code float} elements. + * Creates a rank-5 constant of {@code long} elements. * - * @param scope is a scope used to add the underlying operation. * @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 constant containing a single {@code byte} element. + * Creates a rank-1 constant of {@code int} elements. * - * @param scope is a scope used to add the underlying operation. - * @param data The value to put into the new constant. - * @return a byte 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 an integer constant */ - public Constant constant(byte data) { - return Constant.scalarOf(scope, data); + public Constant constant(int[] data) { + return Constant.vectorOf(scope, data); } /** - * Creates a rank-3 constant of {@code boolean} elements. + * Creates a rank-2 constant of {@code boolean} elements. * - * @param scope is a scope used to add the underlying operation. * @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) { + public Constant constant(boolean[][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-4 constant of {@code float} elements. + * Creates a constant of {@code boolean} elements that is a copy of a given n-dimensional array. * - * @param scope is a scope used to add the underlying operation. - * @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 + * @param data an n-dimensional array of {@code boolean} elements. + * @return a boolean constant */ - public Constant constant(float[][][][] data) { + public Constant constant(BooleanNdArray data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-2 constant of {@code long} elements. + * Creates a rank-1 constant of {@code double} elements. * - * @param scope is a scope used to add the underlying operation. * @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 double constant */ - public Constant constant(long[][] data) { - return Constant.tensorOf(scope, data); + public Constant constant(double[] data) { + return Constant.vectorOf(scope, data); } /** - * Creates a rank-5 constant of {@code byte} elements. + * Creates a constant of {@code long} elements that is a copy of a given n-dimensional array. * - * @param scope is a scope used to add the underlying operation. - * @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 + * @param data an n-dimensional array of {@code long} elements. + * @return a long constant */ - public Constant constant(byte[][][][][] data) { + public Constant constant(LongNdArray 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-3 constant of {@code long} elements. * - * @param scope is a scope used to add the underlying operation. - * @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 long constant */ - public Constant constant(BooleanNdArray 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 scope is a scope used to add the underlying operation. * @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 byte constant */ - public Constant constant(float[][] data) { - return Constant.tensorOf(scope, data); + public Constant constant(byte[] data) { + return Constant.vectorOf(scope, data); } /** - * Creates a constant of {@code byte} elements that is a copy of a given n-dimensional array. + * Creates a constant of {@code float} elements that is a copy of a given n-dimensional array. * - * @param scope is a scope used to add the underlying operation. - * @param data an n-dimensional array of {@code byte} elements. - * @return a byte constant + * @param data an n-dimensional array of {@code float} elements. + * @return a float constant */ - public Constant constant(ByteNdArray data) { + public Constant constant(FloatNdArray data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-2 constant of {@code byte} elements. + * Creates a rank-5 constant of {@code int} elements. * - * @param scope is a scope used to add the underlying operation. * @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 an integer constant */ - public Constant constant(byte[][] data) { + public Constant constant(int[][][][][] data) { return Constant.tensorOf(scope, data); } /** * Creates a rank-5 constant of {@code double} elements. * - * @param scope is a scope used to add the underlying operation. * @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 @@ -1411,50 +1758,56 @@ public Constant constant(double[][][][][] data) { } /** - * Creates a rank-3 constant of {@code float} elements. + * Creates a rank-5 constant of {@code boolean} elements. * - * @param scope is a scope used to add the underlying operation. * @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 boolean constant */ - public Constant constant(float[][][] data) { + public Constant constant(boolean[][][][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-1 constant of {@code byte} elements. + * Creates a constant containing a single {@code float} element. + * + * @param data The value to put into the new constant. + * @return a float constant + */ + public Constant constant(float data) { + return Constant.scalarOf(scope, data); + } + + /** + * Creates a rank-2 constant of {@code byte} elements. * - * @param scope is a scope used to add the underlying operation. * @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); + public Constant constant(byte[][] data) { + return Constant.tensorOf(scope, data); } /** - * Creates a rank-1 constant of {@code float} elements. + * Creates a rank-2 constant of {@code double} elements. * - * @param scope is a scope used to add the underlying operation. * @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 double constant */ - public Constant constant(float[] data) { - return Constant.vectorOf(scope, data); + public Constant constant(double[][] data) { + return Constant.tensorOf(scope, data); } /** - * Creates a rank-2 constant of {@code boolean} elements. + * Creates a rank-3 constant of {@code byte} elements. * - * @param scope is a scope used to add the underlying operation. * @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 byte constant */ - public Constant constant(boolean[][] data) { + public Constant constant(byte[][][] data) { return Constant.tensorOf(scope, data); } @@ -1462,7 +1815,6 @@ public Constant constant(boolean[][] 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 scope is a scope used to add the underlying operation. * @param data an n-dimensional array of {@code String} elements. * @return a string constant */ @@ -1471,79 +1823,72 @@ public Constant constant(NdArray data) { } /** - * Creates a {@code String} constant using the default, UTF-8 encoding. + * Creates a rank-2 constant of {@code long} elements. * - * @param scope is a scope used to add the underlying operation. - * @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 long constant */ - public Constant constant(String data) { - return Constant.scalarOf(scope, data); + public Constant constant(long[][] data) { + return Constant.tensorOf(scope, data); } /** - * Creates a rank-4 constant of {@code double} elements. + * Creates a rank-3 constant of {@code float} elements. * - * @param scope is a scope used to add the underlying operation. * @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 float constant */ - public Constant constant(double[][][][] data) { + public Constant constant(float[][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-2 constant of {@code double} elements. + * Creates a rank-5 constant of {@code float} elements. * - * @param scope is a scope used to add the underlying operation. * @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 float constant */ - public Constant constant(double[][] data) { + public Constant constant(float[][][][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a constant containing a single {@code int} element. + * Creates a rank-2 constant of {@code float} elements. * - * @param scope is a scope used to add the underlying operation. - * @param data The value to put into the new constant. - * @return an integer 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 float constant */ - public Constant constant(int data) { - return Constant.scalarOf(scope, data); + public Constant constant(float[][] data) { + return Constant.tensorOf(scope, data); } /** - * Creates a rank-4 constant of {@code byte} elements. + * Creates a constant containing a single {@code double} element. * - * @param scope is a scope used to add the underlying operation. - * @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 + * @param data The value to put into the new constant. + * @return a double constant */ - public Constant constant(byte[][][][] data) { - return Constant.tensorOf(scope, data); + public Constant constant(double data) { + return Constant.scalarOf(scope, data); } /** - * Creates a rank-6 constant of {@code int} elements. + * Creates a constant containing a single {@code boolean} element. * - * @param scope is a scope used to add the underlying operation. - * @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 boolean constant */ - public Constant constant(int[][][][][][] data) { - return Constant.tensorOf(scope, data); + public Constant constant(boolean data) { + return Constant.scalarOf(scope, data); } /** * Creates a constant containing a single {@code long} element. * - * @param scope is a scope used to add the underlying operation. * @param data The value to put into the new constant. * @return a long constant */ @@ -1552,68 +1897,61 @@ public Constant constant(long data) { } /** - * Creates a constant containing a single {@code float} element. + * Creates a {@code String} constant using the default, UTF-8 encoding. * - * @param scope is a scope used to add the underlying operation. - * @param data The value to put into the new constant. - * @return a float constant + * @param data The string to put into the new constant. + * @return a string constant */ - public Constant constant(float data) { + public Constant constant(String data) { return Constant.scalarOf(scope, data); } /** - * Creates a rank-5 constant of {@code float} elements. + * Creates a rank-1 constant of {@code float} elements. * - * @param scope is a scope used to add the underlying operation. * @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 */ - public Constant constant(float[][][][][] data) { - return Constant.tensorOf(scope, data); + public Constant constant(float[] data) { + return Constant.vectorOf(scope, data); } /** - * Creates a rank-3 constant of {@code double} elements. + * Creates a rank-3 constant of {@code boolean} elements. * - * @param scope is a scope used to add the underlying operation. * @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 boolean constant */ - public Constant constant(double[][][] data) { + public Constant constant(boolean[][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-6 constant of {@code long} elements. + * Creates a rank-3 constant of {@code int} elements. * - * @param scope is a scope used to add the underlying operation. * @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 an integer constant */ - public Constant constant(long[][][][][][] data) { + public Constant constant(int[][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-4 constant of {@code long} elements. + * Creates a constant of {@code int} elements that is a copy of a given n-dimensional array. * - * @param scope is a scope used to add the underlying operation. - * @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 + * @param data an n-dimensional array of {@code int} elements. + * @return an integer constant */ - public Constant constant(long[][][][] data) { + public Constant constant(IntNdArray data) { return Constant.tensorOf(scope, data); } /** * Creates a rank-1 constant of {@code long} elements. * - * @param scope is a scope used to add the underlying operation. * @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 @@ -1623,144 +1961,132 @@ public Constant constant(long[] data) { } /** - * Creates a rank-1 constant of {@code boolean} elements. + * Creates a rank-6 constant of {@code int} elements. * - * @param scope is a scope used to add the underlying operation. * @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) { - return Constant.vectorOf(scope, data); + public Constant constant(int[][][][][][] data) { + return Constant.tensorOf(scope, data); } /** - * Creates a rank-3 constant of {@code byte} elements. + * Creates a constant of {@code double} elements that is a copy of a given n-dimensional array. * - * @param scope is a scope used to add the underlying operation. - * @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 + * @param data an n-dimensional array of {@code double} elements. + * @return a double constant */ - public Constant constant(byte[][][] data) { + public Constant constant(DoubleNdArray data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-6 constant of {@code byte} elements. + * Creates a rank-6 constant of {@code double} elements. * - * @param scope is a scope used to add the underlying operation. * @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 double constant */ - public Constant constant(byte[][][][][][] data) { + public Constant constant(double[][][][][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-2 constant of {@code int} elements. + * Creates a rank-6 constant of {@code long} elements. * - * @param scope is a scope used to add the underlying operation. * @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) { - return Constant.tensorOf(scope, data); - } - - /** - * Creates a constant of {@code float} elements that is a copy of a given n-dimensional array. - * - * @param scope is a scope used to add the underlying operation. - * @param data an n-dimensional array of {@code float} elements. - * @return a float constant + * @return a long constant */ - public Constant constant(FloatNdArray data) { + public Constant constant(long[][][][][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-5 constant of {@code int} elements. + * Creates a rank-2 constant of {@code int} elements. * - * @param scope is a scope used to add the underlying operation. * @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-1 constant of {@code double} elements. + * Creates a rank-1 constant of {@code boolean} elements. * - * @param scope is a scope used to add the underlying operation. * @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 boolean constant */ - public Constant constant(double[] data) { + public Constant constant(boolean[] data) { return Constant.vectorOf(scope, data); } /** - * Creates a rank-6 constant of {@code boolean} elements. + * Creates a rank-4 constant of {@code byte} elements. * - * @param scope is a scope used to add the underlying operation. * @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 byte constant */ - public Constant constant(boolean[][][][][][] data) { + public Constant constant(byte[][][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-6 constant of {@code double} elements. + * Creates a rank-4 constant of {@code float} elements. * - * @param scope is a scope used to add the underlying operation. * @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 float constant */ - public Constant constant(double[][][][][][] data) { + public Constant constant(float[][][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a constant containing a single {@code boolean} element. + * Creates a constant of {@code byte} elements that is a copy of a given n-dimensional array. * - * @param scope is a scope used to add the underlying operation. - * @param data The value to put into the new constant. - * @return a boolean constant + * @param data an n-dimensional array of {@code byte} elements. + * @return a byte constant */ - public Constant constant(boolean data) { - return Constant.scalarOf(scope, data); + public Constant constant(ByteNdArray data) { + return Constant.tensorOf(scope, data); } /** - * Creates a rank-4 constant of {@code boolean} elements. + * Creates a rank-6 constant of {@code byte} elements. * - * @param scope is a scope used to add the underlying operation. * @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 byte constant */ - public Constant constant(boolean[][][][] data) { + public Constant constant(byte[][][][][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-3 constant of {@code long} elements. + * Creates a rank-4 constant of {@code long} elements. * - * @param scope is a scope used to add the underlying operation. * @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) { + public Constant constant(long[][][][] data) { + return Constant.tensorOf(scope, data); + } + + /** + * Creates a rank-4 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); } @@ -1768,18 +2094,28 @@ public Constant constant(long[][][] data) { * Creates a rank-1 constant of {@code long} elements representing the size of each dimensions of * the given shape. * - * @param scope is a scope used to add the underlying operation. * @param shape a shape * @return a long constant */ - public Constant constant(Shape shape) { - return Constant.tensorOf(scope, shape); + public Constant constant(Shape shape) { + return Constant.tensorOf(scope, shape); + } + + /** + * Creates a constant of {@code String} elements that is a copy of a given n-dimensional array, + * using the given encoding. + * + * @param charset charset used to encode/decode string bytes. + * @param data an n-dimensional array of {@code String} elements. + * @return a string constant + */ + public Constant constant(Charset charset, NdArray data) { + return Constant.tensorOf(scope, charset, data); } /** * Creates a constant of {@code String} elements, using the given charset. * - * @param scope is a scope used to add the underlying operation. * @param charset charset for encoding/decoding strings bytes. * @param data An array containing the values to put into the new constant. String elements are * sequences of bytes from the last array dimension. @@ -1792,7 +2128,6 @@ public Constant constant(Charset charset, String[] data) { /** * Creates a {@code String} constant using a specified encoding. * - * @param scope is a scope used to add the underlying operation. * @param charset The encoding from String to bytes. * @param data The string to put into the new constant. * @return a string constant @@ -1802,48 +2137,33 @@ public Constant constant(Charset charset, String data) { } /** - * Creates a constant of {@code String} elements that is a copy of a given n-dimensional array, - * using the given encoding. - * - * @param scope is a scope used to add the underlying operation. - * @param charset charset used to encode/decode string bytes. - * @param data an n-dimensional array of {@code String} elements. - * @return a string constant - */ - public Constant constant(Charset charset, NdArray data) { - return Constant.tensorOf(scope, charset, data); - } - - /** - * Create a {@link TFloat32} constant with data from the given buffer. + * Create a {@link TBool} constant with data from the given buffer. * - * @param scope is a scope used to add the underlying operation. * @param shape the tensor shape. * @param data a buffer containing the tensor data. - * @return a float constant + * @return an boolean constant * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer */ - public Constant constant(Shape shape, FloatDataBuffer data) { + public Constant constant(Shape shape, BooleanDataBuffer data) { return Constant.tensorOf(scope, shape, data); } /** - * Create a {@link TBool} constant with data from the given buffer. + * Create a {@link TString} constant with data from the given buffer, using the default UTF-8 + * encoding. * - * @param scope is a scope used to add the underlying operation. * @param shape the tensor shape. * @param data a buffer containing the tensor data. - * @return an boolean constant + * @return a string constant * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer */ - public Constant constant(Shape shape, BooleanDataBuffer data) { + public Constant constant(Shape shape, DataBuffer data) { return Constant.tensorOf(scope, shape, data); } /** * Create a {@link TUint8} constant with data from the given buffer. * - * @param scope is a scope used to add the underlying operation. * @param shape the tensor shape. * @param data a buffer containing the tensor data. * @return a byte constant @@ -1854,67 +2174,63 @@ public Constant constant(Shape shape, ByteDataBuffer data) { } /** - * Create a {@link TInt64} constant with data from the given buffer. + * Create a {@link TInt32} constant with data from the given buffer. * - * @param scope is a scope used to add the underlying operation. * @param shape the tensor shape. * @param data a buffer containing the tensor data. - * @return a long constant + * @return an integer 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, IntDataBuffer data) { return Constant.tensorOf(scope, shape, data); } /** - * Create a {@link TString} constant with data from the given buffer, using the default UTF-8 - * encoding. + * Create a {@link TFloat64} constant with data from the given buffer. * - * @param scope is a scope used to add the underlying operation. * @param shape the tensor shape. * @param data a buffer containing the tensor data. - * @return a string constant + * @return a double constant * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer */ - public Constant constant(Shape shape, DataBuffer 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 scope is a scope used to add the underlying operation. * @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); } /** - * Create a {@link TInt32} constant with data from the given buffer. + * Create a {@link TFloat32} constant with data from the given buffer. * - * @param scope is a scope used to add the underlying operation. * @param shape the tensor shape. * @param data a buffer containing the tensor data. - * @return an integer constant + * @return a float constant * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer */ - public Constant constant(Shape shape, IntDataBuffer data) { + public Constant constant(Shape shape, FloatDataBuffer data) { return Constant.tensorOf(scope, shape, data); } /** - * Creates a scalar of {@code type}, with the value of {@code number}. {@code number} may be truncated if it does not - * fit in the target type. + * Creates a scalar of {@code type}, with the value of {@code number}. {@code number} may be + * truncated if it does not fit in the target type. * - * @param type the type of tensor to create. Must be concrete (i.e. not {@link org.tensorflow.types.family.TFloating}) + * @param type the type of tensor to create. Must be concrete (i.e. not {@link + * org.tensorflow.types.family.TFloating}) * @param number the value of the tensor * @return a constant of the passed type - * @throws IllegalArgumentException if the type is abstract (i.e. {@link org.tensorflow.types.family.TFloating}) or - * unknown. + * @throws IllegalArgumentException if the type is abstract (i.e. {@link + * org.tensorflow.types.family.TFloating}) or unknown. */ public Constant constant(Class type, Number number) { return Constant.tensorOf(scope, type, number); @@ -1923,7 +2239,6 @@ public Constant constant(Class type, Number number) { /** * Create a {@link TString} constant with data from the given buffer, using the given encoding. * - * @param scope is a scope used to add the underlying operation. * @param charset charset used to encode/decode string bytes. * @param shape the tensor shape. * @param data a buffer containing the tensor data. @@ -1938,7 +2253,6 @@ public Constant constant(Charset charset, Shape shape, DataBuffer the tensor type - * @param scope is a scope used to add the underlying operation. * @param type the tensor type class * @param shape the tensor shape. * @param data a buffer containing the tensor data. @@ -1951,13 +2265,9 @@ 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)}}. + * Create a constant by making an immutable copy of {@code tensor}. {@code tensor} may be closed + * afterward without issue. * - * @param scope is a scope used to add the underlying operation. * @param tensor a Tensor holding the constant value * @return a constant of the same data type as `tensor` */ @@ -1966,8 +2276,8 @@ public Constant constantOf(T tensor) { } /** - * Creates a scalar of the same type as {@code toMatch}, with the value of {@code number}. {@code number} may be - * truncated if it does not fit in the target type. + * Creates a scalar of the same type as {@code toMatch}, with the value of {@code number}. {@code + * number} may be truncated if it does not fit in the target type. * * @param toMatch the operand providing the target type * @param number the value of the tensor @@ -1980,26 +2290,23 @@ public Constant constantOfSameType(Operand toMatch, Nu } /** - * This op consumes a lock created by `MutexLock`. - *

- * This op exists to consume a tensor created by `MutexLock` (other than + * This op consumes a lock created by {@code MutexLock}. + * This op exists to consume a tensor created by {@code MutexLock} (other than * direct control dependencies). It should be the only that consumes the tensor, * and will raise an error if it is not. Its only purpose is to keep the * mutex lock tensor alive until it is consumed by this op. - *

- * NOTE: This operation must run on the same device as its input. This may - * be enforced via the `colocate_with` mechanism. + *

NOTE: This operation must run on the same device as its input. This may + * be enforced via the {@code colocate_with} mechanism. * - * @param mutexLock A tensor returned by `MutexLock`. + * @param mutexLock A tensor returned by {@code MutexLock}. * @return a new instance of ConsumeMutexLock */ - public ConsumeMutexLock consumeMutexLock(Operand mutexLock) { + public ConsumeMutexLock consumeMutexLock(Operand mutexLock) { return ConsumeMutexLock.create(scope, mutexLock); } /** * Does nothing. Serves as a control trigger for scheduling. - *

* Only useful as a placeholder for control edges. * * @return a new instance of ControlTrigger @@ -2008,13 +2315,38 @@ 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 `Variable` node. + * @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. + * @param data type for {@code CountUpTo} output and operands * @return a new instance of CountUpTo */ public CountUpTo countUpTo(Operand ref, Long limit) { @@ -2023,61 +2355,77 @@ public CountUpTo countUpTo(Operand ref, Long limit) { /** * The op extracts fields from a serialized protocol buffers message into tensors. - *

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

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

- * Each output tensor is a dense tensor. This means that it is padded to hold + * {@code descriptor_source} attribute. + *

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

- * For the most part, the mapping between Proto field types and TensorFlow dtypes + *

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

- * - A proto field that contains a submessage or group can only be converted - * to `DT_STRING` (the serialized submessage). This is to reduce the complexity + *

    + *
  • + *

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

    - * - TensorFlow lacks support for unsigned integers. The ops represent uint64 - * types as a `DT_INT64` with the same twos-complement bit pattern (the obvious + *

  • + *
  • + *

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

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

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

    - * - An empty string or "local://", in which case protocol descriptors are + * {@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. + *

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

    + *
  • + *

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

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

    - * - A "bytes://", in which protocol descriptors are created from ``, - * which is expected to be a `FileDescriptorSet` serialized as a string. - * - * @param bytes Tensor of serialized protos with shape `batch_shape`. + *

  • + *
  • + *

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

  • + *
  • + *

    A "bytes://<bytes>", in which protocol descriptors are created from {@code }, + * which is expected to be a {@code FileDescriptorSet} serialized as a string. + *

  • + *
+ * + * @param bytes Tensor of serialized protos with shape {@code batch_shape}. * @param messageType Name of the proto message type to decode. * @param fieldNames List of strings containing proto field names. An extension field can be decoded * by using its full name, e.g. EXT_PACKAGE.EXT_FIELD_NAME. * @param outputTypes List of TF types to use for the respective field in field_names. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of DecodeProto */ public DecodeProto decodeProto(Operand bytes, String messageType, @@ -2087,10 +2435,10 @@ public DecodeProto decodeProto(Operand bytes, String messageType, } /** - * Makes a copy of `x`. + * Makes a copy of {@code x}. * - * @param data type for {@code y()} output - * @param x The source tensor of type `T`. + * @param x The source tensor of type {@code T}. + * @param data type for {@code DeepCopy} output and operands * @return a new instance of DeepCopy */ public DeepCopy deepCopy(Operand x) { @@ -2109,34 +2457,31 @@ public DeleteSessionTensor deleteSessionTensor(Operand handle) { /** * Deletes the resource specified by the handle. - *

* All subsequent operations using the resource will result in a NotFound * error status. * * @param resource handle to the resource to delete. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of DestroyResourceOp */ - public DestroyResourceOp destroyResourceOp(Operand resource, + public DestroyResourceOp destroyResourceOp(Operand resource, DestroyResourceOp.Options... options) { return DestroyResourceOp.create(scope, resource, options); } /** * Destroys the temporary variable and returns its final value. - *

* Sets output to the value of the Tensor pointed to by 'ref', then destroys * the temporary variable called 'var_name'. - * All other uses of 'ref' must have executed before this op. + * All other uses of 'ref' must have executed before this op. * 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'. + *

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. + * @param data type for {@code DestroyTemporaryVariable} output and operands * @return a new instance of DestroyTemporaryVariable */ public DestroyTemporaryVariable destroyTemporaryVariable(Operand ref, @@ -2145,22 +2490,43 @@ public DestroyTemporaryVariable destroyTemporaryVariable(Op } /** - * Partitions `data` into `num_partitions` tensors using indices from `partitions`. - *

- * For each index tuple `js` of size `partitions.ndim`, the slice `data[js, ...]` - * becomes part of `outputs[partitions[js]]`. The slices with `partitions[js] = i` - * are placed in `outputs[i]` in lexicographic order of `js`, and the first - * dimension of `outputs[i]` is the number of entries in `partitions` equal to `i`. + * 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, ...]} + * becomes part of {@code outputs[partitions[js]]}. The slices with {@code partitions[js] = i} + * are placed in {@code outputs[i]} in lexicographic order of {@code js}, and the first + * dimension of {@code outputs[i]} is the number of entries in {@code partitions} equal to {@code i}. * In detail, - *

{@code
+   *  
    *      outputs[i].shape = [sum(partitions == i)] + data.shape[partitions.ndim:]
    *
    *      outputs[i] = pack([data[js, ...] for js if partitions[js] == i])
-   *  }
- * `data.shape` must start with `partitions.shape`. - *

- * For example: - *

{@code
+   *  
+ *

{@code data.shape} must start with {@code partitions.shape}. + *

For example: + *

    *      # Scalar partitions.
    *      partitions = 1
    *      num_partitions = 2
@@ -2174,17 +2540,25 @@ public  DestroyTemporaryVariable destroyTemporaryVariable(Op
    *      data = [10, 20, 30, 40, 50]
    *      outputs[0] = [10, 20, 50]
    *      outputs[1] = [30, 40]
-   *  }
- * See `dynamic_stitch` for an example on how to merge partitions back. - *

+ *

+ *

See {@code dynamic_stitch} for an example on how to merge partitions back. *

* *
+ *

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 - * @param partitions Any shape. Indices in the range `[0, num_partitions)`. + * @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 * @return a new instance of DynamicPartition */ public DynamicPartition dynamicPartition(Operand data, @@ -2193,34 +2567,32 @@ public DynamicPartition dynamicPartition(Operand data, } /** - * Interleave the values from the `data` tensors into a single tensor. - *

+ * Interleave the values from the {@code data} tensors into a single tensor. * Builds a merged tensor such that - *

{@code
+   *  
    *      merged[indices[m][i, ..., j], ...] = data[m][i, ..., j, ...]
-   *  }
- * For example, if each `indices[m]` is scalar or vector, we have - *
{@code
+   *  
+ *

For example, if each {@code indices[m]} is scalar or vector, we have + *

    *      # Scalar indices:
    *      merged[indices[m], ...] = data[m][...]
    *
    *      # Vector indices:
    *      merged[indices[m][i], ...] = data[m][i, ...]
-   *  }
- * Each `data[i].shape` must start with the corresponding `indices[i].shape`, - * and the rest of `data[i].shape` must be constant w.r.t. `i`. That is, we - * must have `data[i].shape = indices[i].shape + constant`. In terms of this - * `constant`, the output shape is - *

- * merged.shape = [max(indices)] + constant - *

- * Values are merged in order, so if an index appears in both `indices[m][i]` and - * `indices[n][j]` for `(m,i) < (n,j)` the slice `data[n][j]` will appear in the + *

+ *

Each {@code data[i].shape} must start with the corresponding {@code indices[i].shape}, + * and the rest of {@code data[i].shape} must be constant w.r.t. {@code i}. That is, we + * must have {@code data[i].shape = indices[i].shape + constant}. In terms of this + * {@code constant}, the output shape is + *

+   *  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 * merged result. If you do not need this guarantee, ParallelDynamicStitch might * perform better on some devices. - *

- * For example: - *

{@code
+   *  

For example: + *

    *      indices[0] = 6
    *      indices[1] = [4, 1]
    *      indices[2] = [[5, 2], [0, 3]]
@@ -2229,10 +2601,10 @@ public  DynamicPartition dynamicPartition(Operand data,
    *      data[2] = [[[51, 52], [21, 22]], [[1, 2], [31, 32]]]
    *      merged = [[1, 2], [11, 12], [21, 22], [31, 32], [41, 42],
    *                [51, 52], [61, 62]]
-   *  }
- * This method can be used to merge partitions created by `dynamic_partition` + *
+ *

This method can be used to merge partitions created by {@code dynamic_partition} * as illustrated on the following example: - *

{@code
+   *  
    *      # Apply function (increments x_i) on elements for which a certain condition
    *      # apply (x_i != -1 in this example).
    *      x=tf.constant([0.1, -1., 5.2, 4.3, -1., 7.4])
@@ -2245,14 +2617,14 @@ public  DynamicPartition dynamicPartition(Operand data,
    *      x = tf.dynamic_stitch(condition_indices, partitioned_data)
    *      # Here x=[1.1, -1., 6.2, 5.3, -1, 8.4], the -1. values remain
    *      # unchanged.
-   *  }
+ *
*
* *
* - * @param data type for {@code merged()} output - * @param indices - * @param data + * @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 */ public DynamicStitch dynamicStitch(Iterable> indices, @@ -2262,13 +2634,11 @@ public DynamicStitch dynamicStitch(Iterable /** * Computes the (possibly normalized) Levenshtein Edit Distance. - *

* The inputs are variable-length sequences provided by SparseTensors - * (hypothesis_indices, hypothesis_values, hypothesis_shape) + * (hypothesis_indices, hypothesis_values, hypothesis_shape) * and - * (truth_indices, truth_values, truth_shape). - *

- * The inputs are: + * (truth_indices, truth_values, truth_shape). + *

The inputs are: * * @param hypothesisIndices The indices of the hypothesis list SparseTensor. * This is an N x R int64 matrix. @@ -2281,7 +2651,8 @@ public DynamicStitch dynamicStitch(Iterable * @param truthValues The values of the truth list SparseTensor. * This is an M-length vector. * @param truthShape truth indices, vector. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code EditDistance} output and operands * @return a new instance of EditDistance */ public EditDistance editDistance(Operand hypothesisIndices, @@ -2292,13 +2663,12 @@ public EditDistance editDistance(Operand hypothesisInd /** * Creates a tensor with the given shape. - *

- * This operation creates a tensor of `shape` and `dtype`. + *

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 - * @param options carries optional attributes values + * @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 */ public Empty empty(Operand shape, Class dtype, @@ -2308,17 +2678,16 @@ public Empty empty(Operand shape, Class dtype, /** * Creates and returns an empty tensor list. - *

* All list elements must be tensors of dtype element_dtype and shape compatible * with element_shape. - *

- * handle: an empty tensor list. + *

handle: an empty tensor list. * element_dtype: the type of elements in the list. * element_shape: a shape compatible with that of elements in the list. * - * @param elementShape - * @param maxNumElements - * @param elementDtype + * @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 */ public EmptyTensorList emptyTensorList(Operand elementShape, @@ -2328,7 +2697,6 @@ public EmptyTensorList emptyTensorList(Operand * handle: an empty tensor map * * @return a new instance of EmptyTensorMap @@ -2339,53 +2707,57 @@ public EmptyTensorMap emptyTensorMap() { /** * The op serializes protobuf messages provided in the input tensors. - *

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

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

- * A `message_type` name must be provided to give context for the field names. + * The types of the tensors in {@code values} must match the schema for the fields + * specified in {@code field_names}. All the tensors in {@code values} must have a common + * shape prefix, batch_shape. + *

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

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

- * For the most part, the mapping between Proto field types and TensorFlow dtypes + * {@code descriptor_source} attribute. + *

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

- * - A proto field that contains a submessage or group can only be converted - * to `DT_STRING` (the serialized submessage). This is to reduce the complexity + *

    + *
  • + *

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

    - * - TensorFlow lacks support for unsigned integers. The ops represent uint64 - * types as a `DT_INT64` with the same twos-complement bit pattern (the obvious + *

  • + *
  • + *

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

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

    - * - An empty string or "local://", in which case protocol descriptors are + * {@code DT_INT64}, or using twos-complement if the caller specifies {@code DT_INT32} in + * the {@code output_types} attribute. + *

  • + *
+ *

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

    + *
  • + *

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

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

    - * - A "bytes://", in which protocol descriptors are created from ``, - * which is expected to be a `FileDescriptorSet` serialized as a string. - * - * @param sizes Tensor of int32 with shape `[batch_shape, len(field_names)]`. + *

  • + *
  • + *

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

  • + *
  • + *

    A "bytes://<bytes>", in which protocol descriptors are created from {@code }, + * which is expected to be a {@code FileDescriptorSet} serialized as a string. + *

  • + *
+ * + * @param sizes Tensor of int32 with shape {@code [batch_shape, len(field_names)]}. * @param values List of tensors containing values for the corresponding field. * @param fieldNames List of strings containing proto field names. * @param messageType Name of the proto message type to decode. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of EncodeProto */ public EncodeProto encodeProto(Operand sizes, Iterable> values, @@ -2395,56 +2767,80 @@ public EncodeProto encodeProto(Operand sizes, Iterable> value /** * 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 * @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 * @return a new instance of EnsureShape */ public EnsureShape ensureShape(Operand input, Shape shape) { 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 `input`, this operation inserts a dimension of 1 at the - * dimension index `axis` of `input`'s shape. The dimension index `axis` starts at - * zero; if you specify a negative number for `axis` it is counted backward from + * Given a tensor {@code input}, this operation inserts a dimension of 1 at the + * dimension index {@code axis} of {@code input}'s shape. The dimension index {@code axis} starts at + * zero; if you specify a negative number for {@code axis} it is counted backward from * the end. - *

- * This operation is useful if you want to add a batch dimension to a single - * element. For example, if you have a single image of shape `[height, width, - * channels]`, you can make it a batch of 1 image with `expand_dims(image, 0)`, - * which will make the shape `[1, height, width, channels]`. - *

- * Other examples: - *

{@code
+   *  

This operation is useful if you want to add a batch dimension to a single + * element. For example, if you have a single image of shape {@code [height, width, channels]}, you can make it a batch of 1 image with {@code expand_dims(image, 0)}, + * which will make the shape {@code [1, height, width, channels]}. + *

Other examples: + *

    *  # 't' is a tensor of shape [2]
-   *  shape(expand_dims(t, 0)) ==> [1, 2]
-   *  shape(expand_dims(t, 1)) ==> [2, 1]
-   *  shape(expand_dims(t, -1)) ==> [2, 1]
+   *  shape(expand_dims(t, 0)) ==> [1, 2]
+   *  shape(expand_dims(t, 1)) ==> [2, 1]
+   *  shape(expand_dims(t, -1)) ==> [2, 1]
    *
    *  # 't2' is a tensor of shape [2, 3, 5]
-   *  shape(expand_dims(t2, 0)) ==> [1, 2, 3, 5]
-   *  shape(expand_dims(t2, 2)) ==> [2, 3, 1, 5]
-   *  shape(expand_dims(t2, 3)) ==> [2, 3, 5, 1]
-   *  }
- * This operation requires that: - *

- * `-1-input.dims() <= dim <= input.dims()` - *

- * This operation is related to `squeeze()`, which removes dimensions of + * shape(expand_dims(t2, 0)) ==> [1, 2, 3, 5] + * shape(expand_dims(t2, 2)) ==> [2, 3, 1, 5] + * shape(expand_dims(t2, 3)) ==> [2, 3, 5, 1] + *

+ *

This operation requires that: + *

{@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 - * @param input + * @param input The input value * @param axis 0-D (scalar). Specifies the dimension index at which to - * expand the shape of `input`. Must be in the range - * `[-rank(input) - 1, rank(input)]`. + * expand the shape of {@code input}. Must be in the range + * {@code [-rank(input) - 1, rank(input)]}. + * @param data type for {@code ExpandDims} output and operands * @return a new instance of ExpandDims */ public ExpandDims expandDims(Operand input, @@ -2453,20 +2849,19 @@ public ExpandDims expandDims(Operand input, } /** - * Extract `patches` from `input` and put them in the `"depth"` output dimension. 3D extension of `extract_image_patches`. + * 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 `[batch, in_planes, in_rows, in_cols, depth]`. - * @param ksizes The size of the sliding window for each dimension of `input`. + * @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 - * `input`. Must be: `[1, stride_planes, stride_rows, stride_cols, 1]`. + * {@code input}. Must be: {@code [1, stride_planes, stride_rows, stride_cols, 1]}. * @param padding The type of padding algorithm to use. - *

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

{@code
+   *  

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]
-   *  }
+ *
+ * @param data type for {@code ExtractVolumePatches} output and operands * @return a new instance of ExtractVolumePatches */ public ExtractVolumePatches extractVolumePatches(Operand input, @@ -2474,38 +2869,63 @@ 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 `dims` and fills it with `value`. - *

- * For example: - *

{@code
+   *  This operation creates a tensor of shape {@code dims} and fills it with {@code value}.
+   *  

For example: + *

    *  # Output tensor has shape [2, 3].
-   *  fill([2, 3], 9) ==> [[9, 9, 9]
+   *  fill([2, 3], 9) ==> [[9, 9, 9]
    *                       [9, 9, 9]]
-   *  }
- * `tf.fill` differs from `tf.constant` in a few ways: + *
+ *

{@code tf.fill} differs from {@code tf.constant} in a few ways: *

    - *
  • - * `tf.fill` only supports scalar contents, whereas `tf.constant` supports - * Tensor values. - *
  • - *
  • - * `tf.fill` creates an Op in the computation graph that constructs the actual - * Tensor value at runtime. This is in contrast to `tf.constant` which embeds - * the entire Tensor into the graph with a `Const` node. - *
  • - *
  • - * Because `tf.fill` evaluates at graph runtime, it supports dynamic shapes - * based on other runtime Tensors, unlike `tf.constant`. + *
  • {@code tf.fill} only supports scalar contents, whereas {@code tf.constant} supports + * Tensor values.
  • + *
  • {@code tf.fill} creates an Op in the computation graph that constructs the actual + * Tensor value at runtime. This is in contrast to {@code tf.constant} which embeds + * the entire Tensor into the graph with a {@code Const} node.
  • + *
  • 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 * @param dims 1-D. Represents the shape of the output tensor. * @param value 0-D (scalar). Value to fill the returned tensor. - *

- * @compatibility(numpy) Equivalent to np.full - * @end_compatibility + *

{@literal @}compatibility(numpy)
+ * Equivalent to np.full + *
{@literal @}end_compatibility + * @param data type for {@code Fill} output and operands * @return a new instance of Fill */ public Fill fill(Operand dims, Operand value) { @@ -2514,39 +2934,33 @@ public Fill fill(Operand dims, Operand - * Generates fingerprint values of `data`. - *

- * Fingerprint op considers the first dimension of `data` as the batch dimension, - * and `output[i]` contains the fingerprint value generated from contents in - * `data[i, ...]` for all `i`. - *

- * Fingerprint op writes fingerprint values as byte arrays. For example, the - * default method `farmhash64` generates a 64-bit fingerprint value at a time. - * This 8-byte value is written out as an `uint8` array of size 8, in little-endian + * Generates fingerprint values of {@code data}. + *

Fingerprint op considers the first dimension of {@code data} as the batch dimension, + * and {@code output[i]} contains the fingerprint value generated from contents in + * {@code data[i, ...]} for all {@code i}. + *

Fingerprint op writes fingerprint values as byte arrays. For example, the + * default method {@code farmhash64} generates a 64-bit fingerprint value at a time. + * This 8-byte value is written out as an {@code uint8} array of size 8, in little-endian * order. - *

- * For example, suppose that `data` has data type `DT_INT32` and shape (2, 3, 4), - * and that the fingerprint method is `farmhash64`. In this case, the output shape - * is (2, 8), where 2 is the batch dimension size of `data`, and 8 is the size of - * each fingerprint value in bytes. `output[0, :]` is generated from 12 integers in - * `data[0, :, :]` and similarly `output[1, :]` is generated from other 12 integers - * in `data[1, :, :]`. - *

- * Note that this op fingerprints the raw underlying buffer, and it does not + *

For example, suppose that {@code data} has data type {@code DT_INT32} and shape (2, 3, 4), + * and that the fingerprint method is {@code farmhash64}. In this case, the output shape + * is (2, 8), where 2 is the batch dimension size of {@code data}, and 8 is the size of + * each fingerprint value in bytes. {@code output[0, :]} is generated from 12 integers in + * {@code data[0, :, :]} and similarly {@code output[1, :]} is generated from other 12 integers + * in {@code data[1, :, :]}. + *

Note that this op fingerprints the raw underlying buffer, and it does not * fingerprint Tensor's metadata such as data type and/or shape. For example, the * fingerprint values are invariant under reshapes and bitcasts as long as the * batch dimension remain the same: - *

{@code
+   *  
    *  Fingerprint(data) == Fingerprint(Reshape(data, ...))
    *  Fingerprint(data) == Fingerprint(Bitcast(data, ...))
-   *  }
- * For string data, one should expect `Fingerprint(data) != - * Fingerprint(ReduceJoin(data))` in general. + *
+ *

For string data, one should expect {@code Fingerprint(data) != Fingerprint(ReduceJoin(data))} in general. * * @param data Must have rank 1 or higher. * @param method Fingerprint method used by this op. Currently available method is - * `farmhash::fingerprint64`. + * {@code farmhash::fingerprint64}. * @return a new instance of Fingerprint */ public Fingerprint fingerprint(Operand data, Operand method) { @@ -2554,12 +2968,33 @@ public Fingerprint fingerprint(Operand data, Operand m } /** - * Gather slices from `params` axis `axis` according to `indices`. - *

- * `indices` must be an integer tensor of any dimension (usually 0-D or 1-D). - * Produces an output tensor with shape `params.shape[:axis] + - * indices.shape[batch_dims:] + params.shape[axis + 1:]` where: - *

{@code
+   * Applies a for loop.
+   *  
+   *   output = input;
+   *   for i in range(start, limit, delta)
+   *     output = body(i, output);
+   *  
+ * + * @param start The lower bound. An int32 + * @param limit The upper bound. An int32 + * @param delta The increment. An int32 + * @param input A list of input tensors whose types are T. + * @param body
+   *  A function that takes a list of tensors (int32, T) and returns another
+   *  list of tensors (T).
+   *  
+ * @return a new instance of For + */ + public For forOp(Operand start, Operand limit, Operand delta, + Iterable> input, ConcreteFunction body) { + return For.create(scope, start, limit, delta, input, body); + } + + /** + * Gather slices from {@code params} axis {@code axis} according to {@code indices}. + * {@code indices} must be an integer tensor of any dimension (usually 0-D or 1-D). + * Produces an output tensor with shape {@code params.shape[:axis] + indices.shape[batch_dims:] + params.shape[axis + 1:]} where: + *
    *      # Scalar indices (output is rank(params) - 1).
    *      output[a_0, ..., a_n, b_0, ..., b_n] =
    *        params[a_0, ..., a_n, indices, b_0, ..., b_n]
@@ -2571,24 +3006,25 @@ public Fingerprint fingerprint(Operand data, Operand m
    *      # Higher rank indices (output is rank(params) + rank(indices) - 1).
    *      output[a_0, ..., a_n, i, ..., j, b_0, ... b_n] =
    *        params[a_0, ..., a_n, indices[i, ..., j], b_0, ..., b_n]
-   *  }
+ *
*
* *
- *

- * Note that on CPU, if an out of bound index is found, an error is returned. + *

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

- * See also `tf.batch_gather` and `tf.gather_nd`. + *

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 - * `axis + 1`. - * @param indices Index tensor. Must be in range `[0, params.shape[axis])`. - * @param axis The axis in `params` to gather `indices` from. Defaults to the first + * {@code axis + 1}. + * @param indices Index tensor. Must be in range {@code [0, params.shape[axis])}. + * @param axis The axis in {@code params} to gather {@code indices} from. Defaults to the first * dimension. Supports negative indexes. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code GatherV2} output and operands * @return a new instance of Gather */ public Gather gather(Operand params, Operand indices, @@ -2597,50 +3033,54 @@ public Gather gather(Operand params, Operand - * `indices` is a K-dimensional integer tensor, best thought of as a - * (K-1)-dimensional tensor of indices into `params`, where each element defines a - * slice of `params`: - *

- * output[\\(i_0, ..., i_{K-2}\\)] = params[indices[\\(i_0, ..., i_{K-2}\\)]] - *

- * Whereas in `tf.gather` `indices` defines slices into the `axis` - * dimension of `params`, in `tf.gather_nd`, `indices` defines slices into the - * first `N` dimensions of `params`, where `N = indices.shape[-1]`. - *

- * The last dimension of `indices` can be at most the rank of - * `params`: - *

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

- * The last dimension of `indices` corresponds to elements - * (if `indices.shape[-1] == params.rank`) or slices - * (if `indices.shape[-1] < params.rank`) along dimension `indices.shape[-1]` - * of `params`. The output tensor has shape - *

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

- * Some examples below. - *

- * Simple indexing into a matrix: - *

{@code
+   * Gather slices from {@code params} into a Tensor with shape specified by {@code indices}.
+   *  {@code indices} is a K-dimensional integer tensor, best thought of as a
+   *  (K-1)-dimensional tensor of indices into {@code params}, where each element defines a
+   *  slice of {@code params}:
+   *  
+   *  output[\\(i_0, ..., i_{K-2}\\)] = params[indices[\\(i_0, ..., i_{K-2}\\)]]
+   *  
+ *

Whereas in {@code tf.gather} {@code indices} defines slices into the {@code axis} + * dimension of {@code params}, in {@code tf.gather_nd}, {@code indices} defines slices into the + * first {@code N} dimensions of {@code params}, where {@code N = indices.shape[-1]}. + *

The last dimension of {@code indices} can be at most the rank of + * {@code params}: + *

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

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

+   *  indices.shape[:-1] + params.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 error and set the corresponding output to 0; + * supported on both CPU and GPU.
  6. + *
+ *

Some examples below. + *

Simple indexing into a matrix: + *

    *      indices = [[0, 0], [1, 1]]
    *      params = [['a', 'b'], ['c', 'd']]
    *      output = ['a', 'd']
-   *  }
- * Slice indexing into a matrix: - *
{@code
+   *  
+ *

Slice indexing into a matrix: + *

    *      indices = [[1], [0]]
    *      params = [['a', 'b'], ['c', 'd']]
    *      output = [['c', 'd'], ['a', 'b']]
-   *  }
- * Indexing into a 3-tensor: - *
{@code
+   *  
+ *

Indexing into a 3-tensor: + *

    *      indices = [[1]]
    *      params = [[['a0', 'b0'], ['c0', 'd0']],
    *                [['a1', 'b1'], ['c1', 'd1']]]
@@ -2657,21 +3097,21 @@ public  Gather gather(Operand params, Operand
-   *  Batched indexing into a matrix:
-   *  
{@code
+   *  
+ *

Batched indexing into a matrix: + *

    *      indices = [[[0, 0]], [[0, 1]]]
    *      params = [['a', 'b'], ['c', 'd']]
    *      output = [['a'], ['b']]
-   *  }
- * Batched slice indexing into a matrix: - *
{@code
+   *  
+ *

Batched slice indexing into a matrix: + *

    *      indices = [[[1]], [[0]]]
    *      params = [['a', 'b'], ['c', 'd']]
    *      output = [[['c', 'd']], [['a', 'b']]]
-   *  }
- * Batched indexing into a 3-tensor: - *
{@code
+   *  
+ *

Batched indexing into a 3-tensor: + *

    *      indices = [[[1]], [[0]]]
    *      params = [[['a0', 'b0'], ['c0', 'd0']],
    *                [['a1', 'b1'], ['c1', 'd1']]]
@@ -2689,17 +3129,42 @@ public  Gather gather(Operand params, Operand
-   *  See also `tf.gather` and `tf.batch_gather`.
+   *  
+ *

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); } /** @@ -2715,9 +3180,9 @@ 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 * @return a new instance of GetSessionTensor */ public GetSessionTensor getSessionTensor(Operand handle, @@ -2726,63 +3191,61 @@ 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 scope current graph scope - * @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); } /** * Gives a guarantee to the TF runtime that the input tensor is a constant. - *

* The runtime is then free to make optimizations based on this. - *

- * Only accepts value typed tensors as inputs and rejects resource variable handles + *

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

- * Returns the input tensor without modification. + *

Returns the input tensor without modification. * - * @param data type for {@code output()} output - * @param input + * @param input The input value + * @param data type for {@code GuaranteeConst} output and operands * @return a new instance of GuaranteeConst */ public GuaranteeConst guaranteeConst(Operand input) { @@ -2791,14 +3254,15 @@ public GuaranteeConst guaranteeConst(Operand input) { /** * Creates a non-initialized hash table. - *

* This op creates a hash table, specifying the type of its keys and values. * Before using the table you will have to initialize it. After initialization the * table will be immutable. * * @param keyDtype Type of the table keys. * @param valueDtype Type of the table values. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code HashTableV2} output and operands + * @param data type for {@code HashTableV2} output and operands * @return a new instance of HashTable */ public HashTable hashTable(Class keyDtype, @@ -2808,11 +3272,10 @@ public HashTable hashTable(Class keyDtype, /** * Return histogram of values. - *

- * Given the tensor `values`, this operation returns a rank 1 histogram counting - * the number of entries in `values` that fall into every bin. The bins are - * equal width and determined by the arguments `value_range` and `nbins`. - *

{@code
+   *  Given the tensor {@code values}, this operation returns a rank 1 histogram counting
+   *  the number of entries in {@code values} that fall into every bin.  The bins are
+   *  equal width and determined by the arguments {@code value_range} and {@code nbins}.
+   *  
    *  # Bins will be:  (-inf, 1), [1, 2), [2, 3), [3, 4), [4, inf)
    *  nbins = 5
    *  value_range = [0.0, 5.0]
@@ -2821,16 +3284,16 @@ public  HashTable hashTable(Class keyDtype,
    *  with tf.get_default_session() as sess:
    *    hist = tf.histogram_fixed_width(new_values, value_range, nbins=5)
    *    variables.global_variables_initializer().run()
-   *    sess.run(hist) => [2, 1, 1, 0, 2]
-   *  }
+ * sess.run(hist) => [2, 1, 1, 0, 2] + *
* - * @param data type for {@code out()} output - * @param values Numeric `Tensor`. - * @param valueRange Shape [2] `Tensor` of same `dtype` as `values`. - * values <= value_range[0] will be mapped to hist[0], - * values >= value_range[1] will be mapped to hist[-1]. - * @param nbins Scalar `int32 Tensor`. Number of histogram bins. - * @return a new instance of HistogramFixedWidth + * @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 data type for {@code HistogramFixedWidth} output and operands + * @return a new instance of HistogramFixedWidth, with default output types */ public HistogramFixedWidth histogramFixedWidth(Operand values, Operand valueRange, Operand nbins) { @@ -2839,11 +3302,10 @@ public HistogramFixedWidth histogramFixedWidth(Opera /** * Return histogram of values. - *

- * Given the tensor `values`, this operation returns a rank 1 histogram counting - * the number of entries in `values` that fall into every bin. The bins are - * equal width and determined by the arguments `value_range` and `nbins`. - *

{@code
+   *  Given the tensor {@code values}, this operation returns a rank 1 histogram counting
+   *  the number of entries in {@code values} that fall into every bin.  The bins are
+   *  equal width and determined by the arguments {@code value_range} and {@code nbins}.
+   *  
    *  # Bins will be:  (-inf, 1), [1, 2), [2, 3), [3, 4), [4, inf)
    *  nbins = 5
    *  value_range = [0.0, 5.0]
@@ -2852,28 +3314,41 @@ public  HistogramFixedWidth histogramFixedWidth(Opera
    *  with tf.get_default_session() as sess:
    *    hist = tf.histogram_fixed_width(new_values, value_range, nbins=5)
    *    variables.global_variables_initializer().run()
-   *    sess.run(hist) => [2, 1, 1, 0, 2]
-   *  }
+ * sess.run(hist) => [2, 1, 1, 0, 2] + *
+ * + * @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 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 + */ + public HistogramFixedWidth histogramFixedWidth( + Operand values, Operand valueRange, Operand nbins, Class dtype) { + return HistogramFixedWidth.create(scope, values, valueRange, nbins, dtype); + } + + /** + * Returns a constant tensor on the host. Only for writing C++ tests. * - * @param data type for {@code out()} output - * @param values Numeric `Tensor`. - * @param valueRange Shape [2] `Tensor` of same `dtype` as `values`. - * values <= value_range[0] will be mapped to hist[0], - * values >= value_range[1] will be mapped to hist[-1]. - * @param nbins Scalar `int32 Tensor`. Number of histogram bins. - * @param dtype - * @return a new instance of HistogramFixedWidth + * @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 HistogramFixedWidth histogramFixedWidth( - Operand values, Operand valueRange, Operand nbins, Class dtype) { - return HistogramFixedWidth.create(scope, values, valueRange, nbins, dtype); + 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 + * @param input The input value + * @param data type for {@code Identity} output and operands * @return a new instance of Identity */ public Identity identity(Operand input) { @@ -2882,37 +3357,68 @@ public Identity identity(Operand input) { /** * Returns a list of tensors with the same shapes and contents as the input - *

* tensors. - *

- * This op can be used to override the gradient for complicated functions. For + *

This op can be used to override the gradient for complicated functions. For * example, suppose y = f(x) and we wish to apply a custom function g for backprop * such that dx = g(dy). In Python, - *

{@code
+   *  
    *  with tf.get_default_graph().gradient_override_map(
    *      {'IdentityN': 'OverrideGradientWithG'}):
    *    y, _ = identity_n([f(x), x])
    *
-   * @tf.RegisterGradient('OverrideGradientWithG') def ApplyG(op, dy, _):
+   *  {@literal @}tf.RegisterGradient('OverrideGradientWithG')
+   *  def ApplyG(op, dy, _):
    *    return [None, g(dy)]  # Do not backprop to f(x).
-   *  }
- * @param input + *
+ * + * @param input The input value * @return a new instance of IdentityN */ public IdentityN identityN(Iterable> input) { return IdentityN.create(scope, input); } + /** + * output = cond ? then_branch(input) : else_branch(input) + * + *

Selects between {@link StatefulIf} and {@link StatelessIf} based on the statefulness of the function arguments. + * + * @param cond

+   *    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.
+   *  
+ * @param input A list of input tensors. + * @param Tout A list of output types. + * @param thenBranch
+   *    A function that takes 'inputs' and returns a list of tensors, whose
+   *    types are the same as what else_branch returns.
+   *  
+ * @param elseBranch
+   *  A function that takes 'inputs' and returns a list of tensors, whose
+   *  types are the same as what then_branch returns.
+   *  
+ * @param options carries optional attribute values + * @return a new instance of If + */ + public If ifOp(Operand cond, Iterable> input, + List> Tout, ConcreteFunction thenBranch, ConcreteFunction elseBranch, + If.Options... options) { + return If.create(scope, cond, input, Tout, thenBranch, elseBranch, options); + } + /** * 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 * NewReadOnlyMemoryRegionFromFile in tensorflow::Env. + * @param data type for {@code ImmutableConst} output and operands * @return a new instance of ImmutableConst */ public ImmutableConst immutableConst(Class dtype, Shape shape, @@ -2920,82 +3426,6 @@ public ImmutableConst immutableConst(Class dtype, Shape return ImmutableConst.create(scope, dtype, shape, memoryRegionName); } - /** - * Factory method to create an operation executing all initializers of a graph. - * - *

All initializers added to a graph via - * {@link org.tensorflow.op.core.Init#add(Scope, Op) tf.initAdd} are grouped together as a single - * unit of computation in the graph. This operation must then be added to any graph using one or - * more {@link Variable variables} and executed once before running the graph so the variable - * states are initialized properly.

- * - *

When the graph is built by the same process that is running the session, the initializers - * can be invoked by executing this single endpoint. For example:

- *
{@code
-   *  try (Graph g = new Graph()) {
-   *    Variable x = tf.variable(tf.constant(10));  // initAdd is called implicitly
-   *    Variable y = tf.variable(tf.constant(20));  // idem
-   *    Add z = tf.math.add(x, y);
-   *
-   *    try (Session s = new Session(g)) {
-   *      s.run(tf.init());  // initialize all variables
-   *
-   *      try (TInt32 t = (TInt32)s.runner().fetch(z).run().get(0)) {
-   *        assertEquals(30, t.data().getInt());
-   *      }
-   *    }
-   *  }
-   *  }
- * - *

When the graph is built by a separate process, the initializers can be invoked by running - * the init op by its name, which defaults to {@link org.tensorflow.op.core.Init#DEFAULT_NAME}. - * For example:

- *
{@code
-   *  // Building the model
-   *  try (Graph g = new Graph()) {
-   *    Variable x = tf.variable(tf.constant(10));  // initAdd is called implicitly
-   *    Variable y = tf.variable(tf.constant(20));  // idem
-   *    Add z = tf.withName("z").math.add(x, y);
-   *
-   *    tf.init();  // add variables initializers to the graph, as Init.DEFAULT_NAME
-   *    // ...exporting graph as a saved model...
-   *  }
-   *
-   *  ...
-   *
-   *  // Running the model
-   *  try (SavedModelBundle model = SavedModelBundle.load("/path/to/model", "train")) {
-   *    model.session().run(Init.DEFAULT_NAME);
-   *
-   *    try (TInt32 t = (TInt32)s.runner().fetch("z").run().get(0)) {
-   *      assertEquals(30, t.data().getInt());
-   *    }
-   *  }
-   *  }
- * - * @param scope current scope - * @return an op grouping all initializers added to the graph - * @throws IllegalArgumentException if the execution environment in scope is not a graph - */ - public Init init() { - return Init.create(scope); - } - - /** - * Register an op as an initializer of the graph. - * - *

Registered initializers are then grouped as a single unit of computation by adding - * and executing an {@link org.tensorflow.op.core.Init#create(Scope) init} operation from a graph - * session. This is a no-op if executed in an eager session. - * - * @param scope - * @param initializer - * @see org.tensorflow.op.core.Init#create(Scope) init - */ - public void initAdd(Op initializer) { - Init.add(scope, initializer); - } - /** * Table initializer that takes two tensors for keys and values respectively. * @@ -3004,48 +3434,49 @@ public void initAdd(Op initializer) { * @param values Values of type Tval. * @return a new instance of InitializeTable */ - public InitializeTable initializeTable(Operand tableHandle, Operand keys, - Operand values) { + public InitializeTable initializeTable(Operand tableHandle, + Operand keys, Operand values) { return InitializeTable.create(scope, tableHandle, keys, values); } /** * Initializes a table from a text file. - *

* It inserts one key-value pair into the table for each line of the file. * The key and value is extracted from the whole line content, elements from the - * split line based on `delimiter` or the line number (starting from zero). - * Where to extract the key and value from a line is specified by `key_index` and - * `value_index`. - *

- * - A value of -1 means use the line number(starting from zero), expects `int64`. - * - A value of -2 means use the whole line content, expects `string`. - * - A value >= 0 means use the index (starting at zero) of the split line based - * on `delimiter`. + * split line based on {@code delimiter} or the line number (starting from zero). + * Where to extract the key and value from a line is specified by {@code key_index} and + * {@code value_index}. + *

    + *
  • A value of -1 means use the line number(starting from zero), expects {@code int64}.
  • + *
  • A value of -2 means use the whole line content, expects {@code string}.
  • + *
  • A value >= 0 means use the index (starting at zero) of the split line based + * on {@code delimiter}.
  • + *
* * @param tableHandle Handle to a table which will be initialized. * @param filename Filename of a vocabulary text file. - * @param keyIndex Column index in a line to get the table `key` values from. + * @param keyIndex Column index in a line to get the table {@code key} values from. * @param valueIndex Column index that represents information of a line to get the table - * `value` values from. - * @param options carries optional attributes values + * {@code value} values from. + * @param options carries optional attribute values * @return a new instance of InitializeTableFromTextFile */ - public InitializeTableFromTextFile initializeTableFromTextFile(Operand tableHandle, - Operand filename, Long keyIndex, Long valueIndex, - InitializeTableFromTextFile.Options... options) { + public InitializeTableFromTextFile initializeTableFromTextFile( + Operand tableHandle, Operand filename, Long keyIndex, + Long valueIndex, InitializeTableFromTextFile.Options... options) { return InitializeTableFromTextFile.create(scope, tableHandle, filename, keyIndex, valueIndex, options); } /** - * Adds v into specified rows of x. - *

- * Computes y = x; y[i, :] += v; return y. + * Adds v into specified rows of x. + *

+   *  Computes y = x; y[i, :] += v; return y.
+   *  
* - * @param data type for {@code y()} output - * @param x A `Tensor` of type T. - * @param i A vector. Indices into the left-most dimension of `x`. - * @param v A `Tensor` of type T. Same dimension sizes as x except the first dimension, which must be the same as i's size. + * @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. + * @param data type for {@code InplaceAdd} output and operands * @return a new instance of InplaceAdd */ public InplaceAdd inplaceAdd(Operand x, Operand i, Operand v) { @@ -3053,14 +3484,16 @@ public InplaceAdd inplaceAdd(Operand x, Operand } /** - * Subtracts `v` into specified rows of `x`. - *

- * Computes y = x; y[i, :] -= v; return y. + *

+   *  Subtracts `v` into specified rows of `x`.
    *
-   * @param  data type for {@code y()} output
-   * @param x A `Tensor` of type T.
-   * @param i A vector. Indices into the left-most dimension of `x`.
-   * @param v A `Tensor` of type T. Same dimension sizes as x except the first dimension, which must be the same as i's size.
+   *  Computes y = x; y[i, :] -= v; return y.
+   *  
+ * + * @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. + * @param data type for {@code InplaceSub} output and operands * @return a new instance of InplaceSub */ public InplaceSub inplaceSub(Operand x, Operand i, Operand v) { @@ -3069,16 +3502,14 @@ public InplaceSub inplaceSub(Operand x, Operand /** * Updates specified rows 'i' with values 'v'. - *

- * Computes `x[i, :] = v; return x`. - *

- * Originally this function is mutative however for compilation we make this - * operation create / operate on a copy of `x`. - * - * @param data type for {@code y()} output - * @param x A tensor of type `T`. - * @param i A vector. Indices into the left-most dimension of `x`. - * @param v A `Tensor` of type T. Same dimension sizes as x except the first dimension, which must be the same as i's size. + * 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 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. + * @param data type for {@code InplaceUpdate} output and operands * @return a new instance of InplaceUpdate */ public InplaceUpdate inplaceUpdate(Operand x, Operand i, @@ -3088,10 +3519,9 @@ public InplaceUpdate inplaceUpdate(Operand x, Operand * Outputs boolean scalar indicating whether the tensor has been initialized. * - * @param ref Should be from a `Variable` node. May be uninitialized. + * @param ref Should be from a {@code Variable} node. May be uninitialized. * @return a new instance of IsVariableInitialized */ public IsVariableInitialized isVariableInitialized(Operand ref) { @@ -3100,7 +3530,6 @@ public IsVariableInitialized isVariableInitialized(Operand ref) /** * Computes the Kth order statistic of a data set. The current - *

* implementation uses a binary search requiring exactly 32 passes over * the input data. The running time is linear with respect to input * size. The median-of-medians algorithm is probably faster, but is @@ -3116,96 +3545,126 @@ public IsVariableInitialized isVariableInitialized(Operand ref) * equal to the Kth order statistic. The semantics are not the same as * top_k_unique. * - * @param input - * @param k + * @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 - * @param Tvalues + * @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 */ public LookupTableExport lookupTableExport( - Operand tableHandle, Class Tkeys, Class Tvalues) { + Operand tableHandle, Class Tkeys, Class Tvalues) { return LookupTableExport.create(scope, tableHandle, Tkeys, Tvalues); } /** * Looks up keys in a table, outputs the corresponding values. - *

- * The tensor `keys` must of the same type as the keys of the table. - * The output `values` is of the type of the table values. - *

- * The scalar `default_value` is the value output for keys not present in the + * The tensor {@code keys} must of the same type as the keys of the table. + * 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 * @param tableHandle Handle to the table. * @param keys Any shape. Keys to look up. - * @param defaultValue + * @param defaultValue The defaultValue value + * @param data type for {@code LookupTableFindV2} output and operands * @return a new instance of LookupTableFind */ - public LookupTableFind lookupTableFind(Operand tableHandle, + public LookupTableFind lookupTableFind(Operand tableHandle, Operand keys, Operand defaultValue) { return LookupTableFind.create(scope, tableHandle, keys, defaultValue); } /** * Replaces the contents of the table with the specified keys and values. - *

- * The tensor `keys` must be of the same type as the keys of the table. - * The tensor `values` must be of the type of the table values. + * 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. * * @param tableHandle Handle to the table. * @param keys Any shape. Keys to look up. * @param values Values to associate with keys. * @return a new instance of LookupTableImport */ - public LookupTableImport lookupTableImport(Operand tableHandle, Operand keys, - Operand values) { + public LookupTableImport lookupTableImport(Operand tableHandle, + Operand keys, Operand values) { return LookupTableImport.create(scope, tableHandle, keys, values); } /** * Updates the table to associates keys with values. - *

- * The tensor `keys` must be of the same type as the keys of the table. - * The tensor `values` must be of the type of the table values. + * 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. * * @param tableHandle Handle to the table. * @param keys Any shape. Keys to look up. * @param values Values to associate with keys. * @return a new instance of LookupTableInsert */ - public LookupTableInsert lookupTableInsert(Operand tableHandle, Operand keys, - Operand values) { + public LookupTableInsert lookupTableInsert(Operand tableHandle, + Operand keys, Operand values) { 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. * * @param tableHandle Handle to the table. * @return a new instance of LookupTableSize */ - public LookupTableSize lookupTableSize(Operand tableHandle) { + public LookupTableSize lookupTableSize(Operand tableHandle) { return LookupTableSize.create(scope, tableHandle); } /** * Forwards the input to the output. - *

* This operator represents the loop termination condition used by the - * "pivot" switches of a loop. + * "pivot" switches of a loop. * * @param input A boolean scalar, representing the branch predicate of the Switch op. * @return a new instance of LoopCond @@ -3215,14 +3674,69 @@ public LoopCond loopCond(Operand input) { } /** - * Make all elements in the non-Batch dimension unique, but \"close\" to - *

+ * 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 * zero. The sign of each input element is always identical to the sign * of the corresponding output element. Behavior for infinite elements is * undefined. Behavior for subnormal elements is undefined. * - * @param input + * @param input The input value * @return a new instance of MakeUnique */ public MakeUnique makeUnique(Operand input) { @@ -3232,19 +3746,51 @@ public MakeUnique makeUnique(Operand input) { /** * Op removes all elements in the underlying container. * - * @param dtypes - * @param options carries optional attributes values + * @param dtypes The value of the dtypes attribute + * @param options carries optional attribute values * @return a new instance of MapClear */ public MapClear mapClear(List> dtypes, MapClear.Options... 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 - * @param options carries optional attributes values + * @param dtypes The value of the dtypes attribute + * @param options carries optional attribute values * @return a new instance of MapIncompleteSize */ public MapIncompleteSize mapIncompleteSize(List> dtypes, @@ -3254,14 +3800,13 @@ public MapIncompleteSize mapIncompleteSize(List> dtypes, /** * Op peeks at the values at the specified key. If the - *

* underlying container does not contain this key * this op will block until it does. * - * @param key - * @param indices - * @param dtypes - * @param options carries optional attributes values + * @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 */ public MapPeek mapPeek(Operand key, Operand indices, @@ -3272,8 +3817,8 @@ public MapPeek mapPeek(Operand key, Operand indices, /** * Op returns the number of elements in the underlying container. * - * @param dtypes - * @param options carries optional attributes values + * @param dtypes The value of the dtypes attribute + * @param options carries optional attribute values * @return a new instance of MapSize */ public MapSize mapSize(List> dtypes, MapSize.Options... options) { @@ -3284,11 +3829,11 @@ 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 + * @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 - * @param options carries optional attributes values + * @param dtypes The value of the dtypes attribute + * @param options carries optional attribute values * @return a new instance of MapStage */ public MapStage mapStage(Operand key, Operand indices, @@ -3299,14 +3844,13 @@ public MapStage mapStage(Operand key, Operand indices, /** * Op removes and returns the values associated with the key - *

* from the underlying container. If the underlying container * does not contain this key, the op will block until it does. * - * @param key - * @param indices - * @param dtypes - * @param options carries optional attributes values + * @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 */ public MapUnstage mapUnstage(Operand key, Operand indices, @@ -3316,13 +3860,12 @@ public MapUnstage mapUnstage(Operand key, Operand indices, /** * Op removes and returns a random (key, value) - *

* from the underlying container. If the underlying container * does not contain elements, the op will block until it does. * - * @param indices - * @param dtypes - * @param options carries optional attributes values + * @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 */ public MapUnstageNoKey mapUnstageNoKey(Operand indices, @@ -3332,35 +3875,32 @@ public MapUnstageNoKey mapUnstageNoKey(Operand indices, /** * Computes the maximum of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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 * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values + * @param data type for {@code Max} output and operands * @return a new instance of Max */ - public Max max(Operand input, Operand axis, + public Max max(Operand input, Operand axis, Max.Options... options) { return Max.create(scope, input, axis, options); } /** - * Forwards the value of an available tensor from `inputs` to `output`. - *

- * `Merge` waits for at least one of the tensors in `inputs` to become available. - * It is usually combined with `Switch` to implement branching. - *

- * `Merge` forwards the first tensor to become available to `output`, and sets - * `value_index` to its index in `inputs`. + * 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 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 */ public Merge merge(Iterable> inputs) { @@ -3369,61 +3909,56 @@ public Merge merge(Iterable> inputs) { /** * Computes the minimum of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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 * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values + * @param data type for {@code Min} output and operands * @return a new instance of Min */ - public Min min(Operand input, Operand axis, + public Min min(Operand input, Operand axis, Min.Options... options) { return Min.create(scope, input, axis, options); } /** * Pads a tensor with mirrored values. - *

- * This operation pads a `input` with mirrored values according to the `paddings` - * you specify. `paddings` is an integer tensor with shape `[n, 2]`, where n is - * the rank of `input`. For each dimension D of `input`, `paddings[D, 0]` indicates - * how many values to add before the contents of `input` in that dimension, and - * `paddings[D, 1]` indicates how many values to add after the contents of `input` - * in that dimension. Both `paddings[D, 0]` and `paddings[D, 1]` must be no greater - * than `input.dim_size(D)` (or `input.dim_size(D) - 1`) if `copy_border` is true + * This operation pads a {@code input} with mirrored values according to the {@code paddings} + * you specify. {@code paddings} is an integer tensor with shape {@code [n, 2]}, where n is + * the rank of {@code input}. For each dimension D of {@code input}, {@code paddings[D, 0]} indicates + * how many values to add before the contents of {@code input} in that dimension, and + * {@code paddings[D, 1]} indicates how many values to add after the contents of {@code input} + * in that dimension. Both {@code paddings[D, 0]} and {@code paddings[D, 1]} must be no greater + * than {@code input.dim_size(D)} (or {@code input.dim_size(D) - 1}) if {@code copy_border} is true * (if false, respectively). - *

- * The padded size of each dimension D of the output is: - *

- * `paddings(D, 0) + input.dim_size(D) + paddings(D, 1)` - *

- * For example: - *

{@code
+   *  

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

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

For example: + *

    *  # 't' is [[1, 2, 3], [4, 5, 6]].
    *  # 'paddings' is [[1, 1]], [2, 2]].
    *  # 'mode' is SYMMETRIC.
    *  # rank of 't' is 2.
-   *  pad(t, paddings) ==> [[2, 1, 1, 2, 3, 3, 2]
+   *  pad(t, paddings) ==> [[2, 1, 1, 2, 3, 3, 2]
    *                        [2, 1, 1, 2, 3, 3, 2]
    *                        [5, 4, 4, 5, 6, 6, 5]
    *                        [5, 4, 4, 5, 6, 6, 5]]
-   *  }
+ *
* - * @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 `input`. - * @param mode Either `REFLECT` or `SYMMETRIC`. In reflect mode the padded regions + * rows must be the same as the rank of {@code input}. + * @param mode 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 `input` is `[1, 2, 3]` and `paddings` - * is `[0, 2]`, then the output is `[1, 2, 3, 2, 1]` in reflect mode, and - * it is `[1, 2, 3, 3, 2]` in symmetric mode. + * 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. + * @param data type for {@code MirrorPad} output and operands * @return a new instance of MirrorPad */ public MirrorPad mirrorPad(Operand input, @@ -3431,9 +3966,37 @@ 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 * executed in a regular TensorFlow session. Instead it is intended to be used for * testing or for special case where a user intends to pass custom MLIR computation @@ -3445,25 +4008,27 @@ public MirrorPad mirrorPad(Operand input, * main() function and the returned values of the main function mapped to the * outputs. * Example usage: - *

{@code
+   *  
    *  import tensorflow as tf
    *  from tensorflow.compiler.mlir.tensorflow.gen_mlir_passthrough_op import mlir_passthrough_op
    *
    *  mlir_module = '''python
-   *  func @main(%arg0 : tensor<10xf32>, %arg1 : tensor<10xf32>) -> tensor<10x10xf32> {
-   *     %add = "magic.op"(%arg0, %arg1) : (tensor<10xf32>, tensor<10xf32>) -> tensor<10x10xf32>
-   *     return %ret : tensor<10x10xf32>
+   *  func {@literal @}main(%arg0 : tensor<10xf32>, %arg1 : tensor<10xf32>) -> tensor<10x10xf32> {
+   *     %add = "magic.op"(%arg0, %arg1) : (tensor<10xf32>, tensor<10xf32>) -> tensor<10x10xf32>
+   *     return %ret : tensor<10x10xf32>
    *  }
    *  '''
    *
-   * @tf.function def foo(x, y):
+   *  {@literal @}tf.function
+   *  def foo(x, y):
    *    return mlir_passthrough_op([x, y], mlir_module, Toutputs=[tf.float32])
    *
    *  graph_def = foo.get_concrete_function(tf.TensorSpec([10], tf.float32), tf.TensorSpec([10], tf.float32)).graph.as_graph_def()
-   *  }
- * @param inputs - * @param mlirModule - * @param Toutputs + *
+ * + * @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, @@ -3473,19 +4038,19 @@ public MlirPassthroughOp mlirPassthroughOp(Iterable> inputs, String m /** * Creates an empty hash table that uses tensors as the backing store. - *

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

- * This op creates a mutable hash table, specifying the type of its keys and + *

This op creates a mutable hash table, specifying the type of its keys and * 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. * * @param emptyKey The key used to represent empty key buckets internally. Must not * be used in insert or lookup operations. - * @param deletedKey + * @param deletedKey The deletedKey value * @param valueDtype Type of the table values. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MutableDenseHashTableV2} output and operands + * @param data type for {@code MutableDenseHashTableV2} output and operands * @return a new instance of MutableDenseHashTable */ public MutableDenseHashTable mutableDenseHashTable( @@ -3496,14 +4061,15 @@ public MutableDenseHashTable mutableDenseHash /** * Creates an empty hash table. - *

* This op creates a mutable hash table, specifying the type of its keys and * 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. * * @param keyDtype Type of the table keys. * @param valueDtype Type of the table values. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MutableHashTableV2} output and operands + * @param data type for {@code MutableHashTableV2} output and operands * @return a new instance of MutableHashTable */ public MutableHashTable mutableHashTable(Class keyDtype, @@ -3513,14 +4079,15 @@ public MutableHashTable mutableHashTable(Clas /** * Creates an empty hash table. - *

* This op creates a mutable hash table, specifying the type of its keys and * 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. * * @param keyDtype Type of the table keys. * @param valueDtype Type of the table values. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MutableHashTableOfTensorsV2} output and operands + * @param data type for {@code MutableHashTableOfTensorsV2} output and operands * @return a new instance of MutableHashTableOfTensors */ public MutableHashTableOfTensors mutableHashTableOfTensors( @@ -3529,9 +4096,9 @@ public MutableHashTableOfTensors mutableHashT } /** - * Creates a Mutex resource that can be locked by `MutexLock`. + * Creates a Mutex resource that can be locked by {@code MutexLock}. * - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Mutex */ public Mutex mutex(Mutex.Options... options) { @@ -3540,12 +4107,11 @@ public Mutex mutex(Mutex.Options... options) { /** * Locks a mutex resource. The output is the lock. So long as the lock tensor - *

- * is alive, any other request to use `MutexLock` with this mutex will wait. - *

- * This is particularly useful for creating a critical section when used in - * conjunction with `MutexLockIdentity`: - *

{@code
+   *  is alive, any other request to use {@code MutexLock} with this mutex will wait.
+   *  

This is particularly useful for creating a critical section when used in + * conjunction with {@code MutexLockIdentity}: + *

+   *
    *  mutex = mutex_v2(
    *    shared_name=handle_name, container=container, name=name)
    *
@@ -3565,30 +4131,96 @@ public Mutex mutex(Mutex.Options... options) {
    *
    *    with ops.control_dependencies([ensure_lock_exists]):
    *      return nest.map_structure(tf.identity, r)
-   *  }
- * While `fn` is running in the critical section, no other functions which wish to + *
+ *

While {@code fn} is running in the critical section, no other functions which wish to * use this critical section may run. - *

- * Often the use case is that two executions of the same graph, in parallel, - * wish to run `fn`; and we wish to ensure that only one of them executes - * at a time. This is especially important if `fn` modifies one or more + *

Often the use case is that two executions of the same graph, in parallel, + * wish to run {@code fn}; and we wish to ensure that only one of them executes + * at a time. This is especially important if {@code fn} modifies one or more * variables at a time. - *

- * It is also useful if two separate functions must share a resource, but we + *

It is also useful if two separate functions must share a resource, but we * wish to ensure the usage is exclusive. * * @param mutex The mutex resource to lock. * @return a new instance of MutexLock */ - public MutexLock mutexLock(Operand mutex) { + 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 */ public NextIteration nextIteration(Operand data) { @@ -3606,57 +4238,51 @@ public NoOp noOp() { /** * Returns a one-hot tensor. - *

- * The locations represented by indices in `indices` take value `on_value`, - * while all other locations take value `off_value`. - *

- * If the input `indices` is rank `N`, the output will have rank `N+1`, - * The new axis is created at dimension `axis` (default: the new axis is + * The locations represented by indices in {@code indices} take value {@code on_value}, + * while all other locations take value {@code off_value}. + *

If the input {@code indices} is rank {@code N}, the output will have rank {@code N+1}, + * The new axis is created at dimension {@code axis} (default: the new axis is * appended at the end). - *

- * If `indices` is a scalar the output shape will be a vector of length `depth`. - *

- * If `indices` is a vector of length `features`, the output shape will be: - *

{@code
+   *  

If {@code indices} is a scalar the output shape will be a vector of length {@code depth}. + *

If {@code indices} is a vector of length {@code features}, the output shape will be: + *

    *    features x depth if axis == -1
    *    depth x features if axis == 0
-   *  }
- * If `indices` is a matrix (batch) with shape `[batch, features]`, + *
+ *

If {@code indices} is a matrix (batch) with shape {@code [batch, features]}, * the output shape will be: - *

{@code
+   *  
    *    batch x features x depth if axis == -1
    *    batch x depth x features if axis == 1
    *    depth x batch x features if axis == 0
-   *  }
- * Examples - * ========= - *

- * Suppose that - *

{@code
+   *  
+ * Examples
+ *

Suppose that + *

    *    indices = [0, 2, -1, 1]
    *    depth = 3
    *    on_value = 5.0
    *    off_value = 0.0
    *    axis = -1
-   *  }
- * Then output is `[4 x 3]`: - *
{@code
+   *  
+ *

Then output is {@code [4 x 3]}: + *

    *  output =
    *    [5.0 0.0 0.0]  // one_hot(0)
    *    [0.0 0.0 5.0]  // one_hot(2)
    *    [0.0 0.0 0.0]  // one_hot(-1)
    *    [0.0 5.0 0.0]  // one_hot(1)
-   *  }
- * Suppose that - *
{@code
+   *  
+ *

Suppose that + *

    *    indices = [0, 2, -1, 1]
    *    depth = 3
    *    on_value = 0.0
    *    off_value = 3.0
    *    axis = 0
-   *  }
- * Then output is `[3 x 4]`: - *
{@code
+   *  
+ *

Then output is {@code [3 x 4]}: + *

    *  output =
    *    [0.0 3.0 3.0 3.0]
    *    [3.0 3.0 3.0 0.0]
@@ -3666,17 +4292,17 @@ public NoOp noOp() {
    *  //      ^            one_hot(2)
    *  //          ^        one_hot(-1)
    *  //              ^    one_hot(1)
-   *  }
- * Suppose that - *
{@code
+   *  
+ *

Suppose that + *

    *    indices = [[0, 2], [1, -1]]
    *    depth = 3
    *    on_value = 1.0
    *    off_value = 0.0
    *    axis = -1
-   *  }
- * Then output is `[2 x 2 x 3]`: - *
{@code
+   *  
+ *

Then output is {@code [2 x 2 x 3]}: + *

    *  output =
    *    [
    *      [1.0, 0.0, 0.0]  // one_hot(0)
@@ -3685,14 +4311,14 @@ public NoOp noOp() {
    *      [0.0, 1.0, 0.0]  // one_hot(1)
    *      [0.0, 0.0, 0.0]  // one_hot(-1)
    *    ]
-   *  }
+ *
* - * @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 `indices[j] = i`. - * @param offValue A scalar defining the value to fill in output when `indices[j] != i`. - * @param options carries optional attributes values + * @param onValue A scalar defining the value to fill in output when {@code indices[j] = i}. + * @param offValue A scalar defining the value to fill in output when {@code indices[j] != i}. + * @param options carries optional attribute values + * @param data type for {@code OneHot} output and operands * @return a new instance of OneHot */ public OneHot oneHot(Operand indices, @@ -3703,7 +4329,6 @@ public OneHot oneHot(Operand indices, /** * Creates a one valued tensor given its type and shape. * - * @param scope is a scope used to add the underlying operation * @param dims a 1-D operand that represents the shape of the output tensor * @param type the output tensor type class. Can not be TString. * @return a constant tensor initialized with ones @@ -3716,8 +4341,8 @@ 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 */ public OnesLike onesLike(Operand x) { @@ -3727,8 +4352,8 @@ public OnesLike onesLike(Operand x) { /** * Op removes all elements in the underlying container. * - * @param dtypes - * @param options carries optional attributes values + * @param dtypes The value of the dtypes attribute + * @param options carries optional attribute values * @return a new instance of OrderedMapClear */ public OrderedMapClear orderedMapClear(List> dtypes, @@ -3739,8 +4364,8 @@ public OrderedMapClear orderedMapClear(List> dtypes, /** * Op returns the number of incomplete elements in the underlying container. * - * @param dtypes - * @param options carries optional attributes values + * @param dtypes The value of the dtypes attribute + * @param options carries optional attribute values * @return a new instance of OrderedMapIncompleteSize */ public OrderedMapIncompleteSize orderedMapIncompleteSize(List> dtypes, @@ -3750,15 +4375,14 @@ public OrderedMapIncompleteSize orderedMapIncompleteSize(List * underlying container does not contain this key * this op will block until it does. This Op is optimized for * performance. * - * @param key - * @param indices - * @param dtypes - * @param options carries optional attributes values + * @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 */ public OrderedMapPeek orderedMapPeek(Operand key, Operand indices, @@ -3769,8 +4393,8 @@ public OrderedMapPeek orderedMapPeek(Operand key, Operand indice /** * Op returns the number of elements in the underlying container. * - * @param dtypes - * @param options carries optional attributes values + * @param dtypes The value of the dtypes attribute + * @param options carries optional attribute values * @return a new instance of OrderedMapSize */ public OrderedMapSize orderedMapSize(List> dtypes, @@ -3780,15 +4404,14 @@ public OrderedMapSize orderedMapSize(List> dtypes, /** * Stage (key, values) in the underlying container which behaves like a ordered - *

* associative container. Elements are ordered by key. * * @param key int64 - * @param indices + * @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 - * @param options carries optional attributes values + * @param dtypes The value of the dtypes attribute + * @param options carries optional attribute values * @return a new instance of OrderedMapStage */ public OrderedMapStage orderedMapStage(Operand key, Operand indices, @@ -3799,14 +4422,13 @@ public OrderedMapStage orderedMapStage(Operand key, Operand indi /** * Op removes and returns the values associated with the key - *

* from the underlying container. If the underlying container * does not contain this key, the op will block until it does. * - * @param key - * @param indices - * @param dtypes - * @param options carries optional attributes values + * @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 */ public OrderedMapUnstage orderedMapUnstage(Operand key, Operand indices, @@ -3816,13 +4438,12 @@ public OrderedMapUnstage orderedMapUnstage(Operand key, Operand /** * Op removes and returns the (key, value) element with the smallest - *

* key from the underlying container. If the underlying container * does not contain elements, the op will block until it does. * - * @param indices - * @param dtypes - * @param options carries optional attributes values + * @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 */ public OrderedMapUnstageNoKey orderedMapUnstageNoKey(Operand indices, @@ -3832,35 +4453,31 @@ public OrderedMapUnstageNoKey orderedMapUnstageNoKey(Operand indices, /** * Pads a tensor. - *

- * This operation pads `input` according to the `paddings` and `constant_values` - * you specify. `paddings` is an integer tensor with shape `[Dn, 2]`, where n is - * the rank of `input`. For each dimension D of `input`, `paddings[D, 0]` indicates - * how many padding values to add before the contents of `input` in that dimension, - * and `paddings[D, 1]` indicates how many padding values to add after the contents - * of `input` in that dimension. `constant_values` is a scalar tensor of the same - * type as `input` that indicates the value to use for padding `input`. - *

- * The padded size of each dimension D of the output is: - *

- * `paddings(D, 0) + input.dim_size(D) + paddings(D, 1)` - *

- * For example: - *

{@code
+   *  This operation pads {@code input} according to the {@code paddings} and {@code constant_values}
+   *  you specify. {@code paddings} is an integer tensor with shape {@code [Dn, 2]}, where n is
+   *  the rank of {@code input}. For each dimension D of {@code input}, {@code paddings[D, 0]} indicates
+   *  how many padding values to add before the contents of {@code input} in that dimension,
+   *  and {@code paddings[D, 1]} indicates how many padding values to add after the contents
+   *  of {@code input} in that dimension. {@code constant_values} is a scalar tensor of the same
+   *  type as {@code input} that indicates the value to use for padding {@code input}.
+   *  

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

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

For example: + *

    *  # 't' is [[1, 1], [2, 2]]
    *  # 'paddings' is [[1, 1], [2, 2]]
    *  # 'constant_values' is 0
    *  # rank of 't' is 2
-   *  pad(t, paddings) ==> [[0, 0, 0, 0, 0, 0]
+   *  pad(t, paddings) ==> [[0, 0, 0, 0, 0, 0]
    *                        [0, 0, 1, 1, 0, 0]
    *                        [0, 0, 2, 2, 0, 0]
    *                        [0, 0, 0, 0, 0, 0]]
-   *  }
+ *
* - * @param data type for {@code output()} output - * @param input - * @param paddings - * @param constantValues + * @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 */ public Pad pad(Operand input, Operand paddings, @@ -3869,28 +4486,26 @@ public Pad pad(Operand input, Operand } /** - * Concatenates a list of `N` tensors along the first dimension. - *

+ * Concatenates a list of {@code N} tensors along the first dimension. * The input tensors are all required to have size 1 in the first dimension. - *

- * For example: - *

{@code
+   *  

For example: + *

    *  # 'x' is [[1, 4]]
    *  # 'y' is [[2, 5]]
    *  # 'z' is [[3, 6]]
-   *  parallel_concat([x, y, z]) => [[1, 4], [2, 5], [3, 6]]  # Pack along first dim.
-   *  }
- * The difference between concat and parallel_concat is that concat requires all + * parallel_concat([x, y, z]) => [[1, 4], [2, 5], [3, 6]] # Pack along first dim. + *
+ *

The difference between concat and parallel_concat is that concat requires all * of the inputs be computed before the operation will begin but doesn't require * 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 * @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 * but with the number of input values in the first dimension. + * @param data type for {@code ParallelConcat} output and operands * @return a new instance of ParallelConcat */ public ParallelConcat parallelConcat(Iterable> values, @@ -3899,33 +4514,31 @@ public ParallelConcat parallelConcat(Iterable> v } /** - * Interleave the values from the `data` tensors into a single tensor. - *

+ * Interleave the values from the {@code data} tensors into a single tensor. * Builds a merged tensor such that - *

{@code
+   *  
    *      merged[indices[m][i, ..., j], ...] = data[m][i, ..., j, ...]
-   *  }
- * For example, if each `indices[m]` is scalar or vector, we have - *
{@code
+   *  
+ *

For example, if each {@code indices[m]} is scalar or vector, we have + *

    *      # Scalar indices:
    *      merged[indices[m], ...] = data[m][...]
    *
    *      # Vector indices:
    *      merged[indices[m][i], ...] = data[m][i, ...]
-   *  }
- * Each `data[i].shape` must start with the corresponding `indices[i].shape`, - * and the rest of `data[i].shape` must be constant w.r.t. `i`. That is, we - * must have `data[i].shape = indices[i].shape + constant`. In terms of this - * `constant`, the output shape is - *

- * merged.shape = [max(indices)] + constant - *

- * Values may be merged in parallel, so if an index appears in both `indices[m][i]` - * and `indices[n][j]`, the result may be invalid. This differs from the normal + *

+ *

Each {@code data[i].shape} must start with the corresponding {@code indices[i].shape}, + * and the rest of {@code data[i].shape} must be constant w.r.t. {@code i}. That is, we + * 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
+   *  
+ *

Values may be merged in parallel, so if an index appears in both {@code indices[m][i]} + * and {@code indices[n][j]}, the result may be invalid. This differs from the normal * DynamicStitch operator that defines the behavior in that case. - *

- * For example: - *

{@code
+   *  

For example: + *

    *      indices[0] = 6
    *      indices[1] = [4, 1]
    *      indices[2] = [[5, 2], [0, 3]]
@@ -3934,10 +4547,10 @@ public  ParallelConcat parallelConcat(Iterable> v
    *      data[2] = [[[51, 52], [21, 22]], [[1, 2], [31, 32]]]
    *      merged = [[1, 2], [11, 12], [21, 22], [31, 32], [41, 42],
    *                [51, 52], [61, 62]]
-   *  }
- * This method can be used to merge partitions created by `dynamic_partition` + *
+ *

This method can be used to merge partitions created by {@code dynamic_partition} * as illustrated on the following example: - *

{@code
+   *  
    *      # Apply function (increments x_i) on elements for which a certain condition
    *      # apply (x_i != -1 in this example).
    *      x=tf.constant([0.1, -1., 5.2, 4.3, -1., 7.4])
@@ -3950,14 +4563,14 @@ public  ParallelConcat parallelConcat(Iterable> v
    *      x = tf.dynamic_stitch(condition_indices, partitioned_data)
    *      # Here x=[1.1, -1., 6.2, 5.3, -1, 8.4], the -1. values remain
    *      # unchanged.
-   *  }
+ *
*
* *
* - * @param data type for {@code merged()} output - * @param indices - * @param data + * @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 */ public ParallelDynamicStitch parallelDynamicStitch( @@ -3965,16 +4578,37 @@ public ParallelDynamicStitch parallelDynamicStitch( return ParallelDynamicStitch.create(scope, indices, data); } + /** + * 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. + * + * @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 PartitionedCall + */ + public PartitionedCall partitionedCall(Iterable> args, + List> Tout, ConcreteFunction f, PartitionedCall.Options... options) { + return PartitionedCall.create(scope, args, Tout, f, options); + } + /** * A placeholder op for a value that will be fed into the computation. - *

* 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 * @param dtype The type of elements in the tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Placeholder} output and operands * @return a new instance of Placeholder */ public Placeholder placeholder(Class dtype, @@ -3983,11 +4617,11 @@ public Placeholder placeholder(Class dtype, } /** - * A placeholder op that passes through `input` when its output is not fed. + * 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 `output` is not fed. + * @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 * @return a new instance of PlaceholderWithDefault */ public PlaceholderWithDefault placeholderWithDefault(Operand input, @@ -3997,11 +4631,10 @@ public PlaceholderWithDefault placeholderWithDefault(Operan /** * Prints a string scalar. - *

* Prints a string scalar to the desired output_stream. * * @param input The string scalar to print. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Print */ public Print print(Operand input, Print.Options... options) { @@ -4010,17 +4643,16 @@ public Print print(Operand input, Print.Options... options) { /** * Computes the product of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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 * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values + * @param data type for {@code Prod} output and operands * @return a new instance of Prod */ public Prod prod(Operand input, Operand axis, @@ -4030,14 +4662,12 @@ public Prod prod(Operand input, Operand - * ``` * - * @param data type for {@code output()} output - * @param tensor + * @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. + * @param data type for {@code QuantizedReshape} output and operands * @return a new instance of QuantizedReshape */ public QuantizedReshape quantizedReshape(Operand tensor, @@ -4045,24 +4675,41 @@ 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 `start` and - * extends by increments of `delta` up to but not including `limit`. - *

- * For example: - *

{@code
+   *  This operation creates a sequence of numbers that begins at {@code start} and
+   *  extends by increments of {@code delta} up to but not including {@code limit}.
+   *  

For example: + *

    *  # 'start' is 3
    *  # 'limit' is 18
    *  # 'delta' is 3
-   *  tf.range(start, limit, delta) ==> [3, 6, 9, 12, 15]
-   *  }
+ * 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 `start`. + * @param delta 0-D (scalar). Optional. Default is 1. Number that increments {@code start}. + * @param data type for {@code Range} output and operands * @return a new instance of Range */ public Range range(Operand start, Operand limit, Operand delta) { @@ -4071,20 +4718,18 @@ public Range range(Operand start, Operand limit, Op /** * Returns the rank of a tensor. - *

- * This operation returns an integer representing the rank of `input`. - *

- * For example: - *

{@code
+   *  This operation returns an integer representing the rank of {@code input}.
+   *  

For example: + *

    *  # 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]
    *  # shape of tensor 't' is [2, 2, 3]
-   *  rank(t) ==> 3
-   *  }
- * Note: The rank of a tensor is not the same as the rank of a matrix. The rank + * rank(t) ==> 3 + *
+ *

Note: The rank of a tensor is not the same as the rank of a matrix. The rank * 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." + * of the tensor. Rank is also known as "order", "degree", or "ndims." * - * @param input + * @param input The input value * @return a new instance of Rank */ public Rank rank(Operand input) { @@ -4093,35 +4738,50 @@ public Rank rank(Operand input) { /** * Reads the value of a variable. - *

* The tensor returned by this operation is immutable. - *

- * The value returned by this operation is guaranteed to be influenced by all the + *

The value returned by this operation is guaranteed to be influenced by all the * 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 * @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 * @return a new instance of ReadVariableOp */ - public ReadVariableOp readVariableOp(Operand resource, Class dtype) { + public ReadVariableOp readVariableOp(Operand resource, + Class dtype) { return ReadVariableOp.create(scope, resource, dtype); } /** - * Computes the "logical and" of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Receives the named tensor from send_device on recv_device. + * + * @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. + * @param recvDevice The name of the device receiving the tensor. + * @param options carries optional attribute values + * @param 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 + * {@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 input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values * @return a new instance of ReduceAll */ public ReduceAll reduceAll(Operand input, Operand axis, @@ -4130,17 +4790,16 @@ public ReduceAll reduceAll(Operand input, Operand axis } /** - * Computes the "logical or" of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Computes the "logical or" of elements across dimensions of a tensor. + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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 input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values * @return a new instance of ReduceAny */ public ReduceAny reduceAny(Operand input, Operand axis, @@ -4150,57 +4809,54 @@ public ReduceAny reduceAny(Operand input, Operand axis /** * Computes the maximum of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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 * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values + * @param data type for {@code Max} output and operands * @return a new instance of ReduceMax */ - public ReduceMax reduceMax(Operand input, Operand axis, - ReduceMax.Options... options) { + public ReduceMax reduceMax(Operand input, + Operand axis, ReduceMax.Options... options) { return ReduceMax.create(scope, input, axis, options); } /** * Computes the minimum of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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 * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values + * @param data type for {@code Min} output and operands * @return a new instance of ReduceMin */ - public ReduceMin reduceMin(Operand input, Operand axis, - ReduceMin.Options... options) { + public ReduceMin reduceMin(Operand input, + Operand axis, ReduceMin.Options... options) { return ReduceMin.create(scope, input, axis, options); } /** * Computes the product of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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 * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values + * @param data type for {@code Prod} output and operands * @return a new instance of ReduceProd */ public ReduceProd reduceProd(Operand input, @@ -4210,17 +4866,16 @@ public ReduceProd reduceProd(Operand input, /** * Computes the sum of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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 * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values + * @param data type for {@code Sum} output and operands * @return a new instance of ReduceSum */ public ReduceSum reduceSum(Operand input, Operand axis, @@ -4228,11 +4883,67 @@ 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 */ public RefNextIteration refNextIteration(Operand data) { @@ -4240,11 +4951,11 @@ public RefNextIteration refNextIteration(Operand data) { } /** - * Forwards the `index`th element of `inputs` to `output`. + * 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 `output`. + * @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 * @return a new instance of RefSelect */ public RefSelect refSelect(Operand index, @@ -4253,16 +4964,14 @@ public RefSelect refSelect(Operand index, } /** - * Forwards the ref tensor `data` to the output port determined by `pred`. - *

- * If `pred` is true, the `data` input is forwarded to `output_true`. Otherwise, - * the data goes to `output_false`. - *

- * See also `Switch` and `Merge`. + * Forwards the ref tensor {@code data} to the output port determined by {@code pred}. + * 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 outputFalse()} 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 * @return a new instance of RefSwitch */ public RefSwitch refSwitch(Operand data, Operand pred) { @@ -4270,56 +4979,68 @@ public RefSwitch refSwitch(Operand data, Operand } /** - * Execute a sub graph on a remote processor. - *

- * The graph specifications(such as graph itself, input tensors and output names) - * are stored as a serialized protocol buffer of RemoteFusedGraphExecuteInfo - * as serialized_remote_fused_graph_execute_info. - * The specifications will be passed to a dedicated registered - * remote fused graph executor. The executor will send the graph specifications - * to a remote processor and execute that graph. The execution results - * will be passed to consumer nodes as outputs of this node. + * 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}. * - * @param inputs Arbitrary number of tensors with arbitrary data types - * @param Toutputs - * @param serializedRemoteFusedGraphExecuteInfo Serialized protocol buffer - * of RemoteFusedGraphExecuteInfo which contains graph specifications. - * @return a new instance of RemoteFusedGraphExecute + * @param target A fully specified device name where we want to run the function. + * @param args A list of arguments for the function. + * @param Tout The type list for the return values. + * @param f The function to run remotely. + * @return a new instance of RemoteCall */ - public RemoteFusedGraphExecute remoteFusedGraphExecute(Iterable> inputs, - List> Toutputs, String serializedRemoteFusedGraphExecuteInfo) { - return RemoteFusedGraphExecute.create(scope, inputs, Toutputs, serializedRemoteFusedGraphExecuteInfo); + public RemoteCall remoteCall(Operand target, Iterable> args, + List> Tout, ConcreteFunction f) { + return RemoteCall.create(scope, target, args, Tout, f); } /** * Reshapes a tensor. - *

- * Given `tensor`, this operation returns a tensor that has the same values - * as `tensor` with shape `shape`. - *

- * If one component of 1-D tensor `shape` is the special value -1, the size of that + * Given {@code tensor}, this operation returns a tensor that has the same values + * as {@code tensor} with shape {@code shape}. + *

If one component of 1-D tensor {@code shape} is the special value -1, the size of that * dimension is computed so that the total size remains constant. In particular, a - * `shape` of `[-1]` flattens into 1-D. At most one component of `shape` may be + * {@code shape} of {@code [-1]} flattens into 1-D. At most one component of {@code shape} may be * unknown. - *

- * The `shape` must be 1-D and the operation returns a tensor with shape - * `shape` filled with the values of `tensor`. In this case, the number of elements - * implied by `shape` must be the same as the number of elements in `tensor`. - *

- * It is an error if `shape` is not 1-D. - *

- * For example: - *

{@code
+   *  

The {@code shape} must be 1-D and the operation returns a tensor with shape + * {@code shape} filled with the values of {@code tensor}. In this case, the number of elements + * implied by {@code shape} must be the same as the number of elements in {@code tensor}. + *

It is an error if {@code shape} is not 1-D. + *

For example: + *

    *  # tensor 't' is [1, 2, 3, 4, 5, 6, 7, 8, 9]
    *  # tensor 't' has shape [9]
-   *  reshape(t, [3, 3]) ==> [[1, 2, 3],
+   *  reshape(t, [3, 3]) ==> [[1, 2, 3],
    *                          [4, 5, 6],
    *                          [7, 8, 9]]
    *
    *  # tensor 't' is [[[1, 1], [2, 2]],
    *  #                [[3, 3], [4, 4]]]
    *  # tensor 't' has shape [2, 2, 2]
-   *  reshape(t, [2, 4]) ==> [[1, 1, 2, 2],
+   *  reshape(t, [2, 4]) ==> [[1, 1, 2, 2],
    *                          [3, 3, 4, 4]]
    *
    *  # tensor 't' is [[[1, 1, 1],
@@ -4330,18 +5051,18 @@ public RemoteFusedGraphExecute remoteFusedGraphExecute(Iterable> inpu
    *  #                 [6, 6, 6]]]
    *  # tensor 't' has shape [3, 2, 3]
    *  # pass '[-1]' to flatten 't'
-   *  reshape(t, [-1]) ==> [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6]
+   *  reshape(t, [-1]) ==> [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6]
    *
    *  # -1 can also be used to infer the shape
    *
    *  # -1 is inferred to be 9:
-   *  reshape(t, [2, -1]) ==> [[1, 1, 1, 2, 2, 2, 3, 3, 3],
+   *  reshape(t, [2, -1]) ==> [[1, 1, 1, 2, 2, 2, 3, 3, 3],
    *                           [4, 4, 4, 5, 5, 5, 6, 6, 6]]
    *  # -1 is inferred to be 2:
-   *  reshape(t, [-1, 9]) ==> [[1, 1, 1, 2, 2, 2, 3, 3, 3],
+   *  reshape(t, [-1, 9]) ==> [[1, 1, 1, 2, 2, 2, 3, 3, 3],
    *                           [4, 4, 4, 5, 5, 5, 6, 6, 6]]
    *  # -1 is inferred to be 3:
-   *  reshape(t, [ 2, -1, 3]) ==> [[[1, 1, 1],
+   *  reshape(t, [ 2, -1, 3]) ==> [[[1, 1, 1],
    *                                [2, 2, 2],
    *                                [3, 3, 3]],
    *                               [[4, 4, 4],
@@ -4350,12 +5071,12 @@ public RemoteFusedGraphExecute remoteFusedGraphExecute(Iterable> inpu
    *
    *  # tensor 't' is [7]
    *  # shape `[]` reshapes to a scalar
-   *  reshape(t, []) ==> 7
-   *  }
+ * reshape(t, []) ==> 7 + *
* - * @param data type for {@code output()} output - * @param tensor + * @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 */ public Reshape reshape(Operand tensor, Operand shape) { @@ -4365,24 +5086,23 @@ public Reshape reshape(Operand tensor, Operand data type for {@code output()} output - * @param resource Should be from a scalar `Variable` node. + * @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 + * @param T The value of the T attribute + * @param data type for {@code ResourceCountUpTo} output and operands * @return a new instance of ResourceCountUpTo */ - public ResourceCountUpTo resourceCountUpTo(Operand resource, Long limit, - Class T) { + public ResourceCountUpTo resourceCountUpTo( + Operand resource, Long limit, Class T) { return ResourceCountUpTo.create(scope, resource, limit, T); } /** - * Gather slices from the variable pointed to by `resource` according to `indices`. - *

- * `indices` must be an integer tensor of any dimension (usually 0-D or 1-D). - * Produces an output tensor with shape `indices.shape + params.shape[1:]` where: - *

{@code
+   * Gather slices from the variable pointed to by {@code resource} according to {@code indices}.
+   *  {@code indices} must be an integer tensor of any dimension (usually 0-D or 1-D).
+   *  Produces an output tensor with shape {@code indices.shape + params.shape[1:]} where:
+   *  
    *      # Scalar indices
    *      output[:, ..., :] = params[indices, :, ... :]
    *
@@ -4391,229 +5111,211 @@ public  ResourceCountUpTo resourceCountUpTo(Operand res
    *
    *      # Higher rank indices
    *      output[i, ..., j, :, ... :] = params[indices[i, ..., j], :, ..., :]
-   *  }
+ *
* - * @param data type for {@code output()} output - * @param resource - * @param indices - * @param dtype - * @param options carries optional attributes values + * @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 */ - public ResourceGather resourceGather(Operand resource, + public ResourceGather resourceGather(Operand resource, Operand indices, Class dtype, ResourceGather.Options... options) { return ResourceGather.create(scope, resource, indices, dtype, options); } /** + * The ResourceGatherNd operation * - * @param data type for {@code output()} output - * @param resource - * @param indices - * @param dtype + * @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 */ - public ResourceGatherNd resourceGatherNd(Operand resource, + public ResourceGatherNd resourceGatherNd(Operand resource, Operand indices, Class dtype) { return ResourceGatherNd.create(scope, resource, indices, dtype); } /** - * Adds sparse updates to the variable referenced by `resource`. - *

+ * Adds sparse updates to the variable referenced by {@code resource}. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] += updates[...] - *

- * # Vector indices (for each i) - * ref[indices[i], ...] += updates[i, ...] - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] += updates[i, ..., j, ...] - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

+   *  # Scalar indices
+   *  ref[indices, ...] += updates[...]
+   *
+   *  # Vector indices (for each i)
+   *  ref[indices[i], ...] += updates[i, ...]
+   *
+   *  # High rank indices (for each i, ..., j)
+   *  ref[indices[i, ..., j], ...] += updates[i, ..., j, ...]
+   *  
+ *

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

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
* - * @param resource Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. + * @param resource 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}. * @return a new instance of ResourceScatterAdd */ - public ResourceScatterAdd resourceScatterAdd(Operand resource, + public ResourceScatterAdd resourceScatterAdd(Operand resource, Operand indices, Operand updates) { return ResourceScatterAdd.create(scope, resource, indices, updates); } /** - * Divides sparse updates into the variable referenced by `resource`. - *

+ * Divides sparse updates into the variable referenced by {@code resource}. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] /= updates[...] - *

- * # Vector indices (for each i) - * ref[indices[i], ...] /= updates[i, ...] - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] /= updates[i, ..., j, ...] - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

+   *  # Scalar indices
+   *  ref[indices, ...] /= updates[...]
+   *
+   *  # Vector indices (for each i)
+   *  ref[indices[i], ...] /= updates[i, ...]
+   *
+   *  # High rank indices (for each i, ..., j)
+   *  ref[indices[i, ..., j], ...] /= updates[i, ..., j, ...]
+   *  
+ *

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

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
* - * @param resource Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. + * @param resource 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}. * @return a new instance of ResourceScatterDiv */ - public ResourceScatterDiv resourceScatterDiv(Operand resource, + public ResourceScatterDiv resourceScatterDiv(Operand resource, Operand indices, Operand updates) { return ResourceScatterDiv.create(scope, resource, indices, updates); } /** - * Reduces sparse updates into the variable referenced by `resource` using the `max` operation. - *

+ * Reduces sparse updates into the variable referenced by {@code resource} using the {@code max} operation. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] = max(ref[indices, ...], updates[...]) - *

- * # Vector indices (for each i) - * ref[indices[i], ...] = max(ref[indices[i], ...], updates[i, ...]) - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] = max(ref[indices[i, ..., j], ...], updates[i, ..., j, ...]) - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

+   *  # Scalar indices
+   *  ref[indices, ...] = max(ref[indices, ...], updates[...])
+   *
+   *  # Vector indices (for each i)
+   *  ref[indices[i], ...] = max(ref[indices[i], ...], updates[i, ...])
+   *
+   *  # High rank indices (for each i, ..., j)
+   *  ref[indices[i, ..., j], ...] = max(ref[indices[i, ..., j], ...], updates[i, ..., j, ...])
+   *  
+ *

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

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
* - * @param resource Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. + * @param resource 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}. * @return a new instance of ResourceScatterMax */ - public ResourceScatterMax resourceScatterMax(Operand resource, + public ResourceScatterMax resourceScatterMax(Operand resource, Operand indices, Operand updates) { return ResourceScatterMax.create(scope, resource, indices, updates); } /** - * Reduces sparse updates into the variable referenced by `resource` using the `min` operation. - *

+ * Reduces sparse updates into the variable referenced by {@code resource} using the {@code min} operation. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] = min(ref[indices, ...], updates[...]) - *

- * # Vector indices (for each i) - * ref[indices[i], ...] = min(ref[indices[i], ...], updates[i, ...]) - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] = min(ref[indices[i, ..., j], ...], updates[i, ..., j, ...]) - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

+   *  # Scalar indices
+   *  ref[indices, ...] = min(ref[indices, ...], updates[...])
+   *
+   *  # Vector indices (for each i)
+   *  ref[indices[i], ...] = min(ref[indices[i], ...], updates[i, ...])
+   *
+   *  # High rank indices (for each i, ..., j)
+   *  ref[indices[i, ..., j], ...] = min(ref[indices[i, ..., j], ...], updates[i, ..., j, ...])
+   *  
+ *

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

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
* - * @param resource Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. + * @param resource 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}. * @return a new instance of ResourceScatterMin */ - public ResourceScatterMin resourceScatterMin(Operand resource, + public ResourceScatterMin resourceScatterMin(Operand resource, Operand indices, Operand updates) { return ResourceScatterMin.create(scope, resource, indices, updates); } /** - * Multiplies sparse updates into the variable referenced by `resource`. - *

+ * Multiplies sparse updates into the variable referenced by {@code resource}. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] *= updates[...] - *

- * # Vector indices (for each i) - * ref[indices[i], ...] *= updates[i, ...] - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] *= updates[i, ..., j, ...] - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

+   *  # Scalar indices
+   *  ref[indices, ...] *= updates[...]
+   *
+   *  # Vector indices (for each i)
+   *  ref[indices[i], ...] *= updates[i, ...]
+   *
+   *  # High rank indices (for each i, ..., j)
+   *  ref[indices[i, ..., j], ...] *= updates[i, ..., j, ...]
+   *  
+ *

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

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
* - * @param resource Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. + * @param resource 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}. * @return a new instance of ResourceScatterMul */ - public ResourceScatterMul resourceScatterMul(Operand resource, + public ResourceScatterMul resourceScatterMul(Operand resource, Operand indices, Operand updates) { return ResourceScatterMul.create(scope, resource, indices, updates); } /** * Applies sparse addition to individual values or slices in a Variable. - *

- * `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. - *

- * `indices` must be integer tensor, containing indices into `ref`. - * It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. - *

- * The innermost dimension of `indices` (with length `K`) corresponds to - * indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th - * dimension of `ref`. - *

- * `updates` is `Tensor` of rank `Q-1+P-K` with shape: - *

{@code
+   *  {@code ref} is a {@code Tensor} with rank {@code P} and {@code indices} is a {@code Tensor} of rank {@code Q}.
+   *  

{@code indices} must be integer tensor, containing indices into {@code ref}. + * It must be shape {@code [d_0, ..., d_{Q-2}, K]} where {@code 0 < K <= P}. + *

The innermost dimension of {@code indices} (with length {@code K}) corresponds to + * indices into elements (if {@code K = P}) or slices (if {@code K < P}) along the {@code K}th + * dimension of {@code ref}. + *

{@code updates} is {@code Tensor} of rank {@code Q-1+P-K} with shape: + *

    *  [d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]
-   *  }
- * For example, say we want to add 4 scattered elements to a rank-1 tensor to + *
+ *

For example, say we want to add 4 scattered elements to a rank-1 tensor to * 8 elements. In Python, that addition would look like this: - *

{@code
+   *  
    *  ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8], use_resource=True)
    *  indices = tf.constant([[4], [3], [1], [7]])
    *  updates = tf.constant([9, 10, 11, 12])
    *  add = tf.scatter_nd_add(ref, indices, updates)
    *  with tf.Session() as sess:
    *    print sess.run(add)
-   *  }
- * The resulting update to ref would look like this: - *

- * [1, 13, 3, 14, 14, 6, 7, 20] - *

- * See `tf.scatter_nd` for more details about how to make updates to + *

+ *

The resulting update to ref would look like this: + *

+   *  [1, 13, 3, 14, 14, 6, 7, 20]
+   *  
+ *

See {@code tf.scatter_nd} for more details about how to make updates to * slices. * * @param ref A resource handle. Must be from a VarHandleOp. @@ -4621,42 +5323,44 @@ public ResourceScatterMul resourceScatterMul(Operand resource, * A tensor of indices into ref. * @param updates A Tensor. Must have the same type as ref. A tensor of * values to add to ref. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ResourceScatterNdAdd */ - public ResourceScatterNdAdd resourceScatterNdAdd(Operand ref, + public ResourceScatterNdAdd resourceScatterNdAdd(Operand ref, Operand indices, Operand updates, ResourceScatterNdAdd.Options... options) { return ResourceScatterNdAdd.create(scope, ref, indices, updates, options); } /** + * The ResourceScatterNdMax operation * * @param ref A resource handle. Must be from a VarHandleOp. * @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 * values whose element wise max is taken with ref - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ResourceScatterNdMax */ - public ResourceScatterNdMax resourceScatterNdMax(Operand ref, + public ResourceScatterNdMax resourceScatterNdMax(Operand ref, Operand indices, Operand updates, ResourceScatterNdMax.Options... options) { return ResourceScatterNdMax.create(scope, ref, indices, updates, options); } /** + * The ResourceScatterNdMin operation * * @param ref A resource handle. Must be from a VarHandleOp. * @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 * values whose element wise min is taken with ref. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ResourceScatterNdMin */ - public ResourceScatterNdMin resourceScatterNdMin(Operand ref, + public ResourceScatterNdMin resourceScatterNdMin(Operand ref, Operand indices, Operand updates, ResourceScatterNdMin.Options... options) { return ResourceScatterNdMin.create(scope, ref, indices, updates, options); @@ -4664,35 +5368,31 @@ public ResourceScatterNdMin resourceScatterNdMin(Operand ref, /** * Applies sparse subtraction to individual values or slices in a Variable. - *

- * `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. - *

- * `indices` must be integer tensor, containing indices into `ref`. - * It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. - *

- * The innermost dimension of `indices` (with length `K`) corresponds to - * indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th - * dimension of `ref`. - *

- * `updates` is `Tensor` of rank `Q-1+P-K` with shape: - *

{@code
+   *  {@code ref} is a {@code Tensor} with rank {@code P} and {@code indices} is a {@code Tensor} of rank {@code Q}.
+   *  

{@code indices} must be integer tensor, containing indices into {@code ref}. + * It must be shape {@code [d_0, ..., d_{Q-2}, K]} where {@code 0 < K <= P}. + *

The innermost dimension of {@code indices} (with length {@code K}) corresponds to + * indices into elements (if {@code K = P}) or slices (if {@code K < P}) along the {@code K}th + * dimension of {@code ref}. + *

{@code updates} is {@code Tensor} of rank {@code Q-1+P-K} with shape: + *

    *  [d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]
-   *  }
- * For example, say we want to subtract 4 scattered elements from a rank-1 tensor + *
+ *

For example, say we want to subtract 4 scattered elements from a rank-1 tensor * with 8 elements. In Python, that subtraction would look like this: - *

{@code
+   *  
    *  ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8], use_resource=True)
    *  indices = tf.constant([[4], [3], [1], [7]])
    *  updates = tf.constant([9, 10, 11, 12])
    *  sub = tf.scatter_nd_sub(ref, indices, updates)
    *  with tf.Session() as sess:
    *    print sess.run(sub)
-   *  }
- * The resulting update to ref would look like this: - *

- * [1, -9, 3, -6, -4, 6, 7, -4] - *

- * See `tf.scatter_nd` for more details about how to make updates to + *

+ *

The resulting update to ref would look like this: + *

+   *  [1, -9, 3, -6, -4, 6, 7, -4]
+   *  
+ *

See {@code tf.scatter_nd} for more details about how to make updates to * slices. * * @param ref A resource handle. Must be from a VarHandleOp. @@ -4700,48 +5400,43 @@ public ResourceScatterNdMin resourceScatterNdMin(Operand ref, * A tensor of indices into ref. * @param updates A Tensor. Must have the same type as ref. A tensor of * values to add to ref. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ResourceScatterNdSub */ - public ResourceScatterNdSub resourceScatterNdSub(Operand ref, + public ResourceScatterNdSub resourceScatterNdSub(Operand ref, Operand indices, Operand updates, ResourceScatterNdSub.Options... options) { return ResourceScatterNdSub.create(scope, ref, indices, updates, options); } /** - * Applies sparse `updates` to individual values or slices within a given - *

- * variable according to `indices`. - *

- * `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. - *

- * `indices` must be integer tensor, containing indices into `ref`. - * It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. - *

- * The innermost dimension of `indices` (with length `K`) corresponds to - * indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th - * dimension of `ref`. - *

- * `updates` is `Tensor` of rank `Q-1+P-K` with shape: - *

{@code
+   * Applies sparse {@code updates} to individual values or slices within a given
+   *  variable according to {@code indices}.
+   *  

{@code ref} is a {@code Tensor} with rank {@code P} and {@code indices} is a {@code Tensor} of rank {@code Q}. + *

{@code indices} must be integer tensor, containing indices into {@code ref}. + * It must be shape {@code [d_0, ..., d_{Q-2}, K]} where {@code 0 < K <= P}. + *

The innermost dimension of {@code indices} (with length {@code K}) corresponds to + * indices into elements (if {@code K = P}) or slices (if {@code K < P}) along the {@code K}th + * dimension of {@code ref}. + *

{@code updates} is {@code Tensor} of rank {@code Q-1+P-K} with shape: + *

    *  [d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]].
-   *  }
- * For example, say we want to update 4 scattered elements to a rank-1 tensor to + *
+ *

For example, say we want to update 4 scattered elements to a rank-1 tensor to * 8 elements. In Python, that update would look like this: - *

{@code
+   *  
    *      ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8])
    *      indices = tf.constant([[4], [3], [1] ,[7]])
    *      updates = tf.constant([9, 10, 11, 12])
    *      update = tf.scatter_nd_update(ref, indices, updates)
    *      with tf.Session() as sess:
    *        print sess.run(update)
-   *  }
- * The resulting update to ref would look like this: - *

- * [1, 11, 3, 10, 9, 6, 7, 12] - *

- * See `tf.scatter_nd` for more details about how to make updates to + *

+ *

The resulting update to ref would look like this: + *

+   *  [1, 11, 3, 10, 9, 6, 7, 12]
+   *  
+ *

See {@code tf.scatter_nd} for more details about how to make updates to * slices. * * @param ref A resource handle. Must be from a VarHandleOp. @@ -4749,112 +5444,102 @@ public ResourceScatterNdSub resourceScatterNdSub(Operand ref, * 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 attributes values + * @param options carries optional attribute values * @return a new instance of ResourceScatterNdUpdate */ - public ResourceScatterNdUpdate resourceScatterNdUpdate(Operand ref, + public ResourceScatterNdUpdate resourceScatterNdUpdate(Operand ref, Operand indices, Operand updates, ResourceScatterNdUpdate.Options... options) { return ResourceScatterNdUpdate.create(scope, ref, indices, updates, options); } /** - * Subtracts sparse updates from the variable referenced by `resource`. - *

+ * Subtracts sparse updates from the variable referenced by {@code resource}. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] -= updates[...] - *

- * # Vector indices (for each i) - * ref[indices[i], ...] -= updates[i, ...] - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] -= updates[i, ..., j, ...] - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

+   *  # Scalar indices
+   *  ref[indices, ...] -= updates[...]
+   *
+   *  # Vector indices (for each i)
+   *  ref[indices[i], ...] -= updates[i, ...]
+   *
+   *  # High rank indices (for each i, ..., j)
+   *  ref[indices[i, ..., j], ...] -= updates[i, ..., j, ...]
+   *  
+ *

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

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
* - * @param resource Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. + * @param resource 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}. * @return a new instance of ResourceScatterSub */ - public ResourceScatterSub resourceScatterSub(Operand resource, + public ResourceScatterSub resourceScatterSub(Operand resource, Operand indices, Operand updates) { return ResourceScatterSub.create(scope, resource, indices, updates); } /** - * Assigns sparse updates to the variable referenced by `resource`. - *

+ * Assigns sparse updates to the variable referenced by {@code resource}. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] = updates[...] - *

- * # Vector indices (for each i) - * ref[indices[i], ...] = updates[i, ...] - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] = updates[i, ..., j, ...] + *

+   *  # Scalar indices
+   *  ref[indices, ...] = updates[...]
    *
-   * @param resource Should be from a `Variable` node.
-   * @param indices A tensor of indices into the first dimension of `ref`.
-   * @param updates A tensor of updated values to add to `ref`.
+   *  # Vector indices (for each i)
+   *  ref[indices[i], ...] = updates[i, ...]
+   *
+   *  # High rank indices (for each i, ..., j)
+   *  ref[indices[i, ..., j], ...] = updates[i, ..., j, ...]
+   *  
+ * + * @param resource 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}. * @return a new instance of ResourceScatterUpdate */ - public ResourceScatterUpdate resourceScatterUpdate(Operand resource, + public ResourceScatterUpdate resourceScatterUpdate(Operand resource, Operand indices, Operand updates) { return ResourceScatterUpdate.create(scope, resource, indices, updates); } /** - * 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`. - * - * @param ref - * @param begin - * @param end - * @param strides - * @param value - * @param options carries optional attributes values + * Assign {@code value} to the sliced l-value reference of {@code ref}. + * The values of {@code value} are assigned to the positions in the variable + * {@code ref} that are selected by the slice parameters. The slice parameters + * {@code begin, }end{@code , }strides{@code , etc. work exactly as in }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 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 */ - public ResourceStridedSliceAssign resourceStridedSliceAssign(Operand ref, - Operand begin, Operand end, Operand strides, Operand value, - ResourceStridedSliceAssign.Options... options) { + public ResourceStridedSliceAssign resourceStridedSliceAssign( + Operand ref, Operand begin, Operand end, Operand strides, + Operand value, ResourceStridedSliceAssign.Options... options) { return ResourceStridedSliceAssign.create(scope, ref, begin, end, strides, value, options); } /** * Reverses specific dimensions of a tensor. - *

- * NOTE `tf.reverse` has now changed behavior in preparation for 1.0. - * `tf.reverse_v2` is currently an alias that will be deprecated before TF 1.0. - *

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

- * `tensor` can have up to 8 dimensions. The number of dimensions specified - * in `axis` may be 0 or more entries. If an index is specified more than + * 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 + * in {@code axis} may be 0 or more entries. If an index is specified more than * once, a InvalidArgument error is raised. - *

- * For example: - *

{@code
+   *  

For example: + *

    *  # tensor 't' is [[[[ 0,  1,  2,  3],
    *  #                  [ 4,  5,  6,  7],
    *  #                  [ 8,  9, 10, 11]],
@@ -4864,7 +5549,7 @@ public  ResourceStridedSliceAssign resourceStridedSliceAssign
    *  # tensor 't' shape is [1, 2, 3, 4]
    *
    *  # 'dims' is [3] or 'dims' is [-1]
-   *  reverse(t, dims) ==> [[[[ 3,  2,  1,  0],
+   *  reverse(t, dims) ==> [[[[ 3,  2,  1,  0],
    *                          [ 7,  6,  5,  4],
    *                          [ 11, 10, 9, 8]],
    *                         [[15, 14, 13, 12],
@@ -4872,7 +5557,7 @@ public  ResourceStridedSliceAssign resourceStridedSliceAssign
    *                          [23, 22, 21, 20]]]]
    *
    *  # 'dims' is '[1]' (or 'dims' is '[-3]')
-   *  reverse(t, dims) ==> [[[[12, 13, 14, 15],
+   *  reverse(t, dims) ==> [[[[12, 13, 14, 15],
    *                          [16, 17, 18, 19],
    *                          [20, 21, 22, 23]
    *                         [[ 0,  1,  2,  3],
@@ -4880,18 +5565,18 @@ public  ResourceStridedSliceAssign resourceStridedSliceAssign
    *                          [ 8,  9, 10, 11]]]]
    *
    *  # 'dims' is '[2]' (or 'dims' is '[-2]')
-   *  reverse(t, dims) ==> [[[[8, 9, 10, 11],
+   *  reverse(t, dims) ==> [[[[8, 9, 10, 11],
    *                          [4, 5, 6, 7],
    *                          [0, 1, 2, 3]]
    *                         [[20, 21, 22, 23],
    *                          [16, 17, 18, 19],
    *                          [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 - * `[-rank(tensor), rank(tensor))`. + * {@code [-rank(tensor), rank(tensor))}. + * @param data type for {@code ReverseV2} output and operands * @return a new instance of Reverse */ public Reverse reverse(Operand tensor, Operand axis) { @@ -4900,20 +5585,16 @@ public Reverse reverse(Operand tensor, Operand - * This op first slices `input` along the dimension `batch_dim`, and for each - * slice `i`, reverses the first `seq_lengths[i]` elements along - * the dimension `seq_dim`. - *

- * The elements of `seq_lengths` must obey `seq_lengths[i] <= input.dims[seq_dim]`, - * and `seq_lengths` must be a vector of length `input.dims[batch_dim]`. - *

- * The output slice `i` along dimension `batch_dim` is then given by input - * slice `i`, with the first `seq_lengths[i]` slices along dimension - * `seq_dim` reversed. - *

- * For example: - *

{@code
+   *  This op first slices {@code input} along the dimension {@code batch_dim}, and for each
+   *  slice {@code i}, reverses the first {@code seq_lengths[i]} elements along
+   *  the dimension {@code seq_dim}.
+   *  

The elements of {@code seq_lengths} must obey {@code seq_lengths[i] <= input.dims[seq_dim]}, + * and {@code seq_lengths} must be a vector of length {@code input.dims[batch_dim]}. + *

The output slice {@code i} along dimension {@code batch_dim} is then given by input + * slice {@code i}, with the first {@code seq_lengths[i]} slices along dimension + * {@code seq_dim} reversed. + *

For example: + *

    *  # Given this:
    *  batch_dim = 0
    *  seq_dim = 1
@@ -4931,9 +5612,9 @@ public  Reverse reverse(Operand tensor, Operand
-   *  In contrast, if:
-   *  
{@code
+   *  
+ *

In contrast, if: + *

    *  # Given this:
    *  batch_dim = 2
    *  seq_dim = 0
@@ -4951,14 +5632,14 @@ 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 `input.dims(batch_dim)` and - * `max(seq_lengths) <= input.dims(seq_dim)` + * @param seqLengths 1-D with length {@code input.dims(batch_dim)} and + * {@code max(seq_lengths) <= input.dims(seq_dim)} * @param seqDim The dimension which is partially reversed. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ReverseSequence} output and operands * @return a new instance of ReverseSequence */ public ReverseSequence reverseSequence(Operand input, @@ -4968,37 +5649,35 @@ public ReverseSequence reverseSequence(Operand input, /** * Rolls the elements of a tensor along an axis. - *

* The elements are shifted positively (towards larger indices) by the offset of - * `shift` along the dimension of `axis`. Negative `shift` values will shift + * {@code shift} along the dimension of {@code axis}. Negative {@code shift} values will shift * elements in the opposite direction. Elements that roll passed the last position * will wrap around to the first and vice versa. Multiple shifts along multiple * axes may be specified. - *

- * For example: - *

{@code
+   *  

For example: + *

    *  # 't' is [0, 1, 2, 3, 4]
-   *  roll(t, shift=2, axis=0) ==> [3, 4, 0, 1, 2]
+   *  roll(t, shift=2, axis=0) ==> [3, 4, 0, 1, 2]
    *
    *  # shifting along multiple dimensions
    *  # 't' is [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]
-   *  roll(t, shift=[1, -2], axis=[0, 1]) ==> [[7, 8, 9, 5, 6], [2, 3, 4, 0, 1]]
+   *  roll(t, shift=[1, -2], axis=[0, 1]) ==> [[7, 8, 9, 5, 6], [2, 3, 4, 0, 1]]
    *
    *  # shifting along the same axis multiple times
    *  # '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]]
-   *  }
+ * 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 - * @param shift Dimension must be 0-D or 1-D. `shift[i]` specifies the number of places by which + * @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 `axis[i]`. Negative shifts will roll the elements in the opposite + * specified by {@code axis[i]}. Negative shifts will roll the elements in the opposite * direction. - * @param axis Dimension must be 0-D or 1-D. `axis[i]` specifies the dimension that the shift - * `shift[i]` should occur. If the same axis is referenced more than once, the + * @param axis 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. + * @param data type for {@code Roll} output and operands * @return a new instance of Roll */ public Roll roll(Operand input, Operand shift, @@ -5006,101 +5685,33 @@ public Roll roll(Operand input, Operand - * This op asynchronously performs either a single RPC request, or a batch - * of requests. RPC requests are defined by three main parameters: - *

- * - `address` (the host+port or BNS address of the request) - * - `method` (the RPC method name for the request) - * - `request` (the serialized proto string, or vector of strings, - * of the RPC request argument). - *

- * For example, if you have an RPC service running on port localhost:2345, - * and its interface is configured with the following proto declaration: - *

{@code
-   *  service MyService {
-   *    rpc MyMethod(MyRequestProto) returns (MyResponseProto) {
-   *    }
-   *  };
-   *  }
- * then call this op with arguments: - *
{@code
-   *  address = "localhost:2345"
-   *  method = "MyService/MyMethod"
-   *  }
- * The `request` tensor is a string tensor representing serialized `MyRequestProto` - * strings; and the output string tensor `response` will have the same shape - * and contain (upon successful completion) corresponding serialized - * `MyResponseProto` strings. - *

- * For example, to send a single, empty, `MyRequestProto`, call - * this op with `request = ""`. To send 5 parallel empty requests, - * call this op with `request = ["", "", "", "", ""]`. - *

- * More generally, one can create a batch of `MyRequestProto` serialized protos - * from regular batched tensors using the `encode_proto` op, and convert - * the response `MyResponseProto` serialized protos to batched tensors - * using the `decode_proto` op. - *

- * NOTE Working with serialized proto strings is faster than instantiating - * actual proto objects in memory, so no performance degradation is expected - * compared to writing custom kernels for this workflow. - *

- * If the connection fails or the remote worker returns an error - * status, the op reraises this exception locally. - *

- * See the `TryRpc` op if you prefer to handle RPC failures manually in the graph. - * - * @param address `0-D` or `1-D`. The address (i.e. host_name:port) of the RPC server. - * If this tensor has more than 1 element, then multiple parallel rpc requests - * are sent. This argument broadcasts with `method` and `request`. - * @param method `0-D` or `1-D`. The method address on the RPC server. - * If this tensor has more than 1 element, then multiple parallel rpc requests - * are sent. This argument broadcasts with `address` and `request`. - * @param request `0-D` or `1-D`. Serialized proto strings: the rpc request argument. - * If this tensor has more than 1 element, then multiple parallel rpc requests - * are sent. This argument broadcasts with `address` and `method`. - * @param options carries optional attributes values - * @return a new instance of Rpc - */ - public Rpc rpc(Operand address, Operand method, Operand request, - Rpc.Options... options) { - return Rpc.create(scope, address, method, request, options); - } - /** * Adds sparse updates to a variable reference. - *

* This operation computes - *

- * # Scalar indices - * ref[indices, ...] += updates[...] - *

- * # Vector indices (for each i) - * ref[indices[i], ...] += updates[i, ...] - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] += updates[i, ..., j, ...] - *

- * This operation outputs `ref` after the update is done. + *

+   *  # Scalar indices
+   *  ref[indices, ...] += updates[...]
+   *
+   *  # Vector indices (for each i)
+   *  ref[indices[i], ...] += updates[i, ...]
+   *
+   *  # High rank indices (for each i, ..., j)
+   *  ref[indices[i, ..., j], ...] += updates[i, ..., j, ...]
+   *  
+ *

This operation outputs {@code ref} after the update is done. * This makes it easier to chain operations that need to use the reset value. - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

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

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
* - * @param data type for {@code outputRef()} output - * @param ref Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. - * @param options carries optional attributes values + * @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}. + * @param options carries optional attribute values + * @param data type for {@code ScatterAdd} output and operands * @return a new instance of ScatterAdd */ public ScatterAdd scatterAdd(Operand ref, @@ -5110,9 +5721,8 @@ public ScatterAdd scatterAdd(Operand ref, /** * Divides a variable reference by sparse updates. - *

* This operation computes - *

{@code
+   *  
    *      # Scalar indices
    *      ref[indices, ...] /= updates[...]
    *
@@ -5121,20 +5731,18 @@ public  ScatterAdd scatterAdd(Operand ref,
    *
    *      # High rank indices (for each i, ..., j)
    *      ref[indices[i, ..., j], ...] /= updates[i, ..., j, ...]
-   *  }
- * This operation outputs `ref` after the update is done. + *
+ *

This operation outputs {@code ref} after the update is done. * This makes it easier to chain operations that need to use the reset value. - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

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

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. + *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. * - * @param data type for {@code outputRef()} output - * @param ref Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of values that `ref` is divided by. - * @param options carries optional attributes values + * @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. + * @param options carries optional attribute values + * @param data type for {@code ScatterDiv} output and operands * @return a new instance of ScatterDiv */ public ScatterDiv scatterDiv(Operand ref, @@ -5143,36 +5751,32 @@ public ScatterDiv scatterDiv(Operand ref, } /** - * Reduces sparse updates into a variable reference using the `max` operation. - *

+ * Reduces sparse updates into a variable reference using the {@code max} operation. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] = max(ref[indices, ...], updates[...]) - *

- * # Vector indices (for each i) - * ref[indices[i], ...] = max(ref[indices[i], ...], updates[i, ...]) - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] = max(ref[indices[i, ..., j], ...], updates[i, ..., j, ...]) - *

- * This operation outputs `ref` after the update is done. + *

+   *  # Scalar indices
+   *  ref[indices, ...] = max(ref[indices, ...], updates[...])
+   *
+   *  # Vector indices (for each i)
+   *  ref[indices[i], ...] = max(ref[indices[i], ...], updates[i, ...])
+   *
+   *  # High rank indices (for each i, ..., j)
+   *  ref[indices[i, ..., j], ...] = max(ref[indices[i, ..., j], ...], updates[i, ..., j, ...])
+   *  
+ *

This operation outputs {@code ref} after the update is done. * This makes it easier to chain operations that need to use the reset value. - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

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

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
* - * @param data type for {@code outputRef()} output - * @param ref Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to reduce into `ref`. - * @param options carries optional attributes values + * @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}. + * @param options carries optional attribute values + * @param data type for {@code ScatterMax} output and operands * @return a new instance of ScatterMax */ public ScatterMax scatterMax(Operand ref, @@ -5181,36 +5785,32 @@ public ScatterMax scatterMax(Operand ref, } /** - * Reduces sparse updates into a variable reference using the `min` operation. - *

+ * Reduces sparse updates into a variable reference using the {@code min} operation. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] = min(ref[indices, ...], updates[...]) - *

- * # Vector indices (for each i) - * ref[indices[i], ...] = min(ref[indices[i], ...], updates[i, ...]) - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] = min(ref[indices[i, ..., j], ...], updates[i, ..., j, ...]) - *

- * This operation outputs `ref` after the update is done. + *

+   *  # Scalar indices
+   *  ref[indices, ...] = min(ref[indices, ...], updates[...])
+   *
+   *  # Vector indices (for each i)
+   *  ref[indices[i], ...] = min(ref[indices[i], ...], updates[i, ...])
+   *
+   *  # High rank indices (for each i, ..., j)
+   *  ref[indices[i, ..., j], ...] = min(ref[indices[i, ..., j], ...], updates[i, ..., j, ...])
+   *  
+ *

This operation outputs {@code ref} after the update is done. * This makes it easier to chain operations that need to use the reset value. - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

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

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
* - * @param data type for {@code outputRef()} output - * @param ref Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to reduce into `ref`. - * @param options carries optional attributes values + * @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}. + * @param options carries optional attribute values + * @param data type for {@code ScatterMin} output and operands * @return a new instance of ScatterMin */ public ScatterMin scatterMin(Operand ref, @@ -5220,9 +5820,8 @@ public ScatterMin scatterMin(Operand ref, /** * Multiplies sparse updates into a variable reference. - *

* This operation computes - *

{@code
+   *  
    *      # Scalar indices
    *      ref[indices, ...] *= updates[...]
    *
@@ -5231,20 +5830,18 @@ public  ScatterMin scatterMin(Operand ref,
    *
    *      # High rank indices (for each i, ..., j)
    *      ref[indices[i, ..., j], ...] *= updates[i, ..., j, ...]
-   *  }
- * This operation outputs `ref` after the update is done. + *
+ *

This operation outputs {@code ref} after the update is done. * This makes it easier to chain operations that need to use the reset value. - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

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

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. + *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. * - * @param data type for {@code outputRef()} output - * @param ref Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to multiply to `ref`. - * @param options carries optional attributes values + * @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}. + * @param options carries optional attribute values + * @param data type for {@code ScatterMul} output and operands * @return a new instance of ScatterMul */ public ScatterMul scatterMul(Operand ref, @@ -5253,67 +5850,63 @@ public ScatterMul scatterMul(Operand ref, } /** - * Scatter `updates` into a new tensor according to `indices`. - *

- * Creates a new tensor by applying sparse `updates` to individual values or - * slices within a tensor (initially zero for numeric, empty for string) of - * the given `shape` according to indices. This operator is the inverse of the - * `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 `tf.scatter_nd(indices, values, shape)` is identical - * to `tensor_scatter_add(tf.zeros(shape, values.dtype), indices, values)` - *

- * If `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 `indices` contains duplicates -- because - * of some numerical approximation issues, numbers summed in different order - * may yield different results. - *

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

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

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

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

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

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

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

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

* *
- *

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

{@code
+   *  

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

    *      indices = tf.constant([[4], [3], [1], [7]])
    *      updates = tf.constant([9, 10, 11, 12])
    *      shape = tf.constant([8])
    *      scatter = tf.scatter_nd(indices, updates, shape)
    *      print(scatter)
-   *  }
- * The resulting tensor would look like this: - *

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

+ *

+ *

The resulting tensor would look like this: + *

+   *  [0, 11, 0, 10, 9, 0, 0, 12]
+   *  
+ *

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: - *

{@code
-   *      indices = tf.constant([[0], [2]])
+   *  

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

+   *      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],
@@ -5321,68 +5914,74 @@ public  ScatterMul scatterMul(Operand ref,
    *      shape = tf.constant([4, 4, 4])
    *      scatter = tf.scatter_nd(indices, updates, shape)
    *      print(scatter)
-   *  }
- * 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]], - * [[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]]] - *

- * 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 indices Index tensor. - * @param updates Updates to scatter into output. - * @param shape 1-D. The shape of the resulting tensor. + *

+ *

The resulting tensor would look like this: + *

+   *  [[[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]],
+   *   [[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]]]
+   *  
+ *

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 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); } /** * Applies sparse addition to individual values or slices in a Variable. - *

- * `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. - *

- * `indices` must be integer tensor, containing indices into `ref`. - * It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. - *

- * The innermost dimension of `indices` (with length `K`) corresponds to - * indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th - * dimension of `ref`. - *

- * `updates` is `Tensor` of rank `Q-1+P-K` with shape: - *

{@code
+   *  {@code ref} is a {@code Tensor} with rank {@code P} and {@code indices} is a {@code Tensor} of rank {@code Q}.
+   *  

{@code indices} must be integer tensor, containing indices into {@code ref}. + * It must be shape {@code [d_0, ..., d_{Q-2}, K]} where {@code 0 < K <= P}. + *

The innermost dimension of {@code indices} (with length {@code K}) corresponds to + * indices into elements (if {@code K = P}) or slices (if {@code K < P}) along the {@code K}th + * dimension of {@code ref}. + *

{@code updates} is {@code Tensor} of rank {@code Q-1+P-K} with shape: + *

    *  [d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]
-   *  }
- * For example, say we want to add 4 scattered elements to a rank-1 tensor to + *
+ *

For example, say we want to add 4 scattered elements to a rank-1 tensor to * 8 elements. In Python, that addition would look like this: - *

{@code
+   *  
    *  ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8])
    *  indices = tf.constant([[4], [3], [1], [7]])
    *  updates = tf.constant([9, 10, 11, 12])
    *  add = tf.scatter_nd_add(ref, indices, updates)
    *  with tf.Session() as sess:
    *    print sess.run(add)
-   *  }
- * The resulting update to ref would look like this: - *

- * [1, 13, 3, 14, 14, 6, 7, 20] - *

- * See `tf.scatter_nd` for more details about how to make updates to + *

+ *

The resulting update to ref would look like this: + *

+   *  [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 outputRef()} 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. * @param updates A Tensor. Must have the same type as ref. A tensor of updated values * to add to ref. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ScatterNdAdd} output and operands * @return a new instance of ScatterNdAdd */ public ScatterNdAdd scatterNdAdd(Operand ref, @@ -5391,97 +5990,121 @@ public ScatterNdAdd scatterNdAdd(Operand ref, } /** - * Applies sparse addition to `input` using individual values or slices - *

- * from `updates` according to indices `indices`. The updates are non-aliasing: - * `input` is only modified in-place if no other operations will use it. - * Otherwise, a copy of `input` is made. This operation has a gradient with - * respect to both `input` and `updates`. - *

- * `input` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. - *

- * `indices` must be integer tensor, containing indices into `input`. - * It must be shape \\([d_0, ..., d_{Q-2}, K]\\) where `0 < K <= P`. - *

- * The innermost dimension of `indices` (with length `K`) corresponds to - * indices into elements (if `K = P`) or `(P-K)`-dimensional slices - * (if `K < P`) along the `K`th dimension of `input`. - *

- * `updates` is `Tensor` of rank `Q-1+P-K` with shape: - *

- * $$[d_0, ..., d_{Q-2}, input.shape[K], ..., input.shape[P-1]].$$ - *

- * For example, say we want to add 4 scattered elements to a rank-1 tensor to 8 + * 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: + * {@code input} is only modified in-place if no other operations will use it. + * Otherwise, a copy of {@code input} is made. This operation has a gradient with + * respect to both {@code input} and {@code updates}. + *

{@code input} is a {@code Tensor} with rank {@code P} and {@code indices} is a {@code Tensor} of rank {@code Q}. + *

{@code indices} must be integer tensor, containing indices into {@code input}. + * It must be shape \([d_0, ..., d_{Q-2}, K]\) where {@code 0 < K <= P}. + *

The innermost dimension of {@code indices} (with length {@code K}) corresponds to + * indices into elements (if {@code K = P}) or {@code (P-K)}-dimensional slices + * (if {@code K < P}) along the {@code K}th dimension of {@code input}. + *

{@code updates} is {@code Tensor} of rank {@code Q-1+P-K} with shape: + *

$$[d_0, ..., d_{Q-2}, input.shape[K], ..., input.shape[P-1]].$$ + *

For example, say we want to add 4 scattered elements to a rank-1 tensor to 8 * elements. In Python, that addition would look like this: - *

- * input = tf.constant([1, 2, 3, 4, 5, 6, 7, 8]) - * indices = tf.constant([[4], [3], [1], [7]]) - * updates = tf.constant([9, 10, 11, 12]) - * output = tf.scatter_nd_non_aliasing_add(input, indices, updates) - * with tf.Session() as sess: - * print(sess.run(output)) - *

- * The resulting value `output` would look like this: - *

- * [1, 13, 3, 14, 14, 6, 7, 20] - *

- * See `tf.scatter_nd` for more details about how to make updates to slices. + *

+   *  input = tf.constant([1, 2, 3, 4, 5, 6, 7, 8])
+   *  indices = tf.constant([[4], [3], [1], [7]])
+   *  updates = tf.constant([9, 10, 11, 12])
+   *  output = tf.scatter_nd_non_aliasing_add(input, indices, updates)
+   *  with tf.Session() as sess:
+   *    print(sess.run(output))
+   *  
+ *

The resulting value {@code output} would look like this: + *

+   *  [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 * @param input A Tensor. - * @param indices A Tensor. Must be one of the following types: `int32`, `int64`. - * A tensor of indices into `input`. + * @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 `input`. + * 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); } /** * Applies sparse subtraction to individual values or slices in a Variable. - *

- * within a given variable according to `indices`. - *

- * `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. - *

- * `indices` must be integer tensor, containing indices into `ref`. - * It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. - *

- * The innermost dimension of `indices` (with length `K`) corresponds to - * indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th - * dimension of `ref`. - *

- * `updates` is `Tensor` of rank `Q-1+P-K` with shape: - *

{@code
+   *  within a given variable according to {@code indices}.
+   *  

{@code ref} is a {@code Tensor} with rank {@code P} and {@code indices} is a {@code Tensor} of rank {@code Q}. + *

{@code indices} must be integer tensor, containing indices into {@code ref}. + * It must be shape {@code [d_0, ..., d_{Q-2}, K]} where {@code 0 < K <= P}. + *

The innermost dimension of {@code indices} (with length {@code K}) corresponds to + * indices into elements (if {@code K = P}) or slices (if {@code K < P}) along the {@code K}th + * dimension of {@code ref}. + *

{@code updates} is {@code Tensor} of rank {@code Q-1+P-K} with shape: + *

    *  [d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]
-   *  }
- * For example, say we want to subtract 4 scattered elements from a rank-1 tensor + *
+ *

For example, say we want to subtract 4 scattered elements from a rank-1 tensor * with 8 elements. In Python, that subtraction would look like this: - *

{@code
+   *  
    *  ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8])
    *  indices = tf.constant([[4], [3], [1], [7]])
    *  updates = tf.constant([9, 10, 11, 12])
    *  sub = tf.scatter_nd_sub(ref, indices, updates)
    *  with tf.Session() as sess:
    *    print sess.run(sub)
-   *  }
- * The resulting update to ref would look like this: - *

- * [1, -9, 3, -6, -4, 6, 7, -4] - *

- * See `tf.scatter_nd` for more details about how to make updates to + *

+ *

The resulting update to ref would look like this: + *

+   *  [1, -9, 3, -6, -4, 6, 7, -4]
+   *  
+ *

See {@code tf.scatter_nd} for more details about how to make updates to * slices. * - * @param data type for {@code outputRef()} 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. * @param updates A Tensor. Must have the same type as ref. A tensor of updated values * to subtract from ref. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ScatterNdSub} output and operands * @return a new instance of ScatterNdSub */ public ScatterNdSub scatterNdSub(Operand ref, @@ -5490,49 +6113,41 @@ public ScatterNdSub scatterNdSub(Operand ref, } /** - * Applies sparse `updates` to individual values or slices within a given - *

- * variable according to `indices`. - *

- * `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. - *

- * `indices` must be integer tensor, containing indices into `ref`. - * It must be shape \\([d_0, ..., d_{Q-2}, K]\\) where `0 < K <= P`. - *

- * The innermost dimension of `indices` (with length `K`) corresponds to - * indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th - * dimension of `ref`. - *

- * `updates` is `Tensor` of rank `Q-1+P-K` with shape: - *

- * $$[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]].$$ - *

- * For example, say we want to update 4 scattered elements to a rank-1 tensor to + * Applies sparse {@code updates} to individual values or slices within a given + * variable according to {@code indices}. + *

{@code ref} is a {@code Tensor} with rank {@code P} and {@code indices} is a {@code Tensor} of rank {@code Q}. + *

{@code indices} must be integer tensor, containing indices into {@code ref}. + * It must be shape \([d_0, ..., d_{Q-2}, K]\) where {@code 0 < K <= P}. + *

The innermost dimension of {@code indices} (with length {@code K}) corresponds to + * indices into elements (if {@code K = P}) or slices (if {@code K < P}) along the {@code K}th + * dimension of {@code ref}. + *

{@code updates} is {@code Tensor} of rank {@code Q-1+P-K} with shape: + *

$$[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]].$$ + *

For example, say we want to update 4 scattered elements to a rank-1 tensor to * 8 elements. In Python, that update would look like this: - *

{@code
+   *  
    *      ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8])
    *      indices = tf.constant([[4], [3], [1] ,[7]])
    *      updates = tf.constant([9, 10, 11, 12])
    *      update = tf.scatter_nd_update(ref, indices, updates)
    *      with tf.Session() as sess:
    *        print sess.run(update)
-   *  }
- * The resulting update to ref would look like this: - *

- * [1, 11, 3, 10, 9, 6, 7, 12] - *

- * See `tf.scatter_nd` for more details about how to make updates to + *

+ *

The resulting update to ref would look like this: + *

+   *  [1, 11, 3, 10, 9, 6, 7, 12]
+   *  
+ *

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

- * See also `tf.scatter_update` and `tf.batch_scatter_update`. + *

See also {@code tf.scatter_update} and {@code tf.batch_scatter_update}. * - * @param data type for {@code outputRef()} 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. * @param updates A Tensor. Must have the same type as ref. A tensor of updated * values to add to ref. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ScatterNdUpdate} output and operands * @return a new instance of ScatterNdUpdate */ public ScatterNdUpdate scatterNdUpdate(Operand ref, @@ -5542,8 +6157,7 @@ public ScatterNdUpdate scatterNdUpdate(Operand ref, /** * Subtracts sparse updates to a variable reference. - *

- *

{@code
+   *  
    *      # Scalar indices
    *      ref[indices, ...] -= updates[...]
    *
@@ -5552,24 +6166,21 @@ public  ScatterNdUpdate scatterNdUpdate(Operand ref,
    *
    *      # High rank indices (for each i, ..., j)
    *      ref[indices[i, ..., j], ...] -= updates[i, ..., j, ...]
-   *  }
- * This operation outputs `ref` after the update is done. + *
+ * This operation outputs {@code ref} after the update is done. * This makes it easier to chain operations that need to use the reset value. - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

Duplicate entries are handled correctly: if multiple {@code indices} reference * the same location, their (negated) contributions add. - *

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
* - * @param data type for {@code outputRef()} output - * @param ref Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to subtract from `ref`. - * @param options carries optional attributes values + * @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}. + * @param options carries optional attribute values + * @param data type for {@code ScatterSub} output and operands * @return a new instance of ScatterSub */ public ScatterSub scatterSub(Operand ref, @@ -5579,9 +6190,8 @@ public ScatterSub scatterSub(Operand ref, /** * Applies sparse updates to a variable reference. - *

* This operation computes - *

{@code
+   *  
    *      # Scalar indices
    *      ref[indices, ...] = updates[...]
    *
@@ -5590,27 +6200,23 @@ public  ScatterSub scatterSub(Operand ref,
    *
    *      # High rank indices (for each i, ..., j)
    *      ref[indices[i, ..., j], ...] = updates[i, ..., j, ...]
-   *  }
- * This operation outputs `ref` after the update is done. + *
+ *

This operation outputs {@code ref} after the update is done. * This makes it easier to chain operations that need to use the reset value. - *

- * If values in `ref` is to be updated more than once, because there are - * duplicate entries in `indices`, the order at which the updates happen + *

If values in {@code ref} is to be updated more than once, because there are + * duplicate entries in {@code indices}, the order at which the updates happen * for each value is undefined. - *

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
- *

- * See also `tf.batch_scatter_update` and `tf.scatter_nd_update`. + *

See also {@code tf.batch_scatter_update} and {@code tf.scatter_nd_update}. * - * @param data type for {@code outputRef()} output - * @param ref Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to store in `ref`. - * @param options carries optional attributes values + * @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}. + * @param options carries optional attribute values + * @param data type for {@code ScatterUpdate} output and operands * @return a new instance of ScatterUpdate */ public ScatterUpdate scatterUpdate(Operand ref, @@ -5619,44 +6225,57 @@ public ScatterUpdate scatterUpdate(Operand ref, } /** + * The SelectV2 operation * - * @param data type for {@code output()} output - * @param condition - * @param t - * @param e + * @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 */ public Select select(Operand condition, Operand t, Operand e) { 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 `x` and a list `y`, this operation returns a list `out` that - * represents all values that are in `x` but not in `y`. The returned list `out` - * is sorted in the same order that the numbers appear in `x` (duplicates are - * preserved). This operation also returns a list `idx` that represents the - * position of each `out` element in `x`. In other words: - *

- * `out[i] = x[idx[i]] for i in [0, 1, ..., len(out) - 1]` - *

- * For example, given this input: - *

{@code
+   *  Given a list {@code x} and a list {@code y}, this operation returns a list {@code out} that
+   *  represents all values that are in {@code x} but not in {@code y}. The returned list {@code out}
+   *  is sorted in the same order that the numbers appear in {@code x} (duplicates are
+   *  preserved). This operation also returns a list {@code idx} that represents the
+   *  position of each {@code out} element in {@code x}. In other words:
+   *  

{@code out[i] = x[idx[i]] for i in [0, 1, ..., len(out) - 1]} + *

For example, given this input: + *

    *  x = [1, 2, 3, 4, 5, 6]
    *  y = [1, 3, 5]
-   *  }
- * This operation would return: - *
{@code
-   *  out ==> [2, 4, 6]
-   *  idx ==> [1, 3, 5]
-   *  }
+ *
+ *

This operation would return: + *

+   *  out ==> [2, 4, 6]
+   *  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. - * @return a new instance of SetDiff1d + * @param data type for {@code ListDiff} output and operands + * @return a new instance of SetDiff1d, with default output types */ public SetDiff1d setDiff1d(Operand x, Operand y) { return SetDiff1d.create(scope, x, y); @@ -5664,31 +6283,28 @@ public SetDiff1d setDiff1d(Operand x, Operand /** * Computes the difference between two lists of numbers or strings. - *

- * Given a list `x` and a list `y`, this operation returns a list `out` that - * represents all values that are in `x` but not in `y`. The returned list `out` - * is sorted in the same order that the numbers appear in `x` (duplicates are - * preserved). This operation also returns a list `idx` that represents the - * position of each `out` element in `x`. In other words: - *

- * `out[i] = x[idx[i]] for i in [0, 1, ..., len(out) - 1]` - *

- * For example, given this input: - *

{@code
+   *  Given a list {@code x} and a list {@code y}, this operation returns a list {@code out} that
+   *  represents all values that are in {@code x} but not in {@code y}. The returned list {@code out}
+   *  is sorted in the same order that the numbers appear in {@code x} (duplicates are
+   *  preserved). This operation also returns a list {@code idx} that represents the
+   *  position of each {@code out} element in {@code x}. In other words:
+   *  

{@code out[i] = x[idx[i]] for i in [0, 1, ..., len(out) - 1]} + *

For example, given this input: + *

    *  x = [1, 2, 3, 4, 5, 6]
    *  y = [1, 3, 5]
-   *  }
- * This operation would return: - *
{@code
-   *  out ==> [2, 4, 6]
-   *  idx ==> [1, 3, 5]
-   *  }
+ *
+ *

This operation would return: + *

+   *  out ==> [2, 4, 6]
+   *  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 + * @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 */ public SetDiff1d setDiff1d(Operand x, Operand y, @@ -5697,19 +6313,18 @@ public SetDiff1d setDiff1d(Operand } /** - * Number of unique elements along last dimension of input `set`. - *

- * Input `set` is a `SparseTensor` represented by `set_indices`, `set_values`, - * and `set_shape`. The last dimension contains values in a set, duplicates are + * Number of unique elements along last dimension of input {@code set}. + * Input {@code set} is a {@code SparseTensor} represented by {@code set_indices}, {@code set_values}, + * and {@code set_shape}. The last dimension contains values in a set, duplicates are * allowed but ignored. - *

- * If `validate_indices` is `True`, this op validates the order and range of `set` - * indices. - * - * @param setIndices 2D `Tensor`, indices of a `SparseTensor`. - * @param setValues 1D `Tensor`, values of a `SparseTensor`. - * @param setShape 1D `Tensor`, shape of a `SparseTensor`. - * @param options carries optional attributes values + *

If {@code validate_indices} is {@code True}, this op validates the order and range of {@code set} + * 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}. + * @param setShape 1D {@code Tensor}, shape of a {@code SparseTensor}. + * @param options carries optional attribute values * @return a new instance of SetSize */ public SetSize setSize(Operand setIndices, Operand setValues, @@ -5719,18 +6334,15 @@ public SetSize setSize(Operand setIndices, Operand setV /** * Returns the shape of a tensor. - *

- * This operation returns a 1-D integer tensor representing the shape of `input`. - *

- * For example: - *

{@code
+   *  This operation returns a 1-D integer tensor representing the shape of {@code input}.
+   *  

For example: + *

    *  # 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]
-   *  shape(t) ==> [2, 2, 3]
-   *  }
+ * shape(t) ==> [2, 2, 3] + *
* - * @param data type for {@code output()} output - * @param input - * @return a new instance of Shape + * @param input The input value + * @return a new instance of Shape, with default output types */ public org.tensorflow.op.core.Shape shape(Operand input) { return org.tensorflow.op.core.Shape.create(scope, input); @@ -5738,18 +6350,16 @@ public org.tensorflow.op.core.Shape shape(Operand input /** * Returns the shape of a tensor. - *

- * This operation returns a 1-D integer tensor representing the shape of `input`. - *

- * For example: - *

{@code
+   *  This operation returns a 1-D integer tensor representing the shape of {@code input}.
+   *  

For example: + *

    *  # 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]
-   *  shape(t) ==> [2, 2, 3]
-   *  }
+ * shape(t) ==> [2, 2, 3] + *
* - * @param data type for {@code output()} output - * @param input - * @param outType + * @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 */ public org.tensorflow.op.core.Shape shape(Operand input, @@ -5759,47 +6369,41 @@ public org.tensorflow.op.core.Shape shape(Operand - * This operation returns N 1-D integer tensors representing shape of `input[i]s`. + * This operation returns N 1-D integer tensors representing shape of {@code input[i]s}. * - * @param data type for {@code output()} output - * @param input - * @return a new instance of ShapeN + * @param input The input value + * @return a new instance of ShapeN, with default output types */ - public ShapeN shapeN(Iterable> input) { + public ShapeN shapeN(Iterable> input) { return ShapeN.create(scope, input); } /** * Returns shape of tensors. - *

- * This operation returns N 1-D integer tensors representing shape of `input[i]s`. + * This operation returns N 1-D integer tensors representing shape of {@code input[i]s}. * - * @param data type for {@code output()} output - * @param input - * @param outType + * @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 */ - public ShapeN shapeN(Iterable> input, + public ShapeN shapeN(Iterable> input, Class outType) { return ShapeN.create(scope, input, outType); } /** * Returns the size of a tensor. - *

* This operation returns an integer representing the number of elements in - * `input`. - *

- * For example: - *

{@code
+   *  {@code input}.
+   *  

For example: + *

    *  # 't' is [[[1, 1,, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]]
-   *  size(t) ==> 12
-   *  }
+ * size(t) ==> 12 + *
* - * @param data type for {@code output()} output - * @param input - * @return a new instance of Size + * @param input The input value + * @return a new instance of Size, with default output types */ public Size size(Operand input) { return Size.create(scope, input); @@ -5807,19 +6411,17 @@ public Size size(Operand input) { /** * Returns the size of a tensor. - *

* This operation returns an integer representing the number of elements in - * `input`. - *

- * For example: - *

{@code
+   *  {@code input}.
+   *  

For example: + *

    *  # 't' is [[[1, 1,, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]]
-   *  size(t) ==> 12
-   *  }
+ * size(t) ==> 12 + *
* - * @param data type for {@code output()} output - * @param input - * @param outType + * @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 */ public Size size(Operand input, Class outType) { @@ -5831,7 +6433,7 @@ public Size size(Operand input, Class * * @param filename The corpus's text file name. * @param batchSize The size of produced batch. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Skipgram */ public Skipgram skipgram(String filename, Long batchSize, Skipgram.Options... options) { @@ -5840,34 +6442,33 @@ public Skipgram skipgram(String filename, Long batchSize, Skipgram.Options... op /** * Return a slice from 'input'. - *

* The output tensor is a tensor with dimensions described by 'size' * whose values are extracted from 'input' starting at the offsets in * 'begin'. - *

- * Requirements: - * 0 <= begin[i] <= begin[i] + size[i] <= Di for i in [0, n) + *

Requirements: + * 0 <= begin[i] <= begin[i] + size[i] <= Di for i in [0, n) * - * @param data type for {@code output()} output - * @param input + * @param input The input value * @param begin begin[i] specifies the offset into the 'i'th dimension of * 'input' to slice from. - * @param size size[i] specifies the number of elements of the 'i'th dimension + * @param sizeOutput 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]). + * @param data type for {@code Slice} output and operands + * @param data type for {@code Slice} output and operands * @return a new instance of Slice */ public Slice slice(Operand input, Operand begin, - Operand size) { - return Slice.create(scope, input, begin, size); + Operand sizeOutput) { + return Slice.create(scope, input, begin, sizeOutput); } /** * Returns a copy of the input tensor. * - * @param data type for {@code output()} output - * @param input + * @param input The input value + * @param data type for {@code Snapshot} output and operands * @return a new instance of Snapshot */ public Snapshot snapshot(Operand input) { @@ -5876,112 +6477,111 @@ public Snapshot snapshot(Operand input) { /** * SpaceToBatch for N-D tensors of type T. - *

- * This operation divides "spatial" dimensions `[1, ..., M]` of the input into a - * grid of blocks of shape `block_shape`, and interleaves these blocks with the - * "batch" dimension (0) such that in the output, the spatial dimensions - * `[1, ..., M]` correspond to the position within the grid, and the batch + * This operation divides "spatial" dimensions {@code [1, ..., M]} of the input into a + * grid of blocks of shape {@code block_shape}, and interleaves these blocks with the + * "batch" dimension (0) such that in the output, the spatial dimensions + * {@code [1, ..., M]} correspond to the position within the grid, and the batch * dimension combines both the position within a spatial block and the original * batch position. Prior to division into blocks, the spatial dimensions of the - * input are optionally zero padded according to `paddings`. See below for a + * input are optionally zero padded according to {@code paddings}. See below for a * precise description. - * - * @param data type for {@code output()} output - * @param input N-D with shape `input_shape = [batch] + spatial_shape + remaining_shape`, - * where spatial_shape has `M` dimensions. - * @param blockShape 1-D with shape `[M]`, all values must be >= 1. - * @param paddings 2-D with shape `[M, 2]`, all values must be >= 0. - * `paddings[i] = [pad_start, pad_end]` specifies the padding for input dimension - * `i + 1`, which corresponds to spatial dimension `i`. It is required that - * `block_shape[i]` divides `input_shape[i + 1] + pad_start + pad_end`. - *

- * This operation is equivalent to the following steps: - *

- * 1. Zero-pad the start and end of dimensions `[1, ..., M]` of the - * input according to `paddings` to produce `padded` of shape `padded_shape`. - *

- * 2. Reshape `padded` to `reshaped_padded` of shape: - *

- * [batch] + - * [padded_shape[1] / block_shape[0], - * block_shape[0], - * ..., - * padded_shape[M] / block_shape[M-1], - * block_shape[M-1]] + - * remaining_shape - *

- * 3. Permute dimensions of `reshaped_padded` to produce - * `permuted_reshaped_padded` of shape: - *

- * block_shape + - * [batch] + - * [padded_shape[1] / block_shape[0], - * ..., - * padded_shape[M] / block_shape[M-1]] + - * remaining_shape - *

- * 4. Reshape `permuted_reshaped_padded` to flatten `block_shape` into the batch - * dimension, producing an output tensor of shape: - *

- * [batch * prod(block_shape)] + - * [padded_shape[1] / block_shape[0], - * ..., - * padded_shape[M] / block_shape[M-1]] + - * remaining_shape - *

- * Some examples: - *

- * (1) For the following input of shape `[1, 2, 2, 1]`, `block_shape = [2, 2]`, and - * `paddings = [[0, 0], [0, 0]]`: - *

{@code
+   *  

This operation is equivalent to the following steps: + *

    + *
  1. + *

    Zero-pad the start and end of dimensions {@code [1, ..., M]} of the + * input according to {@code paddings} to produce {@code padded} of shape {@code padded_shape}. + *

  2. + *
  3. + *

    Reshape {@code padded} to {@code reshaped_padded} of shape: + *

    [batch] + + * [padded_shape[1] / block_shape[0], + * block_shape[0], + * ..., + * padded_shape[M] / block_shape[M-1], + * block_shape[M-1]] + + * remaining_shape + *

  4. + *
  5. + *

    Permute dimensions of {@code reshaped_padded} to produce + * {@code permuted_reshaped_padded} of shape: + *

    block_shape + + * [batch] + + * [padded_shape[1] / block_shape[0], + * ..., + * padded_shape[M] / block_shape[M-1]] + + * remaining_shape + *

  6. + *
  7. + *

    Reshape {@code permuted_reshaped_padded} to flatten {@code block_shape} into the batch + * dimension, producing an output tensor of shape: + *

    [batch * prod(block_shape)] + + * [padded_shape[1] / block_shape[0], + * ..., + * padded_shape[M] / block_shape[M-1]] + + * remaining_shape + *

  8. + *
+ *

Some examples: + *

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

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

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

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

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

    *  x = [[[[1, 2, 3], [4, 5, 6]],
    *        [[7, 8, 9], [10, 11, 12]]]]
-   *  }
- * The output tensor has shape `[4, 1, 1, 3]` and value: - *
{@code
+   *  
+ *

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

    *  [[[[1, 2, 3]]], [[[4, 5, 6]]], [[[7, 8, 9]]], [[[10, 11, 12]]]]
-   *  }
- * (3) For the following input of shape `[1, 4, 4, 1]`, `block_shape = [2, 2]`, and - * `paddings = [[0, 0], [0, 0]]`: - *
{@code
+   *  
+ *

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

    *  x = [[[[1],   [2],  [3],  [4]],
    *        [[5],   [6],  [7],  [8]],
    *        [[9],  [10], [11],  [12]],
    *        [[13], [14], [15],  [16]]]]
-   *  }
- * The output tensor has shape `[4, 2, 2, 1]` and value: - *
{@code
+   *  
+ *

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

    *  x = [[[[1], [3]], [[9], [11]]],
    *       [[[2], [4]], [[10], [12]]],
    *       [[[5], [7]], [[13], [15]]],
    *       [[[6], [8]], [[14], [16]]]]
-   *  }
- * (4) For the following input of shape `[2, 2, 4, 1]`, block_shape = `[2, 2]`, and - * paddings = `[[0, 0], [2, 0]]`: - *
{@code
+   *  
+ *

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

    *  x = [[[[1],   [2],  [3],  [4]],
    *        [[5],   [6],  [7],  [8]]],
    *       [[[9],  [10], [11],  [12]],
    *        [[13], [14], [15],  [16]]]]
-   *  }
- * The output tensor has shape `[8, 1, 3, 1]` and value: - *
{@code
+   *  
+ *

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

    *  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]]]]
-   *  }
- * Among others, this operation is useful for reducing atrous convolution into + *
+ *

Among others, this operation is useful for reducing atrous convolution into * regular convolution. + * + * @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. + * @param paddings 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}. + * @param data type for {@code SpaceToBatchND} output and operands * @return a new instance of SpaceToBatchNd */ public SpaceToBatchNd spaceToBatchNd(Operand input, @@ -5990,14 +6590,14 @@ public SpaceToBatchNd spaceToBatchNd(Operand input, } /** - * Splits a tensor into `num_split` tensors along one dimension. + * 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 - * `[-rank(value), rank(value))`. + * {@code [-rank(value), rank(value))}. * @param value The tensor to split. * @param numSplit The number of ways to split. Must evenly divide - * `value.shape[split_dim]`. + * {@code value.shape[split_dim]}. + * @param data type for {@code Split} output and operands * @return a new instance of Split */ public Split split(Operand axis, Operand value, Long numSplit) { @@ -6005,16 +6605,16 @@ public Split split(Operand axis, Operand value, } /** - * Splits a tensor into `num_split` tensors along one dimension. + * 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 - * `[-rank(value), rank(value))`. - * @param numSplit + * {@code [-rank(value), rank(value))}. + * @param numSplit The value of the numSplit attribute + * @param data type for {@code SplitV} output and operands * @return a new instance of SplitV */ public SplitV splitV(Operand value, Operand sizeSplits, @@ -6024,26 +6624,24 @@ public SplitV splitV(Operand value, Operand - * Given a tensor `input`, this operation returns a tensor of the same type with + * Given a tensor {@code input}, this operation returns a tensor of the same type with * all dimensions of size 1 removed. If you don't want to remove all size 1 * dimensions, you can remove specific size 1 dimensions by specifying - * `axis`. - *

- * For example: - *

{@code
+   *  {@code axis}.
+   *  

For example: + *

    *  # 't' is a tensor of shape [1, 2, 1, 3, 1, 1]
-   *  shape(squeeze(t)) ==> [2, 3]
-   *  }
- * Or, to remove specific size 1 dimensions: - *
{@code
+   *  shape(squeeze(t)) ==> [2, 3]
+   *  
+ *

Or, to remove specific size 1 dimensions: + *

    *  # 't' is a tensor of shape [1, 2, 1, 3, 1, 1]
-   *  shape(squeeze(t, [2, 4])) ==> [1, 2, 3, 1]
-   *  }
+ * shape(squeeze(t, [2, 4])) ==> [1, 2, 3, 1] + *
* - * @param data type for {@code output()} output - * @param input The `input` to squeeze. - * @param options carries optional attributes values + * @param input The {@code input} to squeeze. + * @param options carries optional attribute values + * @param data type for {@code Squeeze} output and operands * @return a new instance of Squeeze */ public Squeeze squeeze(Operand input, Squeeze.Options... options) { @@ -6051,44 +6649,92 @@ public Squeeze squeeze(Operand input, Squeeze.Options... } /** - * Packs a list of `N` rank-`R` tensors into one rank-`(R+1)` tensor. - *

- * Packs the `N` tensors in `values` into a tensor with rank one higher than each - * tensor in `values`, by packing them along the `axis` dimension. - * Given a list of tensors of shape `(A, B, C)`; - *

- * if `axis == 0` then the `output` tensor will have the shape `(N, A, B, C)`. - * if `axis == 1` then the `output` tensor will have the shape `(A, N, B, C)`. - * Etc. - *

- * For example: - *

{@code
-   *  # 'x' is [1, 4]
-   *  # 'y' is [2, 5]
-   *  # 'z' is [3, 6]
-   *  pack([x, y, z]) => [[1, 4], [2, 5], [3, 6]]  # Pack along first dim.
-   *  pack([x, y, z], axis=1) => [[1, 2, 3], [4, 5, 6]]
-   *  }
- * This is the opposite of `unpack`. + * Packs a list of {@code N} rank-{@code R} tensors into one rank-{@code (R+1)} tensor. + * Packs the {@code N} tensors in {@code values} into a tensor with rank one higher than each + * tensor in {@code values}, by packing them along the {@code axis} dimension. + * Given a list of tensors of shape {@code (A, B, C)}; + *

if {@code axis == 0} then the {@code output} tensor will have the shape {@code (N, A, B, C)}. + * if {@code axis == 1} then the {@code output} tensor will have the shape {@code (A, N, B, C)}. + * Etc. + *

For example: + *

+   *  # 'x' is [1, 4]
+   *  # 'y' is [2, 5]
+   *  # 'z' is [3, 6]
+   *  pack([x, y, z]) => [[1, 4], [2, 5], [3, 6]]  # Pack along first dim.
+   *  pack([x, y, z], axis=1) => [[1, 2, 3], [4, 5, 6]]
+   *  
+ *

This is the opposite of {@code unpack}. + * + * @param values Must be of same shape and type. + * @param options carries optional attribute values + * @param data type for {@code Pack} output and operands + * @return a new instance of Stack + */ + public Stack stack(Iterable> values, Stack.Options... options) { + 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 data type for {@code output()} output - * @param values Must be of same shape and type. - * @param options carries optional attributes values - * @return a new instance of 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 Stack stack(Iterable> values, Stack.Options... options) { - return Stack.create(scope, values, options); + 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 * fewer capabilities and options. This Op is optimized for performance. * * @param values a list of tensors * dtypes A list of data types that inserted values should adhere to. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Stage */ public Stage stage(Iterable> values, Stage.Options... options) { @@ -6098,8 +6744,8 @@ public Stage stage(Iterable> values, Stage.Options... options) { /** * Op removes all elements in the underlying container. * - * @param dtypes - * @param options carries optional attributes values + * @param dtypes The value of the dtypes attribute + * @param options carries optional attribute values * @return a new instance of StageClear */ public StageClear stageClear(List> dtypes, StageClear.Options... options) { @@ -6108,14 +6754,13 @@ public StageClear stageClear(List> dtypes, StageClear.Opt /** * Op peeks at the values at the specified index. If the - *

* underlying container does not contain sufficient elements * this op will block until it does. This Op is optimized for * performance. * - * @param index - * @param dtypes - * @param options carries optional attributes values + * @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 */ public StagePeek stagePeek(Operand index, List> dtypes, @@ -6126,44 +6771,301 @@ public StagePeek stagePeek(Operand index, List> d /** * Op returns the number of elements in the underlying container. * - * @param dtypes - * @param options carries optional attributes values + * @param dtypes The value of the dtypes attribute + * @param options carries optional attribute values * @return a new instance of StageSize */ public StageSize stageSize(List> dtypes, StageSize.Options... options) { return StageSize.create(scope, dtypes, 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;
+   *  }
+   *  ```
+   *  
+ * + * @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 StatefulCase + */ + public StatefulCase statefulCase(Operand branchIndex, Iterable> input, + List> Tout, List branches, Case.Options... options) { + return StatefulCase.create(scope, branchIndex, input, Tout, branches, options); + } + + /** + * output = cond ? then_branch(input) : else_branch(input) + * + * @param cond
+   *    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.
+   *  
+ * @param input A list of input tensors. + * @param Tout A list of output types. + * @param thenBranch
+   *    A function that takes 'inputs' and returns a list of tensors, whose
+   *    types are the same as what else_branch returns.
+   *  
+ * @param elseBranch
+   *  A function that takes 'inputs' and returns a list of tensors, whose
+   *  types are the same as what then_branch returns.
+   *  
+ * @param options carries optional attribute values + * @return a new instance of StatefulIf + */ + public StatefulIf statefulIf(Operand cond, Iterable> input, + List> Tout, ConcreteFunction thenBranch, ConcreteFunction elseBranch, + If.Options... options) { + return StatefulIf.create(scope, cond, input, Tout, thenBranch, elseBranch, options); + } + + /** + * returns {@code f(inputs)}, where {@code f}'s body is placed and partitioned. + * + * @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. This op is
+   *    stateful.
+   *  
+ * @param options carries optional attribute values + * @return a new instance of StatefulPartitionedCall + */ + public StatefulPartitionedCall statefulPartitionedCall(Iterable> args, + List> Tout, ConcreteFunction f, + StatefulPartitionedCall.Options... options) { + return StatefulPartitionedCall.create(scope, args, Tout, f, options); + } + + /** + * output = input; While (Cond(output)) { output = Body(output) } + * + * @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.
+   *  
+ * @param options carries optional attribute values + * @return a new instance of StatefulWhile + */ + public StatefulWhile statefulWhile(Iterable> input, ConcreteFunction cond, + ConcreteFunction body, While.Options... options) { + 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) + * + * @param cond
+   *    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.
+   *  
+ * @param input A list of input tensors. + * @param Tout A list of output types. + * @param thenBranch
+   *    A function that takes 'inputs' and returns a list of tensors, whose
+   *    types are the same as what else_branch returns.
+   *  
+ * @param elseBranch
+   *  A function that takes 'inputs' and returns a list of tensors, whose
+   *  types are the same as what then_branch returns.
+   *  
+ * @param options carries optional attribute values + * @return a new instance of StatelessIf + */ + public StatelessIf statelessIf(Operand cond, Iterable> input, + List> Tout, ConcreteFunction thenBranch, ConcreteFunction elseBranch, + If.Options... options) { + return StatelessIf.create(scope, cond, input, Tout, thenBranch, elseBranch, options); + } + + /** + * output = input; While (Cond(output)) { output = Body(output) } + * + * @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.
+   *
+   *    This should only be used when the while condition and body functions
+   *    do not have stateful ops.
+   *  
+ * @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.
+   *  
+ * @param options carries optional attribute values + * @return a new instance of StatelessWhile + */ + public StatelessWhile statelessWhile(Iterable> input, ConcreteFunction cond, + ConcreteFunction body, While.Options... options) { + 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. - *

- * When building ops to compute gradients, this op prevents the contribution of + *

When building ops to compute gradients, this op prevents the contribution of * its inputs to be taken into account. Normally, the gradient generator adds ops * to a graph to compute the derivatives of a specified 'loss' by recursively * finding out inputs that contributed to its computation. If you insert this op * in the graph it inputs are masked from the gradient generator. They are not * taken into account for computing gradients. - *

- * This is useful any time you want to compute a value with TensorFlow but need - * to pretend that the value was a constant. Some examples include: + *

This is useful any time you want to compute a value with TensorFlow but need + * to pretend that the value was a constant. For example, the softmax function + * for a vector x can be written as + *

+   *
+   *    def softmax(x):
+   *      numerator = tf.exp(x)
+   *      denominator = tf.reduce_sum(numerator)
+   *      return numerator / denominator
+   *  
+ *

This however is susceptible to overflow if the values in x are large. An + * alternative more stable way is to subtract the maximum of x from each of the + * values. + *

+   *
+   *    def stable_softmax(x):
+   *      z = x - tf.reduce_max(x)
+   *      numerator = tf.exp(z)
+   *      denominator = tf.reduce_sum(numerator)
+   *      return numerator / denominator
+   *  
+ *

However, when we backprop through the softmax to x, we dont want to backprop + * through the {@code tf.reduce_max(x)} (if the max values are not unique then the + * gradient could flow to the wrong input) calculation and treat that as a + * constant. Therefore, we should write this out as + *

+   *
+   *    def stable_softmax(x):
+   *      z = x - tf.stop_gradient(tf.reduce_max(x))
+   *      numerator = tf.exp(z)
+   *      denominator = tf.reduce_sum(numerator)
+   *      return numerator / denominator
+   *  
+ *

Some other examples include: *

    - *
  • - * The EM algorithm where the M-step should not involve backpropagation - * through the output of the E-step. - *
  • - *
  • - * Contrastive divergence training of Boltzmann machines where, when - * differentiating the energy function, the training must not backpropagate - * through the graph that generated the samples from the model. - *
  • - *
  • - * Adversarial training, where no backprop should happen through the adversarial - * example generation process. + *
  • The EM algorithm where the M-step should not involve backpropagation + * through the output of the E-step.
  • + *
  • Contrastive divergence training of Boltzmann machines where, when + * differentiating the energy function, the training must not backpropagate + * through the graph that generated the samples from the model.
  • + *
  • Adversarial training, where no backprop should happen through the adversarial + * example generation process.
  • + *
* - * @param data type for {@code output()} output - * @param input + * @param input The input value + * @param data type for {@code StopGradient} output and operands * @return a new instance of StopGradient */ public StopGradient stopGradient(Operand input) { @@ -6172,159 +7074,176 @@ 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. - * - * @param scope current scope + * + *

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); } /** - * Return a strided slice from `input`. - *

- * Note, most python users will want to use the Python `Tensor.__getitem__` - * or `Variable.__getitem__` rather than this op directly. - *

- * 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 + * Return a strided slice from {@code input}. + * Note, most python users will want to use the Python {@code Tensor.__getitem__} + * or {@code Variable.__getitem__} rather than this op directly. + *

The goal of this op is to produce a new tensor with a subset of + * the elements from the {@code n} dimensional {@code input} tensor. The subset is chosen using + * a sequence of {@code 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 + * {@code m} could be equal to {@code n}, but this need not be the case. Each * range specification entry can be one of the following: - *

- * - An ellipsis (...). Ellipses are used to imply zero or more - * dimensions of full-dimension selection and are produced using - * `ellipsis_mask`. For example, `foo[...]` is the identity slice. - *

- * - A new axis. This is used to insert a new shape=1 dimension and is - * produced using `new_axis_mask`. For example, `foo[:, ...]` where - * `foo` is shape `(3, 4)` produces a `(1, 3, 4)` tensor. - *

- * - A range `begin:end:stride`. This is used to specify how much to choose from - * a given dimension. `stride` can be any integer but 0. `begin` is an integer - * which represents the index of the first value to select while `end` represents - * the index of the last value to select. The number of values selected in each - * dimension is `end - begin` if `stride > 0` and `begin - end` if `stride < 0`. - * `begin` and `end` can be negative where `-1` is the last element, `-2` is - * the second to last. `begin_mask` controls whether to replace the explicitly - * given `begin` with an implicit effective value of `0` if `stride > 0` and - * `-1` if `stride < 0`. `end_mask` is analogous but produces the number - * required to create the largest open interval. For example, given a shape - * `(3,)` tensor `foo[:]`, the effective `begin` and `end` are `0` and `3`. Do - * not assume this is equivalent to `foo[0:-1]` which has an effective `begin` - * and `end` of `0` and `2`. Another example is `foo[-2::-1]` which reverses the - * first dimension of a tensor while dropping the last two (in the original - * order elements). For example `foo = [1,2,3,4]; foo[-2::-1]` is `[4,3]`. - *

- * - A single index. This is used to keep only elements that have a given - * index. For example (`foo[2, :]` on a shape `(5,6)` tensor produces a - * shape `(6,)` tensor. This is encoded in `begin` and `end` and - * `shrink_axis_mask`. - *

- * Each conceptual range specification is encoded in the op's argument. This + *

    + *
  • + *

    An ellipsis (...). Ellipses are used to imply zero or more + * dimensions of full-dimension selection and are produced using + * {@code ellipsis_mask}. For example, {@code foo[...]} is the identity slice. + *

  • + *
  • + *

    A new axis. This is used to insert a new shape=1 dimension and is + * produced using {@code new_axis_mask}. For example, {@code foo[:, ...]} where + * {@code foo} is shape {@code (3, 4)} produces a {@code (1, 3, 4)} tensor. + *

  • + *
  • + *

    A range {@code begin:end:stride}. 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. 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. {@code begin_mask} controls whether to replace the explicitly + * given {@code begin} with an implicit effective value of {@code 0} if {@code stride > 0} and + * {@code -1} if {@code stride < 0}. {@code end_mask} is analogous but produces the number + * required to create the largest open interval. For example, given a shape + * {@code (3,)} tensor {@code foo[:]}, the effective {@code begin} and {@code end} are {@code 0} and {@code 3}. Do + * not assume this is equivalent to {@code foo[0:-1]} which has an effective {@code begin} + * and {@code end} of {@code 0} and {@code 2}. Another example is {@code foo[-2::-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]; foo[-2::-1]} is {@code [4,3]}. + *

  • + *
  • + *

    A single index. This is used to keep only elements that have a given + * index. For example ({@code foo[2, :]} on a shape {@code (5,6)} tensor produces a + * shape {@code (6,)} tensor. This is encoded in {@code begin} and {@code end} and + * {@code shrink_axis_mask}. + *

  • + *
+ *

Each conceptual range specification is encoded in the op's argument. This * encoding is best understand by considering a non-trivial example. In * particular, - * `foo[1, 2:4, None, ..., :-3:-1, :]` will be encoded as - *

{@code
+   *  {@code foo[1, 2:4, None, ..., :-3:-1, :]} will be encoded as
+   *  
    *  begin = [1, 2, x, x, 0, x] # x denotes don't care (usually 0)
    *  end = [2, 4, x, x, -3, x]
    *  strides = [1, 1, x, x, -1, 1]
-   *  begin_mask = 1<<4 | 1<<5 = 48
-   *  end_mask = 1<<5 = 32
-   *  ellipsis_mask = 1<<3 = 8
-   *  new_axis_mask = 1<<2 = 4
-   *  shrink_axis_mask = 1<<0 = 1
-   *  }
- * In this case if `foo.shape` is (5, 5, 5, 5, 5, 5) the final shape of + * begin_mask = 1<<4 | 1<<5 = 48 + * end_mask = 1<<5 = 32 + * ellipsis_mask = 1<<3 = 8 + * new_axis_mask = 1<<2 = 4 + * shrink_axis_mask = 1<<0 = 1 + *
+ *

In this case if {@code foo.shape} is (5, 5, 5, 5, 5, 5) the final shape of * the slice becomes (2, 1, 5, 5, 2, 5). * Let us walk step by step through each argument specification. - *

- * 1. The first argument in the example slice is turned into `begin = 1` and - * `end = begin + 1 = 2`. To disambiguate from the original spec `2:4` we - * also set the appropriate bit in `shrink_axis_mask`. - *

- * 2. `2:4` is contributes 2, 4, 1 to begin, end, and stride. All masks have + *

    + *
  1. + *

    The first argument in the example slice is turned into {@code begin = 1} and + * {@code end = begin + 1 = 2}. To disambiguate from the original spec {@code 2:4} we + * also set the appropriate bit in {@code shrink_axis_mask}. + *

  2. + *
  3. + *

    {@code 2:4} is contributes 2, 4, 1 to begin, end, and stride. All masks have * zero bits contributed. - *

    - * 3. None is a synonym for `tf.newaxis`. This means insert a dimension of size 1 + *

  4. + *
  5. + *

    None is a synonym for {@code tf.newaxis}. This means insert a dimension of size 1 * dimension in the final shape. Dummy values are contributed to begin, * end and stride, while the new_axis_mask bit is set. - *

    - * 4. `...` grab the full ranges from as many dimensions as needed to + *

  6. + *
  7. + *

    {@code ...} grab the full ranges from as many dimensions as needed to * fully specify a slice for every dimension of the input shape. - *

    - * 5. `:-3:-1` shows the use of negative indices. A negative index `i` associated - * with a dimension that has shape `s` is converted to a positive index - * `s + i`. So `-1` becomes `s-1` (i.e. the last element). This conversion + *

  8. + *
  9. + *

    {@code :-3:-1} shows the use of negative indices. A negative index {@code i} associated + * with a dimension that has shape {@code s} is converted to a positive index + * {@code s + i}. So {@code -1} becomes {@code s-1} (i.e. the last element). This conversion * is done internally so begin, end and strides receive x, -3, and -1. * The appropriate begin_mask bit is set to indicate the start range is the * full range (ignoring the x). - *

    - * 6. `:` indicates that the entire contents of the corresponding dimension - * is selected. This is equivalent to `::` or `0::1`. begin, end, and strides - * receive 0, 0, and 1, respectively. The appropriate bits in `begin_mask` and - * `end_mask` are also set. - *

    - * Requirements: - * `0 != strides[i] for i in [0, m)` - * `ellipsis_mask must be a power of two (only one ellipsis)` + *

  10. + *
  11. + *

    {@code :} indicates that the entire contents of the corresponding dimension + * is selected. This is equivalent to {@code ::} or {@code 0::1}. begin, end, and strides + * receive 0, 0, and 1, respectively. The appropriate bits in {@code begin_mask} and + * {@code end_mask} are also set. + *

  12. + *
+ *

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 - * @param input - * @param begin `begin[k]` specifies the offset into the `k`th range specification. + * @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 `k`th bit of - * `begin_mask` then `begin[k]` is ignored and the full range of the + * 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 `foo==[1,2,3]` then `foo[-1]==3`. - * @param end `end[i]` is like `begin` with the exception that `end_mask` is + * to start from the highest element e.g. If {@code foo==[1,2,3]} then {@code foo[-1]==3}. + * @param end {@code end[i]} is like {@code begin} with the exception that {@code end_mask} is * used to determine full ranges. - * @param strides `strides[i]` specifies the increment in the `i`th specification + * @param strides {@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 `[0,dim[i]) if slice[i]>0` or `[-1,dim[i]-1] if slice[i] < 0` - * @param options carries optional attributes values + * clamped to {@code [0,dim[i]) if slice[i]>0} or {@code [-1,dim[i]-1] if slice[i] < 0} + * @param options carries optional attribute values + * @param data type for {@code StridedSlice} output and operands + * @param data type for {@code StridedSlice} output and operands * @return a new instance of StridedSlice */ public StridedSlice stridedSlice(Operand input, @@ -6334,20 +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 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...) */ public StridedSliceAssign stridedSliceAssign(Operand ref, Operand value, Index... indices) { @@ -6355,22 +7275,21 @@ public StridedSliceAssign stridedSliceAssign(Operand ref } /** - * 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`. + * Assign {@code value} to the sliced l-value reference of {@code ref}. + * The values of {@code value} are assigned to the positions in the variable + * {@code ref} that are selected by the slice parameters. The slice parameters + * {@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 outputRef()} output - * @param ref - * @param begin - * @param end - * @param strides - * @param value - * @param options carries optional attributes values + * @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 * @return a new instance of StridedSliceAssign */ public StridedSliceAssign stridedSliceAssign( @@ -6380,24 +7299,23 @@ public StridedSliceAssign stridedSliceAs } /** - * Returns the gradient of `StridedSlice`. - *

- * Since `StridedSlice` cuts out pieces of its `input` which is size - * `shape`, its gradient will have the same shape (which is passed here - * as `shape`). The gradient will be zero in any element that the slice + * Returns the gradient of {@code StridedSlice}. + * Since {@code StridedSlice} cuts out pieces of its {@code input} which is size + * {@code shape}, its gradient will have the same shape (which is passed here + * as {@code shape}). The gradient will be zero in any element that the slice * does not select. - *

- * Arguments are the same as StridedSliceGrad with the exception that - * `dy` is the input gradient to be propagated and `shape` is the - * shape of `StridedSlice`'s `input`. - * - * @param data type for {@code output()} output - * @param shape - * @param begin - * @param end - * @param strides - * @param dy - * @param options carries optional attributes values + *

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 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 * @return a new instance of StridedSliceGrad */ public StridedSliceGrad stridedSliceGrad(Operand shape, @@ -6408,17 +7326,16 @@ public StridedSliceGrad stridedSliceGrad /** * Computes the sum of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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 * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values + * @param data type for {@code Sum} output and operands * @return a new instance of Sum */ public Sum sum(Operand input, Operand axis, @@ -6427,44 +7344,49 @@ public Sum sum(Operand input, Operand } /** - * Forwards `data` to the output port determined by `pred`. - *

- * If `pred` is true, the `data` input is forwarded to `output_true`. Otherwise, - * the data goes to `output_false`. - *

- * See also `RefSwitch` and `Merge`. + * Forwards {@code data} to the output port determined by {@code pred}. + * 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 outputFalse()} 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 * @return a new instance of SwitchCond */ public SwitchCond switchCond(Operand data, Operand pred) { return SwitchCond.create(scope, data, pred); } + /** + * 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. + * + * @return a new instance of SyncDevice + */ + public SyncDevice syncDevice() { + return SyncDevice.create(scope); + } + /** * Returns a tensor that may be mutated, but only persists within a single step. - *

* This is an experimental op for internal use only and it is possible to use this * op in unsafe ways. DO NOT USE unless you fully understand the risks. - *

- * It is the caller's responsibility to ensure that 'ref' is eventually passed to a + *

It is the caller's responsibility to ensure that 'ref' is eventually passed to a * matching 'DestroyTemporaryVariable' op after all other uses have completed. - *

- * Outputs a ref to the tensor state so it may be read or modified. - *

- * E.g. - * var = state_ops._temporary_variable([1, 2], types.float_) - * var_name = var.op.name - * 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 + *

Outputs a ref to the tensor state so it may be read or modified. + *

E.g. + * var = state_ops.temporary_variable([1, 2], types.float) + * var_name = var.op.name + * 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 shape The shape of the variable tensor. * @param dtype The type of elements in the variable tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code TemporaryVariable} output and operands * @return a new instance of TemporaryVariable */ public TemporaryVariable temporaryVariable(Shape shape, Class dtype, @@ -6474,72 +7396,68 @@ public TemporaryVariable temporaryVariable(Shape shape, Cla /** * An array of Tensors of given size. - *

* Write data via Write and read via Read or Pack. * - * @param size The size of the array. + * @param sizeOutput The size of the array. * @param dtype The type of the elements on the tensor_array. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code TensorArrayV3} output and operands * @return a new instance of TensorArray */ - public TensorArray tensorArray(Operand size, Class dtype, + public TensorArray tensorArray(Operand sizeOutput, Class dtype, TensorArray.Options... options) { - return TensorArray.create(scope, size, dtype, options); + return TensorArray.create(scope, sizeOutput, dtype, options); } /** * Delete the TensorArray from its resource container. - *

* This enables the user to close and release the resource in the middle * of a step/run. * * @param handle The handle to a TensorArray (output of TensorArray or TensorArrayGrad). * @return a new instance of TensorArrayClose */ - public TensorArrayClose tensorArrayClose(Operand handle) { + public TensorArrayClose tensorArrayClose(Operand handle) { return TensorArrayClose.create(scope, handle); } /** - * Concat the elements from the TensorArray into value `value`. - *

- * Takes `T` elements of shapes - *

- *

{@code
-   *    (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 ...)}
- * All elements must have the same shape (excepting the first dimension). + * Concat the elements from the TensorArray into value {@code value}. + * Takes {@code T} elements of shapes + *
+   *  (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: + *

+   *  (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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code TensorArrayConcatV3} output and operands * @return a new instance of TensorArrayConcat */ - public TensorArrayConcat tensorArrayConcat(Operand handle, + public TensorArrayConcat tensorArrayConcat(Operand handle, Operand flowIn, Class dtype, TensorArrayConcat.Options... options) { return TensorArrayConcat.create(scope, handle, flowIn, dtype, options); } /** - * Gather specific elements from the TensorArray into output `value`. - *

- * All elements selected by `indices` must have the same shape. + * 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 * @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. * @param dtype The type of the elem that is returned. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code TensorArrayGatherV3} output and operands * @return a new instance of TensorArrayGather */ - public TensorArrayGather tensorArrayGather(Operand handle, + public TensorArrayGather tensorArrayGather(Operand handle, Operand indices, Operand flowIn, Class dtype, TensorArrayGather.Options... options) { return TensorArrayGather.create(scope, handle, indices, flowIn, dtype, options); @@ -6547,14 +7465,10 @@ public TensorArrayGather tensorArrayGather(Operand handl /** * Creates a TensorArray for storing the gradients of values in the given handle. - *

* If the given TensorArray gradient already exists, returns a reference to it. - *

- * Locks the size of the original TensorArray by disabling its dynamic size flag. - *

- * *A note about the input flow_in:** - *

- * The handle flow_in forces the execution of the gradient lookup to occur + *

Locks the size of the original TensorArray by disabling its dynamic size flag. + *

A note about the input flow_in: + *

The handle flow_in forces the execution of the gradient lookup to occur * only after certain other operations have occurred. For example, when * the forward TensorArray is dynamically sized, writes to this TensorArray * may resize the object. The gradient TensorArray is statically sized based @@ -6562,26 +7476,21 @@ public TensorArrayGather tensorArrayGather(Operand handl * Furthermore, the size of the forward TensorArray is frozen by this call. * As a result, the flow is used to ensure that the call to generate the gradient * TensorArray only happens after all writes are executed. - *

- * In the case of dynamically sized TensorArrays, gradient computation should + *

In the case of dynamically sized TensorArrays, gradient computation should * only be performed on read operations that have themselves been chained via * flow to occur only after all writes have executed. That way the final size * of the forward TensorArray is known when this operation is called. - *

- * *A note about the source attribute:** - *

- * TensorArray gradient calls use an accumulator TensorArray object. If + *

A note about the source attribute: + *

TensorArray gradient calls use an accumulator TensorArray object. If * multiple gradients are calculated and run in the same session, the multiple * gradient nodes may accidentally flow through the same accumulator TensorArray. * This double counts and generally breaks the TensorArray gradient flow. - *

- * The solution is to identify which gradient call this particular + *

The solution is to identify which gradient call this particular * TensorArray gradient is being called in. This is performed by identifying - * a unique string (e.g. "gradients", "gradients_1", ...) from the input + * a unique string (e.g. "gradients", "gradients_1", ...) from the input * gradient Tensor's name. This string is used as a suffix when creating - * the TensorArray gradient object here (the attribute `source`). - *

- * The attribute `source` is added as a suffix to the forward TensorArray's + * the TensorArray gradient object here (the attribute {@code source}). + *

The attribute {@code source} is added as a suffix to the forward TensorArray's * name when performing the creation / lookup, so that each separate gradient * calculation gets its own TensorArray accumulator. * @@ -6591,14 +7500,13 @@ public TensorArrayGather tensorArrayGather(Operand handl * to return. * @return a new instance of TensorArrayGrad */ - public TensorArrayGrad tensorArrayGrad(Operand handle, Operand flowIn, + public TensorArrayGrad tensorArrayGrad(Operand handle, Operand flowIn, String source) { return TensorArrayGrad.create(scope, handle, flowIn, source); } /** * Creates a TensorArray for storing multiple gradients of values in the given handle. - *

* Similar to TensorArrayGradV3. However it creates an accumulator with an * expanded shape compared to the input TensorArray whose gradient is being * computed. This enables multiple gradients for the same TensorArray to be @@ -6613,18 +7521,19 @@ public TensorArrayGrad tensorArrayGrad(Operand handle, Operand flow * to return. * @return a new instance of TensorArrayGradWithShape */ - public TensorArrayGradWithShape tensorArrayGradWithShape(Operand handle, + public TensorArrayGradWithShape tensorArrayGradWithShape(Operand handle, Operand flowIn, Operand shapeToPrepend, String source) { return TensorArrayGradWithShape.create(scope, handle, flowIn, shapeToPrepend, source); } /** + * The TensorArrayPack operation * - * @param data type for {@code value()} output - * @param handle - * @param flowIn - * @param dtype - * @param options carries optional attributes values + * @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 */ public TensorArrayPack tensorArrayPack(Operand handle, @@ -6633,24 +7542,23 @@ public TensorArrayPack tensorArrayPack(Operand han } /** - * Read an element from the TensorArray into output `value`. + * 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 + * @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 * @return a new instance of TensorArrayRead */ - public TensorArrayRead tensorArrayRead(Operand handle, + public TensorArrayRead tensorArrayRead(Operand handle, Operand index, Operand flowIn, Class dtype) { return TensorArrayRead.create(scope, handle, index, flowIn, dtype); } /** * Scatter the data from the input value into specific TensorArray elements. - *

- * `indices` must be a vector, its length must match the first dim of `value`. + * {@code indices} must be a vector, its length must match the first dim of {@code value}. * * @param handle The handle to a TensorArray. * @param indices The locations at which to write the tensor elements. @@ -6658,8 +7566,8 @@ public TensorArrayRead tensorArrayRead(Operand handle, * @param flowIn A float scalar that enforces proper chaining of operations. * @return a new instance of TensorArrayScatter */ - public TensorArrayScatter tensorArrayScatter(Operand handle, Operand indices, - Operand value, Operand flowIn) { + public TensorArrayScatter tensorArrayScatter(Operand handle, + Operand indices, Operand value, Operand flowIn) { return TensorArrayScatter.create(scope, handle, indices, value, flowIn); } @@ -6670,33 +7578,30 @@ public TensorArrayScatter tensorArrayScatter(Operand handle, Operand * @param flowIn A float scalar that enforces proper chaining of operations. * @return a new instance of TensorArraySize */ - public TensorArraySize tensorArraySize(Operand handle, Operand flowIn) { + public TensorArraySize tensorArraySize(Operand handle, + Operand flowIn) { return TensorArraySize.create(scope, handle, flowIn); } /** * Split the data from the input value into TensorArray elements. - *

- * Assuming that `lengths` takes on values - *

- *

{@code
-   *  (n0, n1, ..., n(T-1))}
- * and that `value` has shape - *

- *

{@code
-   *  (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, ...)}
- * and having size - *

- *

{@code
-   *  nt x d0 x d1 x ...}
+ * Assuming that {@code lengths} takes on values + *
+   *  (n0, n1, ..., n(T-1))
+   *  
+ *

and that {@code value} has shape + *

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

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

and having size + *

+   *  nt x d0 x d1 x ...
+   *  
* * @param handle The handle to a TensorArray. * @param value The concatenated tensor to write to the TensorArray. @@ -6705,16 +7610,17 @@ public TensorArraySize tensorArraySize(Operand handle, Operand flow * @param flowIn A float scalar that enforces proper chaining of operations. * @return a new instance of TensorArraySplit */ - public TensorArraySplit tensorArraySplit(Operand handle, Operand value, - Operand lengths, Operand flowIn) { + public TensorArraySplit tensorArraySplit(Operand handle, + Operand value, Operand lengths, Operand flowIn) { return TensorArraySplit.create(scope, handle, value, lengths, flowIn); } /** + * The TensorArrayUnpack operation * - * @param handle - * @param value - * @param flowIn + * @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, @@ -6731,76 +7637,74 @@ public TensorArrayUnpack tensorArrayUnpack(Operand handle, * @param flowIn A float scalar that enforces proper chaining of operations. * @return a new instance of TensorArrayWrite */ - public TensorArrayWrite tensorArrayWrite(Operand handle, Operand index, + public TensorArrayWrite tensorArrayWrite(Operand handle, Operand index, Operand value, Operand flowIn) { return TensorArrayWrite.create(scope, handle, index, value, flowIn); } /** * Concats all tensors in the list along the 0th dimension. - *

* Requires that all tensors have the same shape except the first dimension. - *

- * input_handle: The input list. + *

input_handle: The input list. * element_shape: The shape of the uninitialized elements in the list. If the first - * dimension is not -1, it is assumed that all list elements have the same - * leading dim. + * dimension is not -1, it is assumed that all list elements have the same + * leading dim. * leading_dims: The list of leading dims of uninitialized list elements. Used if - * the leading dim of input_handle.element_shape or the element_shape input arg - * is not already set. + * the leading dim of input_handle.element_shape or the element_shape input arg + * 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 - * @param inputHandle - * @param elementShape - * @param leadingDims - * @param elementDtype + * @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 */ - public TensorListConcat tensorListConcat(Operand inputHandle, - Operand elementShape, Operand leadingDims, Class elementDtype) { + public TensorListConcat tensorListConcat( + Operand inputHandle, Operand elementShape, + Operand leadingDims, Class elementDtype) { return TensorListConcat.create(scope, inputHandle, elementShape, leadingDims, elementDtype); } /** + * The TensorListConcatLists operation * - * @param inputA - * @param inputB - * @param elementDtype + * @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 */ - public TensorListConcatLists tensorListConcatLists(Operand inputA, - Operand inputB, Class elementDtype) { + public TensorListConcatLists tensorListConcatLists( + Operand inputA, Operand inputB, Class elementDtype) { return TensorListConcatLists.create(scope, inputA, inputB, elementDtype); } /** * 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 + * input_handle: the list + * element_shape: the shape of elements of the list * - * @param data type for {@code elementShape()} output - * @param inputHandle - * @param shapeType + * @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 */ public TensorListElementShape tensorListElementShape( - Operand inputHandle, Class shapeType) { + Operand inputHandle, Class shapeType) { return TensorListElementShape.create(scope, inputHandle, shapeType); } /** - * Creates a TensorList which, when stacked, has the value of `tensor`. - *

+ * Creates a TensorList which, when stacked, has the value of {@code tensor}. * Each tensor in the result list corresponds to one row of the input tensor. - *

- * tensor: The input tensor. + *

tensor: The input tensor. * output_handle: The list. * - * @param tensor - * @param elementShape + * @param tensor The tensor value + * @param elementShape The elementShape value * @return a new instance of TensorListFromTensor */ public TensorListFromTensor tensorListFromTensor(Operand tensor, @@ -6810,114 +7714,115 @@ public TensorListFromTensor tensorListFromTensor(Operand tensor /** * Creates a Tensor by indexing into the TensorList. - *

* Each row in the produced Tensor corresponds to the element in the TensorList - * specified by the given index (see `tf.gather`). - *

- * input_handle: The input tensor list. + * specified by the given index (see {@code tf.gather}). + *

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 - * @param inputHandle - * @param indices - * @param elementShape - * @param elementDtype + * @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 */ - public TensorListGather tensorListGather(Operand inputHandle, - Operand indices, Operand elementShape, Class elementDtype) { + public TensorListGather tensorListGather( + Operand inputHandle, Operand indices, Operand elementShape, + Class elementDtype) { return TensorListGather.create(scope, inputHandle, indices, elementShape, elementDtype); } /** + * 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 - * @param index - * @param elementShape - * @param elementDtype + * @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 */ - public TensorListGetItem tensorListGetItem(Operand inputHandle, - Operand index, Operand elementShape, Class elementDtype) { + public TensorListGetItem tensorListGetItem( + Operand inputHandle, Operand index, + Operand elementShape, Class elementDtype) { return TensorListGetItem.create(scope, inputHandle, index, elementShape, elementDtype); } /** * Returns the number of tensors in the input tensor list. - *

* input_handle: the input list * length: the number of tensors in the list * - * @param inputHandle + * @param inputHandle The inputHandle value * @return a new instance of TensorListLength */ - public TensorListLength tensorListLength(Operand inputHandle) { + public TensorListLength tensorListLength(Operand inputHandle) { return TensorListLength.create(scope, inputHandle); } /** * Returns the last element of the input list as well as a list with all but that element. - *

* Fails if the list is empty. - *

- * input_handle: the input list + *

input_handle: the input list * 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 - * @param inputHandle - * @param elementShape - * @param elementDtype + * @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 */ - public TensorListPopBack tensorListPopBack(Operand inputHandle, - Operand elementShape, Class elementDtype) { + public TensorListPopBack tensorListPopBack( + Operand inputHandle, Operand elementShape, Class elementDtype) { return TensorListPopBack.create(scope, inputHandle, elementShape, elementDtype); } /** - * Returns a list which has the passed-in `Tensor` as last element and the other elements of the given list in `input_handle`. - *

+ * Returns a list which has the passed-in {@code Tensor} as last element and the other elements of the given list in {@code input_handle}. * tensor: The tensor to put on the list. * input_handle: The old list. * output_handle: A list with the elements of the old list followed by tensor. * element_dtype: the type of elements in the list. * element_shape: a shape compatible with that of elements in the list. * - * @param inputHandle - * @param tensor + * @param inputHandle The inputHandle value + * @param tensor The tensor value * @return a new instance of TensorListPushBack */ - public TensorListPushBack tensorListPushBack(Operand inputHandle, + public TensorListPushBack tensorListPushBack(Operand inputHandle, Operand tensor) { return TensorListPushBack.create(scope, inputHandle, tensor); } /** + * The TensorListPushBackBatch operation * - * @param inputHandles - * @param tensor + * @param inputHandles The inputHandles value + * @param tensor The tensor value * @return a new instance of TensorListPushBackBatch */ - public TensorListPushBackBatch tensorListPushBackBatch(Operand inputHandles, + public TensorListPushBackBatch tensorListPushBackBatch(Operand inputHandles, Operand tensor) { return TensorListPushBackBatch.create(scope, inputHandles, tensor); } /** * List of the given size with empty elements. - *

* element_shape: the shape of the future elements of the list * num_elements: the number of elements to reserve * handle: the output list * element_dtype: the desired type of elements in the list. * - * @param elementShape - * @param numElements - * @param elementDtype + * @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 */ public TensorListReserve tensorListReserve( @@ -6927,38 +7832,35 @@ public TensorListReserve tensorListReserve( /** * Resizes the list. - *

- * * input_handle: the input list * size: size of the output list * - * @param inputHandle - * @param size + * @param inputHandle The inputHandle value + * @param sizeOutput The sizeOutput value * @return a new instance of TensorListResize */ - public TensorListResize tensorListResize(Operand inputHandle, Operand size) { - return TensorListResize.create(scope, inputHandle, size); + public TensorListResize tensorListResize(Operand inputHandle, + Operand sizeOutput) { + return TensorListResize.create(scope, inputHandle, sizeOutput); } /** * Creates a TensorList by indexing into a Tensor. - *

* Each member of the TensorList corresponds to one row of the input tensor, - * specified by the given index (see `tf.gather`). - *

- * tensor: The input tensor. + * specified by the given index (see {@code tf.gather}). + *

tensor: The input tensor. * indices: The indices used to index into the list. * element_shape: The shape of the elements in the list (can be less specified than - * the shape of the tensor). + * the shape of the tensor). * num_elements: The size of the output list. Must be large enough to accommodate - * the largest index in indices. If -1, the list is just large enough to include - * the largest index in indices. + * the largest index in indices. If -1, the list is just large enough to include + * the largest index in indices. * output_handle: The TensorList. * - * @param tensor - * @param indices - * @param elementShape - * @param numElements + * @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, @@ -6969,51 +7871,54 @@ public TensorListScatter tensorListScatter(Operand tensor, /** * Scatters tensor at indices in an input list. - *

* Each member of the TensorList corresponds to one row of the input tensor, - * specified by the given index (see `tf.gather`). - *

- * input_handle: The list to scatter into. + * specified by the given index (see {@code tf.gather}). + *

input_handle: The list to scatter into. * tensor: The input tensor. * indices: The indices used to index into the list. * output_handle: The TensorList. * - * @param inputHandle - * @param tensor - * @param indices + * @param inputHandle The inputHandle value + * @param tensor The tensor value + * @param indices The indices value * @return a new instance of TensorListScatterIntoExistingList */ - public TensorListScatterIntoExistingList tensorListScatterIntoExistingList(Operand inputHandle, - Operand tensor, Operand indices) { + public TensorListScatterIntoExistingList tensorListScatterIntoExistingList( + Operand inputHandle, Operand tensor, + Operand indices) { return TensorListScatterIntoExistingList.create(scope, inputHandle, tensor, indices); } /** + * 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 - * @param index - * @param item + * @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); + public TensorListSetItem tensorListSetItem(Operand inputHandle, + Operand index, Operand item, TensorListSetItem.Options... options) { + return TensorListSetItem.create(scope, inputHandle, index, item, options); } /** * Splits a tensor into a list. - *

* list[i] corresponds to lengths[i] tensors from the input tensor. * The tensor must have rank at least 1 and contain exactly sum(lengths) elements. - *

- * tensor: The input tensor. + *

tensor: The input tensor. * element_shape: A shape compatible with that of elements in the tensor. * lengths: Vector of sizes of the 0th dimension of tensors in the list. * output_handle: The list. * - * @param tensor - * @param elementShape - * @param lengths + * @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, @@ -7023,265 +7928,285 @@ public TensorListSplit tensorListSplit(Operand tensor, /** * Stacks all tensors in the list. - *

* Requires that all tensors have the same shape. - *

- * input_handle: the input list + *

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 - * @param inputHandle - * @param elementShape - * @param elementDtype - * @param options carries optional attributes values + * @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 */ - public TensorListStack tensorListStack(Operand inputHandle, + public TensorListStack tensorListStack(Operand inputHandle, Operand elementShape, Class elementDtype, TensorListStack.Options... options) { return TensorListStack.create(scope, inputHandle, elementShape, elementDtype, options); } /** * Returns a tensor map with item from given key erased. - *

* input_handle: the original map * output_handle: the map with value from given key removed * key: the key of the value to be erased * - * @param inputHandle - * @param key - * @param valueDtype + * @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 */ - public TensorMapErase tensorMapErase(Operand inputHandle, + public TensorMapErase tensorMapErase(Operand inputHandle, Operand key, Class valueDtype) { return TensorMapErase.create(scope, inputHandle, key, valueDtype); } /** * Returns whether the given key exists in the map. - *

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

* input_handle: the original map * output_handle: the map with key and value inserted * key: the key to be inserted * value: the value to be inserted * - * @param inputHandle - * @param key - * @param value + * @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, Operand key, - Operand value) { + public TensorMapInsert tensorMapInsert(Operand inputHandle, + Operand key, Operand value) { return TensorMapInsert.create(scope, inputHandle, key, value); } /** * Returns the value from a given key in a tensor map. - *

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

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

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

- * This operation creates a new tensor by adding sparse `updates` to the passed - * in `tensor`. - * This operation is very similar to `tf.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. - *

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

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

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

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

- * The simplest form of tensor_scatter_add is to add individual elements to a + * 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. + *

{@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}: + *

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

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

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

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: - *

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

- * We can also, insert entire slices of a higher rank tensor all at once. For + *

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) + * 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: - *

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

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) + * 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); + } + + /** + * 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); } /** - * Subtracts sparse `updates` from an existing tensor according to `indices`. - *

- * This operation creates a new tensor by subtracting sparse `updates` from the - * passed in `tensor`. - * This operation is very similar to `tf.scatter_nd_sub`, except that the updates + * Subtracts sparse {@code updates} from an existing tensor according to {@code indices}. + * This operation creates a new tensor by subtracting sparse {@code updates} from the + * passed in {@code tensor}. + * This operation is very similar to {@code tf.scatter_nd_sub}, except that the updates * are subtracted from 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. - *

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

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

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

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

- * The simplest form of tensor_scatter_sub is to subtract individual elements + *

{@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}: + *

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

The last dimension of {@code indices} corresponds to indices into 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 + *

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

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

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

{@code
+   *  

In Python, this scatter subtract 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_sub(tensor, indices, updates)
    *      print(updated)
-   *  }
- * The resulting tensor would look like this: - *

- * [1, -10, 1, -9, -8, 1, 1, -11] - *

- * We can also, insert entire slices of a higher rank tensor all at once. For + *

+ *

The resulting tensor would look like this: + *

+   *  [1, -10, 1, -9, -8, 1, 1, -11]
+   *  
+ *

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: - *

{@code
+   *  

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]],
@@ -7290,97 +8215,100 @@ public  TensorScatterNdMin tensorScatterNdMin(Operand ten
    *      tensor = tf.ones([4, 4, 4],dtype=tf.int32)
    *      updated = tf.tensor_scatter_nd_sub(tensor, indices, updates)
    *      print(updated)
-   *  }
- * The resulting tensor would look like this: - *

- * [[[-4, -4, -4, -4], [-5, -5, -5, -5], [-6, -6, -6, -6], [-7, -7, -7, -7]], - * [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]], - * [[-4, -4, -4, -4], [-5, -5, -5, -5], [-6, -6, -6, -6], [-7, -7, -7, -7]], - * [[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. + *

+ *

The resulting tensor would look like this: + *

+   *  [[[-4, -4, -4, -4], [-5, -5, -5, -5], [-6, -6, -6, -6], [-7, -7, -7, -7]],
+   *   [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]],
+   *   [[-4, -4, -4, -4], [-5, -5, -5, -5], [-6, -6, -6, -6], [-7, -7, -7, -7]],
+   *   [[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 * @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); } /** - * Scatter `updates` into an existing tensor according to `indices`. - *

- * This operation creates a new tensor by applying sparse `updates` to the passed - * in `tensor`. - * This operation is very similar to `tf.scatter_nd`, except that the updates are + * Scatter {@code updates} into an existing tensor according to {@code indices}. + * This operation creates a new tensor by applying sparse {@code updates} to the passed + * in {@code tensor}. + * This operation is very similar to {@code tf.scatter_nd}, except that the updates are * scattered onto an existing tensor (as opposed to a zero-tensor). If the memory * for the existing tensor cannot be re-used, a copy is made and updated. - *

- * If `indices` contains duplicates, then 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. - * - The order in which updates are applied is nondeterministic, so the output - * will be nondeterministic if `indices` contains duplicates. - *

- * `indices` is an integer tensor containing indices into a new tensor of shape - * `shape`. + *

If {@code indices} contains duplicates, then we pick the last update for the index. + *

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

    - *
  • - * `indices` must have at least 2 axes: `(num_updates, index_depth)`. - *
  • - *
  • - * The last axis of `indices` is how deep to index into `tensor` so this index - * depth must be less than the rank of `tensor`: `indices.shape[-1] <= tensor.ndim` - *
  • + *
  • If an out of bound index is found, the index is ignored.
  • + *
  • The order in which updates are applied is nondeterministic, so the output + * will be nondeterministic if {@code indices} contains duplicates.
  • *
- * if `indices.shape[-1] = tensor.rank` this Op indexes and updates scalar elements. - * if `indices.shape[-1] < tensor.rank` it indexes and updates slices of the input - * `tensor`. - *

- * Each `update` has a rank of `tensor.rank - indices.shape[-1]`. - * The overall shape of `updates` is: - *

{@code
+   *  

{@code indices} is an integer tensor containing indices into a new tensor of shape + * {@code shape}. + *

    + *
  • {@code indices} must have at least 2 axes: {@code (num_updates, index_depth)}.
  • + *
  • The last axis of {@code indices} is how deep to index into {@code tensor} so this index + * depth must be less than the rank of {@code tensor}: {@code indices.shape[-1] <= tensor.ndim}
  • + *
+ *

if {@code indices.shape[-1] = tensor.rank} this Op indexes and updates scalar elements. + * if {@code indices.shape[-1] < tensor.rank} it indexes and updates slices of the input + * {@code tensor}. + *

Each {@code update} has a rank of {@code tensor.rank - indices.shape[-1]}. + * The overall shape of {@code updates} is: + *

    *  indices.shape[:-1] + tensor.shape[indices.shape[-1]:]
-   *  }
- * For usage examples see the python [tf.tensor_scatter_nd_update]( - * https://www.tensorflow.org/api_docs/python/tf/tensor_scatter_nd_update) function + *
+ *

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); - } - - /** - * Assign `value` to the sliced l-value reference of `input`. - *

- * The values of `value` are assigned to the positions in the tensor `input` 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 `input`. - * - * @param data type for {@code output()} output - * @param input - * @param begin - * @param end - * @param strides - * @param value - * @param options carries optional attributes values + Operand indices, Operand updates, + TensorScatterNdUpdate.Options... options) { + return TensorScatterNdUpdate.create(scope, tensor, indices, updates, options); + } + + /** + * Assign {@code value} to the sliced l-value reference of {@code input}. + * The values of {@code value} are assigned to the positions in the tensor {@code input} that + * are selected by the slice parameters. The slice parameters {@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 input}. + * + * @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 * @return a new instance of TensorStridedSliceUpdate */ public TensorStridedSliceUpdate tensorStridedSliceUpdate( @@ -7391,37 +8319,41 @@ public TensorStridedSliceUpdate tensorSt /** * Constructs a tensor by tiling a given tensor. - *

- * This operation creates a new tensor by replicating `input` `multiples` times. - * The output tensor's i'th dimension has `input.dims(i) * multiples[i]` elements, - * and the values of `input` are replicated `multiples[i]` times along the 'i'th - * dimension. For example, tiling `[a b c d]` by `[2]` produces - * `[a b c d a b c d]`. - *

- * >>> a = tf.constant([[1,2,3],[4,5,6]], tf.int32) - * >>> b = tf.constant([1,2], tf.int32) - * >>> tf.tile(a, b) - * + *

+ *
+ *

a = tf.constant([[1,2,3],[4,5,6]], tf.int32) + * b = tf.constant([1,2], tf.int32) + * tf.tile(a, b) + * <tf.Tensor: shape=(2, 6), dtype=int32, numpy= * array([[1, 2, 3, 1, 2, 3], - * [4, 5, 6, 4, 5, 6]], dtype=int32)> - * >>> c = tf.constant([2,1], tf.int32) - * >>> tf.tile(a, c) - * - * >>> d = tf.constant([2,2], tf.int32) - * >>> tf.tile(a, d) - * - * - * @param data type for {@code output()} output - * @param input 1-D or higher. - * @param multiples 1-D. Length must be the same as the number of dimensions in `input` + * [4, 5, 6, 4, 5, 6], + * [1, 2, 3, 1, 2, 3], + * [4, 5, 6, 4, 5, 6]], dtype=int32)> + *

+ *
+ * + * + * @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 */ public Tile tile(Operand input, Operand multiples) { @@ -7430,11 +8362,17 @@ public Tile tile(Operand input, Operand - * Returns the timestamp as a `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. + * Returns the timestamp as a {@code float64} for seconds since the Unix epoch. + *

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 */ @@ -7443,9 +8381,8 @@ public Timestamp timestamp() { } /** - * Returns the TopK unique values in the array in sorted order. The - *

- * running time is proportional to the product of K and the input + * Returns the TopK unique values in the array in sorted order. + * The running time is proportional to the product of K and the input * size. Sorting the whole array is more efficient for sufficiently large * values of K. The median-of-medians algorithm is probably faster, but * difficult to implement efficiently in XLA. If there are fewer than K @@ -7458,8 +8395,8 @@ public Timestamp timestamp() { * padding value will be returned. The semantics are not the same as * kth_order_statistic. * - * @param input - * @param k + * @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) { @@ -7467,115 +8404,47 @@ public TopKUnique topKUnique(Operand input, Long k) { } /** - * Returns the TopK values in the array in sorted order. This is a combination - *

- * of MakeUnique and TopKUnique. The returned top-K will have its lower bits - * replaced by iota, thus it will be close to the original value but not exactly - * the same. The running time is proportional to the product of K and the input - * size. NaNs are never returned. Subnormal numbers are flushed to zero. + * Returns the TopK values in the array in sorted order. + * This is a combination of MakeUnique and TopKUnique. The returned top-K will + * have its lower bits replaced by iota, thus it will be close to the original + * value but not exactly the same. The running time is proportional to the product + * of K and the input size. NaNs are never returned. Subnormal numbers are flushed + * to zero. * - * @param input - * @param k + * @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) { return TopKWithUnique.create(scope, input, k); } - /** - * Perform batches of RPC requests. - *

- * This op asynchronously performs either a single RPC request, or a batch - * of requests. RPC requests are defined by three main parameters: - *

- * - `address` (the host+port or BNS address of the request) - * - `method` (the method name for the request) - * - `request` (the serialized proto string, or vector of strings, - * of the RPC request argument). - *

- * For example, if you have an RPC service running on port localhost:2345, - * and its interface is configured with the following proto declaration: - *

{@code
-   *  service MyService {
-   *    rpc MyMethod(MyRequestProto) returns (MyResponseProto) {
-   *    }
-   *  };
-   *  }
- * then call this op with arguments: - *
{@code
-   *  address = "localhost:2345"
-   *  method = "MyService/MyMethod"
-   *  }
- * The `request` tensor is a string tensor representing serialized `MyRequestProto` - * strings; and the output string tensor `response` will have the same shape - * and contain (upon successful completion) corresponding serialized - * `MyResponseProto` strings. - *

- * For example, to send a single, empty, `MyRequestProto`, call - * this op with `request = ""`. To send 5 parallel empty requests, - * call this op with `request = ["", "", "", "", ""]`. - *

- * More generally, one can create a batch of `MyRequestProto` serialized protos - * from regular batched tensors using the `encode_proto` op, and convert - * the response `MyResponseProto` serialized protos to batched tensors - * using the `decode_proto` op. - *

- * NOTE Working with serialized proto strings is faster than instantiating - * actual proto objects in memory, so no performance degradation is expected - * compared to writing custom kernels for this workflow. - *

- * Unlike the standard `Rpc` op, if the connection fails or the remote worker - * returns an error status, this op does not reraise the exception. - * Instead, the `status_code` and `status_message` entry for the corresponding RPC - * call is set with the error returned from the RPC call. The `response` tensor - * will contain valid response values for those minibatch entries whose RPCs did - * not fail; the rest of the entries will have empty strings. - * - * @param address `0-D` or `1-D`. The address (i.e. host_name:port) of the RPC server. - * If this tensor has more than 1 element, then multiple parallel rpc requests - * are sent. This argument broadcasts with `method` and `request`. - * @param method `0-D` or `1-D`. The method address on the RPC server. - * If this tensor has more than 1 element, then multiple parallel rpc requests - * are sent. This argument broadcasts with `address` and `request`. - * @param request `0-D` or `1-D`. Serialized proto strings: the rpc request argument. - * If this tensor has more than 1 element, then multiple parallel rpc requests - * are sent. This argument broadcasts with `address` and `method`. - * @param options carries optional attributes values - * @return a new instance of TryRpc - */ - public TryRpc tryRpc(Operand address, Operand method, Operand request, - TryRpc.Options... options) { - return TryRpc.create(scope, address, method, request, options); - } - /** * Reverses the operation of Batch for a single output Tensor. - *

* An instance of Unbatch either receives an empty batched_tensor, in which case it * asynchronously waits until the values become available from a concurrently * running instance of Unbatch with the same container and shared_name, or receives * a non-empty batched_tensor in which case it finalizes all other concurrently * running instances and outputs its own element from the batch. - *

- * batched_tensor: The possibly transformed output of Batch. The size of the first - * dimension should remain unchanged by the transformations for the operation to - * work. + *

batched_tensor: The possibly transformed output of Batch. The size of the first + * dimension should remain unchanged by the transformations for the operation to + * work. * batch_index: The matching batch_index obtained from Batch. * id: The id scalar emitted by Batch. * unbatched_tensor: The Tensor corresponding to this execution. * timeout_micros: Maximum amount of time (in microseconds) to wait to receive the - * batched input tensor associated with a given invocation of the op. + * batched input tensor associated with a given invocation of the op. * container: Container to control resource sharing. * 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 unbatchedTensor()} output - * @param batchedTensor - * @param batchIndex - * @param id - * @param timeoutMicros - * @param options carries optional attributes values + * assumed to possibly belong to the same batch. If left empty, the op name will + * be used as the shared name. + * + * @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 */ public Unbatch unbatch(Operand batchedTensor, Operand batchIndex, @@ -7585,12 +8454,10 @@ public Unbatch unbatch(Operand batchedTensor, Operand * Acts like Batch but using the given batch_index index of batching things as they * become available. This ensures that the gradients are propagated back in the * same session which did the forward pass. - *

- * original_input: The input to the Unbatch operation this is the gradient of. + *

original_input: The input to the Unbatch operation this is the gradient of. * batch_index: The batch_index given to the Unbatch operation this is the gradient * of. * grad: The downstream gradient. @@ -7598,15 +8465,15 @@ public Unbatch unbatch(Operand batchedTensor, Operand data type for {@code batchedGrad()} output - * @param originalInput - * @param batchIndex - * @param grad - * @param id - * @param options carries optional attributes values + * are assumed to possibly belong to the same batch. If left empty, the op name + * will be used as the shared name. + * + * @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 */ public UnbatchGrad unbatchGrad(Operand originalInput, @@ -7615,54 +8482,78 @@ 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 `y` containing unique elements - * along the `axis` of a tensor. The returned unique elements is sorted - * in the same order as they occur along `axis` in `x`. - * This operation also returns a tensor `idx` that is the same size as - * the number of the elements in `x` along the `axis` dimension. It - * contains the index in the unique output `y`. - * In other words, for an `1-D` tensor `x` with `axis = None: - *

- * `y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]` - *

- * For example: - *

{@code
+   *  This operation either returns a tensor {@code y} containing unique elements
+   *  along the {@code axis} of a tensor. The returned unique elements is sorted
+   *  in the same order as they occur along {@code axis} in {@code x}.
+   *  This operation also returns a tensor {@code idx} that is the same size as
+   *  the number of the elements in {@code x} along the {@code axis} dimension. It
+   *  contains the index in the unique output {@code y}.
+   *  In other words, for an {@code 1-D} tensor {@code x} with `axis = None:
+   *  

{@code y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]} + *

For example: + *

    *  # tensor 'x' is [1, 1, 2, 4, 4, 4, 7, 8, 8]
    *  y, idx = unique(x)
-   *  y ==> [1, 2, 4, 7, 8]
-   *  idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
-   *  }
- * For an `2-D` tensor `x` with `axis = 0`: - *
{@code
+   *  y ==> [1, 2, 4, 7, 8]
+   *  idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
+   *  
+ *

For an {@code 2-D} tensor {@code x} with {@code axis = 0}: + *

    *  # tensor 'x' is [[1, 0, 0],
    *  #                [1, 0, 0],
    *  #                [2, 0, 0]]
    *  y, idx = unique(x, axis=0)
-   *  y ==> [[1, 0, 0],
+   *  y ==> [[1, 0, 0],
    *         [2, 0, 0]]
-   *  idx ==> [0, 0, 1]
-   *  }
- * For an `2-D` tensor `x` with `axis = 1`: - *
{@code
+   *  idx ==> [0, 0, 1]
+   *  
+ *

For an {@code 2-D} tensor {@code x} with {@code axis = 1}: + *

    *  # tensor 'x' is [[1, 0, 0],
    *  #                [1, 0, 0],
    *  #                [2, 0, 0]]
    *  y, idx = unique(x, axis=1)
-   *  y ==> [[1, 0],
+   *  y ==> [[1, 0],
    *         [1, 0],
    *         [2, 0]]
-   *  idx ==> [0, 1, 1]
-   *  }
+ * idx ==> [0, 1, 1] + *
* - * @param data type for {@code y()} output - * @param data type for {@code idx()} output - * @param x A `Tensor`. - * @param axis A `Tensor` of type `int32` (default: None). The axis of the Tensor to + * @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. - * @return a new instance of Unique + * @param data type for {@code UniqueV2} output and operands + * @return a new instance of Unique, with default output types */ public Unique unique(Operand x, Operand axis) { return Unique.create(scope, x, axis); @@ -7670,52 +8561,49 @@ public Unique unique(Operand x, Operand - * This operation either returns a tensor `y` containing unique elements - * along the `axis` of a tensor. The returned unique elements is sorted - * in the same order as they occur along `axis` in `x`. - * This operation also returns a tensor `idx` that is the same size as - * the number of the elements in `x` along the `axis` dimension. It - * contains the index in the unique output `y`. - * In other words, for an `1-D` tensor `x` with `axis = None: - *

- * `y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]` - *

- * For example: - *

{@code
+   *  This operation either returns a tensor {@code y} containing unique elements
+   *  along the {@code axis} of a tensor. The returned unique elements is sorted
+   *  in the same order as they occur along {@code axis} in {@code x}.
+   *  This operation also returns a tensor {@code idx} that is the same size as
+   *  the number of the elements in {@code x} along the {@code axis} dimension. It
+   *  contains the index in the unique output {@code y}.
+   *  In other words, for an {@code 1-D} tensor {@code x} with `axis = None:
+   *  

{@code y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]} + *

For example: + *

    *  # tensor 'x' is [1, 1, 2, 4, 4, 4, 7, 8, 8]
    *  y, idx = unique(x)
-   *  y ==> [1, 2, 4, 7, 8]
-   *  idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
-   *  }
- * For an `2-D` tensor `x` with `axis = 0`: - *
{@code
+   *  y ==> [1, 2, 4, 7, 8]
+   *  idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
+   *  
+ *

For an {@code 2-D} tensor {@code x} with {@code axis = 0}: + *

    *  # tensor 'x' is [[1, 0, 0],
    *  #                [1, 0, 0],
    *  #                [2, 0, 0]]
    *  y, idx = unique(x, axis=0)
-   *  y ==> [[1, 0, 0],
+   *  y ==> [[1, 0, 0],
    *         [2, 0, 0]]
-   *  idx ==> [0, 0, 1]
-   *  }
- * For an `2-D` tensor `x` with `axis = 1`: - *
{@code
+   *  idx ==> [0, 0, 1]
+   *  
+ *

For an {@code 2-D} tensor {@code x} with {@code axis = 1}: + *

    *  # tensor 'x' is [[1, 0, 0],
    *  #                [1, 0, 0],
    *  #                [2, 0, 0]]
    *  y, idx = unique(x, axis=1)
-   *  y ==> [[1, 0],
+   *  y ==> [[1, 0],
    *         [1, 0],
    *         [2, 0]]
-   *  idx ==> [0, 1, 1]
-   *  }
+ * idx ==> [0, 1, 1] + *
* - * @param data type for {@code y()} output - * @param data type for {@code idx()} output - * @param x A `Tensor`. - * @param axis A `Tensor` of type `int32` (default: None). The axis of the Tensor to + * @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 + * @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 */ public Unique unique(Operand x, @@ -7725,56 +8613,52 @@ public Unique unique(Operand x, /** * Finds unique elements along an axis of a tensor. - *

- * This operation either returns a tensor `y` containing unique elements - * along the `axis` of a tensor. The returned unique elements is sorted - * in the same order as they occur along `axis` in `x`. - * This operation also returns a tensor `idx` and a tensor `count` - * that are the same size as the number of the elements in `x` along the - * `axis` dimension. The `idx` contains the index in the unique output `y` - * and the `count` contains the count in the unique output `y`. - * In other words, for an `1-D` tensor `x` with `axis = None: - *

- * `y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]` - *

- * For example: - *

{@code
-   *  # tensor 'x' is [1, 1, 2, 4, 4, 4, 7, 8, 8]
-   *  y, idx, count = unique_with_counts(x)
-   *  y ==> [1, 2, 4, 7, 8]
-   *  idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
-   *  count ==> [2, 1, 3, 1, 2]
-   *  }
- * For an `2-D` tensor `x` with `axis = 0`: - *
{@code
-   *  # tensor 'x' is [[1, 0, 0],
-   *  #                [1, 0, 0],
-   *  #                [2, 0, 0]]
-   *  y, idx, count = unique_with_counts(x, axis=0)
-   *  y ==> [[1, 0, 0],
+   *  This operation either returns a tensor {@code y} containing unique elements
+   *  along the {@code axis} of a tensor. The returned unique elements is sorted
+   *  in the same order as they occur along {@code axis} in {@code x}.
+   *  This operation also returns a tensor {@code idx} and a tensor {@code count}
+   *  that are the same size as the number of the elements in {@code x} along the
+   *  {@code axis} dimension. The {@code idx} contains the index in the unique output {@code y}
+   *  and the {@code count} contains the count in the unique output {@code y}.
+   *  In other words, for an {@code 1-D} tensor {@code x} with `axis = None:
+   *  

{@code y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]} + *

For example: + *

+   *  x = tf.constant([1, 1, 2, 4, 4, 4, 7, 8, 8])
+   *  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]
+   *  
+ *

For a {@code 2-D} tensor {@code x} with {@code axis = 0}: + *

+   *  x = tf.constant([[1, 0, 0],
+   *                  [1, 0, 0],
+   *                  [2, 0, 0]])
+   *  y, idx, count = tf.raw_ops.UniqueWithCountsV2(x=x, axis=[0])
+   *  y ==> [[1, 0, 0],
    *         [2, 0, 0]]
-   *  idx ==> [0, 0, 1]
-   *  count ==> [2, 1]
-   *  }
- * For an `2-D` tensor `x` with `axis = 1`: - *
{@code
-   *  # tensor 'x' is [[1, 0, 0],
-   *  #                [1, 0, 0],
-   *  #                [2, 0, 0]]
-   *  y, idx, count = unique_with_counts(x, axis=1)
-   *  y ==> [[1, 0],
+   *  idx ==> [0, 0, 1]
+   *  count ==> [2, 1]
+   *  
+ *

For a {@code 2-D} tensor {@code x} with {@code axis = 1}: + *

+   *  x = tf.constant([[1, 0, 0],
+   *                  [1, 0, 0],
+   *                  [2, 0, 0]])
+   *  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]
-   *  }
+ * idx ==> [0, 1, 1] + * count ==> [1, 2] + *
* - * @param data type for {@code y()} output - * @param data type for {@code idx()} output - * @param x A `Tensor`. - * @param axis A `Tensor` of type `int32` (default: None). The axis of the Tensor to + * @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. - * @return a new instance of UniqueWithCounts + * @param data type for {@code UniqueWithCountsV2} output and operands + * @return a new instance of UniqueWithCounts, with default output types */ public UniqueWithCounts uniqueWithCounts(Operand x, Operand axis) { @@ -7783,56 +8667,53 @@ public UniqueWithCounts uniqueWithCounts(Operand /** * Finds unique elements along an axis of a tensor. - *

- * This operation either returns a tensor `y` containing unique elements - * along the `axis` of a tensor. The returned unique elements is sorted - * in the same order as they occur along `axis` in `x`. - * This operation also returns a tensor `idx` and a tensor `count` - * that are the same size as the number of the elements in `x` along the - * `axis` dimension. The `idx` contains the index in the unique output `y` - * and the `count` contains the count in the unique output `y`. - * In other words, for an `1-D` tensor `x` with `axis = None: - *

- * `y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]` - *

- * For example: - *

{@code
-   *  # tensor 'x' is [1, 1, 2, 4, 4, 4, 7, 8, 8]
-   *  y, idx, count = unique_with_counts(x)
-   *  y ==> [1, 2, 4, 7, 8]
-   *  idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
-   *  count ==> [2, 1, 3, 1, 2]
-   *  }
- * For an `2-D` tensor `x` with `axis = 0`: - *
{@code
-   *  # tensor 'x' is [[1, 0, 0],
-   *  #                [1, 0, 0],
-   *  #                [2, 0, 0]]
-   *  y, idx, count = unique_with_counts(x, axis=0)
-   *  y ==> [[1, 0, 0],
+   *  This operation either returns a tensor {@code y} containing unique elements
+   *  along the {@code axis} of a tensor. The returned unique elements is sorted
+   *  in the same order as they occur along {@code axis} in {@code x}.
+   *  This operation also returns a tensor {@code idx} and a tensor {@code count}
+   *  that are the same size as the number of the elements in {@code x} along the
+   *  {@code axis} dimension. The {@code idx} contains the index in the unique output {@code y}
+   *  and the {@code count} contains the count in the unique output {@code y}.
+   *  In other words, for an {@code 1-D} tensor {@code x} with `axis = None:
+   *  

{@code y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]} + *

For example: + *

+   *  x = tf.constant([1, 1, 2, 4, 4, 4, 7, 8, 8])
+   *  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]
+   *  
+ *

For a {@code 2-D} tensor {@code x} with {@code axis = 0}: + *

+   *  x = tf.constant([[1, 0, 0],
+   *                  [1, 0, 0],
+   *                  [2, 0, 0]])
+   *  y, idx, count = tf.raw_ops.UniqueWithCountsV2(x=x, axis=[0])
+   *  y ==> [[1, 0, 0],
    *         [2, 0, 0]]
-   *  idx ==> [0, 0, 1]
-   *  count ==> [2, 1]
-   *  }
- * For an `2-D` tensor `x` with `axis = 1`: - *
{@code
-   *  # tensor 'x' is [[1, 0, 0],
-   *  #                [1, 0, 0],
-   *  #                [2, 0, 0]]
-   *  y, idx, count = unique_with_counts(x, axis=1)
-   *  y ==> [[1, 0],
+   *  idx ==> [0, 0, 1]
+   *  count ==> [2, 1]
+   *  
+ *

For a {@code 2-D} tensor {@code x} with {@code axis = 1}: + *

+   *  x = tf.constant([[1, 0, 0],
+   *                  [1, 0, 0],
+   *                  [2, 0, 0]])
+   *  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]
-   *  }
+ * idx ==> [0, 1, 1] + * count ==> [1, 2] + *
* - * @param data type for {@code y()} output - * @param data type for {@code idx()} output - * @param x A `Tensor`. - * @param axis A `Tensor` of type `int32` (default: None). The axis of the Tensor to + * @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 + * @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 */ public UniqueWithCounts uniqueWithCounts(Operand x, @@ -7842,10 +8723,8 @@ public UniqueWithCounts uniqueWithCou /** * Converts an array of flat indices into a tuple of coordinate arrays. - *

- * * Example: - *

{@code
+   *  
    *  y = tf.unravel_index(indices=[2, 5, 7], dims=[3, 3])
    *  # 'dims' represent a hypothetical (3, 3) tensor of indices:
    *  # [[0, 1, *2*],
@@ -7853,19 +8732,20 @@ public  UniqueWithCounts uniqueWithCou
    *  #  [6, *7*, 8]]
    *  # For each entry from 'indices', this operation returns
    *  # its coordinates (marked with '*'), such as
-   *  # 2 ==> (0, 2)
-   *  # 5 ==> (1, 2)
-   *  # 7 ==> (2, 1)
-   *  y ==> [[0, 1, 2], [2, 2, 1]]
-   *  }
- * - * @compatibility(numpy) Equivalent to np.unravel_index - * @end_compatibility - * @param data type for {@code output()} output - * @param indices An 0-D or 1-D `int` Tensor whose elements are indices into the + * # 2 ==> (0, 2) + * # 5 ==> (1, 2) + * # 7 ==> (2, 1) + * y ==> [[0, 1, 2], [2, 2, 1]] + *
+ *

{@literal @}compatibility(numpy)
+ * Equivalent to np.unravel_index + *
{@literal @}end_compatibility + * + * @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 `int` Tensor. The shape of the array to use for unraveling + * @param dims An 1-D {@code int} Tensor. The shape of the array to use for unraveling * indices. + * @param data type for {@code UnravelIndex} output and operands * @return a new instance of UnravelIndex */ public UnravelIndex unravelIndex(Operand indices, Operand dims) { @@ -7873,25 +8753,21 @@ public UnravelIndex unravelIndex(Operand indices, Oper } /** - * Unpacks a given dimension of a rank-`R` tensor into `num` rank-`(R-1)` tensors. - *

- * Unpacks `num` tensors from `value` by chipping it along the `axis` dimension. - * For example, given a tensor of shape `(A, B, C, D)`; - *

- * If `axis == 0` then the i'th tensor in `output` is the slice `value[i, :, :, :]` - * and each tensor in `output` will have shape `(B, C, D)`. (Note that the - * dimension unpacked along is gone, unlike `split`). - *

- * If `axis == 1` then the i'th tensor in `output` is the slice `value[:, i, :, :]` - * and each tensor in `output` will have shape `(A, C, D)`. + * Unpacks a given dimension of a rank-{@code R} tensor into {@code num} rank-{@code (R-1)} tensors. + * Unpacks {@code num} tensors from {@code value} by chipping it along the {@code axis} dimension. + * For example, given a tensor of shape {@code (A, B, C, D)}; + *

If {@code axis == 0} then the i'th tensor in {@code output} is the slice {@code value[i, :, :, :]} + * and each tensor in {@code output} will have shape {@code (B, C, D)}. (Note that the + * dimension unpacked along is gone, unlike {@code split}). + *

If {@code axis == 1} then the i'th tensor in {@code output} is the slice {@code value[:, i, :, :]} + * and each tensor in {@code output} will have shape {@code (A, C, D)}. * Etc. - *

- * This is the opposite of `pack`. + *

This is the opposite of {@code pack}. * - * @param data type for {@code output()} output - * @param value 1-D or higher, with `axis` dimension size equal to `num`. - * @param num - * @param options carries optional attributes values + * @param value 1-D or higher, with {@code axis} dimension size equal to {@code num}. + * @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 */ public Unstack unstack(Operand value, Long num, @@ -7901,25 +8777,81 @@ public Unstack unstack(Operand value, Long num, /** * Op is similar to a lightweight Dequeue. - *

* The basic functionality is similar to dequeue with many fewer * capabilities and options. This Op is optimized for performance. * - * @param dtypes - * @param options carries optional attributes values + * @param dtypes The value of the dtypes attribute + * @param options carries optional attribute values * @return a new instance of Unstage */ public Unstage unstage(List> dtypes, Unstage.Options... options) { 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. * * @param dtype the type of this variable. Must agree with the dtypes * of all ops using this variable. * @param shape The (possibly partially specified) shape of this variable. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code VarHandleOp} output and operands * @return a new instance of VarHandleOp */ public VarHandleOp varHandleOp(Class dtype, Shape shape, @@ -7933,17 +8865,17 @@ public VarHandleOp varHandleOp(Class dtype, Shape shape, * @param resource the input resource handle. * @return a new instance of VarIsInitializedOp */ - public VarIsInitializedOp varIsInitializedOp(Operand resource) { + public VarIsInitializedOp varIsInitializedOp(Operand resource) { return VarIsInitializedOp.create(scope, resource); } /** - * Factory method to create a new Variable with it's initializer. - *

- * Only supported on Graph sessions as the {@link org.tensorflow.op.core.Assign} op - * does not work in an EagerSession. + * Factory method to create a new Variable with its initializer. Both the creation and assignment + * are done in the init scope. + * + *

Only supported on Graph sessions as the {@link org.tensorflow.op.core.Assign} op does not + * work in an EagerSession. * - * @param scope current scope * @param init The op to use to initialise this variable. * @param options carries optional attributes values * @return a new instance of Variable @@ -7954,15 +8886,14 @@ public Variable variable(Operand init, Variable.Options. /** * Holds state in the form of a tensor that persists across steps. - *

* 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 * @param shape The shape of the variable tensor. * @param dtype The type of elements in the variable tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code VariableV2} output and operands * @return a new instance of Variable */ public Variable variable(Shape shape, Class dtype, @@ -7971,61 +8902,55 @@ public Variable variable(Shape shape, Class dtype, } /** - * Returns the shape of the variable pointed to by `resource`. - *

- * This operation returns a 1-D integer tensor representing the shape of `input`. - *

- * For example: - *

{@code
+   * Returns the shape of the variable pointed to by {@code resource}.
+   *  This operation returns a 1-D integer tensor representing the shape of {@code input}.
+   *  

For example: + *

    *  # 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]
-   *  shape(t) ==> [2, 2, 3]
-   *  }
+ * shape(t) ==> [2, 2, 3] + *
* - * @param data type for {@code output()} output - * @param input - * @return a new instance of VariableShape + * @param input The input value + * @return a new instance of VariableShape, with default output types */ - public VariableShape variableShape(Operand input) { + public VariableShape variableShape(Operand input) { return VariableShape.create(scope, input); } /** - * Returns the shape of the variable pointed to by `resource`. - *

- * This operation returns a 1-D integer tensor representing the shape of `input`. - *

- * For example: - *

{@code
+   * Returns the shape of the variable pointed to by {@code resource}.
+   *  This operation returns a 1-D integer tensor representing the shape of {@code input}.
+   *  

For example: + *

    *  # 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]
-   *  shape(t) ==> [2, 2, 3]
-   *  }
+ * shape(t) ==> [2, 2, 3] + *
* - * @param data type for {@code output()} output - * @param input - * @param outType + * @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 */ - public VariableShape variableShape(Operand input, Class outType) { + public VariableShape variableShape(Operand input, + Class outType) { return VariableShape.create(scope, input, outType); } /** * Returns locations of nonzero / true values in a tensor. - *

- * This operation returns the coordinates of true elements in `condition`. The + * This operation returns the coordinates of true elements in {@code condition}. The * coordinates are returned in a 2-D tensor where the first dimension (rows) * represents the number of true elements, and the second dimension (columns) * represents the coordinates of the true elements. Keep in mind, the shape of * the output tensor can vary depending on how many true values there are in - * `condition`. Indices are output in row-major order. - *

- * For example: - *

{@code
+   *  {@code condition}. Indices are output in row-major order.
+   *  

For example: + *

    *  # 'input' tensor is [[True, False]
    *  #                    [True, False]]
    *  # 'input' has two true values, so output has two coordinates.
    *  # 'input' has rank of 2, so coordinates have two indices.
-   *  where(input) ==> [[0, 0],
+   *  where(input) ==> [[0, 0],
    *                    [1, 0]]
    *
    *  # `condition` tensor is [[[True, False]
@@ -8036,7 +8961,7 @@ public  VariableShape variableShape(Operand input, Clas
    *  #                     [False, True]]]
    *  # 'input' has 5 true values, so output has 5 coordinates.
    *  # 'input' has rank of 3, so coordinates have three indices.
-   *  where(input) ==> [[0, 0, 0],
+   *  where(input) ==> [[0, 0, 0],
    *                    [0, 1, 0],
    *                    [1, 0, 1],
    *                    [1, 1, 1],
@@ -8050,7 +8975,7 @@ public  VariableShape variableShape(Operand input, Clas
    *  #                     [0.0,  0.01]]]
    *  # 'input' has 5 nonzero values, so output has 5 coordinates.
    *  # 'input' has rank of 3, so coordinates have three indices.
-   *  where(input) ==> [[0, 0, 0],
+   *  where(input) ==> [[0, 0, 0],
    *                    [0, 1, 0],
    *                    [1, 0, 1],
    *                    [1, 1, 1],
@@ -8064,14 +8989,14 @@ public  VariableShape variableShape(Operand input, Clas
    *  #                     [0.0 + 0.0j, 0.01 + 0.0j]]]
    *  # 'input' has 5 nonzero magnitude values, so output has 5 coordinates.
    *  # 'input' has rank of 3, so coordinates have three indices.
-   *  where(input) ==> [[0, 0, 0],
+   *  where(input) ==> [[0, 0, 0],
    *                    [0, 1, 0],
    *                    [1, 0, 1],
    *                    [1, 1, 1],
    *                    [2, 1, 1]]
-   *  }
+ *
* - * @param condition + * @param condition The condition value * @return a new instance of Where */ public Where where(Operand condition) { @@ -8079,45 +9004,36 @@ public Where where(Operand condition) { } /** - * 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. + * output = input; While (Cond(output)) { output = Body(output) } * - * @param data type for {@code output()} output - * @param input - * @param manualSharding - * @return a new instance of XlaSpmdFullToShardShape - */ - public XlaSpmdFullToShardShape xlaSpmdFullToShardShape(Operand input, - String manualSharding) { - return XlaSpmdFullToShardShape.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. + *

Selects between {@link StatefulWhile} and {@link StatelessWhile} based on the statefulness of the function arguments. * - * @param data type for {@code output()} output - * @param input - * @param manualSharding - * @param fullShape - * @return a new instance of XlaSpmdShardToFullShape + * @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.
+   *  
+ * @param options carries optional attribute values + * @return a new instance of While */ - public XlaSpmdShardToFullShape xlaSpmdShardToFullShape(Operand input, - String manualSharding, Shape fullShape) { - return XlaSpmdShardToFullShape.create(scope, input, manualSharding, fullShape); + public While whileOp(Iterable> input, ConcreteFunction cond, ConcreteFunction body, + While.Options... options) { + return While.create(scope, input, cond, body, options); } /** * Creates a zeroed tensor given its type and shape. * - * @param scope is a scope used to add the underlying operation * @param dims a 1-D operand that represents the shape of the output tensor * @param type the output tensor datatype * @return a constant tensor initialized with zeros @@ -8130,8 +9046,8 @@ 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 */ public ZerosLike zerosLike(Operand x) { @@ -8141,16 +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. + *

+ * 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. + */ + public Ops withInitScope() { + return new Ops(scope.withInitScope()); + } + /** * 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)); @@ -8159,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)); @@ -8168,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 */ @@ -8185,7 +9141,7 @@ public final Scope scope() { * Creates an API for building operations in the provided execution environment */ public static Ops create(ExecutionEnvironment env) { - return new Ops(new Scope(env)); + return new Ops(env.baseScope()); } /** @@ -8194,6 +9150,6 @@ public static Ops create(ExecutionEnvironment env) { *

Invoking this method is equivalent to {@code Ops.create(EagerSession.getDefault())}. */ public static Ops create() { - return new Ops(new Scope(EagerSession.getDefault())); + return create(EagerSession.getDefault()); } } 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 13323a555af..8485f694be2 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; @@ -56,171 +63,170 @@ public final class QuantizationOps { /** * Dequantize the 'input' tensor into a float or bfloat16 Tensor. - *

* [min_range, max_range] are scalar floats that specify the range for * the output. The 'mode' attribute controls exactly which calculations are * used to convert the float values to their quantized equivalents. - *

- * In 'MIN_COMBINED' mode, each value of the tensor will undergo the following: - *

{@code
+   *  

In 'MIN_COMBINED' mode, each value of the tensor will undergo the following: + *

    *  if T == qint8: in[i] += (range(T) + 1)/ 2.0
    *  out[i] = min_range + (in[i]* (max_range - min_range) / range(T))
-   *  }
- * here `range(T) = numeric_limits::max() - numeric_limits::min()` - *

- * MIN_COMBINED Mode Example - *

- * If the input comes from a QuantizedRelu6, the output type is + *

+ *

here {@code range(T) = numeric_limits::max() - numeric_limits::min()} + *

MIN_COMBINED Mode Example + *

If the input comes from a QuantizedRelu6, the output type is * quint8 (range of 0-255) but the possible range of QuantizedRelu6 is * 0-6. The min_range and max_range values are therefore 0.0 and 6.0. * Dequantize on quint8 will take each value, cast to float, and multiply * by 6 / 255. * Note that if quantizedtype is qint8, the operation will additionally add * each value by 128 prior to casting. - *

- * If the mode is 'MIN_FIRST', then this approach is used: - *

{@code
-   *  num_discrete_values = 1 << (# of bits in T)
+   *  

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 = range / num_discrete_values
-   *  const double offset_input = static_cast(input) - lowest_quantized;
-   *  result = range_min + ((input - numeric_limits::min()) * range_scale)
-   *  }
- * If the mode is `SCALED`, dequantization is performed by multiplying each + * const double offset_input = static_cast<double>(input) - lowest_quantized; + * result = range_min + ((input - numeric_limits<T>::min()) * range_scale) + *
+ *

If the mode is {@code SCALED}, dequantization is performed by multiplying each * input value by a scaling_factor. (Thus an input of 0 always maps to 0.0). - *

- * The scaling_factor is determined from `min_range`, `max_range`, and - * `narrow_range` in a way that is compatible with `QuantizeAndDequantize{V2|V3}` - * and `QuantizeV2`, using the following algorithm: - *

{@code
-   *    const int min_expected_T = std::numeric_limits::min() +
+   *  

The scaling_factor is determined from {@code min_range}, {@code max_range}, and + * {@code narrow_range} in a way that is compatible with {@code QuantizeAndDequantize{V2|V3}} + * and {@code QuantizeV2}, using the following algorithm: + *

+   *
+   *    const int min_expected_T = std::numeric_limits<T>::min() +
    *      (narrow_range ? 1 : 0);
-   *    const int max_expected_T = std::numeric_limits::max();
-   *    const float max_expected_T = std::numeric_limits::max();
+   *    const int max_expected_T = std::numeric_limits<T>::max();
+   *    const float max_expected_T = std::numeric_limits<float>::max();
    *
    *    const float scale_factor =
-   *      (std::numeric_limits::min() == 0) ? (max_range / max_expected_T)
+   *      (std::numeric_limits<T>::min() == 0) ? (max_range / max_expected_T)
    *                                           : std::max(min_range / min_expected_T,
    *                                                      max_range / max_expected_T);
-   *  }
+ *
* - * @param data type for {@code output()} output - * @param input + * @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 attributes values - * @return a new instance of Dequantize + * @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) { + public Dequantize dequantize(Operand input, + Operand minRange, Operand maxRange, Dequantize.Options... options) { return Dequantize.create(scope, input, minRange, maxRange, options); } /** * Dequantize the 'input' tensor into a float or bfloat16 Tensor. - *

* [min_range, max_range] are scalar floats that specify the range for * the output. The 'mode' attribute controls exactly which calculations are * used to convert the float values to their quantized equivalents. - *

- * In 'MIN_COMBINED' mode, each value of the tensor will undergo the following: - *

{@code
+   *  

In 'MIN_COMBINED' mode, each value of the tensor will undergo the following: + *

    *  if T == qint8: in[i] += (range(T) + 1)/ 2.0
    *  out[i] = min_range + (in[i]* (max_range - min_range) / range(T))
-   *  }
- * here `range(T) = numeric_limits::max() - numeric_limits::min()` - *

- * MIN_COMBINED Mode Example - *

- * If the input comes from a QuantizedRelu6, the output type is + *

+ *

here {@code range(T) = numeric_limits::max() - numeric_limits::min()} + *

MIN_COMBINED Mode Example + *

If the input comes from a QuantizedRelu6, the output type is * quint8 (range of 0-255) but the possible range of QuantizedRelu6 is * 0-6. The min_range and max_range values are therefore 0.0 and 6.0. * Dequantize on quint8 will take each value, cast to float, and multiply * by 6 / 255. * Note that if quantizedtype is qint8, the operation will additionally add * each value by 128 prior to casting. - *

- * If the mode is 'MIN_FIRST', then this approach is used: - *

{@code
-   *  num_discrete_values = 1 << (# of bits in T)
+   *  

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 = range / num_discrete_values
-   *  const double offset_input = static_cast(input) - lowest_quantized;
-   *  result = range_min + ((input - numeric_limits::min()) * range_scale)
-   *  }
- * If the mode is `SCALED`, dequantization is performed by multiplying each + * const double offset_input = static_cast<double>(input) - lowest_quantized; + * result = range_min + ((input - numeric_limits<T>::min()) * range_scale) + *
+ *

If the mode is {@code SCALED}, dequantization is performed by multiplying each * input value by a scaling_factor. (Thus an input of 0 always maps to 0.0). - *

- * The scaling_factor is determined from `min_range`, `max_range`, and - * `narrow_range` in a way that is compatible with `QuantizeAndDequantize{V2|V3}` - * and `QuantizeV2`, using the following algorithm: - *

{@code
-   *    const int min_expected_T = std::numeric_limits::min() +
+   *  

The scaling_factor is determined from {@code min_range}, {@code max_range}, and + * {@code narrow_range} in a way that is compatible with {@code QuantizeAndDequantize{V2|V3}} + * and {@code QuantizeV2}, using the following algorithm: + *

+   *
+   *    const int min_expected_T = std::numeric_limits<T>::min() +
    *      (narrow_range ? 1 : 0);
-   *    const int max_expected_T = std::numeric_limits::max();
-   *    const float max_expected_T = std::numeric_limits::max();
+   *    const int max_expected_T = std::numeric_limits<T>::max();
+   *    const float max_expected_T = std::numeric_limits<float>::max();
    *
    *    const float scale_factor =
-   *      (std::numeric_limits::min() == 0) ? (max_range / max_expected_T)
+   *      (std::numeric_limits<T>::min() == 0) ? (max_range / max_expected_T)
    *                                           : std::max(min_range / min_expected_T,
    *                                                      max_range / max_expected_T);
-   *  }
+ *
* - * @param data type for {@code output()} output - * @param input + * @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. * If 'dtype' is 'bfloat16', it only supports 'MIN_COMBINED' mode. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Dequantize} output and operands * @return a new instance of Dequantize */ - public Dequantize dequantize(Operand input, + public Dequantize dequantize(Operand input, Operand minRange, Operand maxRange, Class dtype, Dequantize.Options... options) { return Dequantize.create(scope, input, minRange, maxRange, dtype, options); } /** - * 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 *

    - *
  • - * `[min; max]` define the clamping range for the `inputs` data. - *
  • - *
  • - * `inputs` values are quantized into the quantization range ( - * `[0; 2^num_bits - 1]` when `narrow_range` is false and `[1; 2^num_bits - 1]` - * when it is true) and then de-quantized and output as floats in `[min; max]` - * interval. - *
  • - *
  • - * `num_bits` is the bitwidth of the quantization; between 2 and 16, inclusive. - *
  • + *
  • {@code [min; max]} define the clamping range for the {@code inputs} data.
  • + *
  • {@code inputs} values are quantized into the quantization range ( + * {@code [0; 2^num_bits - 1]} when {@code narrow_range} is false and {@code [1; 2^num_bits - 1]} + * when it is true) and then de-quantized and output as floats in {@code [min; max]} + * interval.
  • + *
  • {@code num_bits} is the bitwidth of the quantization; between 2 and 16, inclusive.
  • *
- * Before quantization, `min` and `max` values are adjusted with the following + *

Before quantization, {@code min} and {@code max} values are adjusted with the following * logic. - * It is suggested to have `min <= 0 <= max`. If `0` is not in the range of values, + * It is suggested to have {@code min <= 0 <= max}. If {@code 0} is not in the range of values, * the behavior can be unexpected: *

    - *
  • - * If `0 < min < max`: `min_adj = 0` and `max_adj = max - min`. - *
  • - *
  • - * If `min < max < 0`: `min_adj = min - max` and `max_adj = 0`. - *
  • - *
  • - * If `min <= 0 <= max`: `scale = (max - min) / (2^num_bits - 1) `, - * `min_adj = scale * round(min / scale)` and `max_adj = max + min_adj - min`. + *
  • If {@code 0 < min < max}: {@code min_adj = 0} and {@code max_adj = max - min}.
  • + *
  • If {@code min < max < 0}: {@code min_adj = min - max} and {@code max_adj = 0}.
  • + *
  • 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}.
  • + *
+ *

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.
  • *
- * Quantization is called fake since the output is still in floating point. * - * @param inputs - * @param options carries optional attributes values + * @param inputs The inputs value + * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxArgs */ public FakeQuantWithMinMaxArgs fakeQuantWithMinMaxArgs(Operand inputs, @@ -233,7 +239,7 @@ public FakeQuantWithMinMaxArgs fakeQuantWithMinMaxArgs(Operand inputs, * * @param gradients Backpropagated gradients above the FakeQuantWithMinMaxArgs operation. * @param inputs Values passed as inputs to the FakeQuantWithMinMaxArgs operation. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxArgsGradient */ public FakeQuantWithMinMaxArgsGradient fakeQuantWithMinMaxArgsGradient( @@ -244,48 +250,56 @@ public FakeQuantWithMinMaxArgsGradient fakeQuantWithMinMaxArgsGradient( /** * Fake-quantize the 'inputs' tensor of type float via global float scalars - *

- * Fake-quantize the `inputs` tensor of type float via global float scalars - * `min` and `max` to `outputs` tensor of same shape as `inputs`. - *

- * Attributes + * Fake-quantize the {@code inputs} tensor of type float via global float scalars + * {@code min} and {@code max} to {@code outputs} tensor of same shape as {@code inputs}. + *

Attributes *

    - *
  • - * `[min; max]` define the clamping range for the `inputs` data. - *
  • - *
  • - * `inputs` values are quantized into the quantization range ( - * `[0; 2^num_bits - 1]` when `narrow_range` is false and `[1; 2^num_bits - 1]` - * when it is true) and then de-quantized and output as floats in `[min; max]` - * interval. - *
  • - *
  • - * `num_bits` is the bitwidth of the quantization; between 2 and 16, inclusive. - *
  • + *
  • {@code [min; max]} define the clamping range for the {@code inputs} data.
  • + *
  • {@code inputs} values are quantized into the quantization range ( + * {@code [0; 2^num_bits - 1]} when {@code narrow_range} is false and {@code [1; 2^num_bits - 1]} + * when it is true) and then de-quantized and output as floats in {@code [min; max]} + * interval.
  • + *
  • {@code num_bits} is the bitwidth of the quantization; between 2 and 16, inclusive.
  • *
- * Before quantization, `min` and `max` values are adjusted with the following + *

Before quantization, {@code min} and {@code max} values are adjusted with the following * logic. - * It is suggested to have `min <= 0 <= max`. If `0` is not in the range of values, + * It is suggested to have {@code min <= 0 <= max}. If {@code 0} is not in the range of values, * the behavior can be unexpected: *

    - *
  • - * If `0 < min < max`: `min_adj = 0` and `max_adj = max - min`. - *
  • - *
  • - * If `min < max < 0`: `min_adj = min - max` and `max_adj = 0`. - *
  • - *
  • - * If `min <= 0 <= max`: `scale = (max - min) / (2^num_bits - 1) `, - * `min_adj = scale * round(min / scale)` and `max_adj = max + min_adj - min`. - *
  • + *
  • If {@code 0 < min < max}: {@code min_adj = 0} and {@code max_adj = max - min}.
  • + *
  • If {@code min < max < 0}: {@code min_adj = min - max} and {@code max_adj = 0}.
  • + *
  • 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}.
  • *
- * This operation has a gradient and thus allows for training `min` and `max` + *

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 - * @param min - * @param max - * @param options carries optional attributes values + * @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 */ public FakeQuantWithMinMaxVars fakeQuantWithMinMaxVars(Operand inputs, @@ -299,9 +313,9 @@ 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 - * @param max - * @param options carries optional attributes values + * @param min The min value + * @param max The max value + * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxVarsGradient */ public FakeQuantWithMinMaxVarsGradient fakeQuantWithMinMaxVarsGradient( @@ -312,49 +326,35 @@ public FakeQuantWithMinMaxVarsGradient fakeQuantWithMinMaxVarsGradient( /** * Fake-quantize the 'inputs' tensor of type float via per-channel floats - *

- * Fake-quantize the `inputs` tensor of type float per-channel and one of the - * shapes: `[d]`, `[b, d]` `[b, h, w, d]` via per-channel floats `min` and `max` - * of shape `[d]` to `outputs` tensor of same shape as `inputs`. - *

- * Attributes + * Fake-quantize the {@code inputs} tensor of type float per-channel and one of the + * shapes: {@code [d]}, {@code [b, d]} {@code [b, h, w, d]} via per-channel floats {@code min} and {@code max} + * of shape {@code [d]} to {@code outputs} tensor of same shape as {@code inputs}. + *

Attributes *

    - *
  • - * `[min; max]` define the clamping range for the `inputs` data. - *
  • - *
  • - * `inputs` values are quantized into the quantization range ( - * `[0; 2^num_bits - 1]` when `narrow_range` is false and `[1; 2^num_bits - 1]` - * when it is true) and then de-quantized and output as floats in `[min; max]` - * interval. - *
  • - *
  • - * `num_bits` is the bitwidth of the quantization; between 2 and 16, inclusive. - *
  • + *
  • {@code [min; max]} define the clamping range for the {@code inputs} data.
  • + *
  • {@code inputs} values are quantized into the quantization range ( + * {@code [0; 2^num_bits - 1]} when {@code narrow_range} is false and {@code [1; 2^num_bits - 1]} + * when it is true) and then de-quantized and output as floats in {@code [min; max]} + * interval.
  • + *
  • {@code num_bits} is the bitwidth of the quantization; between 2 and 16, inclusive.
  • *
- * Before quantization, `min` and `max` values are adjusted with the following + *

Before quantization, {@code min} and {@code max} values are adjusted with the following * logic. - * It is suggested to have `min <= 0 <= max`. If `0` is not in the range of values, + * It is suggested to have {@code min <= 0 <= max}. If {@code 0} is not in the range of values, * the behavior can be unexpected: *

    - *
  • - * If `0 < min < max`: `min_adj = 0` and `max_adj = max - min`. - *
  • - *
  • - * If `min < max < 0`: `min_adj = min - max` and `max_adj = 0`. - *
  • - *
  • - * If `min <= 0 <= max`: `scale = (max - min) / (2^num_bits - 1) `, - * `min_adj = scale * round(min / scale)` and `max_adj = max + min_adj - min`. - *
  • + *
  • If {@code 0 < min < max}: {@code min_adj = 0} and {@code max_adj = max - min}.
  • + *
  • If {@code min < max < 0}: {@code min_adj = min - max} and {@code max_adj = 0}.
  • + *
  • 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}.
  • *
- * This operation has a gradient and thus allows for training `min` and `max` + *

This operation has a gradient and thus allows for training {@code min} and {@code max} * values. * - * @param inputs - * @param min - * @param max - * @param options carries optional attributes values + * @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 */ public FakeQuantWithMinMaxVarsPerChannel fakeQuantWithMinMaxVarsPerChannel( @@ -367,13 +367,13 @@ public FakeQuantWithMinMaxVarsPerChannel fakeQuantWithMinMaxVarsPerChannel( * Compute gradients for a FakeQuantWithMinMaxVarsPerChannel operation. * * @param gradients Backpropagated gradients above the FakeQuantWithMinMaxVars operation, - * shape one of: `[d]`, `[b, d]`, `[b, h, w, d]`. + * shape one of: {@code [d]}, {@code [b, d]}, {@code [b, h, w, d]}. * @param inputs Values passed as inputs to the FakeQuantWithMinMaxVars operation, shape - * same as `gradients`. - * min, max: Quantization interval, floats of shape `[d]`. - * @param min - * @param max - * @param options carries optional attributes values + * same as {@code gradients}. + * min, max: Quantization interval, floats of shape {@code [d]}. + * @param min The min value + * @param max The max value + * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxVarsPerChannelGradient */ public FakeQuantWithMinMaxVarsPerChannelGradient fakeQuantWithMinMaxVarsPerChannelGradient( @@ -384,147 +384,129 @@ public FakeQuantWithMinMaxVarsPerChannelGradient fakeQuantWithMinMaxVarsPerChann /** * Quantize the 'input' tensor of type float to 'output' tensor of type 'T'. - *

* [min_range, max_range] are scalar floats that specify the range for * the 'input' data. The 'mode' attribute controls exactly which calculations are * used to convert the float values to their quantized equivalents. The * 'round_mode' attribute controls which rounding tie-breaking algorithm is used * when rounding float values to their quantized equivalents. - *

- * In 'MIN_COMBINED' mode, each value of the tensor will undergo the following: - *

{@code
+   *  

In 'MIN_COMBINED' mode, each value of the tensor will undergo the following: + *

    *  out[i] = (in[i] - min_range) * range(T) / (max_range - min_range)
    *  if T == qint8: out[i] -= (range(T) + 1) / 2.0
-   *  }
- * here `range(T) = numeric_limits::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 + *

+ *

here {@code range(T) = numeric_limits::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 + *

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: - *

{@code
-   *  num_discrete_values = 1 << (# of bits in T)
+   *  

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 + * numeric_limits<T>::min() + * quantized = max(quantized, numeric_limits<T>::min()) + * quantized = min(quantized, numeric_limits<T>::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 + *

SCALED mode Example + *

{@code SCALED} mode matches the quantization approach used in + * {@code QuantizeAndDequantize{V2|V3}}. + *

If the mode is {@code 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 + * The scaling_factor is determined from {@code min_range} and {@code max_range} to be as large + * as possible such that the range from {@code min_range} to {@code max_range} is representable * within values of type T. - *

{@code
-   *    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 int min_T = std::numeric_limits<T>::min();
+   *    const int max_T = std::numeric_limits<T>::max();
+   *    const float max_float = std::numeric_limits<float>::max();
    *
    *    const float scale_factor_from_min_side =
-   *        (min_T * min_range > 0) ? min_T / min_range : max_float;
+   *        (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;
+   *        (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: - *
{@code
+   *  
+ *

We next use the scale_factor to adjust min_range and max_range as follows: + *

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

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: - *

{@code
+   *  

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 + * {@code min_range} to {@code max_range}, then multiplying by scale_factor as follows: + *

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

The adjusted {@code min_range} and {@code 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. + *

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

axis (int) attribute + *

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

If axis is specified, min_range and max_range + *

if {@code 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. * - * @param data type for {@code output()} output - * @param input + * @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 `output_min`. - * If the `axis` attribute is specified, this must be a 1-D tensor whose size - * matches the `axis` dimension of the input and output tensors. + * 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. * @param maxRange 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 `output_max`. - * If the `axis` attribute is specified, this must be a 1-D tensor whose size - * matches the `axis` dimension of the input and output tensors. - * @param T - * @param options carries optional attributes values + * 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 attribute + * @param options carries optional attribute values + * @param data type for {@code QuantizeV2} output and operands * @return a new instance of Quantize */ - public Quantize quantize(Operand input, Operand minRange, - Operand maxRange, Class T, Quantize.Options... options) { + public Quantize quantize(Operand input, + Operand minRange, Operand maxRange, Class T, + Quantize.Options... options) { return Quantize.create(scope, input, minRange, maxRange, T, options); } /** * Quantizes then dequantizes a tensor. - *

* This is almost identical to QuantizeAndDequantizeV2, except that num_bits is a * tensor, so its value can change during training. * - * @param data type for {@code output()} output - * @param input - * @param inputMin - * @param inputMax - * @param numBits - * @param options carries optional attributes values + * @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 */ public QuantizeAndDequantize quantizeAndDequantize(Operand input, @@ -535,16 +517,15 @@ public QuantizeAndDequantize quantizeAndDequantize(Operan /** * Quantizes then dequantizes a tensor. - *

* This is almost identical to QuantizeAndDequantizeV2, except that num_bits is a * tensor, so its value can change during training. * - * @param data type for {@code output()} output - * @param input - * @param inputMin - * @param inputMax - * @param numBits - * @param options carries optional attributes values + * @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 */ public QuantizeAndDequantizeV3 quantizeAndDequantizeV3(Operand input, @@ -554,16 +535,19 @@ public QuantizeAndDequantizeV3 quantizeAndDequantizeV3(Op } /** - * Returns the gradient of `quantization.QuantizeAndDequantizeV4`. - *

+ * 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 - * @param input - * @param inputMin - * @param inputMax - * @param options carries optional attributes values + * @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} + * tensor. + * @param inputMax 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. + * @param options carries optional attribute values + * @param data type for {@code QuantizeAndDequantizeV4} output and operands * @return a new instance of QuantizeAndDequantizeV4 */ public QuantizeAndDequantizeV4 quantizeAndDequantizeV4(Operand input, @@ -572,17 +556,18 @@ public QuantizeAndDequantizeV4 quantizeAndDequantizeV4(Op } /** - * Returns the gradient of `QuantizeAndDequantizeV4`. - *

+ * 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 inputBackprop()} output - * @param gradients - * @param input - * @param inputMin - * @param inputMax - * @param options carries optional attributes values + * @param gradients The gradients value + * @param input The input value + * @param inputMin If {@code axis} is specified, the shape of the minimum input tensor + * must be rank 1. + * @param inputMax If {@code axis} is specified, the shape of the maximum input tensor + * must be rank 1. + * @param options carries optional attribute values + * @param data type for {@code QuantizeAndDequantizeV4Grad} output and operands * @return a new instance of QuantizeAndDequantizeV4Grad */ public QuantizeAndDequantizeV4Grad quantizeAndDequantizeV4Grad( @@ -593,39 +578,35 @@ public QuantizeAndDequantizeV4Grad quantizeAndDequantizeV /** * Convert the quantized 'input' tensor into a lower-precision 'output', using the - *

* actual distribution of the values to maximize the usage of the lower bit depth * and adjusting the output min and max ranges accordingly. - *

- * [input_min, input_max] are scalar floats that specify the range for the float + *

[input_min, input_max] are scalar floats that specify the range for the float * interpretation of the 'input' data. For example, if input_min is -1.0f and * input_max is 1.0f, and we are dealing with quint16 quantized data, then a 0 * value in the 16-bit data should be interpreted as -1.0f, and a 65535 means 1.0f. - *

- * This operator tries to squeeze as much precision as possible into an output with + *

This operator tries to squeeze as much precision as possible into an output with * a lower bit depth by calculating the actual min and max values found in the * data. For example, maybe that quint16 input has no values lower than 16,384 and * none higher than 49,152. That means only half the range is actually needed, all * the float interpretations are between -0.5f and 0.5f, so if we want to compress * the data into a quint8 output, we can use that range rather than the theoretical * -1.0f to 1.0f that is suggested by the input min and max. - *

- * In practice, this is most useful for taking output from operations like + *

In practice, this is most useful for taking output from operations like * QuantizedMatMul that can produce higher bit-depth outputs than their inputs and * may have large potential output ranges, but in practice have a distribution of * 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 - * @param input + * @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. + * @param data type for {@code QuantizeDownAndShrinkRange} output and operands * @return a new instance of QuantizeDownAndShrinkRange */ - public QuantizeDownAndShrinkRange quantizeDownAndShrinkRange( - Operand input, Operand inputMin, Operand inputMax, + public QuantizeDownAndShrinkRange quantizeDownAndShrinkRange( + Operand input, Operand inputMin, Operand inputMax, Class outType) { return QuantizeDownAndShrinkRange.create(scope, input, inputMin, inputMax, outType); } @@ -633,13 +614,13 @@ public QuantizeDownAndShrinkRange quantizeDownAndShrinkRang /** * 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 `N` Tensors to concatenate. Their ranks and types must match, - * and their sizes must match in all dimensions except `concat_dim`. + * @param values The {@code N} Tensors to concatenate. Their ranks and types must match, + * and their sizes must match in all dimensions except {@code concat_dim}. * @param inputMins The minimum scalar values for each of the input tensors. * @param inputMaxes The maximum scalar values for each of the input tensors. + * @param data type for {@code QuantizedConcat} output and operands * @return a new instance of QuantizedConcat */ public QuantizedConcat quantizedConcat(Operand concatDim, @@ -648,50 +629,291 @@ 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 `(input, input_min, input_max)`, outputs a + * Given a quantized tensor described by {@code (input, input_min, input_max)}, outputs a * range that covers the actual values present in that tensor. This op is typically - * used to produce the `requested_output_min` and `requested_output_max` for - * `Requantize`. + * used to produce the {@code requested_output_min} and {@code requested_output_max} for + * {@code Requantize}. * - * @param input + * @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 */ - public RequantizationRange requantizationRange(Operand input, + public RequantizationRange requantizationRange(Operand input, Operand inputMin, Operand inputMax) { return RequantizationRange.create(scope, input, inputMin, inputMax); } /** - * Converts the quantized `input` tensor into a lower-precision `output`. - *

- * Converts the quantized `input` tensor into a lower-precision `output`, using the - * output range specified with `requested_output_min` and `requested_output_max`. - *

- * `[input_min, input_max]` are scalar floats that specify the range for the float - * interpretation of the `input` data. For example, if `input_min` is -1.0f and - * `input_max` is 1.0f, and we are dealing with `quint16` quantized data, then a 0 + * Converts the quantized {@code input} tensor into a lower-precision {@code output}. + * Converts the quantized {@code input} tensor into a lower-precision {@code output}, using the + * output range specified with {@code requested_output_min} and {@code requested_output_max}. + *

{@code [input_min, input_max]} are scalar floats that specify the range for the float + * 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 - * @param input + * @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. * @param requestedOutputMax The float value that the maximum quantized output value represents. * @param outType The type of the output. Should be a lower bit depth than Tinput. + * @param data type for {@code Requantize} output and operands * @return a new instance of Requantize */ - public Requantize requantize(Operand input, + public Requantize requantize(Operand input, Operand inputMin, Operand inputMax, Operand requestedOutputMin, Operand requestedOutputMax, Class outType) { 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 59aaae4bd70..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; @@ -39,29 +53,385 @@ public final class RaggedOps { /** * Counts the number of occurrences of each value in an integer array. - *

- * Outputs a vector with length `size` and the same dtype as `weights`. If - * `weights` are empty, then index `i` stores the number of times the value `i` is - * counted in `arr`. If `weights` are non-empty, then index `i` stores the sum of - * the value in `weights` at each index where the corresponding value in `arr` is - * `i`. - *

- * Values in `arr` outside of the range [0, size) are ignored. + * Outputs a vector with length {@code size} and the same dtype as {@code weights}. If + * {@code weights} are empty, then index {@code i} stores the number of times the value {@code i} is + * counted in {@code arr}. If {@code weights} are non-empty, then index {@code i} stores the sum of + * 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 - * @param splits 1D int64 `Tensor`. - * @param values 2D int `Tensor`. - * @param size non-negative int scalar `Tensor`. - * @param weights is an int32, int64, float32, or float64 `Tensor` with the same - * shape as `input`, or a length-0 `Tensor`, in which case it acts as all weights + * @param splits 1D int64 {@code Tensor}. + * @param values 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 + * shape as {@code input}, or a length-0 {@code Tensor}, in which case it acts as all weights * equal to 1. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code RaggedBincount} output and operands + * @param data type for {@code RaggedBincount} output and operands * @return a new instance of RaggedBincount */ public RaggedBincount raggedBincount( - Operand splits, Operand values, Operand size, Operand weights, + Operand splits, Operand values, Operand sizeOutput, Operand weights, RaggedBincount.Options... options) { - return RaggedBincount.create(scope, splits, values, size, weights, options); + 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); } /** 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 b1083100c6f..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,17 +87,15 @@ public final class RandomOps { RandomOps(Ops ops) { this.scope = ops.scope(); this.ops = ops; + experimental = new RandomExperimentalOps(ops); } /** * 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 + *

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. @@ -78,7 +107,7 @@ public final class RandomOps { * @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 options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of AllCandidateSampler */ public AllCandidateSampler allCandidateSampler(Operand trueClasses, Long numTrue, @@ -86,15 +115,70 @@ 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 * 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 + *

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. @@ -107,7 +191,7 @@ public AllCandidateSampler allCandidateSampler(Operand trueClasses, Long * 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 attributes values + * @param options carries optional attribute values * @return a new instance of LogUniformCandidateSampler */ public LogUniformCandidateSampler logUniformCandidateSampler(Operand trueClasses, @@ -119,12 +203,11 @@ 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 `[batch_size, num_classes]`. Each slice `[i, :]` + * @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 options carries optional attributes values - * @return a new instance of Multinomial + * @param options carries optional attribute values + * @return a new instance of Multinomial, with default output types */ public Multinomial multinomial(Operand logits, Operand numSamples, Multinomial.Options... options) { @@ -134,12 +217,12 @@ public Multinomial multinomial(Operand logits, /** * Draws samples from a multinomial distribution. * - * @param data type for {@code output()} output - * @param logits 2-D Tensor with shape `[batch_size, num_classes]`. Each slice `[i, :]` + * @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 - * @param options carries optional attributes values + * @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 */ public Multinomial multinomial(Operand logits, @@ -147,20 +230,44 @@ 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. * @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 options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ParameterizedTruncatedNormal} output and operands * @return a new instance of ParameterizedTruncatedNormal */ public ParameterizedTruncatedNormal parameterizedTruncatedNormal( @@ -171,17 +278,16 @@ public ParameterizedTruncatedNormal parameterizedTruncate /** * Outputs random values from the Gamma distribution(s) described by alpha. - *

* 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 * @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 + * @param alpha A tensor in which each scalar is a "shape" parameter describing the * associated gamma distribution. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code RandomGamma} output and operands * @return a new instance of RandomGamma */ public RandomGamma randomGamma(Operand shape, @@ -189,26 +295,36 @@ 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 + * This op uses two algorithms, depending on rate. If rate >= 10, then * the algorithm by Hormann is used to acquire samples via * transformation-rejection. * See http://www.sciencedirect.com/science/article/pii/0167668793909974. - *

- * Otherwise, Knuth's algorithm is used to acquire samples via multiplying uniform + *

Otherwise, Knuth's algorithm is used to acquire samples via multiplying uniform * 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 * @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 + * @param rate A tensor in which each scalar is a "rate" parameter describing the * associated poisson distribution. - * @param options carries optional attributes values - * @return a new instance of RandomPoisson + * @param options carries optional attribute values + * @return a new instance of RandomPoisson, with default output types */ public RandomPoisson randomPoisson(Operand shape, Operand rate, RandomPoisson.Options... options) { @@ -217,24 +333,22 @@ public RandomPoisson randomPoisson(Operand shape, /** * Outputs random values from the Poisson distribution(s) described by rate. - *

- * This op uses two algorithms, depending on rate. If rate >= 10, then + * This op uses two algorithms, depending on rate. If rate >= 10, then * the algorithm by Hormann is used to acquire samples via * transformation-rejection. * See http://www.sciencedirect.com/science/article/pii/0167668793909974. - *

- * Otherwise, Knuth's algorithm is used to acquire samples via multiplying uniform + *

Otherwise, Knuth's algorithm is used to acquire samples via multiplying uniform * 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 * @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 + * @param rate A tensor in which each scalar is a "rate" parameter describing the * associated poisson distribution. - * @param dtype - * @param options carries optional attributes values + * @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 */ public RandomPoisson randomPoisson(Operand shape, @@ -244,19 +358,18 @@ public RandomPoisson randomPoisson(Operand - * The tensor is shuffled along dimension 0, such that each `value[j]` is mapped - * to one and only one `output[i]`. For example, a mapping that might occur for a - * 3x2 tensor is: - *

{@code
+   *  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],
+   *   [3, 4],  ==>   [1, 2],
    *   [5, 6]]        [3, 4]]
-   *  }
+ *
* - * @param data type for {@code output()} output * @param value The tensor to be shuffled. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code RandomShuffle} output and operands * @return a new instance of RandomShuffle */ public RandomShuffle randomShuffle(Operand value, @@ -266,13 +379,12 @@ 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code RandomStandardNormal} output and operands * @return a new instance of RandomStandardNormal */ public RandomStandardNormal randomStandardNormal( @@ -282,14 +394,13 @@ public RandomStandardNormal randomStandardNormal( /** * Outputs random values from a uniform distribution. - *

- * The generated values follow a uniform distribution in the range `[0, 1)`. The + * 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code RandomUniform} output and operands * @return a new instance of RandomUniform */ public RandomUniform randomUniform(Operand shape, @@ -299,20 +410,18 @@ public RandomUniform randomUniform(Operand - * The generated values are uniform integers in the range `[minval, maxval)`. - * The lower bound `minval` is included in the range, while the upper bound - * `maxval` is excluded. - *

- * The random integers are slightly biased unless `maxval - minval` is an exact - * power of two. The bias is small for values of `maxval - minval` significantly - * smaller than the range of the output (either `2^32` or `2^64`). + * 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 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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code RandomUniformInt} output and operands * @return a new instance of RandomUniformInt */ public RandomUniformInt randomUniformInt(Operand shape, @@ -324,7 +433,7 @@ public RandomUniformInt randomUniformInt(OperandIn 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 data type for {@code output()} output - * @param resource - * @param algorithm - * @param shape - * @param counts - * @param probs - * @return a new instance of StatefulRandomBinomial + * @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 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 */ public StatefulRandomBinomial statefulRandomBinomial( - Operand resource, Operand algorithm, Operand shape, - Operand counts, Operand probs) { + Operand resource, Operand algorithm, + Operand shape, Operand counts, Operand probs) { return StatefulRandomBinomial.create(scope, resource, algorithm, shape, counts, probs); } /** + * The StatefulRandomBinomial operation * - * @param data type for {@code output()} output - * @param resource - * @param algorithm - * @param shape - * @param counts - * @param probs - * @param dtype + * @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 */ public StatefulRandomBinomial statefulRandomBinomial( - Operand resource, Operand algorithm, Operand shape, - Operand counts, Operand probs, Class dtype) { + Operand resource, Operand algorithm, + Operand shape, Operand counts, Operand probs, Class dtype) { return StatefulRandomBinomial.create(scope, resource, algorithm, shape, counts, probs, dtype); } /** * 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. - * @return a new instance of StatefulStandardNormal + * @return a new instance of StatefulStandardNormal, with default output types */ - public StatefulStandardNormal statefulStandardNormal(Operand resource, + public StatefulStandardNormal statefulStandardNormal(Operand resource, Operand algorithm, Operand shape) { return StatefulStandardNormal.create(scope, resource, algorithm, shape); } /** * 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. * @param dtype The type of the output. + * @param data type for {@code StatefulStandardNormalV2} output and operands * @return a new instance of StatefulStandardNormal */ - public StatefulStandardNormal statefulStandardNormal(Operand resource, - Operand algorithm, Operand shape, Class dtype) { + public StatefulStandardNormal statefulStandardNormal( + Operand resource, Operand algorithm, Operand shape, + Class dtype) { 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 `[batch_size, num_classes]`. Each slice `[i, :]` + * @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]). - * @return a new instance of StatelessMultinomial + * @return a new instance of StatelessMultinomial, with default output types */ public StatelessMultinomial statelessMultinomial(Operand logits, Operand numSamples, Operand seed) { @@ -415,12 +667,12 @@ public StatelessMultinomial statelessMultinomial(Operand data type for {@code output()} output - * @param logits 2-D Tensor with shape `[batch_size, num_classes]`. Each slice `[i, :]` + * @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 + * @param outputDtype The value of the outputDtype attribute + * @param data type for {@code StatelessMultinomial} output and operands * @return a new instance of StatelessMultinomial */ public StatelessMultinomial statelessMultinomial( @@ -429,17 +681,129 @@ 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 `shape` and `seed`. + *

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 + * @return a new instance of StatelessRandomNormal, with default output types */ public StatelessRandomNormal statelessRandomNormal(Operand shape, Operand seed) { @@ -448,15 +812,13 @@ public StatelessRandomNormal statelessRandomNormal(Operand * The generated values will have mean 0 and standard deviation 1. - *

- * The outputs are a deterministic function of `shape` and `seed`. + *

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. + * @param data type for {@code StatelessRandomNormal} output and operands * @return a new instance of StatelessRandomNormal */ public StatelessRandomNormal statelessRandomNormal( @@ -464,18 +826,69 @@ 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 `[0, 1)`. The + * 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 `shape` and `seed`. + *

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 + * @return a new instance of StatelessRandomUniform, with default output types */ public StatelessRandomUniform statelessRandomUniform(Operand shape, Operand seed) { @@ -484,16 +897,14 @@ public StatelessRandomUniform statelessRandomUniform(Operand - * The generated values follow a uniform distribution in the range `[0, 1)`. The + * 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 `shape` and `seed`. + *

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. + * @param data type for {@code StatelessRandomUniform} output and operands * @return a new instance of StatelessRandomUniform */ public StatelessRandomUniform statelessRandomUniform( @@ -501,19 +912,127 @@ 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 * deviation 1, except that values whose magnitude is more than 2 standard * deviations from the mean are dropped and re-picked. - *

- * The outputs are a deterministic function of `shape` and `seed`. + *

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 + * @return a new instance of StatelessTruncatedNormal, with default output types */ public StatelessTruncatedNormal statelessTruncatedNormal( Operand shape, Operand seed) { @@ -522,17 +1041,15 @@ public StatelessTruncatedNormal statelessTruncatedNormal( /** * Outputs deterministic pseudorandom values from a truncated normal distribution. - *

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

- * The outputs are a deterministic function of `shape` and `seed`. + *

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. + * @param data type for {@code StatelessTruncatedNormal} output and operands * @return a new instance of StatelessTruncatedNormal */ public StatelessTruncatedNormal statelessTruncatedNormal( @@ -540,17 +1057,83 @@ 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code TruncatedNormal} output and operands * @return a new instance of TruncatedNormal */ public TruncatedNormal truncatedNormal(Operand shape, @@ -560,13 +1143,10 @@ public TruncatedNormal truncatedNormal(Operand * 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 + *

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. @@ -579,7 +1159,7 @@ public TruncatedNormal truncatedNormal(Operand trueClasses, Long numTrue, 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 ac5ec77a7fb..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; @@ -44,7 +44,6 @@ public final class ShapeOps { * Creates a 1-dimensional operand containing the dimensions of a shape followed by the last * dimension. * - * @param scope current scope * @param shape the TensorFlow shape * @param lastDimension the dimension(s) to append * @return a 1-dimensional operand containing the dimensions of a shape followed by the last @@ -58,7 +57,6 @@ public Operand append(Shape shape, long lastDimension) { * Creates a 1-dimensional operand containing the dimensions of a shape followed by the last * dimension. * - * @param scope current scope * @param shape the TensorFlow shape * @param lastDimension the dimension(s) to append * @return a 1-dimensional operand containing the dimensions of a shape followed by the last @@ -73,7 +71,6 @@ public Operand append(Shape shape, int lastDimension) { * operand representing a shape, followed by the dimensions of an operand representing a shape to * append. * - * @param scope current scope * @param shape the TensorFlow shape * @param shapeToAppend the other shape to append * @return a 1-dimensional operand that represents a new shape containing the dimensions of the @@ -88,7 +85,6 @@ public Operand append(Operand shape, Operand shapeT * Flatten the operand to 1 dimension. * * @param the type of operand - * @param scope current scope * @param operand the operand to flatten * @return the reshaped operand */ @@ -99,7 +95,6 @@ public Operand flatten(Operand operand) { /** * Flatten the shape to 1 dimension. * - * @param scope current scope * @param shape the TensorFlow shape * @return the flattened shape */ @@ -112,7 +107,6 @@ public Operand flatten(Shape shape) { * * @param the type of operand * @param the shape datatype - * @param scope current scope * @param operand the operand to flatten * @param type the shape datatype * @return the reshaped operand @@ -126,7 +120,6 @@ public Operand flatten(Operand operan * Flatten the shape to 1 dimension. * * @param the shape datatype - * @param scope current scope * @param shape the TensorFlow shape * @param type the shape datatype * @return the flattened shape @@ -138,7 +131,6 @@ public Operand flatten(Shape shape, Class type) { /** * Creates a 1-dimensional Operand containing the Shape's first dimension. * - * @param scope current scope * @param shape the TensorFlow shape * @return a 1-dimensional Operand containing the Shape's first dimension */ @@ -149,7 +141,6 @@ public Operand head(Shape shape) { /** * Creates a 1-dimensional Operand containing the Shape's first dimension. * - * @param scope current scope * @param shape the TensorFlow shape * @param type the shape datatype. * @param the shape datatype. @@ -162,7 +153,6 @@ public Operand head(Shape shape, Class type) { /** * Get the number of dimensions of the shape object. * - * @param scope current scope * @param shape the shape * @return the number of dimensions */ @@ -174,7 +164,6 @@ public Operand numDimensions(Shape shape) { * Get the number of dimensions of the shape object. * * @param the shape datatype - * @param scope the curren scope * @param shape the shape * @param type the shape datatype * @return the number of dimensions @@ -187,7 +176,6 @@ public Operand numDimensions(Shape shape, Class typ * Creates a 1-dimensional operand containing the first dimension followed by the dimensions of * the shape. * - * @param scope current scope * @param shape the TensorFlow shape * @param firstDimension the dimension to prepend * @return a 1-dimensional operand containing the first dimension followed by the dimensions of @@ -201,7 +189,6 @@ public Operand prepend(Shape shape, long firstDimension) { * Creates a 1-dimensional operand containing the first dimension followed by the dimensions of * the shape. * - * @param scope current scope * @param shape the TensorFlow shape * @param firstDimension the dimension to prepend * @return a 1-dimensional operand containing the first dimension followed by the dimensions of @@ -216,7 +203,6 @@ public Operand prepend(Shape shape, int firstDimension) { * operand representing the shape to prepend, followed by the dimensions of an operand * representing a shape. * - * @param scope current scope * @param shape an operand containing the dimensions of a shape * @param shapeToPrepend an operand containing the dimensions of the shape to prepend * @return a 1-dimensional operand that represents a new shape containing the dimensions of an @@ -231,7 +217,6 @@ public Operand prepend(Operand shape, Operand shape * Reshapes the operand by reducing the shape to the specified axis. * * @param the type of Operand - * @param scope current scope * @param operand the operand * @param axis the axis * @return the reshaped operand @@ -243,7 +228,6 @@ public Operand reduceDims(Operand operand, Operand reduceDims(Shape shape, Operand axis) { * * @param the type of Operand * @param the shape datatype - * @param scope current scope * @param operand the operand * @param axis the axis * @param type the shape datatype @@ -272,7 +255,6 @@ public Operand reduceDims(Operand ope * Reduces the shape to the specified axis. * * @param the shape datatype - * @param scope current scope * @param shape the TensorFlow shape * @param axis the axis * @param type the shape datatype @@ -285,7 +267,6 @@ public Operand reduceDims(Shape shape, Operand axis /** * Get the size represented by the TensorFlow shape. * - * @param scope current scope * @param shape the TensorFlow shape * @return the size */ @@ -296,7 +277,6 @@ public Operand size(Shape shape) { /** * Get the size of the specified dimension for the shape of the tensor. * - * @param scope current scope * @param input the operand * @param dim the dimension * @return the size of the specified dimension @@ -308,7 +288,6 @@ public Operand size(Operand input, Operand /** * Get the size of the specified dimension in the shape. * - * @param scope current scope * @param shape the TensorFlow shape * @param dim the dimension * @return the size of the specified dimension @@ -321,7 +300,6 @@ public Operand size(Shape shape, Operand dim) { * Get the size represented by the TensorFlow shape. * * @param the type of the shape - * @param scope current scope * @param shape the TensorFlow shape * @param type the shape datatype * @return the size @@ -334,7 +312,6 @@ public Operand size(Shape shape, Class type) { * Get the size of the specified dimension for the shape of the tensor. * * @param the shape datatype - * @param scope current scope * @param input the operand * @param dim the dimension * @param type the shape datatype @@ -349,7 +326,6 @@ public Operand size(Operand input, Op * Get the size of the specified dimension in the shape. * * @param the shape datatype - * @param scope current scope * @param shape the TensorFlow shape * @param dim the dimension * @param type the shape datatype @@ -362,7 +338,6 @@ public Operand size(Shape shape, Operand dim, Class /** * Removes dimensions of size 1 from the shape. * - * @param scope current scope * @param shape the TensorFlow shape * @return the squeezed shape */ @@ -374,7 +349,6 @@ public Operand squeeze(Shape shape) { * Removes dimensions of size 1 from the shape. * * @param the shape datatype. - * @param scope current scope * @param shape the TensorFlow shape * @param type the shape datatype. * @return the squeezed shape @@ -387,7 +361,6 @@ public Operand squeeze(Shape shape, Class type) { * Creates a 1-dimensional Operand that contains the dimension matching the last dimension of the * Shape. * - * @param scope current scope * @param shape the TensorFlow shape * @return a 1-dimensional Operand that contains the dimension matching the last dimension of the * Shape @@ -400,7 +373,6 @@ public Operand tail(Shape shape) { * Creates a 1-dimensional Operand that contains the dimension matching the last dimension of * * the Shape. * - * @param scope current scope * @param shape the TensorFlow shape * @param type the shape datatype. * @param the shape datatype. @@ -415,9 +387,9 @@ public Operand tail(Shape shape, Class type) { * Creates a 1-dimensional operand with the dimensions matching the first n dimensions of the * shape. * - * @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 */ @@ -429,9 +401,9 @@ public Operand take(Shape shape, Operand n) { * Creates a 1-dimensional operand containin the dimensions matching the first n dimensions of the * shape. * - * @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 with the dimensions matching * the first n dimensions of the @@ -445,9 +417,9 @@ public Operand take(Shape shape, Operand n, Class Operand takeLast(Shape shape, Operand * Creates a 1-dimensional operand containing the dimensions matching the last n dimensions of the * shape. * - * @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/gen/annotations/org/tensorflow/op/SignalOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SignalOps.java index 14d56516167..8537e79ada7 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; @@ -57,67 +61,72 @@ public final class SignalOps { } /** + * The BatchFFT operation * - * @param input + * @param input The input value * @return a new instance of BatchFft */ - public BatchFft batchFft(Operand input) { + public BatchFft batchFft(Operand input) { return BatchFft.create(scope, input); } /** + * The BatchFFT2D operation * - * @param input + * @param input The input value * @return a new instance of BatchFft2d */ - public BatchFft2d batchFft2d(Operand input) { + public BatchFft2d batchFft2d(Operand input) { return BatchFft2d.create(scope, input); } /** + * The BatchFFT3D operation * - * @param input + * @param input The input value * @return a new instance of BatchFft3d */ - public BatchFft3d batchFft3d(Operand input) { + public BatchFft3d batchFft3d(Operand input) { return BatchFft3d.create(scope, input); } /** + * The BatchIFFT operation * - * @param input + * @param input The input value * @return a new instance of BatchIfft */ - public BatchIfft batchIfft(Operand input) { + public BatchIfft batchIfft(Operand input) { return BatchIfft.create(scope, input); } /** + * The BatchIFFT2D operation * - * @param input + * @param input The input value * @return a new instance of BatchIfft2d */ - public BatchIfft2d batchIfft2d(Operand input) { + public BatchIfft2d batchIfft2d(Operand input) { return BatchIfft2d.create(scope, input); } /** + * The BatchIFFT3D operation * - * @param input + * @param input The input value * @return a new instance of BatchIfft3d */ - public BatchIfft3d batchIfft3d(Operand input) { + public BatchIfft3d batchIfft3d(Operand input) { return BatchIfft3d.create(scope, input); } /** * Fast Fourier transform. - *

* Computes the 1-dimensional discrete Fourier transform over the inner-most - * dimension of `input`. + * 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 */ public Fft fft(Operand input) { @@ -126,12 +135,11 @@ public Fft fft(Operand input) { /** * 2D fast Fourier transform. - *

* Computes the 2-dimensional discrete Fourier transform over the inner-most - * 2 dimensions of `input`. + * 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 */ public Fft2d fft2d(Operand input) { @@ -140,26 +148,46 @@ public Fft2d fft2d(Operand input) { /** * 3D fast Fourier transform. - *

* Computes the 3-dimensional discrete Fourier transform over the inner-most 3 - * dimensions of `input`. + * 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 */ 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 `input`. + * 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 */ public Ifft ifft(Operand input) { @@ -168,12 +196,11 @@ public Ifft ifft(Operand input) { /** * Inverse 2D fast Fourier transform. - *

* Computes the inverse 2-dimensional discrete Fourier transform over the - * inner-most 2 dimensions of `input`. + * 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 */ public Ifft2d ifft2d(Operand input) { @@ -182,39 +209,56 @@ public Ifft2d ifft2d(Operand input) { /** * Inverse 3D fast Fourier transform. - *

* Computes the inverse 3-dimensional discrete Fourier transform over the - * inner-most 3 dimensions of `input`. + * 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 */ 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 - * signal over the inner-most dimension of `input`. - *

- * The inner-most dimension of `input` is assumed to be the result of `RFFT`: the - * `fft_length / 2 + 1` unique components of the DFT of a real-valued signal. If - * `fft_length` is not provided, it is computed from the size of the inner-most - * dimension of `input` (`fft_length = 2 * (inner - 1)`). If the FFT length used to - * compute `input` is odd, it should be provided since it cannot be inferred + * signal over the inner-most dimension of {@code input}. + *

The inner-most dimension of {@code input} is assumed to be the result of {@code RFFT}: the + * {@code fft_length / 2 + 1} unique components of the DFT of a real-valued signal. If + * {@code fft_length} is not provided, it is computed from the size of the inner-most + * dimension of {@code input} ({@code fft_length = 2 * (inner - 1)}). If the FFT length used to + * compute {@code input} is odd, it should be provided since it cannot be inferred * properly. - *

- * Along the axis `signal.Irfft` is computed on, if `fft_length / 2 + 1` is smaller - * than the corresponding dimension of `input`, the dimension is cropped. If it is + *

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 * @param input A complex tensor. * @param fftLength An int32 tensor of shape [1]. The FFT length. - * @return a new instance of Irfft + * @return a new instance of Irfft, with default output types */ public Irfft irfft(Operand input, Operand fftLength) { return Irfft.create(scope, input, fftLength); @@ -222,25 +266,22 @@ public Irfft irfft(Operand input, Operand fft /** * Inverse real-valued fast Fourier transform. - *

* Computes the inverse 1-dimensional discrete Fourier transform of a real-valued - * signal over the inner-most dimension of `input`. - *

- * The inner-most dimension of `input` is assumed to be the result of `RFFT`: the - * `fft_length / 2 + 1` unique components of the DFT of a real-valued signal. If - * `fft_length` is not provided, it is computed from the size of the inner-most - * dimension of `input` (`fft_length = 2 * (inner - 1)`). If the FFT length used to - * compute `input` is odd, it should be provided since it cannot be inferred + * signal over the inner-most dimension of {@code input}. + *

The inner-most dimension of {@code input} is assumed to be the result of {@code RFFT}: the + * {@code fft_length / 2 + 1} unique components of the DFT of a real-valued signal. If + * {@code fft_length} is not provided, it is computed from the size of the inner-most + * dimension of {@code input} ({@code fft_length = 2 * (inner - 1)}). If the FFT length used to + * compute {@code input} is odd, it should be provided since it cannot be inferred * properly. - *

- * Along the axis `signal.Irfft` is computed on, if `fft_length / 2 + 1` is smaller - * than the corresponding dimension of `input`, the dimension is cropped. If it is + *

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 * @param input A complex tensor. * @param fftLength An int32 tensor of shape [1]. The FFT length. - * @param Treal + * @param Treal The value of the Treal attribute + * @param data type for {@code IRFFT} output and operands * @return a new instance of Irfft */ public Irfft irfft(Operand input, @@ -250,26 +291,22 @@ public Irfft irfft(Operand input, /** * Inverse 2D real-valued fast Fourier transform. - *

* Computes the inverse 2-dimensional discrete Fourier transform of a real-valued - * signal over the inner-most 2 dimensions of `input`. - *

- * The inner-most 2 dimensions of `input` are assumed to be the result of `RFFT2D`: - * The inner-most dimension contains the `fft_length / 2 + 1` unique components of - * the DFT of a real-valued signal. If `fft_length` is not provided, it is computed - * from the size of the inner-most 2 dimensions of `input`. If the FFT length used - * to compute `input` is odd, it should be provided since it cannot be inferred + * signal over the inner-most 2 dimensions of {@code input}. + *

The inner-most 2 dimensions of {@code input} are assumed to be the result of {@code RFFT2D}: + * The inner-most dimension contains the {@code fft_length / 2 + 1} unique components of + * the DFT of a real-valued signal. If {@code fft_length} is not provided, it is computed + * from the size of the inner-most 2 dimensions of {@code input}. If the FFT length used + * to compute {@code input} is odd, it should be provided since it cannot be inferred * properly. - *

- * Along each axis `signal.Irfft2d` is computed on, if `fft_length` (or - * `fft_length / 2 + 1` for the inner-most dimension) is smaller than the - * corresponding dimension of `input`, the dimension is cropped. If it is larger, + *

Along each axis {@code signal.Irfft2d} is computed on, if {@code fft_length} (or + * {@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 * @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 + * @return a new instance of Irfft2d, with default output types */ public Irfft2d irfft2d(Operand input, Operand fftLength) { return Irfft2d.create(scope, input, fftLength); @@ -277,26 +314,23 @@ public Irfft2d irfft2d(Operand input, Operand /** * Inverse 2D real-valued fast Fourier transform. - *

* Computes the inverse 2-dimensional discrete Fourier transform of a real-valued - * signal over the inner-most 2 dimensions of `input`. - *

- * The inner-most 2 dimensions of `input` are assumed to be the result of `RFFT2D`: - * The inner-most dimension contains the `fft_length / 2 + 1` unique components of - * the DFT of a real-valued signal. If `fft_length` is not provided, it is computed - * from the size of the inner-most 2 dimensions of `input`. If the FFT length used - * to compute `input` is odd, it should be provided since it cannot be inferred + * signal over the inner-most 2 dimensions of {@code input}. + *

The inner-most 2 dimensions of {@code input} are assumed to be the result of {@code RFFT2D}: + * The inner-most dimension contains the {@code fft_length / 2 + 1} unique components of + * the DFT of a real-valued signal. If {@code fft_length} is not provided, it is computed + * from the size of the inner-most 2 dimensions of {@code input}. If the FFT length used + * to compute {@code input} is odd, it should be provided since it cannot be inferred * properly. - *

- * Along each axis `signal.Irfft2d` is computed on, if `fft_length` (or - * `fft_length / 2 + 1` for the inner-most dimension) is smaller than the - * corresponding dimension of `input`, the dimension is cropped. If it is larger, + *

Along each axis {@code signal.Irfft2d} is computed on, if {@code fft_length} (or + * {@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 * @param input A complex tensor. * @param fftLength An int32 tensor of shape [2]. The FFT length for each dimension. - * @param Treal + * @param Treal The value of the Treal attribute + * @param data type for {@code IRFFT2D} output and operands * @return a new instance of Irfft2d */ public Irfft2d irfft2d(Operand input, @@ -306,26 +340,22 @@ public Irfft2d irfft2d(Operand input, /** * Inverse 3D real-valued fast Fourier transform. - *

* Computes the inverse 3-dimensional discrete Fourier transform of a real-valued - * signal over the inner-most 3 dimensions of `input`. - *

- * The inner-most 3 dimensions of `input` are assumed to be the result of `RFFT3D`: - * The inner-most dimension contains the `fft_length / 2 + 1` unique components of - * the DFT of a real-valued signal. If `fft_length` is not provided, it is computed - * from the size of the inner-most 3 dimensions of `input`. If the FFT length used - * to compute `input` is odd, it should be provided since it cannot be inferred + * signal over the inner-most 3 dimensions of {@code input}. + *

The inner-most 3 dimensions of {@code input} are assumed to be the result of {@code RFFT3D}: + * The inner-most dimension contains the {@code fft_length / 2 + 1} unique components of + * the DFT of a real-valued signal. If {@code fft_length} is not provided, it is computed + * from the size of the inner-most 3 dimensions of {@code input}. If the FFT length used + * to compute {@code input} is odd, it should be provided since it cannot be inferred * properly. - *

- * Along each axis `signal.Irfft3d` is computed on, if `fft_length` (or - * `fft_length / 2 + 1` for the inner-most dimension) is smaller than the - * corresponding dimension of `input`, the dimension is cropped. If it is larger, + *

Along each axis {@code signal.Irfft3d} is computed on, if {@code fft_length} (or + * {@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 * @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 + * @return a new instance of Irfft3d, with default output types */ public Irfft3d irfft3d(Operand input, Operand fftLength) { return Irfft3d.create(scope, input, fftLength); @@ -333,26 +363,23 @@ public Irfft3d irfft3d(Operand input, Operand /** * Inverse 3D real-valued fast Fourier transform. - *

* Computes the inverse 3-dimensional discrete Fourier transform of a real-valued - * signal over the inner-most 3 dimensions of `input`. - *

- * The inner-most 3 dimensions of `input` are assumed to be the result of `RFFT3D`: - * The inner-most dimension contains the `fft_length / 2 + 1` unique components of - * the DFT of a real-valued signal. If `fft_length` is not provided, it is computed - * from the size of the inner-most 3 dimensions of `input`. If the FFT length used - * to compute `input` is odd, it should be provided since it cannot be inferred + * signal over the inner-most 3 dimensions of {@code input}. + *

The inner-most 3 dimensions of {@code input} are assumed to be the result of {@code RFFT3D}: + * The inner-most dimension contains the {@code fft_length / 2 + 1} unique components of + * the DFT of a real-valued signal. If {@code fft_length} is not provided, it is computed + * from the size of the inner-most 3 dimensions of {@code input}. If the FFT length used + * to compute {@code input} is odd, it should be provided since it cannot be inferred * properly. - *

- * Along each axis `signal.Irfft3d` is computed on, if `fft_length` (or - * `fft_length / 2 + 1` for the inner-most dimension) is smaller than the - * corresponding dimension of `input`, the dimension is cropped. If it is larger, + *

Along each axis {@code signal.Irfft3d} is computed on, if {@code fft_length} (or + * {@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 * @param input A complex tensor. * @param fftLength An int32 tensor of shape [3]. The FFT length for each dimension. - * @param Treal + * @param Treal The value of the Treal attribute + * @param data type for {@code IRFFT3D} output and operands * @return a new instance of Irfft3d */ public Irfft3d irfft3d(Operand input, @@ -360,24 +387,68 @@ 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 - * over the inner-most dimension of `input`. - *

- * Since the DFT of a real signal is Hermitian-symmetric, `signal.Rfft` only returns the - * `fft_length / 2 + 1` unique components of the FFT: the zero-frequency term, - * followed by the `fft_length / 2` positive-frequency terms. - *

- * Along the axis `signal.Rfft` is computed on, if `fft_length` is smaller than the - * corresponding dimension of `input`, the dimension is cropped. If it is larger, + * over the inner-most dimension of {@code input}. + *

Since the DFT of a real signal is Hermitian-symmetric, {@code signal.Rfft} only returns the + * {@code fft_length / 2 + 1} unique components of the FFT: the zero-frequency term, + * followed by the {@code fft_length / 2} positive-frequency terms. + *

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 - * @param input A float32 tensor. + * @param input A float32 or float64 tensor. * @param fftLength An int32 tensor of shape [1]. The FFT length. - * @param Tcomplex + * @param Tcomplex Should be {@code tf.complex64} when the type of {@code input} is {@code float32}. + * Should be {@code tf.complex128} when the type of {@code input} is {@code float64}. + * @param data type for {@code RFFT} output and operands * @return a new instance of Rfft */ public Rfft rfft(Operand input, Operand fftLength, @@ -387,23 +458,21 @@ public Rfft rfft(Operand input, Operand< /** * 2D real-valued fast Fourier transform. - *

* Computes the 2-dimensional discrete Fourier transform of a real-valued signal - * over the inner-most 2 dimensions of `input`. - *

- * Since the DFT of a real signal is Hermitian-symmetric, `signal.Rfft2d` only returns the - * `fft_length / 2 + 1` unique components of the FFT for the inner-most dimension - * of `output`: the zero-frequency term, followed by the `fft_length / 2` + * over the inner-most 2 dimensions of {@code input}. + *

Since the DFT of a real signal is Hermitian-symmetric, {@code signal.Rfft2d} only returns the + * {@code fft_length / 2 + 1} unique components of the FFT for the inner-most dimension + * of {@code output}: the zero-frequency term, followed by the {@code fft_length / 2} * positive-frequency terms. - *

- * Along each axis `signal.Rfft2d` is computed on, if `fft_length` is smaller than the - * corresponding dimension of `input`, the dimension is cropped. If it is larger, + *

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 - * @param input A float32 tensor. + * @param input A float32 or float64 tensor. * @param fftLength An int32 tensor of shape [2]. The FFT length for each dimension. - * @param Tcomplex + * @param Tcomplex Should be {@code tf.complex64} when the type of {@code input} is {@code float32}. + * Should be {@code tf.complex128} when the type of {@code input} is {@code float64}. + * @param data type for {@code RFFT2D} output and operands * @return a new instance of Rfft2d */ public Rfft2d rfft2d(Operand input, @@ -413,23 +482,21 @@ public Rfft2d rfft2d(Operand input, /** * 3D real-valued fast Fourier transform. - *

* Computes the 3-dimensional discrete Fourier transform of a real-valued signal - * over the inner-most 3 dimensions of `input`. - *

- * Since the DFT of a real signal is Hermitian-symmetric, `signal.Rfft3d` only returns the - * `fft_length / 2 + 1` unique components of the FFT for the inner-most dimension - * of `output`: the zero-frequency term, followed by the `fft_length / 2` + * over the inner-most 3 dimensions of {@code input}. + *

Since the DFT of a real signal is Hermitian-symmetric, {@code signal.Rfft3d} only returns the + * {@code fft_length / 2 + 1} unique components of the FFT for the inner-most dimension + * of {@code output}: the zero-frequency term, followed by the {@code fft_length / 2} * positive-frequency terms. - *

- * Along each axis `signal.Rfft3d` is computed on, if `fft_length` is smaller than the - * corresponding dimension of `input`, the dimension is cropped. If it is larger, + *

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 - * @param input A float32 tensor. + * @param input A float32 or float64 tensor. * @param fftLength An int32 tensor of shape [3]. The FFT length for each dimension. - * @param Tcomplex + * @param Tcomplex Should be {@code tf.complex64} when the type of {@code input} is {@code float32}. + * Should be {@code tf.complex128} when the type of {@code input} is {@code float64}. + * @param data type for {@code RFFT3D} output and operands * @return a new instance of Rfft3d */ public Rfft3d rfft3d(Operand input, @@ -437,6 +504,31 @@ 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 float32 or float64 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 Should be {@code tf.complex64} when the type of {@code input} is {@code float32}. + * Should be {@code tf.complex128} when the type of {@code input} is {@code float64}. + * @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 06109db5383..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; @@ -52,6 +58,7 @@ import org.tensorflow.op.sparse.SparseSegmentSqrtNGrad; import org.tensorflow.op.sparse.SparseSegmentSqrtNWithNumSegments; import org.tensorflow.op.sparse.SparseSegmentSum; +import org.tensorflow.op.sparse.SparseSegmentSumGrad; import org.tensorflow.op.sparse.SparseSegmentSumWithNumSegments; import org.tensorflow.op.sparse.SparseSlice; import org.tensorflow.op.sparse.SparseSliceGrad; @@ -65,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; @@ -74,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; @@ -87,36 +95,32 @@ public final class SparseOps { } /** - * Add an `N`-minibatch `SparseTensor` to a `SparseTensorsMap`, return `N` handles. - *

- * A `SparseTensor` of rank `R` is represented by three tensors: `sparse_indices`, - * `sparse_values`, and `sparse_shape`, where - *

{@code
-   *  sparse_indices.shape[1] == sparse_shape.shape[0] == R}
- * An `N`-minibatch of `SparseTensor` objects is represented as a `SparseTensor` - * having a first `sparse_indices` column taking values between `[0, N)`, where - * the minibatch size `N == sparse_shape[0]`. - *

- * The input `SparseTensor` must have rank `R` greater than 1, and the first - * dimension is treated as the minibatch dimension. Elements of the `SparseTensor` + * Add an {@code N}-minibatch {@code SparseTensor} to a {@code SparseTensorsMap}, return {@code N} handles. + * A {@code SparseTensor} of rank {@code R} is represented by three tensors: {@code sparse_indices}, + * {@code sparse_values}, and {@code sparse_shape}, where + *

{@code sparse_indices.shape[1] == sparse_shape.shape[0] == R} + *

An {@code N}-minibatch of {@code SparseTensor} objects is represented as a {@code SparseTensor} + * having a first {@code sparse_indices} column taking values between {@code [0, N)}, where + * the minibatch size {@code N == sparse_shape[0]}. + *

The input {@code SparseTensor} must have rank {@code R} greater than 1, and the first + * dimension is treated as the minibatch dimension. Elements of the {@code SparseTensor} * must be sorted in increasing order of this first dimension. The stored - * `SparseTensor` objects pointed to by each row of the output `sparse_handles` - * will have rank `R-1`. - *

- * The `SparseTensor` values can then be read out as part of a minibatch by passing - * the given keys as vector elements to `TakeManySparseFromTensorsMap`. To ensure - * the correct `SparseTensorsMap` is accessed, ensure that the same - * `container` and `shared_name` are passed to that Op. If no `shared_name` - * is provided here, instead use the name of the Operation created by calling - * `sparse.AddManySparseToTensorsMap` as the `shared_name` passed to - * `TakeManySparseFromTensorsMap`. Ensure the Operations are colocated. - * - * @param sparseIndices 2-D. The `indices` of the minibatch `SparseTensor`. - * `sparse_indices[:, 0]` must be ordered values in `[0, N)`. - * @param sparseValues 1-D. The `values` of the minibatch `SparseTensor`. - * @param sparseShape 1-D. The `shape` of the minibatch `SparseTensor`. - * The minibatch size `N == sparse_shape[0]`. - * @param options carries optional attributes values + * {@code SparseTensor} objects pointed to by each row of the output {@code sparse_handles} + * will have rank {@code R-1}. + *

The {@code SparseTensor} values can then be read out as part of a minibatch by passing + * the given keys as vector elements to {@code TakeManySparseFromTensorsMap}. To ensure + * the correct {@code SparseTensorsMap} is accessed, ensure that the same + * {@code container} and {@code shared_name} are passed to that Op. If no {@code shared_name} + * is provided here, instead use the name of the Operation created by calling + * {@code sparse.AddManySparseToTensorsMap} as the {@code shared_name} passed to + * {@code TakeManySparseFromTensorsMap}. Ensure the Operations are colocated. + * + * @param sparseIndices 2-D. The {@code indices} of the minibatch {@code SparseTensor}. + * {@code sparse_indices[:, 0]} must be ordered values in {@code [0, N)}. + * @param sparseValues 1-D. The {@code values} of the minibatch {@code SparseTensor}. + * @param sparseShape 1-D. The {@code shape} of the minibatch {@code SparseTensor}. + * The minibatch size {@code N == sparse_shape[0]}. + * @param options carries optional attribute values * @return a new instance of AddManySparseToTensorsMap */ public AddManySparseToTensorsMap addManySparseToTensorsMap(Operand sparseIndices, @@ -126,27 +130,24 @@ public AddManySparseToTensorsMap addManySparseToTensorsMap(Operand spars } /** - * Add a `SparseTensor` to a `SparseTensorsMap` return its handle. - *

- * A `SparseTensor` is represented by three tensors: `sparse_indices`, - * `sparse_values`, and `sparse_shape`. - *

- * This operator takes the given `SparseTensor` and adds it to a container - * object (a `SparseTensorsMap`). A unique key within this container is generated - * in the form of an `int64`, and this is the value that is returned. - *

- * The `SparseTensor` can then be read out as part of a minibatch by passing - * the key as a vector element to `TakeManySparseFromTensorsMap`. To ensure - * the correct `SparseTensorsMap` is accessed, ensure that the same - * `container` and `shared_name` are passed to that Op. If no `shared_name` - * is provided here, instead use the name of the Operation created by calling - * `sparse.AddSparseToTensorsMap` as the `shared_name` passed to - * `TakeManySparseFromTensorsMap`. Ensure the Operations are colocated. - * - * @param sparseIndices 2-D. The `indices` of the `SparseTensor`. - * @param sparseValues 1-D. The `values` of the `SparseTensor`. - * @param sparseShape 1-D. The `shape` of the `SparseTensor`. - * @param options carries optional attributes values + * Add a {@code SparseTensor} to a {@code SparseTensorsMap} return its handle. + * A {@code SparseTensor} is represented by three tensors: {@code sparse_indices}, + * {@code sparse_values}, and {@code sparse_shape}. + *

This operator takes the given {@code SparseTensor} and adds it to a container + * object (a {@code SparseTensorsMap}). A unique key within this container is generated + * in the form of an {@code int64}, and this is the value that is returned. + *

The {@code SparseTensor} can then be read out as part of a minibatch by passing + * the key as a vector element to {@code TakeManySparseFromTensorsMap}. To ensure + * the correct {@code SparseTensorsMap} is accessed, ensure that the same + * {@code container} and {@code shared_name} are passed to that Op. If no {@code shared_name} + * is provided here, instead use the name of the Operation created by calling + * {@code sparse.AddSparseToTensorsMap} as the {@code shared_name} passed to + * {@code TakeManySparseFromTensorsMap}. Ensure the Operations are colocated. + * + * @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}. + * @param options carries optional attribute values * @return a new instance of AddSparseToTensorsMap */ public AddSparseToTensorsMap addSparseToTensorsMap(Operand sparseIndices, @@ -156,23 +157,89 @@ public AddSparseToTensorsMap addSparseToTensorsMap(Operand sparseIndices } /** - * Applies set operation along last dimension of 2 `Tensor` inputs. - *

- * See SetOperationOp::SetOperationFromContext for values of `set_operation`. - *

- * Output `result` is a `SparseTensor` represented by `result_indices`, - * `result_values`, and `result_shape`. For `set1` and `set2` ranked `n`, this - * has rank `n` and the same 1st `n-1` dimensions as `set1` and `set2`. The `nth` - * dimension contains the result of `set_operation` applied to the corresponding - * `[0...n-1]` dimension of `set`. - * - * @param data type for {@code resultValues()} output - * @param set1 `Tensor` with rank `n`. 1st `n-1` dimensions must be the same as `set2`. - * Dimension `n` contains values in a set, duplicates are allowed but ignored. - * @param set2 `Tensor` with rank `n`. 1st `n-1` dimensions must be the same as `set1`. - * Dimension `n` contains values in a set, duplicates are allowed but ignored. - * @param setOperation - * @param options carries optional attributes values + * 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}. + *

Output {@code result} is a {@code SparseTensor} represented by {@code result_indices}, + * {@code result_values}, and {@code result_shape}. For {@code set1} and {@code set2} ranked {@code n}, this + * 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 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 attribute + * @param options carries optional attribute values + * @param data type for {@code DenseToDenseSetOperation} output and operands * @return a new instance of DenseToDenseSetOperation */ public DenseToDenseSetOperation denseToDenseSetOperation(Operand set1, @@ -181,36 +248,32 @@ public DenseToDenseSetOperation denseToDenseSetOperation(Op } /** - * Applies set operation along last dimension of `Tensor` and `SparseTensor`. - *

- * See SetOperationOp::SetOperationFromContext for values of `set_operation`. - *

- * Input `set2` is a `SparseTensor` represented by `set2_indices`, `set2_values`, - * and `set2_shape`. For `set2` ranked `n`, 1st `n-1` dimensions must be the same - * as `set1`. Dimension `n` contains values in a set, duplicates are allowed but + * Applies set operation along last dimension of {@code Tensor} and {@code SparseTensor}. + * See SetOperationOp::SetOperationFromContext for values of {@code set_operation}. + *

Input {@code set2} is a {@code SparseTensor} represented by {@code set2_indices}, {@code set2_values}, + * and {@code set2_shape}. For {@code set2} ranked {@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. - *

- * If `validate_indices` is `True`, this op validates the order and range of `set2` + *

If {@code validate_indices} is {@code True}, this op validates the order and range of {@code set2} * indices. - *

- * Output `result` is a `SparseTensor` represented by `result_indices`, - * `result_values`, and `result_shape`. For `set1` and `set2` ranked `n`, this - * has rank `n` and the same 1st `n-1` dimensions as `set1` and `set2`. The `nth` - * dimension contains the result of `set_operation` applied to the corresponding - * `[0...n-1]` dimension of `set`. - * - * @param data type for {@code resultValues()} output - * @param set1 `Tensor` with rank `n`. 1st `n-1` dimensions must be the same as `set2`. - * Dimension `n` contains values in a set, duplicates are allowed but ignored. - * @param set2Indices 2D `Tensor`, indices of a `SparseTensor`. Must be in row-major + *

Output {@code result} is a {@code SparseTensor} represented by {@code result_indices}, + * {@code result_values}, and {@code result_shape}. For {@code set1} and {@code set2} ranked {@code n}, this + * 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 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 * order. - * @param set2Values 1D `Tensor`, values of a `SparseTensor`. Must be in row-major + * @param set2Values 1D {@code Tensor}, values of a {@code SparseTensor}. Must be in row-major * order. - * @param set2Shape 1D `Tensor`, shape of a `SparseTensor`. `set2_shape[0...n-1]` must - * be the same as the 1st `n-1` dimensions of `set1`, `result_shape[n]` is the - * max set size across `n-1` dimensions. - * @param setOperation - * @param options carries optional attributes values + * @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 attribute + * @param options carries optional attribute values + * @param data type for {@code DenseToSparseSetOperation} output and operands * @return a new instance of DenseToSparseSetOperation */ public DenseToSparseSetOperation denseToSparseSetOperation(Operand set1, @@ -220,54 +283,51 @@ public DenseToSparseSetOperation denseToSparseSetOperation( } /** - * Deserialize `SparseTensor` objects. - *

- * The input `serialized_sparse` must have the shape `[?, ?, ..., ?, 3]` where - * the last dimension stores serialized `SparseTensor` objects and the other N - * dimensions (N >= 0) correspond to a batch. The ranks of the original - * `SparseTensor` objects must all match. When the final `SparseTensor` is - * created, its rank is the rank of the incoming `SparseTensor` objects plus N; + * Deserialize {@code SparseTensor} objects. + * The input {@code serialized_sparse} must have the shape {@code [?, ?, ..., ?, 3]} where + * the last dimension stores serialized {@code SparseTensor} objects and the other N + * dimensions (N >= 0) correspond to a batch. The ranks of the original + * {@code SparseTensor} objects must all match. When the final {@code SparseTensor} is + * created, its rank is the rank of the incoming {@code SparseTensor} objects plus N; * the sparse tensors have been concatenated along new dimensions, one for each * batch. - *

- * The output `SparseTensor` object's shape values for the original dimensions - * are the max across the input `SparseTensor` objects' shape values for the + *

The output {@code SparseTensor} object's shape values for the original dimensions + * are the max across the input {@code SparseTensor} objects' shape values for the * corresponding dimensions. The new dimensions match the size of the batch. - *

- * The input `SparseTensor` objects' indices are assumed ordered in + *

The input {@code SparseTensor} objects' indices are assumed ordered in * standard lexicographic order. If this is not the case, after this - * step run `SparseReorder` to restore index ordering. - *

- * For example, if the serialized input is a `[2 x 3]` matrix representing two - * original `SparseTensor` objects: - *

- * index = [ 0] - * [10] - * [20] - * values = [1, 2, 3] - * shape = [50] - *

- * and - *

- * index = [ 2] - * [10] - * values = [4, 5] - * shape = [30] - *

- * then the final deserialized `SparseTensor` will be: - *

- * index = [0 0] - * [0 10] - * [0 20] - * [1 2] - * [1 10] - * values = [1, 2, 3, 4, 5] - * shape = [2 50] + * step run {@code SparseReorder} to restore index ordering. + *

For example, if the serialized input is a {@code [2 x 3]} matrix representing two + * original {@code SparseTensor} objects: + *

+   *  index = [ 0]
+   *          [10]
+   *          [20]
+   *  values = [1, 2, 3]
+   *  shape = [50]
+   *  
+ *

and + *

+   *  index = [ 2]
+   *          [10]
+   *  values = [4, 5]
+   *  shape = [30]
+   *  
+ *

then the final deserialized {@code SparseTensor} will be: + *

+   *  index = [0  0]
+   *          [0 10]
+   *          [0 20]
+   *          [1  2]
+   *          [1 10]
+   *  values = [1, 2, 3, 4, 5]
+   *  shape = [2 50]
+   *  
* - * @param data type for {@code sparseValues()} output - * @param serializedSparse The serialized `SparseTensor` objects. The last dimension + * @param serializedSparse The serialized {@code SparseTensor} objects. The last dimension * must have 3 columns. - * @param dtype The `dtype` of the serialized `SparseTensor` objects. + * @param dtype The {@code dtype} of the serialized {@code SparseTensor} objects. + * @param data type for {@code DeserializeSparse} output and operands * @return a new instance of DeserializeSparse */ public DeserializeSparse deserializeSparse( @@ -275,9 +335,31 @@ 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 * global_step. * @@ -302,7 +384,6 @@ public SparseAccumulatorApplyGradient sparseAccumulatorApplyGradient(Operand * The op will 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 will return its @@ -310,11 +391,11 @@ 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 * of the accumulator. + * @param data type for {@code SparseAccumulatorTakeGradient} output and operands * @return a new instance of SparseAccumulatorTakeGradient */ public SparseAccumulatorTakeGradient sparseAccumulatorTakeGradient( @@ -323,31 +404,28 @@ public SparseAccumulatorTakeGradient sparseAccumulatorTakeG } /** - * Adds two `SparseTensor` objects to produce another `SparseTensor`. - *

- * The input `SparseTensor` objects' indices are assumed ordered in standard + * Adds two {@code SparseTensor} objects to produce another {@code SparseTensor}. + * The input {@code SparseTensor} objects' indices are assumed ordered in standard * lexicographic order. If this is not the case, before this step run - * `SparseReorder` to restore index ordering. - *

- * By default, if two values sum to zero at some index, the output `SparseTensor` + * {@code SparseReorder} to restore index ordering. + *

By default, if two values sum to zero at some index, the output {@code SparseTensor} * would still include that particular location in its index, storing a zero in the - * corresponding value slot. To override this, callers can specify `thresh`, - * indicating that if the sum has a magnitude strictly smaller than `thresh`, its + * corresponding value slot. To override this, callers can specify {@code thresh}, + * indicating that if the sum has a magnitude strictly smaller than {@code thresh}, its * corresponding value and index would then not be included. In particular, - * `thresh == 0` (default) means everything is kept and actual thresholding happens + * {@code thresh == 0} (default) means everything is kept and actual thresholding happens * only for a positive value. - *

- * In the following shapes, `nnz` is the count after taking `thresh` into account. - * - * @param data type for {@code sumValues()} output - * @param aIndices 2-D. The `indices` of the first `SparseTensor`, size `[nnz, ndims]` Matrix. - * @param aValues 1-D. The `values` of the first `SparseTensor`, size `[nnz]` Vector. - * @param aShape 1-D. The `shape` of the first `SparseTensor`, size `[ndims]` Vector. - * @param bIndices 2-D. The `indices` of the second `SparseTensor`, size `[nnz, ndims]` Matrix. - * @param bValues 1-D. The `values` of the second `SparseTensor`, size `[nnz]` Vector. - * @param bShape 1-D. The `shape` of the second `SparseTensor`, size `[ndims]` Vector. + *

In the following shapes, {@code nnz} is the count after taking {@code thresh} into account. + * + * @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. + * @param bIndices 2-D. The {@code indices} of the second {@code SparseTensor}, size {@code [nnz, ndims]} Matrix. + * @param bValues 1-D. The {@code values} of the second {@code SparseTensor}, size {@code [nnz]} Vector. + * @param bShape 1-D. The {@code shape} of the second {@code SparseTensor}, size {@code [ndims]} Vector. * @param thresh 0-D. The magnitude threshold that determines if an output value/index * pair takes space. + * @param data type for {@code SparseAdd} output and operands * @return a new instance of SparseAdd */ public SparseAdd sparseAdd(Operand aIndices, Operand aValues, @@ -358,19 +436,18 @@ public SparseAdd sparseAdd(Operand aIndices, Operan /** * The gradient operator for the SparseAdd op. - *

* The SparseAdd op calculates A + B, where A, B, and the sum are all represented - * as `SparseTensor` objects. This op takes in the upstream gradient w.r.t. + * 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 aValGrad()} output - * @param backpropValGrad 1-D with shape `[nnz(sum)]`. The gradient with respect to + * @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 `indices` of the `SparseTensor` A, size `[nnz(A), ndims]`. - * @param bIndices 2-D. The `indices` of the `SparseTensor` B, size `[nnz(B), ndims]`. - * @param sumIndices 2-D. The `indices` of the sum `SparseTensor`, size - * `[nnz(sum), ndims]`. + * @param aIndices 2-D. The {@code indices} of the {@code SparseTensor} A, size {@code [nnz(A), ndims]}. + * @param bIndices 2-D. The {@code indices} of the {@code SparseTensor} B, size {@code [nnz(B), ndims]}. + * @param sumIndices 2-D. The {@code indices} of the sum {@code SparseTensor}, size + * {@code [nnz(sum), ndims]}. + * @param data type for {@code SparseAddGrad} output and operands * @return a new instance of SparseAddGrad */ public SparseAddGrad sparseAddGrad(Operand backpropValGrad, @@ -380,83 +457,77 @@ public SparseAddGrad sparseAddGrad(Operand backpropValGr /** * Counts the number of occurrences of each value in an integer array. - *

- * Outputs a vector with length `size` and the same dtype as `weights`. If - * `weights` are empty, then index `i` stores the number of times the value `i` is - * counted in `arr`. If `weights` are non-empty, then index `i` stores the sum of - * the value in `weights` at each index where the corresponding value in `arr` is - * `i`. - *

- * Values in `arr` outside of the range [0, size) are ignored. - * - * @param data type for {@code output()} output - * @param indices 2D int64 `Tensor`. - * @param values 1D int `Tensor`. - * @param denseShape 1D int64 `Tensor`. - * @param size non-negative int scalar `Tensor`. - * @param weights is an int32, int64, float32, or float64 `Tensor` with the same - * shape as `input`, or a length-0 `Tensor`, in which case it acts as all weights + * Outputs a vector with length {@code size} and the same dtype as {@code weights}. If + * {@code weights} are empty, then index {@code i} stores the number of times the value {@code i} is + * counted in {@code arr}. If {@code weights} are non-empty, then index {@code i} stores the sum of + * 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 indices 2D int64 {@code Tensor}. + * @param values 1D int {@code Tensor}. + * @param denseShape 1D int64 {@code Tensor}. + * @param sizeOutput non-negative int scalar {@code Tensor}. + * @param weights 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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseBincount} output and operands + * @param data type for {@code SparseBincount} output and operands * @return a new instance of SparseBincount */ public SparseBincount sparseBincount( - Operand indices, Operand values, Operand denseShape, Operand size, + Operand indices, Operand values, Operand denseShape, Operand sizeOutput, Operand weights, SparseBincount.Options... options) { - return SparseBincount.create(scope, indices, values, denseShape, size, weights, options); + return SparseBincount.create(scope, indices, values, denseShape, sizeOutput, weights, options); } /** - * Concatenates a list of `SparseTensor` along the specified dimension. - *

+ * Concatenates a list of {@code SparseTensor} along the specified dimension. * Concatenation is with respect to the dense versions of these sparse tensors. - * It is assumed that each input is a `SparseTensor` whose elements are ordered + * It is assumed that each input is a {@code SparseTensor} whose elements are ordered * along increasing dimension number. - *

- * All inputs' shapes must match, except for the concat dimension. The - * `indices`, `values`, and `shapes` lists must have the same length. - *

- * The output shape is identical to the inputs', except along the concat + *

All inputs' shapes must match, except for the concat dimension. The + * {@code indices}, {@code values}, and {@code shapes} lists must have the same length. + *

The output shape is identical to the inputs', except along the concat * dimension, where it is the sum of the inputs' sizes along that dimension. - *

- * The output elements will be resorted to preserve the sort order along + *

The output elements will be resorted to preserve the sort order along * increasing dimension number. - *

- * This op runs in `O(M log M)` time, where `M` is the total number of non-empty + *

This op runs in {@code O(M log M)} time, where {@code M} is the total number of non-empty * values across all inputs. This is due to the need for an internal sort in * order to concatenate efficiently across an arbitrary dimension. - *

- * For example, if `concat_dim = 1` and the inputs are - *

- * sp_inputs[0]: shape = [2, 3] - * [0, 2]: "a" - * [1, 0]: "b" - * [1, 1]: "c" - *

- * sp_inputs[1]: shape = [2, 4] - * [0, 1]: "d" - * [0, 2]: "e" - *

- * then the output will be - *

- * shape = [2, 7] - * [0, 2]: "a" - * [0, 4]: "d" - * [0, 5]: "e" - * [1, 0]: "b" - * [1, 1]: "c" - *

- * Graphically this is equivalent to doing - *

- * [ a] concat [ d e ] = [ a d e ] - * [b c ] [ ] [b c ] - * - * @param data type for {@code outputValues()} output - * @param indices 2-D. Indices of each input `SparseTensor`. - * @param values 1-D. Non-empty values of each `SparseTensor`. - * @param shapes 1-D. Shapes of each `SparseTensor`. + *

For example, if {@code concat_dim = 1} and the inputs are + *

+   *  sp_inputs[0]: shape = [2, 3]
+   *  [0, 2]: "a"
+   *  [1, 0]: "b"
+   *  [1, 1]: "c"
+   *
+   *  sp_inputs[1]: shape = [2, 4]
+   *  [0, 1]: "d"
+   *  [0, 2]: "e"
+   *  
+ *

then the output will be + *

+   *  shape = [2, 7]
+   *  [0, 2]: "a"
+   *  [0, 4]: "d"
+   *  [0, 5]: "e"
+   *  [1, 0]: "b"
+   *  [1, 1]: "c"
+   *  
+ *

Graphically this is equivalent to doing + *

+   *  [    a] concat [  d e  ] = [    a   d e  ]
+   *  [b c  ]        [       ]   [b c          ]
+   *  
+ * + * @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}. * @param concatDim Dimension to concatenate along. Must be in range [-rank, rank), - * where rank is the number of dimensions in each input `SparseTensor`. + * where rank is the number of dimensions in each input {@code SparseTensor}. + * @param data type for {@code SparseConcat} output and operands * @return a new instance of SparseConcat */ public SparseConcat sparseConcat(Iterable> indices, @@ -466,7 +537,6 @@ public SparseConcat sparseConcat(Iterable> /** * A conditional accumulator for aggregating sparse gradients. - *

* The accumulator accepts gradients marked with local_step greater or * equal to the most recent global_step known to the accumulator. The * average can be extracted from the accumulator, provided sufficient @@ -476,7 +546,8 @@ public SparseConcat sparseConcat(Iterable> * * @param dtype The type of the value being accumulated. * @param shape The shape of the values. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseConditionalAccumulator} output and operands * @return a new instance of SparseConditionalAccumulator */ public SparseConditionalAccumulator sparseConditionalAccumulator(Class dtype, @@ -484,50 +555,69 @@ 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 `SparseTensor` and one of 2D `Tensor`, each - * representing features of one feature column. It outputs a 2D `SparseTensor` with + * The op takes two lists, one of 2D {@code SparseTensor} and one of 2D {@code Tensor}, each + * representing features of one feature column. It outputs a 2D {@code SparseTensor} with * the batchwise crosses of these features. - *

- * For example, if the inputs are - *

- * inputs[0]: SparseTensor with shape = [2, 2] - * [0, 0]: "a" - * [1, 0]: "b" - * [1, 1]: "c" - *

- * inputs[1]: SparseTensor with shape = [2, 1] - * [0, 0]: "d" - * [1, 0]: "e" - *

- * inputs[2]: Tensor [["f"], ["g"]] - *

- * then the output will be - *

- * shape = [2, 2] - * [0, 0]: "a_X_d_X_f" - * [1, 0]: "b_X_e_X_g" - * [1, 1]: "c_X_e_X_g" - *

- * if hashed_output=true then the output will be - *

- * shape = [2, 2] - * [0, 0]: FingerprintCat64( - * Fingerprint64("f"), FingerprintCat64( - * Fingerprint64("d"), Fingerprint64("a"))) - * [1, 0]: FingerprintCat64( - * Fingerprint64("g"), FingerprintCat64( - * Fingerprint64("e"), Fingerprint64("b"))) - * [1, 1]: FingerprintCat64( - * Fingerprint64("g"), FingerprintCat64( - * Fingerprint64("e"), Fingerprint64("c"))) - * - * @param indices 2-D. Indices of each input `SparseTensor`. - * @param values 1-D. values of each `SparseTensor`. - * @param shapes 1-D. Shapes of each `SparseTensor`. - * @param denseInputs 2-D. Columns represented by dense `Tensor`. + *

For example, if the inputs are + *

+   *  inputs[0]: SparseTensor with shape = [2, 2]
+   *  [0, 0]: "a"
+   *  [1, 0]: "b"
+   *  [1, 1]: "c"
+   *
+   *  inputs[1]: SparseTensor with shape = [2, 1]
+   *  [0, 0]: "d"
+   *  [1, 0]: "e"
+   *
+   *  inputs[2]: Tensor [["f"], ["g"]]
+   *  
+ *

then the output will be + *

+   *  shape = [2, 2]
+   *  [0, 0]: "a_X_d_X_f"
+   *  [1, 0]: "b_X_e_X_g"
+   *  [1, 1]: "c_X_e_X_g"
+   *  
+ *

if hashed_output=true then the output will be + *

+   *  shape = [2, 2]
+   *  [0, 0]: FingerprintCat64(
+   *              Fingerprint64("f"), FingerprintCat64(
+   *                  Fingerprint64("d"), Fingerprint64("a")))
+   *  [1, 0]: FingerprintCat64(
+   *              Fingerprint64("g"), FingerprintCat64(
+   *                  Fingerprint64("e"), Fingerprint64("b")))
+   *  [1, 1]: FingerprintCat64(
+   *              Fingerprint64("g"), FingerprintCat64(
+   *                  Fingerprint64("e"), Fingerprint64("c")))
+   *  
+ * + * @param indices 2-D. Indices of each input {@code SparseTensor}. + * @param values 1-D. values of each {@code SparseTensor}. + * @param shapes 1-D. Shapes of each {@code SparseTensor}. + * @param denseInputs 2-D. Columns represented by dense {@code Tensor}. * @param sep string used when joining a list of string inputs, can be used as separator later. * @return a new instance of SparseCross */ @@ -538,50 +628,49 @@ public SparseCross sparseCross(Iterable> indices, Iterable - * The op takes two lists, one of 2D `SparseTensor` and one of 2D `Tensor`, each - * representing features of one feature column. It outputs a 2D `SparseTensor` with + * The op takes two lists, one of 2D {@code SparseTensor} and one of 2D {@code Tensor}, each + * representing features of one feature column. It outputs a 2D {@code SparseTensor} with * the batchwise crosses of these features. - *

- * For example, if the inputs are - *

- * inputs[0]: SparseTensor with shape = [2, 2] - * [0, 0]: "a" - * [1, 0]: "b" - * [1, 1]: "c" - *

- * inputs[1]: SparseTensor with shape = [2, 1] - * [0, 0]: "d" - * [1, 0]: "e" - *

- * inputs[2]: Tensor [["f"], ["g"]] - *

- * then the output will be - *

- * shape = [2, 2] - * [0, 0]: "a_X_d_X_f" - * [1, 0]: "b_X_e_X_g" - * [1, 1]: "c_X_e_X_g" - *

- * if hashed_output=true then the output will be - *

- * shape = [2, 2] - * [0, 0]: FingerprintCat64( - * Fingerprint64("f"), FingerprintCat64( - * Fingerprint64("d"), Fingerprint64("a"))) - * [1, 0]: FingerprintCat64( - * Fingerprint64("g"), FingerprintCat64( - * Fingerprint64("e"), Fingerprint64("b"))) - * [1, 1]: FingerprintCat64( - * Fingerprint64("g"), FingerprintCat64( - * Fingerprint64("e"), Fingerprint64("c"))) - * - * @param indices 2-D. Indices of each input `SparseTensor`. - * @param values 1-D. values of each `SparseTensor`. - * @param shapes 1-D. Shapes of each `SparseTensor`. - * @param denseInputs 2-D. Columns represented by dense `Tensor`. + *

For example, if the inputs are + *

+   *  inputs[0]: SparseTensor with shape = [2, 2]
+   *  [0, 0]: "a"
+   *  [1, 0]: "b"
+   *  [1, 1]: "c"
+   *
+   *  inputs[1]: SparseTensor with shape = [2, 1]
+   *  [0, 0]: "d"
+   *  [1, 0]: "e"
+   *
+   *  inputs[2]: Tensor [["f"], ["g"]]
+   *  
+ *

then the output will be + *

+   *  shape = [2, 2]
+   *  [0, 0]: "a_X_d_X_f"
+   *  [1, 0]: "b_X_e_X_g"
+   *  [1, 1]: "c_X_e_X_g"
+   *  
+ *

if hashed_output=true then the output will be + *

+   *  shape = [2, 2]
+   *  [0, 0]: FingerprintCat64(
+   *              Fingerprint64("f"), FingerprintCat64(
+   *                  Fingerprint64("d"), Fingerprint64("a")))
+   *  [1, 0]: FingerprintCat64(
+   *              Fingerprint64("g"), FingerprintCat64(
+   *                  Fingerprint64("e"), Fingerprint64("b")))
+   *  [1, 1]: FingerprintCat64(
+   *              Fingerprint64("g"), FingerprintCat64(
+   *                  Fingerprint64("e"), Fingerprint64("c")))
+   *  
+ * + * @param indices 2-D. Indices of each input {@code SparseTensor}. + * @param values 1-D. values of each {@code SparseTensor}. + * @param shapes 1-D. Shapes of each {@code SparseTensor}. + * @param denseInputs 2-D. Columns represented by dense {@code Tensor}. * @param numBuckets It is used if hashed_output is true. - * output = hashed_value%num_buckets if num_buckets > 0 else hashed_value. + * output = hashed_value%num_buckets if num_buckets > 0 else hashed_value. * @param strongHash boolean, if true, siphash with salt will be used instead of farmhash. * @param salt Specify the salt that will be used by the siphash function. * @return a new instance of SparseCrossHashed @@ -595,22 +684,20 @@ public SparseCrossHashed sparseCrossHashed(Iterable> indices, /** * Adds up a SparseTensor and a dense Tensor, using these special rules: - *

* (1) Broadcasts the dense side to have the same shape as the sparse side, if - * eligible; + * eligible; * (2) Then, only the dense values pointed to by the indices of the SparseTensor - * participate in the cwise addition. - *

- * By these rules, the result is a logical SparseTensor with exactly the same + * participate in the cwise addition. + *

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 - * @param spIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @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. `N` non-empty values corresponding to `sp_indices`. + * @param spValues 1-D. {@code N} non-empty values corresponding to {@code sp_indices}. * @param spShape 1-D. Shape of the input SparseTensor. - * @param dense `R`-D. The dense Tensor operand. + * @param dense {@code R}-D. The dense Tensor operand. + * @param data type for {@code SparseDenseCwiseAdd} output and operands * @return a new instance of SparseDenseCwiseAdd */ public SparseDenseCwiseAdd sparseDenseCwiseAdd(Operand spIndices, @@ -620,16 +707,15 @@ public SparseDenseCwiseAdd sparseDenseCwiseAdd(Operand - * Limitation: this Op only broadcasts the dense side to the sparse side, but not + * Limitation: 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. `N x R` matrix with the indices of non-empty values in a + * @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. `N` non-empty values corresponding to `sp_indices`. + * @param spValues 1-D. {@code N} non-empty values corresponding to {@code sp_indices}. * @param spShape 1-D. Shape of the input SparseTensor. - * @param dense `R`-D. The dense Tensor operand. + * @param dense {@code R}-D. The dense Tensor operand. + * @param data type for {@code SparseDenseCwiseDiv} output and operands * @return a new instance of SparseDenseCwiseDiv */ public SparseDenseCwiseDiv sparseDenseCwiseDiv(Operand spIndices, @@ -639,20 +725,18 @@ public SparseDenseCwiseDiv sparseDenseCwiseDiv(Operand * The output locations corresponding to the implicitly zero elements in the sparse * tensor will be zero (i.e., will not take up storage space), regardless of the - * contents of the dense tensor (even if it's +/-INF and that INF0 == NaN). - *

- * Limitation*: this Op only broadcasts the dense side to the sparse side, but not + * 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 - * @param spIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @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. `N` non-empty values corresponding to `sp_indices`. + * @param spValues 1-D. {@code N} non-empty values corresponding to {@code sp_indices}. * @param spShape 1-D. Shape of the input SparseTensor. - * @param dense `R`-D. The dense Tensor operand. + * @param dense {@code R}-D. The dense Tensor operand. + * @param data type for {@code SparseDenseCwiseMul} output and operands * @return a new instance of SparseDenseCwiseMul */ public SparseDenseCwiseMul sparseDenseCwiseMul(Operand spIndices, @@ -661,52 +745,49 @@ public SparseDenseCwiseMul sparseDenseCwiseMul(Operand - * The input `SparseTensor` is represented via the tuple of inputs - * (`indices`, `values`, `dense_shape`). The output `SparseTensor` has the - * same `dense_shape` but with indices `output_indices` and values - * `output_values`. - *

- * This op inserts a single entry for every row that doesn't have any values. - * The index is created as `[row, 0, ..., 0]` and the inserted value - * is `default_value`. - *

- * For example, suppose `sp_input` has shape `[5, 6]` and non-empty values: - *

- * [0, 1]: a - * [0, 3]: b - * [2, 0]: c - * [3, 1]: d - *

- * Rows 1 and 4 are empty, so the output will be of shape `[5, 6]` with values: - *

- * [0, 1]: a - * [0, 3]: b - * [1, 0]: default_value - * [2, 0]: c - * [3, 1]: d - * [4, 0]: default_value - *

- * The output `SparseTensor` will be in row-major order and will have the + * Fills empty rows in the input 2-D {@code SparseTensor} with a default value. + * The input {@code SparseTensor} is represented via the tuple of inputs + * ({@code indices}, {@code values}, {@code dense_shape}). The output {@code SparseTensor} has the + * same {@code dense_shape} but with indices {@code output_indices} and values + * {@code output_values}. + *

This op inserts a single entry for every row that doesn't have any values. + * The index is created as {@code [row, 0, ..., 0]} and the inserted value + * is {@code default_value}. + *

For example, suppose {@code sp_input} has shape {@code [5, 6]} and non-empty values: + *

+   *  [0, 1]: a
+   *  [0, 3]: b
+   *  [2, 0]: c
+   *  [3, 1]: d
+   *  
+ *

Rows 1 and 4 are empty, so the output will be of shape {@code [5, 6]} with values: + *

+   *  [0, 1]: a
+   *  [0, 3]: b
+   *  [1, 0]: default_value
+   *  [2, 0]: c
+   *  [3, 1]: d
+   *  [4, 0]: default_value
+   *  
+ *

The output {@code SparseTensor} will be in row-major order and will have the * same shape as the input. - *

- * This op also returns an indicator vector shaped `[dense_shape[0]]` such that - *

- * empty_row_indicator[i] = True iff row i was an empty row. - *

- * And a reverse index map vector shaped `[indices.shape[0]]` that is used during + *

This op also returns an indicator vector shaped {@code [dense_shape[0]]} such that + *

+   *  empty_row_indicator[i] = True iff row i was an empty row.
+   *  
+ *

And a reverse index map vector shaped {@code [indices.shape[0]]} that is used during * backpropagation, - *

- * reverse_index_map[j] = out_j s.t. indices[j, :] == output_indices[out_j, :] + *

+   *  reverse_index_map[j] = out_j s.t. indices[j, :] == output_indices[out_j, :]
+   *  
* - * @param data type for {@code outputValues()} 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. - * @param defaultValue 0-D. default value to insert into location `[row, 0, ..., 0]` - * for rows missing from the input sparse tensor. + * @param defaultValue 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. + * @param data type for {@code SparseFillEmptyRows} output and operands * @return a new instance of SparseFillEmptyRows */ public SparseFillEmptyRows sparseFillEmptyRows(Operand indices, @@ -716,19 +797,17 @@ public SparseFillEmptyRows sparseFillEmptyRows(Operand - * Takes vectors reverse_index_map, shaped `[N]`, and grad_values, - * shaped `[N_full]`, where `N_full >= N` and copies data into either - * `d_values` or `d_default_value`. Here `d_values` is shaped `[N]` and - * `d_default_value` is a scalar. - *

- * 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 dValues()} output + * Takes vectors reverse_index_map, shaped {@code [N]}, and grad_values, + * shaped {@code [N_full]}, where {@code N_full >= N} and copies data into either + * {@code d_values} or {@code d_default_value}. Here {@code d_values} is shaped {@code [N]} and + * {@code d_default_value} is a scalar. + *

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 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 * @return a new instance of SparseFillEmptyRowsGrad */ public SparseFillEmptyRowsGrad sparseFillEmptyRowsGrad( @@ -737,21 +816,19 @@ public SparseFillEmptyRowsGrad sparseFillEmptyRowsGrad( } /** - * Multiply matrix "a" by matrix "b". - *

- * The inputs must be two-dimensional matrices and the inner dimension of "a" must - * match the outer dimension of "b". Both "a" and "b" must be `Tensor`s not - * `SparseTensor`s. This op is optimized for the case where at least one of "a" or - * "b" is sparse, in the sense that they have a large proportion of zero values. + * Multiply matrix "a" by matrix "b". + * The inputs must be two-dimensional matrices and the inner dimension of "a" must + * match the outer dimension of "b". Both "a" and "b" must be {@code Tensor}s not + * {@code SparseTensor}s. This op is optimized for the case where at least one of "a" or + * "b" is sparse, in the sense that they have a large proportion of zero values. * The breakeven for using this versus a dense matrix multiply on one platform was * 30% zero values in the sparse matrix. - *

- * The gradient computation of this operation will only take advantage of sparsity + *

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 - * @param b - * @param options carries optional attributes values + * @param a The a value + * @param b The b value + * @param options carries optional attribute values * @return a new instance of SparseMatMul */ public SparseMatMul sparseMatMul(Operand a, Operand b, @@ -761,27 +838,24 @@ public SparseMatMul sparseMatMul(Operand a, Operand * This Op takes a SparseTensor and is the sparse counterpart to - * `tf.reduce_max()`. In particular, this Op also returns a dense `Tensor` + * {@code tf.reduce_max()}. In particular, this Op also returns a dense {@code Tensor} * instead of a sparse one. - *

- * Reduces `sp_input` along the dimensions given in `reduction_axes`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `reduction_axes`. If `keep_dims` is true, the reduced dimensions are retained + *

Reduces {@code sp_input} along the dimensions given in {@code reduction_axes}. Unless + * {@code keep_dims} is true, the rank of the tensor is reduced by 1 for each entry in + * {@code reduction_axes}. If {@code keep_dims} is true, the reduced dimensions are retained * with length 1. - *

- * If `reduction_axes` has no entries, all dimensions are reduced, and a tensor + *

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 - * @param inputIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @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. `N` non-empty values corresponding to `input_indices`. + * @param inputValues 1-D. {@code N} non-empty values corresponding to {@code input_indices}. * @param inputShape 1-D. Shape of the input SparseTensor. - * @param reductionAxes 1-D. Length-`K` vector containing the reduction axes. - * @param options carries optional attributes values + * @param reductionAxes 1-D. Length-{@code K} vector containing the reduction axes. + * @param options carries optional attribute values + * @param data type for {@code SparseReduceMax} output and operands * @return a new instance of SparseReduceMax */ public SparseReduceMax sparseReduceMax(Operand inputIndices, @@ -792,27 +866,24 @@ public SparseReduceMax sparseReduceMax(Operand in /** * Computes the max of elements across dimensions of a SparseTensor. - *

* This Op takes a SparseTensor and is the sparse counterpart to - * `tf.reduce_max()`. In contrast to SparseReduceMax, this Op returns a + * {@code tf.reduce_max()}. In contrast to SparseReduceMax, this Op returns a * SparseTensor. - *

- * Reduces `sp_input` along the dimensions given in `reduction_axes`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `reduction_axes`. If `keep_dims` is true, the reduced dimensions are retained + *

Reduces {@code sp_input} along the dimensions given in {@code reduction_axes}. Unless + * {@code keep_dims} is true, the rank of the tensor is reduced by 1 for each entry in + * {@code reduction_axes}. If {@code keep_dims} is true, the reduced dimensions are retained * with length 1. - *

- * If `reduction_axes` has no entries, all dimensions are reduced, and a tensor + *

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 outputValues()} output - * @param inputIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @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. `N` non-empty values corresponding to `input_indices`. + * @param inputValues 1-D. {@code N} non-empty values corresponding to {@code input_indices}. * @param inputShape 1-D. Shape of the input SparseTensor. - * @param reductionAxes 1-D. Length-`K` vector containing the reduction axes. - * @param options carries optional attributes values + * @param reductionAxes 1-D. Length-{@code K} vector containing the reduction axes. + * @param options carries optional attribute values + * @param data type for {@code SparseReduceMaxSparse} output and operands * @return a new instance of SparseReduceMaxSparse */ public SparseReduceMaxSparse sparseReduceMaxSparse( @@ -823,27 +894,24 @@ public SparseReduceMaxSparse sparseReduceMaxSparse( /** * Computes the sum of elements across dimensions of a SparseTensor. - *

* This Op takes a SparseTensor and is the sparse counterpart to - * `tf.reduce_sum()`. In particular, this Op also returns a dense `Tensor` + * {@code tf.reduce_sum()}. In particular, this Op also returns a dense {@code Tensor} * instead of a sparse one. - *

- * Reduces `sp_input` along the dimensions given in `reduction_axes`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `reduction_axes`. If `keep_dims` is true, the reduced dimensions are retained + *

Reduces {@code sp_input} along the dimensions given in {@code reduction_axes}. Unless + * {@code keep_dims} is true, the rank of the tensor is reduced by 1 for each entry in + * {@code reduction_axes}. If {@code keep_dims} is true, the reduced dimensions are retained * with length 1. - *

- * If `reduction_axes` has no entries, all dimensions are reduced, and a tensor + *

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 - * @param inputIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @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. `N` non-empty values corresponding to `input_indices`. + * @param inputValues 1-D. {@code N} non-empty values corresponding to {@code input_indices}. * @param inputShape 1-D. Shape of the input SparseTensor. - * @param reductionAxes 1-D. Length-`K` vector containing the reduction axes. - * @param options carries optional attributes values + * @param reductionAxes 1-D. Length-{@code K} vector containing the reduction axes. + * @param options carries optional attribute values + * @param data type for {@code SparseReduceSum} output and operands * @return a new instance of SparseReduceSum */ public SparseReduceSum sparseReduceSum(Operand inputIndices, @@ -854,27 +922,24 @@ public SparseReduceSum sparseReduceSum(Operand inpu /** * Computes the sum of elements across dimensions of a SparseTensor. - *

* This Op takes a SparseTensor and is the sparse counterpart to - * `tf.reduce_sum()`. In contrast to SparseReduceSum, this Op returns a + * {@code tf.reduce_sum()}. In contrast to SparseReduceSum, this Op returns a * SparseTensor. - *

- * Reduces `sp_input` along the dimensions given in `reduction_axes`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `reduction_axes`. If `keep_dims` is true, the reduced dimensions are retained + *

Reduces {@code sp_input} along the dimensions given in {@code reduction_axes}. Unless + * {@code keep_dims} is true, the rank of the tensor is reduced by 1 for each entry in + * {@code reduction_axes}. If {@code keep_dims} is true, the reduced dimensions are retained * with length 1. - *

- * If `reduction_axes` has no entries, all dimensions are reduced, and a tensor + *

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 outputValues()} output - * @param inputIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @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. `N` non-empty values corresponding to `input_indices`. + * @param inputValues 1-D. {@code N} non-empty values corresponding to {@code input_indices}. * @param inputShape 1-D. Shape of the input SparseTensor. - * @param reductionAxes 1-D. Length-`K` vector containing the reduction axes. - * @param options carries optional attributes values + * @param reductionAxes 1-D. Length-{@code K} vector containing the reduction axes. + * @param options carries optional attribute values + * @param data type for {@code SparseReduceSumSparse} output and operands * @return a new instance of SparseReduceSumSparse */ public SparseReduceSumSparse sparseReduceSumSparse( @@ -885,21 +950,18 @@ public SparseReduceSumSparse sparseReduceSumSparse( /** * Reorders a SparseTensor into the canonical, row-major ordering. - *

* Note that by convention, all sparse ops preserve the canonical ordering along * increasing dimension number. The only time ordering can be violated is during * manual manipulation of the indices and values vectors to add entries. - *

- * Reordering does not affect the shape of the SparseTensor. - *

- * If the tensor has rank `R` and `N` non-empty values, `input_indices` has - * shape `[N, R]`, input_values has length `N`, and input_shape has length `R`. - * - * @param data type for {@code outputValues()} output - * @param inputIndices 2-D. `N x R` matrix with the indices of non-empty values in a + *

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 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. `N` non-empty values corresponding to `input_indices`. + * @param inputValues 1-D. {@code N} non-empty values corresponding to {@code input_indices}. * @param inputShape 1-D. Shape of the input SparseTensor. + * @param data type for {@code SparseReorder} output and operands * @return a new instance of SparseReorder */ public SparseReorder sparseReorder(Operand inputIndices, @@ -909,27 +971,23 @@ public SparseReorder sparseReorder(Operand inputInd /** * Reshapes a SparseTensor to represent values in a new dense shape. - *

* This operation has the same semantics as reshape on the represented dense - * tensor. The `input_indices` are recomputed based on the requested `new_shape`. - *

- * If one component of `new_shape` is the special value -1, the size of that + * tensor. The {@code input_indices} are recomputed based on the requested {@code new_shape}. + *

If one component of {@code new_shape} is the special value -1, the size of that * dimension is computed so that the total dense size remains constant. At - * most one component of `new_shape` can be -1. The number of dense elements - * implied by `new_shape` must be the same as the number of dense elements - * originally implied by `input_shape`. - *

- * Reshaping does not affect the order of values in the SparseTensor. - *

- * If the input tensor has rank `R_in` and `N` non-empty values, and `new_shape` - * has length `R_out`, then `input_indices` has shape `[N, R_in]`, - * `input_shape` has length `R_in`, `output_indices` has shape `[N, R_out]`, and - * `output_shape` has length `R_out`. - * - * @param inputIndices 2-D. `N x R_in` matrix with the indices of non-empty values in a + * most one component of {@code new_shape} can be -1. The number of dense elements + * implied by {@code new_shape} must be the same as the number of dense elements + * originally implied by {@code input_shape}. + *

Reshaping does not affect the order of values in the SparseTensor. + *

If the input tensor has rank {@code R_in} and {@code N} non-empty values, and {@code new_shape} + * has length {@code R_out}, then {@code input_indices} has shape {@code [N, R_in]}, + * {@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}. + * + * @param inputIndices 2-D. {@code N x R_in} matrix with the indices of non-empty values in a * SparseTensor. - * @param inputShape 1-D. `R_in` vector with the input SparseTensor's dense shape. - * @param newShape 1-D. `R_out` vector with the requested new dense shape. + * @param inputShape 1-D. {@code R_in} vector with the input SparseTensor's dense shape. + * @param newShape 1-D. {@code R_out} vector with the requested new dense shape. * @return a new instance of SparseReshape */ public SparseReshape sparseReshape(Operand inputIndices, Operand inputShape, @@ -939,187 +997,203 @@ public SparseReshape sparseReshape(Operand inputIndices, Operand /** * Computes the mean along sparse segments of a tensor. - *

- * See `tf.sparse.segment_sum` for usage examples. - *

- * Like `SegmentMean`, but `segment_ids` can have rank less than `data`'s first - * dimension, selecting a subset of dimension 0, specified by `indices`. - * - * @param data type for {@code output()} output - * @param data - * @param indices A 1-D tensor. Has same rank as `segment_ids`. + * 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 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. + * Returns tensor "output" with same shape as grad, except for dimension 0 whose + * 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 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); } /** * Computes the mean along sparse segments of a tensor. - *

- * Like `SparseSegmentMean`, but allows missing ids in `segment_ids`. If an id is - * missing, the `output` tensor at that position will be zeroed. - *

- * Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * Like {@code SparseSegmentMean}, but allows missing ids in {@code segment_ids}. If an id is + * missing, the {@code output} tensor at that position will be zeroed. + *

Read + * the section on segmentation * for an explanation of segments. * - * @param data type for {@code output()} output - * @param data - * @param indices A 1-D tensor. Has same rank as `segment_ids`. + * @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); } /** * 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 `tf.sparse.segment_sum` for usage examples. + *

See {@code tf.sparse.segment_sum} for usage examples. * - * @param data type for {@code output()} output - * @param data - * @param indices A 1-D tensor. Has same rank as `segment_ids`. + * @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. + * Returns tensor "output" with same shape as grad, except for dimension 0 whose + * 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 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); } /** * Computes the sum along sparse segments of a tensor divided by the sqrt of N. - *

* N is the size of the segment being reduced. - *

- * Like `SparseSegmentSqrtN`, but allows missing ids in `segment_ids`. If an id is - * missing, the `output` tensor at that position will be zeroed. - *

- * Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + *

Like {@code SparseSegmentSqrtN}, but allows missing ids in {@code segment_ids}. If an id is + * missing, the {@code output} tensor at that position will be zeroed. + *

Read + * the section on segmentation * for an explanation of segments. * - * @param data type for {@code output()} output - * @param data - * @param indices A 1-D tensor. Has same rank as `segment_ids`. + * @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); } /** * Computes the sum along sparse segments of a tensor. - *

* Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * the section on segmentation * for an explanation of segments. - *

- * Like `SegmentSum`, but `segment_ids` can have rank less than `data`'s first - * dimension, selecting a subset of dimension 0, specified by `indices`. - *

- * For example: - *

{@code
+   *  

Like {@code SegmentSum}, but {@code segment_ids} can have rank less than {@code data}'s first + * dimension, selecting a subset of dimension 0, specified by {@code indices}. + *

For example: + *

    *  c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])
    *
    *  # Select two rows, one segment.
    *  tf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 0]))
-   *  # => [[0 0 0 0]]
+   *  # => [[0 0 0 0]]
    *
    *  # Select two rows, two segment.
    *  tf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 1]))
-   *  # => [[ 1  2  3  4]
+   *  # => [[ 1  2  3  4]
    *  #     [-1 -2 -3 -4]]
    *
    *  # Select all rows, two segments.
    *  tf.sparse_segment_sum(c, tf.constant([0, 1, 2]), tf.constant([0, 0, 1]))
-   *  # => [[0 0 0 0]
+   *  # => [[0 0 0 0]
    *  #     [5 6 7 8]]
    *
    *  # Which is equivalent to:
    *  tf.segment_sum(c, tf.constant([0, 0, 1]))
-   *  }
+ *
* - * @param data type for {@code output()} output - * @param data - * @param indices A 1-D tensor. Has same rank as `segment_ids`. + * @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 the number of unique indexes in "indices". Also returns vector + * "sorted_unique_indices" containing the corresponding indexes from "indices". + * + * @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 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 denseOutputDim0) { + return SparseSegmentSumGrad.create(scope, grad, indices, segmentIds, denseOutputDim0); } /** * Computes the sum along sparse segments of a tensor. - *

- * Like `SparseSegmentSum`, but allows missing ids in `segment_ids`. If an id is - * missing, the `output` tensor at that position will be zeroed. - *

- * Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/sparse#Segmentation) + * Like {@code SparseSegmentSum}, but allows missing ids in {@code segment_ids}. If an id is + * missing, the {@code output} tensor at that position will be zeroed. + *

Read + * the section on segmentation * for an explanation of segments. - *

- * For example: - *

{@code
+   *  

For example: + *

    *  c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])
    *
    *  tf.sparse_segment_sum_with_num_segments(
    *      c, tf.constant([0, 1]), tf.constant([0, 0]), num_segments=3)
-   *  # => [[0 0 0 0]
+   *  # => [[0 0 0 0]
    *  #     [0 0 0 0]
    *  #     [0 0 0 0]]
    *
@@ -1127,72 +1201,72 @@ public  SparseSegmentSum sparseSegmentSum(Operand data,
    *                                          tf.constant([0, 1]),
    *                                          tf.constant([0, 2],
    *                                          num_segments=4))
-   *  # => [[ 1  2  3  4]
+   *  # => [[ 1  2  3  4]
    *  #     [ 0  0  0  0]
    *  #     [-1 -2 -3 -4]
    *  #     [ 0  0  0  0]]
-   *  }
+ *
* - * @param data type for {@code output()} output - * @param data - * @param indices A 1-D tensor. Has same rank as `segment_ids`. + * @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); } /** - * Slice a `SparseTensor` based on the `start` and `size`. - *

+ * Slice a {@code SparseTensor} based on the {@code start} and {@code size}. * For example, if the input is - *

- * input_tensor = shape = [2, 7] - * [ a d e ] - * [b c ] - *

- * Graphically the output tensors are: - *

- * sparse_slice([0, 0], [2, 4]) = shape = [2, 4] - * [ a ] - * [b c ] - *

- * sparse_slice([0, 4], [2, 3]) = shape = [2, 3] - * [ d e ] - * [ ] - * - * @param data type for {@code outputValues()} output + *

+   *  input_tensor = shape = [2, 7]
+   *  [    a   d e  ]
+   *  [b c          ]
+   *  
+ *

Graphically the output tensors are: + *

+   *  sparse_slice([0, 0], [2, 4]) = shape = [2, 4]
+   *  [    a  ]
+   *  [b c    ]
+   *
+   *  sparse_slice([0, 4], [2, 3]) = shape = [2, 3]
+   *  [ d e  ]
+   *  [      ]
+   *  
+ * * @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. * @param start 1-D. tensor represents the start of the slice. - * @param size 1-D. tensor represents the size of the slice. + * @param sizeOutput 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. + * @param data type for {@code SparseSlice} output and operands * @return a new instance of SparseSlice */ public SparseSlice sparseSlice(Operand indices, Operand values, - Operand shape, Operand start, Operand size) { - return SparseSlice.create(scope, indices, values, shape, start, size); + Operand shape, Operand start, Operand sizeOutput) { + return SparseSlice.create(scope, indices, values, shape, start, sizeOutput); } /** * The gradient operator for the SparseSlice op. - *

* This op takes in the upstream gradient w.r.t. non-empty values of - * the sliced `SparseTensor`, and outputs the gradients w.r.t. - * the non-empty values of input `SparseTensor`. + * the sliced {@code SparseTensor}, and outputs the gradients w.r.t. + * the non-empty values of input {@code SparseTensor}. * - * @param data type for {@code valGrad()} output * @param backpropValGrad 1-D. The gradient with respect to - * the non-empty values of the sliced `SparseTensor`. - * @param inputIndices 2-D. The `indices` of the input `SparseTensor`. + * the non-empty values of the sliced {@code SparseTensor}. + * @param inputIndices 2-D. The {@code indices} of the input {@code SparseTensor}. * @param inputStart 1-D. tensor represents the start of the slice. - * @param outputIndices 2-D. The `indices` of the sliced `SparseTensor`. + * @param outputIndices 2-D. The {@code indices} of the sliced {@code SparseTensor}. + * @param data type for {@code SparseSliceGrad} output and operands * @return a new instance of SparseSliceGrad */ public SparseSliceGrad sparseSliceGrad(Operand backpropValGrad, @@ -1201,29 +1275,25 @@ public SparseSliceGrad sparseSliceGrad(Operand backpropV } /** - * Applies softmax to a batched N-D `SparseTensor`. - *

- * The inputs represent an N-D SparseTensor with logical shape `[..., B, C]` - * (where `N >= 2`), and with indices sorted in the canonical lexicographic order. - *

- * This op is equivalent to applying the normal `tf.nn.softmax()` to each innermost - * logical submatrix with shape `[B, C]`, but with the catch that the implicitly - * zero elements do not participate. Specifically, the algorithm is equivalent + * Applies softmax to a batched N-D {@code SparseTensor}. + * The inputs represent an N-D SparseTensor with logical shape {@code [..., B, C]} + * (where {@code N >= 2}), and with indices sorted in the canonical lexicographic order. + *

This op is equivalent to applying the normal {@code tf.nn.softmax()} to each innermost + * logical submatrix with shape {@code [B, C]}, but with the catch that the implicitly + * zero elements do not participate. Specifically, the algorithm is equivalent * to the following: - *

- * (1) Applies `tf.nn.softmax()` to a densified view of each innermost submatrix - * with shape `[B, C]`, along the size-C dimension; - * (2) Masks out the original implicitly-zero locations; - * (3) Renormalizes the remaining elements. - *

- * Hence, the `SparseTensor` result has exactly the same non-zero indices and + *

(1) Applies {@code tf.nn.softmax()} to a densified view of each innermost submatrix + * with shape {@code [B, C]}, along the size-C dimension; + * (2) Masks out the original implicitly-zero locations; + * (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 - * @param spIndices 2-D. `NNZ x R` matrix with the indices of non-empty values in a + * @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. `NNZ` non-empty values corresponding to `sp_indices`. + * @param spValues 1-D. {@code NNZ} non-empty values corresponding to {@code sp_indices}. * @param spShape 1-D. Shape of the input SparseTensor. + * @param data type for {@code SparseSoftmax} output and operands * @return a new instance of SparseSoftmax */ public SparseSoftmax sparseSoftmax(Operand spIndices, @@ -1233,17 +1303,16 @@ 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 outputValues()} output - * @param aIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @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. `N` non-empty values corresponding to `a_indices`. + * @param aValues 1-D. {@code N} non-empty values corresponding to {@code a_indices}. * @param aShape 1-D. Shape of the input SparseTensor. - * @param bIndices counterpart to `a_indices` for the other operand. - * @param bValues counterpart to `a_values` for the other operand; must be of the same dtype. - * @param bShape counterpart to `a_shape` for the other operand; the two shapes must be equal. + * @param bIndices counterpart to {@code a_indices} for the other operand. + * @param bValues counterpart to {@code a_values} for the other operand; must be of the same dtype. + * @param bShape counterpart to {@code a_shape} for the other operand; the two shapes must be equal. + * @param data type for {@code SparseSparseMaximum} output and operands * @return a new instance of SparseSparseMaximum */ public SparseSparseMaximum sparseSparseMaximum(Operand aIndices, @@ -1254,17 +1323,16 @@ public SparseSparseMaximum sparseSparseMaximum(Operand * Assumes the two SparseTensors have the same shape, i.e., no broadcasting. * - * @param data type for {@code outputValues()} output - * @param aIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @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. `N` non-empty values corresponding to `a_indices`. + * @param aValues 1-D. {@code N} non-empty values corresponding to {@code a_indices}. * @param aShape 1-D. Shape of the input SparseTensor. - * @param bIndices counterpart to `a_indices` for the other operand. - * @param bValues counterpart to `a_values` for the other operand; must be of the same dtype. - * @param bShape counterpart to `a_shape` for the other operand; the two shapes must be equal. + * @param bIndices counterpart to {@code a_indices} for the other operand. + * @param bValues counterpart to {@code a_values} for the other operand; must be of the same dtype. + * @param bShape counterpart to {@code a_shape} for the other operand; the two shapes must be equal. + * @param data type for {@code SparseSparseMinimum} output and operands * @return a new instance of SparseSparseMinimum */ public SparseSparseMinimum sparseSparseMinimum(Operand aIndices, @@ -1274,35 +1342,35 @@ public SparseSparseMinimum sparseSparseMinimum(Operand - * If the `shape[split_dim]` is not an integer multiple of `num_split`. Slices - * `[0 : shape[split_dim] % num_split]` gets one extra dimension. - * For example, if `split_dim = 1` and `num_split = 2` and the input is - *

- * input_tensor = shape = [2, 7] - * [ a d e ] - * [b c ] - *

- * Graphically the output tensors are: - *

- * output_tensor[0] = shape = [2, 4] - * [ a ] - * [b c ] - *

- * output_tensor[1] = shape = [2, 3] - * [ d e ] - * [ ] - * - * @param data type for {@code outputValues()} output + * Split a {@code SparseTensor} into {@code num_split} tensors along one dimension. + * If the {@code shape[split_dim]} is not an integer multiple of {@code num_split}. Slices + * {@code [0 : shape[split_dim] % num_split]} gets one extra dimension. + * For example, if {@code split_dim = 1} and {@code num_split = 2} and the input is + *

+   *  input_tensor = shape = [2, 7]
+   *  [    a   d e  ]
+   *  [b c          ]
+   *  
+ *

Graphically the output tensors are: + *

+   *  output_tensor[0] = shape = [2, 4]
+   *  [    a  ]
+   *  [b c    ]
+   *
+   *  output_tensor[1] = shape = [2, 3]
+   *  [ d e  ]
+   *  [      ]
+   *  
+ * * @param splitDim 0-D. The dimension along which to split. Must be in the range - * `[0, rank(shape))`. + * {@code [0, rank(shape))}. * @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. * output indices: A list of 1-D tensors represents the indices of the output * sparse tensors. * @param numSplit The number of ways to split. + * @param data type for {@code SparseSplit} output and operands * @return a new instance of SparseSplit */ public SparseSplit sparseSplit(Operand splitDim, @@ -1311,15 +1379,15 @@ public SparseSplit sparseSplit(Operand splitDim, } /** - * Adds up a `SparseTensor` and a dense `Tensor`, producing a dense `Tensor`. - *

- * This Op does not require `a_indices` be sorted in standard lexicographic order. - * - * @param data type for {@code output()} output - * @param aIndices 2-D. The `indices` of the `SparseTensor`, with shape `[nnz, ndims]`. - * @param aValues 1-D. The `values` of the `SparseTensor`, with shape `[nnz]`. - * @param aShape 1-D. The `shape` of the `SparseTensor`, with shape `[ndims]`. - * @param b `ndims`-D Tensor. With shape `a_shape`. + * 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 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]}. + * @param b {@code ndims}-D Tensor. With shape {@code a_shape}. + * @param data type for {@code SparseTensorDenseAdd} output and operands + * @param data type for {@code SparseTensorDenseAdd} output and operands * @return a new instance of SparseTensorDenseAdd */ public SparseTensorDenseAdd sparseTensorDenseAdd( @@ -1328,24 +1396,22 @@ public SparseTensorDenseAdd sparseTensor } /** - * Multiply SparseTensor (of rank 2) "A" by dense matrix "B". - *

+ * Multiply SparseTensor (of rank 2) "A" by dense matrix "B". * No validity checking is performed on the indices of A. However, the following * input format is recommended for optimal behavior: - *

- * if adjoint_a == false: - * A should be sorted in lexicographically increasing order. Use SparseReorder - * if you're not sure. + *

if adjoint_a == false: + * A should be sorted in lexicographically increasing order. Use SparseReorder + * if you're not sure. * if adjoint_a == true: - * A should be sorted in order of increasing dimension 1 (i.e., "column major" - * order instead of "row major" order). + * 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 `indices` of the `SparseTensor`, size `[nnz, 2]` Matrix. - * @param aValues 1-D. The `values` of the `SparseTensor`, size `[nnz]` Vector. - * @param aShape 1-D. The `shape` of the `SparseTensor`, size `[2]` Vector. + * @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. * @param b 2-D. A dense Matrix. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseTensorDenseMatMul} output and operands * @return a new instance of SparseTensorDenseMatMul */ public SparseTensorDenseMatMul sparseTensorDenseMatMul( @@ -1356,9 +1422,8 @@ public SparseTensorDenseMatMul sparseTensorDenseMatMul( /** * Converts a sparse representation into a dense tensor. - *

- * Builds an array `dense` with shape `output_shape` such that - *

{@code
+   *  Builds an array {@code dense} with shape {@code output_shape} such that
+   *  
    *  # If sparse_indices is scalar
    *  dense[i] = (i == sparse_indices ? sparse_values : default_value)
    *
@@ -1367,23 +1432,23 @@ public  SparseTensorDenseMatMul sparseTensorDenseMatMul(
    *
    *  # If sparse_indices is an n by d matrix, then for each i in [0, n)
    *  dense[sparse_indices[i][0], ..., sparse_indices[i][d-1]] = sparse_values[i]
-   *  }
- * All other values in `dense` are set to `default_value`. If `sparse_values` is a + *
+ *

All other values in {@code dense} are set to {@code default_value}. If {@code sparse_values} is a * scalar, all sparse indices are set to this single value. - *

- * Indices should be sorted in lexicographic order, and indices must not - * contain any repeats. If `validate_indices` is true, these properties + *

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 - * @param sparseIndices 0-D, 1-D, or 2-D. `sparse_indices[i]` contains the complete - * index where `sparse_values[i]` will be placed. + * @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. - * @param sparseValues 1-D. Values corresponding to each row of `sparse_indices`, + * @param sparseValues 1-D. Values corresponding to each row of {@code sparse_indices}, * or a scalar value to be used for all sparse indices. * @param defaultValue Scalar value to set for indices not specified in - * `sparse_indices`. - * @param options carries optional attributes values + * {@code sparse_indices}. + * @param options carries optional attribute values + * @param data type for {@code SparseToDense} output and operands + * @param data type for {@code SparseToDense} output and operands * @return a new instance of SparseToDense */ public SparseToDense sparseToDense( @@ -1393,49 +1458,43 @@ public SparseToDense sparseToDense( } /** - * Applies set operation along last dimension of 2 `SparseTensor` inputs. - *

- * See SetOperationOp::SetOperationFromContext for values of `set_operation`. - *

- * If `validate_indices` is `True`, `sparse.SparseToSparseSetOperation` validates the - * order and range of `set1` and `set2` indices. - *

- * Input `set1` is a `SparseTensor` represented by `set1_indices`, `set1_values`, - * and `set1_shape`. For `set1` ranked `n`, 1st `n-1` dimensions must be the same - * as `set2`. Dimension `n` contains values in a set, duplicates are allowed but + * Applies set operation along last dimension of 2 {@code SparseTensor} inputs. + * See SetOperationOp::SetOperationFromContext for values of {@code set_operation}. + *

If {@code validate_indices} is {@code True}, {@code sparse.SparseToSparseSetOperation} validates the + * order and range of {@code set1} and {@code set2} indices. + *

Input {@code set1} is a {@code SparseTensor} represented by {@code set1_indices}, {@code set1_values}, + * and {@code set1_shape}. For {@code set1} ranked {@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. - *

- * Input `set2` is a `SparseTensor` represented by `set2_indices`, `set2_values`, - * and `set2_shape`. For `set2` ranked `n`, 1st `n-1` dimensions must be the same - * as `set1`. Dimension `n` contains values in a set, duplicates are allowed but + *

Input {@code set2} is a {@code SparseTensor} represented by {@code set2_indices}, {@code set2_values}, + * and {@code set2_shape}. For {@code set2} ranked {@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. - *

- * If `validate_indices` is `True`, this op validates the order and range of `set1` - * and `set2` indices. - *

- * Output `result` is a `SparseTensor` represented by `result_indices`, - * `result_values`, and `result_shape`. For `set1` and `set2` ranked `n`, this - * has rank `n` and the same 1st `n-1` dimensions as `set1` and `set2`. The `nth` - * dimension contains the result of `set_operation` applied to the corresponding - * `[0...n-1]` dimension of `set`. - * - * @param data type for {@code resultValues()} output - * @param set1Indices 2D `Tensor`, indices of a `SparseTensor`. Must be in row-major + *

If {@code validate_indices} is {@code True}, this op validates the order and range of {@code set1} + * and {@code set2} indices. + *

Output {@code result} is a {@code SparseTensor} represented by {@code result_indices}, + * {@code result_values}, and {@code result_shape}. For {@code set1} and {@code set2} ranked {@code n}, this + * 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 set1Indices 2D {@code Tensor}, indices of a {@code SparseTensor}. Must be in row-major * order. - * @param set1Values 1D `Tensor`, values of a `SparseTensor`. Must be in row-major + * @param set1Values 1D {@code Tensor}, values of a {@code SparseTensor}. Must be in row-major * order. - * @param set1Shape 1D `Tensor`, shape of a `SparseTensor`. `set1_shape[0...n-1]` must - * be the same as `set2_shape[0...n-1]`, `set1_shape[n]` is the - * max set size across `0...n-1` dimensions. - * @param set2Indices 2D `Tensor`, indices of a `SparseTensor`. Must be in row-major + * @param set1Shape 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. + * @param set2Indices 2D {@code Tensor}, indices of a {@code SparseTensor}. Must be in row-major * order. - * @param set2Values 1D `Tensor`, values of a `SparseTensor`. Must be in row-major + * @param set2Values 1D {@code Tensor}, values of a {@code SparseTensor}. Must be in row-major * order. - * @param set2Shape 1D `Tensor`, shape of a `SparseTensor`. `set2_shape[0...n-1]` must - * be the same as `set1_shape[0...n-1]`, `set2_shape[n]` is the - * max set size across `0...n-1` dimensions. - * @param setOperation - * @param options carries optional attributes values + * @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 attribute + * @param options carries optional attribute values + * @param data type for {@code SparseToSparseSetOperation} output and operands * @return a new instance of SparseToSparseSetOperation */ public SparseToSparseSetOperation sparseToSparseSetOperation( @@ -1446,43 +1505,39 @@ public SparseToSparseSetOperation sparseToSparseSetOperatio } /** - * Read `SparseTensors` from a `SparseTensorsMap` and concatenate them. - *

- * The input `sparse_handles` must be an `int64` matrix of shape `[N, 1]` where - * `N` is the minibatch size and the rows correspond to the output handles of - * `AddSparseToTensorsMap` or `AddManySparseToTensorsMap`. The ranks of the - * original `SparseTensor` objects that went into the given input ops must all - * match. When the final `SparseTensor` is created, it has rank one - * higher than the ranks of the incoming `SparseTensor` objects + * Read {@code SparseTensors} from a {@code SparseTensorsMap} and concatenate them. + * The input {@code sparse_handles} must be an {@code int64} matrix of shape {@code [N, 1]} where + * {@code N} is the minibatch size and the rows correspond to the output handles of + * {@code AddSparseToTensorsMap} or {@code AddManySparseToTensorsMap}. The ranks of the + * original {@code SparseTensor} objects that went into the given input ops must all + * match. When the final {@code SparseTensor} is created, it has rank one + * higher than the ranks of the incoming {@code SparseTensor} objects * (they have been concatenated along a new row dimension on the left). - *

- * The output `SparseTensor` object's shape values for all dimensions but the - * first are the max across the input `SparseTensor` objects' shape values - * for the corresponding dimensions. Its first shape value is `N`, the minibatch + *

The output {@code SparseTensor} object's shape values for all dimensions but the + * first are the max across the input {@code SparseTensor} objects' shape values + * for the corresponding dimensions. Its first shape value is {@code N}, the minibatch * size. - *

- * The input `SparseTensor` objects' indices are assumed ordered in + *

The input {@code SparseTensor} objects' indices are assumed ordered in * standard lexicographic order. If this is not the case, after this - * step run `SparseReorder` to restore index ordering. - *

- * For example, if the handles represent an input, which is a `[2, 3]` matrix - * representing two original `SparseTensor` objects: - *

{@code
+   *  step run {@code SparseReorder} to restore index ordering.
+   *  

For example, if the handles represent an input, which is a {@code [2, 3]} matrix + * representing two original {@code SparseTensor} objects: + *

    *      index = [ 0]
    *              [10]
    *              [20]
    *      values = [1, 2, 3]
    *      shape = [50]
-   *  }
- * and - *
{@code
+   *  
+ *

and + *

    *      index = [ 2]
    *              [10]
    *      values = [4, 5]
    *      shape = [30]
-   *  }
- * then the final `SparseTensor` will be: - *
{@code
+   *  
+ *

then the final {@code SparseTensor} will be: + *

    *      index = [0  0]
    *              [0 10]
    *              [0 20]
@@ -1490,14 +1545,14 @@ public  SparseToSparseSetOperation sparseToSparseSetOperatio
    *              [1 10]
    *      values = [1, 2, 3, 4, 5]
    *      shape = [2 50]
-   *  }
- * - * @param data type for {@code sparseValues()} output - * @param sparseHandles 1-D, The `N` serialized `SparseTensor` objects. - * Shape: `[N]`. - * @param dtype The `dtype` of the `SparseTensor` objects stored in the - * `SparseTensorsMap`. - * @param options carries optional attributes values + *
+ * + * @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 + * {@code SparseTensorsMap}. + * @param options carries optional attribute values + * @param data type for {@code TakeManySparseFromTensorsMap} output and operands * @return a new instance of TakeManySparseFromTensorsMap */ public TakeManySparseFromTensorsMap takeManySparseFromTensorsMap( 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 b9baf04fec6..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; @@ -60,19 +66,22 @@ public final class StringsOps { /** * Joins the strings in the given list of string tensors into one tensor; - *

* with the given separator (default is an empty separator). - *

- * Examples: - *

- * >>> s = ["hello", "world", "tensorflow"] - * >>> tf.strings.join(s, " ") - * + *

Examples: + *

+ *
+ *
+ *

s = ["hello", "world", "tensorflow"] + * tf.strings.join(s, " ") + * <tf.Tensor: shape=(), dtype=string, numpy=b'hello world tensorflow'> + *

+ *
+ *
* * @param inputs 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. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Join */ public Join join(Iterable> inputs, Join.Options... options) { @@ -81,14 +90,18 @@ public Join join(Iterable> inputs, Join.Options... options) { /** * Converts all uppercase characters into their respective lowercase replacements. - *

* Example: - *

- * >>> tf.strings.lower("CamelCase string and ALL CAPS") - * + *

+ *
+ *
+ *

tf.strings.lower("CamelCase string and ALL CAPS") + * <tf.Tensor: shape=(), dtype=string, numpy=b'camelcase string and all caps'> + *

+ *
+ *
* - * @param input - * @param options carries optional attributes values + * @param input The input to be lower-cased. + * @param options carries optional attribute values * @return a new instance of Lower */ public Lower lower(Operand input, Lower.Options... options) { @@ -97,35 +110,33 @@ public Lower lower(Operand input, Lower.Options... options) { /** * Joins a string Tensor across the given dimensions. - *

* Computes the string join across dimensions in the given string Tensor of shape - * `[\\(d_0, d_1, ..., d_{n-1}\\)]`. Returns a new Tensor created by joining the input + * {@code [\\(d_0, d_1, ..., d_{n-1}\\)]}. Returns a new Tensor created by joining the input * strings with the given separator (default: empty string). Negative indices are - * counted backwards from the end, with `-1` being equivalent to `n - 1`. If - * indices are not specified, joins across all dimensions beginning from `n - 1` - * through `0`. - *

- * For example: - *

{@code
-   *  # tensor `a` is [["a", "b"], ["c", "d"]]
-   *  tf.reduce_join(a, 0) ==> ["ac", "bd"]
-   *  tf.reduce_join(a, 1) ==> ["ab", "cd"]
-   *  tf.reduce_join(a, -2) = tf.reduce_join(a, 0) ==> ["ac", "bd"]
-   *  tf.reduce_join(a, -1) = tf.reduce_join(a, 1) ==> ["ab", "cd"]
-   *  tf.reduce_join(a, 0, keep_dims=True) ==> [["ac", "bd"]]
-   *  tf.reduce_join(a, 1, keep_dims=True) ==> [["ab"], ["cd"]]
-   *  tf.reduce_join(a, 0, separator=".") ==> ["a.c", "b.d"]
-   *  tf.reduce_join(a, [0, 1]) ==> "acbd"
-   *  tf.reduce_join(a, [1, 0]) ==> "abcd"
-   *  tf.reduce_join(a, []) ==> [["a", "b"], ["c", "d"]]
-   *  tf.reduce_join(a) = tf.reduce_join(a, [1, 0]) ==> "abcd"
-   *  }
+ * counted backwards from the end, with {@code -1} being equivalent to {@code n - 1}. If + * indices are not specified, joins across all dimensions beginning from {@code n - 1} + * through {@code 0}. + *

For example: + *

+   *  # tensor `a` is [["a", "b"], ["c", "d"]]
+   *  tf.reduce_join(a, 0) ==> ["ac", "bd"]
+   *  tf.reduce_join(a, 1) ==> ["ab", "cd"]
+   *  tf.reduce_join(a, -2) = tf.reduce_join(a, 0) ==> ["ac", "bd"]
+   *  tf.reduce_join(a, -1) = tf.reduce_join(a, 1) ==> ["ab", "cd"]
+   *  tf.reduce_join(a, 0, keep_dims=True) ==> [["ac", "bd"]]
+   *  tf.reduce_join(a, 1, keep_dims=True) ==> [["ab"], ["cd"]]
+   *  tf.reduce_join(a, 0, separator=".") ==> ["a.c", "b.d"]
+   *  tf.reduce_join(a, [0, 1]) ==> "acbd"
+   *  tf.reduce_join(a, [1, 0]) ==> "abcd"
+   *  tf.reduce_join(a, []) ==> [["a", "b"], ["c", "d"]]
+   *  tf.reduce_join(a) = tf.reduce_join(a, [1, 0]) ==> "abcd"
+   *  
* * @param inputs The input to be joined. All reduced indices must have non-zero size. * @param reductionIndices The dimensions to reduce over. Dimensions are reduced in the - * order specified. Omitting `reduction_indices` is equivalent to passing - * `[n-1, n-2, ..., 0]`. Negative indices from `-n` to `-1` are supported. - * @param options carries optional attributes values + * 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. + * @param options carries optional attribute values * @return a new instance of ReduceJoin */ public ReduceJoin reduceJoin(Operand inputs, Operand reductionIndices, @@ -135,20 +146,22 @@ public ReduceJoin reduceJoin(Operand inputs, Operand reductionI /** * Check if the input matches the regex pattern. - *

* The input is a string tensor of any shape. The pattern is a scalar * string tensor which is applied to 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) - *

- * Examples: - *

- * >>> tf.strings.regex_full_match(["TF lib", "lib TF"], ".*lib$") - * - * >>> tf.strings.regex_full_match(["TF lib", "lib TF"], ".*TF$") - * + *

The pattern follows the re2 syntax (https://github.com/google/re2/wiki/Syntax) + *

Examples: + *

+ *
+ *
+ *

tf.strings.regex_full_match(["TF lib", "lib TF"], ".*lib$") + * <tf.Tensor: shape=(2,), dtype=bool, numpy=array([ True, False])> + * tf.strings.regex_full_match(["TF lib", "lib TF"], ".*TF$") + * <tf.Tensor: shape=(2,), dtype=bool, numpy=array([False, True])> + *

+ *
+ *
* * @param input A string tensor of the text to be processed. * @param pattern A scalar string tensor containing the regular expression to match the input. @@ -159,16 +172,15 @@ public RegexFullMatch regexFullMatch(Operand input, Operand pa } /** - * Replaces matches of the `pattern` regular expression in `input` with the - * replacement string provided in `rewrite`. - *

+ * Replaces matches of the {@code pattern} regular expression in {@code input} with the + * replacement string provided in {@code 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 be matched in the `input` strings. - * @param rewrite The rewrite string to be substituted for the `pattern` expression where it is - * matched in the `input` strings. - * @param options carries optional attributes values + * @param pattern The regular expression to be matched in the {@code input} strings. + * @param rewrite The rewrite string to be substituted for the {@code pattern} expression where it is + * matched in the {@code input} strings. + * @param options carries optional attribute values * @return a new instance of RegexReplace */ public RegexReplace regexReplace(Operand input, Operand pattern, @@ -176,13 +188,43 @@ 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. * * @param inputs The list of tensors to format into the placeholder string. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of StringFormat */ public StringFormat stringFormat(Iterable> inputs, StringFormat.Options... options) { @@ -190,18 +232,22 @@ public StringFormat stringFormat(Iterable> inputs, StringFormat.Optio } /** - * String lengths of `input`. - *

+ * String lengths of {@code input}. * Computes the length of each string given in the input tensor. - *

- * >>> strings = tf.constant(['Hello','TensorFlow', '\U0001F642']) - * >>> tf.strings.length(strings).numpy() # default counts bytes + *

+ *
+ *
+ *

strings = tf.constant(['Hello','TensorFlow', '\U0001F642']) + * tf.strings.length(strings).numpy() # default counts bytes * array([ 5, 10, 4], dtype=int32) - * >>> tf.strings.length(strings, unit="UTF8_CHAR").numpy() + * tf.strings.length(strings, unit="UTF8_CHAR").numpy() * array([ 5, 10, 1], dtype=int32) + *

+ *
+ *
* * @param input The strings for which to compute the length for each element. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of StringLength */ public StringLength stringLength(Operand input, StringLength.Options... options) { @@ -210,16 +256,14 @@ public StringLength stringLength(Operand input, StringLength.Options... /** * Creates ngrams from ragged string data. - *

* 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 ngramsSplits()} 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. - * @param separator The string to append between elements of the token. Use "" for no separator. + * @param separator The string to append between elements of the token. Use "" for no separator. * @param ngramWidths The sizes of the ngrams to create. * @param leftPad The string to use to pad the left side of the ngram sequence. Only used if * pad_width != 0. @@ -227,9 +271,10 @@ public StringLength stringLength(Operand input, StringLength.Options... * pad_width != 0. * @param padWidth 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 `pad_width=-1`, then add `max(ngram_widths)-1` + * regardless of this value. If {@code pad_width=-1}, then add {@code max(ngram_widths)-1} * elements. - * @param preserveShortSequences + * @param preserveShortSequences The value of the preserveShortSequences attribute + * @param data type for {@code StringNGrams} output and operands * @return a new instance of StringNGrams */ public StringNGrams stringNGrams(Operand data, @@ -239,15 +284,13 @@ public StringNGrams stringNGrams(Operand data, } /** - * Split elements of `source` based on `sep` into a `SparseTensor`. - *

+ * Split elements of {@code source} based on {@code sep} into a {@code SparseTensor}. * Let N be the size of source (typically N will be the batch size). Split each - * element of `source` based on `sep` and return a `SparseTensor` + * element of {@code source} based on {@code sep} and return a {@code SparseTensor} * containing the split tokens. Empty tokens are ignored. - *

- * For example, N = 2, source[0] is 'hello world' and source[1] is 'a b c', + *

For example, N = 2, source[0] is 'hello world' and source[1] is 'a b c', * then the output will be - *

{@code
+   *  
    *  st.indices = [0, 0;
    *                0, 1;
    *                1, 0;
@@ -255,19 +298,18 @@ public  StringNGrams stringNGrams(Operand data,
    *                1, 2]
    *  st.shape = [2, 3]
    *  st.values = ['hello', 'world', 'a', 'b', 'c']
-   *  }
- * If `sep` is given, consecutive delimiters are not grouped together and are - * deemed to delimit empty strings. For example, source of `"1<>2<><>3"` and - * sep of `"<>"` returns `["1", "2", "", "3"]`. If `sep` is None or an empty + *
+ *

If {@code sep} is given, consecutive delimiters are not grouped together and are + * deemed to delimit empty strings. For example, source of {@code "1<>2<><>3"} and + * sep of {@code "<>"} returns {@code ["1", "2", "", "3"]}. If {@code sep} is None or an empty * string, consecutive whitespace are regarded as a single separator, and the * result will contain no empty strings at the startor end if the string has * leading or trailing whitespace. - *

- * Note that the above mentioned behavior matches python's str.split. + *

Note that the above mentioned behavior matches python's str.split. * - * @param input `1-D` string `Tensor`, the strings to split. - * @param sep `0-D` string `Tensor`, the delimiter character. - * @param options carries optional attributes values + * @param input {@code 1-D} string {@code Tensor}, the strings to split. + * @param sep {@code 0-D} string {@code Tensor}, the delimiter character. + * @param options carries optional attribute values * @return a new instance of StringSplit */ public StringSplit stringSplit(Operand input, Operand sep, @@ -277,8 +319,17 @@ public StringSplit stringSplit(Operand input, Operand sep, /** * Strip leading and trailing whitespaces from the Tensor. + * Examples: + *

+ *
+ *
+ *

tf.strings.strip(["\nTensorFlow", " The python library "]).numpy() + * array([b'TensorFlow', b'The python library'], dtype=object) + *

+ *
+ *
* - * @param input A string `Tensor` of any shape. + * @param input A string {@code Tensor} of any shape. * @return a new instance of Strip */ public Strip strip(Operand input) { @@ -286,40 +337,31 @@ public Strip strip(Operand input) { } /** - * Return substrings from `Tensor` of strings. - *

- * For each string in the input `Tensor`, creates a substring starting at index - * `pos` with a total length of `len`. - *

- * If `len` defines a substring that would extend beyond the length of the input - * string, or if `len` is negative, then as many characters as possible are used. - *

- * A negative `pos` indicates distance within the string backwards from the end. - *

- * If `pos` specifies an index which is out of range for any of the input strings, - * then an `InvalidArgumentError` is thrown. - *

- * `pos` and `len` must have the same shape, otherwise a `ValueError` is thrown on + * Return substrings from {@code Tensor} of strings. + * For each string in the input {@code Tensor}, creates a substring starting at index + * {@code pos} with a total length of {@code len}. + *

If {@code len} defines a substring that would extend beyond the length of the input + * string, or if {@code len} is negative, then as many characters as possible are used. + *

A negative {@code pos} indicates distance within the string backwards from the end. + *

If {@code pos} specifies an index which is out of range for any of the input strings, + * then an {@code InvalidArgumentError} is thrown. + *

{@code pos} and {@code len} must have the same shape, otherwise a {@code ValueError} is thrown on * Op creation. - *

- * NOTE: `strings.Substr` supports broadcasting up to two dimensions. More about + *

NOTE: {@code strings.Substr} supports broadcasting up to two dimensions. More about * broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - *

- * --- - *

- * Examples - *

- * Using scalar `pos` and `len`: - *

{@code
+   *   here 
+   *  
+ *

Examples + *

Using scalar {@code pos} and {@code len}: + *

    *  input = [b'Hello', b'World']
    *  position = 1
    *  length = 3
    *
    *  output = [b'ell', b'orl']
-   *  }
- * Using `pos` and `len` with same shape as `input`: - *
{@code
+   *  
+ *

Using {@code pos} and {@code len} with same shape as {@code input}: + *

    *  input = [[b'ten', b'eleven', b'twelve'],
    *           [b'thirteen', b'fourteen', b'fifteen'],
    *           [b'sixteen', b'seventeen', b'eighteen']]
@@ -333,9 +375,9 @@ public Strip strip(Operand input) {
    *  output = [[b'en', b'eve', b'lve'],
    *            [b'hirt', b'urt', b'te'],
    *            [b'ixtee', b'vente', b'hteen']]
-   *  }
- * Broadcasting `pos` and `len` onto `input`: - *
{@code
+   *  
+ *

Broadcasting {@code pos} and {@code len} onto {@code input}: + *

    *  input = [[b'ten', b'eleven', b'twelve'],
    *           [b'thirteen', b'fourteen', b'fifteen'],
    *           [b'sixteen', b'seventeen', b'eighteen'],
@@ -347,26 +389,28 @@ public Strip strip(Operand input) {
    *            [b'h', b'ur', b'tee'],
    *            [b'i', b've', b'hte'],
    *            [b'i', b'en', b'nty']]
-   *  }
- * Broadcasting `input` onto `pos` and `len`: - *
{@code
+   *  
+ *

Broadcasting {@code input} onto {@code pos} and {@code len}: + *

    *  input = b'thirteen'
    *  position = [1, 5, 7]
    *  length =   [3, 2, 1]
    *
    *  output = [b'hir', b'ee', b'n']
-   *  }
- * Raises: - *

- * `ValueError`: If the first argument cannot be converted to a - * Tensor of `dtype string`. - * `InvalidArgumentError`: If indices are out of range. - * `ValueError`: If `pos` and `len` are not the same shape. + *

+ *

Raises: + *

    + *
  • {@code ValueError}: If the first argument cannot be converted to a + * Tensor of {@code dtype string}.
  • + *
  • {@code InvalidArgumentError}: If indices are out of range.
  • + *
  • {@code ValueError}: If {@code pos} and {@code len} are not the same shape.
  • + *
* * @param input Tensor of strings * @param pos Scalar defining the position of first character in each substring * @param len Scalar defining the number of characters to include in each substring - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Substr} output and operands * @return a new instance of Substr */ public Substr substr(Operand input, Operand pos, Operand len, @@ -376,15 +420,13 @@ public Substr substr(Operand input, Operand pos, /** * Converts each string in the input Tensor to its hash mod by a number of buckets. - *

* The hash function is deterministic on the content of the string within the * process. - *

- * Note that the hash function may change from time to time. + *

Note that the hash function may change from time to time. * This functionality will be deprecated and it's recommended to use - * `tf.string_to_hash_bucket_fast()` or `tf.string_to_hash_bucket_strong()`. + * {@code tf.string_to_hash_bucket_fast()} or {@code tf.string_to_hash_bucket_strong()}. * - * @param stringTensor + * @param stringTensor The stringTensor value * @param numBuckets The number of buckets. * @return a new instance of ToHashBucket */ @@ -394,18 +436,21 @@ public ToHashBucket toHashBucket(Operand stringTensor, Long numBuckets) /** * Converts each string in the input Tensor to its hash mod by a number of buckets. - *

* The hash function is deterministic on the content of the string within the * process and will never change. However, it is not suitable for cryptography. * This function may be used when CPU time is scarce and inputs are trusted or * unimportant. There is a risk of adversaries constructing inputs that all hash * to the same bucket. To prevent this problem, use a strong hash function with - * `tf.string_to_hash_bucket_strong`. - *

- * Examples: - *

- * >>> tf.strings.to_hash_bucket_fast(["Hello", "TensorFlow", "2.x"], 3).numpy() + * {@code tf.string_to_hash_bucket_strong}. + *

Examples: + *

+ *
+ *
+ *

tf.strings.to_hash_bucket_fast(["Hello", "TensorFlow", "2.x"], 3).numpy() * array([0, 2, 2]) + *

+ *
+ *
* * @param input The strings to assign a hash bucket. * @param numBuckets The number of buckets. @@ -417,25 +462,26 @@ public ToHashBucketFast toHashBucketFast(Operand input, Long numBuckets /** * Converts each string in the input Tensor to its hash mod by a number of buckets. - *

* The hash function is deterministic on the content of the string within the - * process. The hash function is a keyed hash function, where attribute `key` - * defines the key of the hash function. `key` is an array of 2 elements. - *

- * A strong hash is important when inputs may be malicious, e.g. URLs with + * process. The hash function is a keyed hash function, where attribute {@code key} + * defines the key of the hash function. {@code key} is an array of 2 elements. + *

A strong hash is important when inputs may be malicious, e.g. URLs with * additional components. Adversaries could try to make their inputs hash to the * same bucket for a denial-of-service attack or to skew the results. A strong * hash can be used to make it difficult to find inputs with a skewed hash value * distribution over buckets. This requires that the hash function is - * seeded by a high-entropy (random) "key" unknown to the adversary. - *

- * The additional robustness comes at a cost of roughly 4x higher compute - * time than `tf.string_to_hash_bucket_fast`. - *

- * Examples: - *

- * >>> tf.strings.to_hash_bucket_strong(["Hello", "TF"], 3, [1, 2]).numpy() + * seeded by a high-entropy (random) "key" unknown to the adversary. + *

The additional robustness comes at a cost of roughly 4x higher compute + * time than {@code tf.string_to_hash_bucket_fast}. + *

Examples: + *

+ *
+ *
+ *

tf.strings.to_hash_bucket_strong(["Hello", "TF"], 3, [1, 2]).numpy() * array([2, 0]) + *

+ *
+ *
* * @param input The strings to assign a hash bucket. * @param numBuckets The number of buckets. @@ -450,19 +496,21 @@ public ToHashBucketStrong toHashBucketStrong(Operand input, Long numBuc /** * Converts each string in the input Tensor to the specified numeric type. - *

* (Note that int32 overflow results in an error while float overflow * results in a rounded value.) - *

- * Example: - *

- * >>> strings = ["5.0", "3.0", "7.0"] - * >>> tf.strings.to_number(strings) - * + *

Example: + *

+ *
+ *
+ *

strings = ["5.0", "3.0", "7.0"] + * tf.strings.to_number(strings) + * <tf.Tensor: shape=(3,), dtype=float32, numpy=array([5., 3., 7.], dtype=float32)> + *

+ *
+ *
* - * @param data type for {@code output()} output - * @param stringTensor - * @return a new instance of ToNumber + * @param stringTensor The stringTensor value + * @return a new instance of ToNumber, with default output types */ public ToNumber toNumber(Operand stringTensor) { return ToNumber.create(scope, stringTensor); @@ -470,46 +518,203 @@ public ToNumber toNumber(Operand stringTensor) { /** * Converts each string in the input Tensor to the specified numeric type. - *

* (Note that int32 overflow results in an error while float overflow * results in a rounded value.) - *

- * Example: - *

- * >>> strings = ["5.0", "3.0", "7.0"] - * >>> tf.strings.to_number(strings) - * - * - * @param data type for {@code output()} output - * @param stringTensor - * @param outType The numeric type to interpret each string in `string_tensor` as. + *

Example: + *

+ *
+ *
+ *

strings = ["5.0", "3.0", "7.0"] + * tf.strings.to_number(strings) + * <tf.Tensor: shape=(3,), dtype=float32, numpy=array([5., 3., 7.], dtype=float32)> + *

+ *
+ *
+ * + * @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 */ public ToNumber toNumber(Operand stringTensor, Class outType) { 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 * each code point. Script codes correspond to International Components for * Unicode (ICU) UScriptCode values. - *

- * See - * [ICU project docs](http://icu-project.org/apiref/icu4c/uscript_8h.html) + *

See + * ICU project docs * for more details on script codes. - *

- * For an example, see the unicode strings guide on [unicode scripts] + *

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

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

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

- * Examples: - *

- * >>> tf.strings.unicode_script([1, 31, 38]) - * + *

Examples: + *

+ *
+ *
+ *

tf.strings.unicode_script([1, 31, 38]) + * <tf.Tensor: shape=(3,), dtype=int32, numpy=array([0, 0, 0], dtype=int32)> + *

+ *
+ *
* * @param input A Tensor of int32 Unicode code points. * @return a new instance of UnicodeScript @@ -520,48 +725,48 @@ public UnicodeScript unicodeScript(Operand input) { /** * Transcode the input text from a source encoding to a destination encoding. - *

* The input is a string tensor of any shape. The output is a string tensor of * the same shape containing the transcoded strings. Output strings are always * valid unicode. If the input contains invalid encoding positions, the - * `errors` attribute sets the policy for how to deal with them. If the default + * {@code errors} attribute sets the policy for how to deal with them. If the default * error-handling policy is used, invalid formatting will be substituted in the - * output by the `replacement_char`. If the errors policy is to `ignore`, any + * output by the {@code replacement_char}. If the errors policy is to {@code ignore}, any * invalid encoding positions in the input are skipped and not included in the - * output. If it set to `strict` then any invalid formatting will result in an + * output. If it set to {@code strict} then any invalid formatting will result in an * InvalidArgument error. - *

- * This operation can be used with `output_encoding = input_encoding` to enforce + *

This operation can be used with {@code output_encoding = input_encoding} to enforce * correct formatting for inputs even if they are already in the desired encoding. - *

- * If the input is prefixed by a Byte Order Mark needed to determine encoding + *

If the input is prefixed by a Byte Order Mark needed to determine encoding * (e.g. if the encoding is UTF-16 and the BOM indicates big-endian), then that * BOM will be consumed and not emitted into the output. If the input encoding * is marked with an explicit endianness (e.g. UTF-16-BE), then the BOM is * interpreted as a non-breaking-space and is preserved in the output (including * always for UTF-8). - *

- * The end result is that if the input is marked as an explicit endianness the + *

The end result is that if the input is marked as an explicit endianness the * transcoding is faithful to all codepoints in the source. If it is not marked * with an explicit endianness, the BOM is not considered part of the string itself * but as metadata, and so is not preserved in the output. - *

- * Examples: - *

- * >>> tf.strings.unicode_transcode(["Hello", "TensorFlow", "2.x"], "UTF-8", "UTF-16-BE") - * Examples: + *

+ *
+ *
+ *

tf.strings.unicode_transcode(["Hello", "TensorFlow", "2.x"], "UTF-8", "UTF-16-BE") + * <tf.Tensor: shape=(3,), dtype=string, numpy= * array([b'\x00H\x00e\x00l\x00l\x00o', - * b'\x00T\x00e\x00n\x00s\x00o\x00r\x00F\x00l\x00o\x00w', - * b'\x002\x00.\x00x'], dtype=object)> - * >>> tf.strings.unicode_transcode(["A", "B", "C"], "US ASCII", "UTF-8").numpy() + * b'\x00T\x00e\x00n\x00s\x00o\x00r\x00F\x00l\x00o\x00w', + * b'\x002\x00.\x00x'], dtype=object)> + * tf.strings.unicode_transcode(["A", "B", "C"], "US ASCII", "UTF-8").numpy() * array([b'A', b'B', b'C'], dtype=object) + *

+ *
+ *
* * @param input The text to be processed. Can have any shape. * @param inputEncoding Text encoding of the input strings. This is any of the encodings supported - * by ICU ucnv algorithmic converters. Examples: `"UTF-16", "US ASCII", "UTF-8"`. + * by ICU ucnv algorithmic converters. Examples: {@code "UTF-16", "US ASCII", "UTF-8"}. * @param outputEncoding The unicode encoding to use in the output. Must be one of - * `"UTF-8", "UTF-16-BE", "UTF-32-BE"`. Multi-byte encodings will be big-endian. - * @param options carries optional attributes values + * {@code "UTF-8", "UTF-16-BE", "UTF-32-BE"}. Multi-byte encodings will be big-endian. + * @param options carries optional attribute values * @return a new instance of UnicodeTranscode */ public UnicodeTranscode unicodeTranscode(Operand input, String inputEncoding, @@ -570,39 +775,12 @@ public UnicodeTranscode unicodeTranscode(Operand input, String inputEnc } /** - * Joins the elements of `inputs` based on `segment_ids`. - *

- * Computes the string join along segments of a tensor. - * Given `segment_ids` with rank `N` and `data` with rank `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: - *

{@code
-   *  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']
-   *  }
- * - * @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 options carries optional attributes values + * The UnsortedSegmentJoin operation + * + * @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 */ public UnsortedSegmentJoin unsortedSegmentJoin(Operand inputs, @@ -613,14 +791,18 @@ public UnsortedSegmentJoin unsortedSegmentJoin(Operand inputs, /** * Converts all lowercase characters into their respective uppercase replacements. - *

* Example: - *

- * >>> tf.strings.upper("CamelCase string and ALL CAPS") - * + *

+ *
+ *
+ *

tf.strings.upper("CamelCase string and ALL CAPS") + * <tf.Tensor: shape=(), dtype=string, numpy=b'CAMELCASE STRING AND ALL CAPS'> + *

+ *
+ *
* - * @param input - * @param options carries optional attributes values + * @param input The input to be upper-cased. + * @param options carries optional attribute values * @return a new instance of Upper */ public Upper upper(Operand input, Upper.Options... options) { 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 5366744fcae..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; @@ -45,27 +62,22 @@ public final class SummaryOps { } /** - * Outputs a `Summary` protocol buffer with audio. - *

- * The summary has up to `max_outputs` summary values containing audio. The - * audio is built from `tensor` which must be 3-D with shape `[batch_size, - * frames, channels]` or 2-D with shape `[batch_size, frames]`. The values are - * assumed to be in the range of `[-1.0, 1.0]` with a sample rate of `sample_rate`. - *

- * The `tag` argument is a scalar `Tensor` of type `string`. It is used to - * build the `tag` of the summary values: + * Outputs a {@code Summary} protocol buffer with audio. + * The summary has up to {@code max_outputs} summary values containing audio. The + * audio is built from {@code tensor} which must be 3-D with shape {@code [batch_size, frames, channels]} or 2-D with shape {@code [batch_size, frames]}. The values are + * assumed to be in the range of {@code [-1.0, 1.0]} with a sample rate of {@code sample_rate}. + *

The {@code tag} argument is a scalar {@code Tensor} of type {@code string}. It is used to + * build the {@code tag} of the summary values: *

    - *
  • - * If `max_outputs` is 1, the summary value tag is 'tag/audio'. - *
  • - *
  • - * If `max_outputs` is greater than 1, the summary value tags are - * generated sequentially as 'tag/audio/0', 'tag/audio/1', etc. + *
  • If {@code max_outputs} is 1, the summary value tag is 'tag/audio'.
  • + *
  • If {@code max_outputs} is greater than 1, the summary value tags are + * generated sequentially as 'tag/audio/0', 'tag/audio/1', etc.
  • + *
* - * @param tag Scalar. Used to build the `tag` attribute of the summary values. - * @param tensor 2-D of shape `[batch_size, frames]`. + * @param tag Scalar. Used to build the {@code tag} attribute of the summary values. + * @param tensor 2-D of shape {@code [batch_size, frames]}. * @param sampleRate The sample rate of the signal in hertz. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of AudioSummary */ public AudioSummary audioSummary(Operand tag, Operand tensor, @@ -74,15 +86,65 @@ public AudioSummary audioSummary(Operand tag, Operand tensor, } /** - * Outputs a `Summary` protocol buffer with a histogram. - *

+ * 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 - * [`Summary`](https://www.tensorflow.org/code/tensorflow/core/framework/summary.proto) - * has one summary value containing a histogram for `values`. - *

- * This op reports an `InvalidArgument` error if any value is not finite. + * {@code Summary} + * has one summary value containing a histogram for {@code values}. + *

This op reports an {@code InvalidArgument} error if any value is not finite. * - * @param tag Scalar. Tag to use for the `Summary.Value`. + * @param tag Scalar. Tag to use for the {@code Summary.Value}. * @param values Any shape. Values to use to build the histogram. * @return a new instance of HistogramSummary */ @@ -92,59 +154,47 @@ public HistogramSummary histogramSummary(Operand tag, } /** - * Outputs a `Summary` protocol buffer with images. - *

- * The summary has up to `max_images` summary values containing images. The - * images are built from `tensor` which must be 4-D with shape `[batch_size, - * height, width, channels]` and where `channels` can be: + * Outputs a {@code Summary} protocol buffer with images. + * The summary has up to {@code max_images} summary values containing images. The + * images are built from {@code tensor} which must be 4-D with shape {@code [batch_size, height, width, channels]} and where {@code channels} can be: *

    - *
  • - * 1: `tensor` is interpreted as Grayscale. - *
  • - *
  • - * 3: `tensor` is interpreted as RGB. - *
  • - *
  • - * 4: `tensor` is interpreted as RGBA. - *
  • + *
  • 1: {@code tensor} is interpreted as Grayscale.
  • + *
  • 3: {@code tensor} is interpreted as RGB.
  • + *
  • 4: {@code tensor} is interpreted as RGBA.
  • *
- * The images have the same number of channels as the input tensor. For float + *

The images have the same number of channels as the input tensor. For float * input, the values are normalized one image at a time to fit in the range - * `[0, 255]`. `uint8` values are unchanged. The op uses two different + * {@code [0, 255]}. {@code uint8} values are unchanged. The op uses two different * normalization algorithms: *

    *
  • - * If the input values are all positive, they are rescaled so the largest one - * is 255. + *

    If the input values are all positive, they are rescaled so the largest one + * is 255. *

  • *
  • - * If any input value is negative, the values are shifted so input value 0.0 - * is at 127. They are then rescaled so that either the smallest value is 0, - * or the largest one is 255. + *

    If any input value is negative, the values are shifted so input value 0.0 + * is at 127. They are then rescaled so that either the smallest value is 0, + * or the largest one is 255. *

  • *
- * The `tag` argument is a scalar `Tensor` of type `string`. It is used to - * build the `tag` of the summary values: + *

The {@code tag} argument is a scalar {@code Tensor} of type {@code string}. It is used to + * build the {@code tag} of the summary values: *

    - *
  • - * If `max_images` is 1, the summary value tag is 'tag/image'. - *
  • - *
  • - * If `max_images` is greater than 1, the summary value tags are - * generated sequentially as 'tag/image/0', 'tag/image/1', etc. - *
  • + *
  • If {@code max_images} is 1, the summary value tag is 'tag/image'.
  • + *
  • If {@code max_images} is greater than 1, the summary value tags are + * generated sequentially as 'tag/image/0', 'tag/image/1', etc.
  • *
- * The `bad_color` argument is the color to use in the generated images for - * non-finite input values. It is a `uint8` 1-D tensor of length `channels`. - * Each element must be in the range `[0, 255]` (It represents the value of a + *

The {@code bad_color} argument is the color to use in the generated images for + * non-finite input values. It is a {@code uint8} 1-D tensor of length {@code channels}. + * Each element must be in the range {@code [0, 255]} (It represents the value of a * pixel in the output image). Non-finite values in the input tensor are * replaced by this tensor in the output image. The default value is the color * red. * - * @param tag Scalar. Used to build the `tag` attribute of the summary values. - * @param tensor 4-D of shape `[batch_size, height, width, channels]` where - * `channels` is 1, 3, or 4. - * @param options carries optional attributes values + * @param tag Scalar. Used to build the {@code tag} attribute of the summary values. + * @param tensor 4-D of shape {@code [batch_size, height, width, channels]} where + * {@code channels} is 1, 3, or 4. + * @param options carries optional attribute values * @return a new instance of ImageSummary */ public ImageSummary imageSummary(Operand tag, Operand tensor, @@ -152,18 +202,27 @@ public ImageSummary imageSummary(Operand tag, Operand writer, Operand event) { + return ImportEvent.create(scope, writer, event); + } + /** * Merges summaries. - *

* This op creates a - * [`Summary`](https://www.tensorflow.org/code/tensorflow/core/framework/summary.proto) + * {@code Summary} * protocol buffer that contains the union of all the values in the input * summaries. - *

- * When the Op is run, it reports an `InvalidArgument` error if multiple values + *

When the Op is run, it reports an {@code InvalidArgument} error if multiple values * in the summaries to merge use the same tag. * - * @param inputs Can be of any shape. Each must contain serialized `Summary` protocol + * @param inputs Can be of any shape. Each must contain serialized {@code Summary} protocol * buffers. * @return a new instance of MergeSummary */ @@ -172,10 +231,9 @@ public MergeSummary mergeSummary(Iterable> inputs) { } /** - * Outputs a `Summary` protocol buffer with scalar values. - *

- * The input `tags` and `values` must have the same shape. The generated summary - * has a summary value for each tag-value pair in `tags` and `values`. + * Outputs a {@code Summary} protocol buffer with scalar values. + * 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}. * * @param tags Tags for the summary. * @param values Same shape as `tags. Values for the summary. @@ -186,7 +244,27 @@ 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. * * @param tag A string attached to this summary. Used for organization in TensorBoard. * @param tensor A tensor to serialize. @@ -199,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 b9b13e9cc22..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. @@ -18,19 +18,118 @@ 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.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; @@ -43,27 +142,516 @@ public final class TpuOps { } /** - * Asserts that compilation succeeded. This op produces no output and closes the - *

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

- * 'compilation_status' is a serialized CompilationResultProto. + * 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 compilationStatus + * @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. + *

'num_computations' is the number of computations to be compiled. + * 'function' is a function containing the computation to compile. + * 'dynamic_shapes' contains dynamic shapes of arguments whose shapes were not + * known statically at TPUReplication rewrite time. + * 'guaranteed_constants' is a list of tensors which have been guaranteed to not + * change their values during the session lifetime. These contain tensors marked as + * constant using the GuaranteeConstOp. + * 'metadata' is a serialized TPUCompileMetadataProto describing + * the shapes and types of the inputs to the computation, as well as a mapping onto + * the TPU pod topology. + * Each 'program' output is a string key that is passed to the _TPUExecute op and + * 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 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, + Iterable> guaranteedConstants, Long numComputations, ConcreteFunction function, + String metadata) { + return Compile.create(scope, dynamicShapes, guaranteedConstants, numComputations, function, metadata); + } + + /** + * Asserts that compilation succeeded. + * This op produces no output and closes the device during failure to ensure all + * pending device interactions fail. + *

'compilation_status' is a serialized CompilationResultProto. + * + * @param compilationStatus 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 - * @param key - * @param Tresults + * @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, @@ -73,7 +661,6 @@ public Execute execute(Iterable> args, Operand key, /** * Op that executes a program with optional in-place variable updates. - *

* It (optionally) reads device variables, loads and executes a TPU program on a * TPU device, and then (optionally) in-place updates variables using the program * outputs, as specified in attributes device_var_reads_indices (program input @@ -82,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 - * @param key - * @param Tresults - * @param deviceVarReadsIndices - * @param deviceVarUpdatesIndices + * @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, @@ -96,32 +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 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 + * @return a new instance of InfeedEnqueue + */ + public InfeedEnqueue infeedEnqueue(Operand input, + InfeedEnqueue.Options... options) { + return InfeedEnqueue.create(scope, input, options); + } + + /** + * An op which enqueues prelinearized buffer into TPU infeed. + * + * @param input A variant tensor representing linearized output. + * @param options carries optional attribute values + * @return a new instance of InfeedEnqueuePrelinearizedBuffer + */ + 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 data type for {@code output()} output * @param inputs A list of partitioned inputs which must have the same shape. - * @param options carries optional attributes values + * @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, - PartitionedInput.Options... options) { - return PartitionedInput.create(scope, inputs, options); + 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. + * outputs outside the XLA computation. Supports ND sharding. * - * @param data type for {@code output()} output * @param inputs A tensor which represents the full shape of partitioned tensors. - * @param numSplits - * @param options carries optional attributes values + * @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, - PartitionedOutput.Options... options) { - return PartitionedOutput.create(scope, inputs, numSplits, options); + 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 eb8d94bc6e4..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. @@ -18,15 +18,18 @@ 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.train.AccumulatorApplyGradient; 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; @@ -38,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; @@ -57,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; @@ -72,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; @@ -81,6 +96,7 @@ import org.tensorflow.op.train.SparseApplyProximalAdagrad; import org.tensorflow.op.train.SparseApplyProximalGradientDescent; import org.tensorflow.op.train.SparseApplyRmsProp; +import org.tensorflow.op.train.SymbolicGradient; import org.tensorflow.op.train.TileGrad; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; @@ -92,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; @@ -106,7 +122,6 @@ public final class TrainOps { /** * 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. @@ -131,7 +146,6 @@ public AccumulatorNumAccumulated accumulatorNumAccumulated(Operand hand /** * Updates the accumulator with a new value for global_step. - *

* Logs warning if the accumulator's value is already higher than * new_global_step. * @@ -146,18 +160,17 @@ public AccumulatorSetGlobalStep accumulatorSetGlobalStep(Operand handle /** * 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 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 * of the accumulator. + * @param data type for {@code AccumulatorTakeGradient} output and operands * @return a new instance of AccumulatorTakeGradient */ public AccumulatorTakeGradient accumulatorTakeGradient( @@ -165,15 +178,38 @@ 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(); * 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 * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param accumUpdate Should be from a Variable(). @@ -181,7 +217,8 @@ public AccumulatorTakeGradient accumulatorTakeGradient( * @param rho Decay factor. Must be a scalar. * @param epsilon Constant factor. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyAdadelta} output and operands * @return a new instance of ApplyAdadelta */ public ApplyAdadelta applyAdadelta(Operand var, Operand accum, @@ -192,16 +229,15 @@ public ApplyAdadelta applyAdadelta(Operand var, Operand< /** * Update '*var' according to the adagrad scheme. - *

* 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. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyAdagrad} output and operands * @return a new instance of ApplyAdagrad */ public ApplyAdagrad applyAdagrad(Operand var, Operand accum, @@ -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(). @@ -221,7 +256,8 @@ public ApplyAdagrad applyAdagrad(Operand var, Operand * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 regularization. Must be a scalar. * @param globalStep Training step number. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyAdagradDA} output and operands * @return a new instance of ApplyAdagradDa */ public ApplyAdagradDa applyAdagradDa(Operand var, @@ -231,15 +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(). @@ -250,7 +303,8 @@ public ApplyAdagradDa applyAdagradDa(Operand var, * @param beta2 Momentum factor. Must be a scalar. * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyAdam} output and operands * @return a new instance of ApplyAdam */ public ApplyAdam applyAdam(Operand var, Operand m, Operand v, @@ -261,12 +315,10 @@ public ApplyAdam applyAdam(Operand var, Operand m, Op /** * Update '*var' according to the AddSign update. - *

- * m_t <- beta1 * m_{t-1} + (1 - beta1) * g - * update <- (alpha + sign_decay * sign(g) *sign(m)) * g - * variable <- variable - lr_t * update + * 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 * @param var Should be from a Variable(). * @param m Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. @@ -274,7 +326,8 @@ public ApplyAdam applyAdam(Operand var, Operand m, Op * @param signDecay Must be a scalar. * @param beta Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyAddSign} output and operands * @return a new instance of ApplyAddSign */ public ApplyAddSign applyAddSign(Operand var, Operand m, Operand lr, @@ -285,27 +338,21 @@ public ApplyAddSign applyAddSign(Operand var, Operand /** * Update '*var' according to the centered RMSProp algorithm. - *

* The centered RMSProp algorithm uses an estimate of the centered second moment * (i.e., the variance) for normalization, as opposed to regular RMSProp, which * uses the (uncentered) second moment. This often helps with training, but is * slightly more expensive in terms of computation and memory. - *

- * Note that in dense implementation of this algorithm, mg, ms, and mom will + *

Note that in dense implementation of this algorithm, mg, ms, and mom will * update even if the grad is zero, but in this sparse implementation, mg, ms, * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * mean_grad = decay * mean_grad + (1-decay) * gradient - *

- * Delta = learning_rate * gradient / sqrt(mean_square + epsilon - mean_grad ** 2) - *

- * mg <- rho * mg_{t-1} + (1-rho) * grad - * ms <- rho * ms_{t-1} + (1-rho) * grad * grad - * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms - mg * mg + epsilon) - * var <- var - mom + *

Delta = learning_rate * gradient / sqrt(mean_square + epsilon - mean_grad ** 2) + *

mg <- rho * mg_{t-1} + (1-rho) * grad + * 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 * @param var Should be from a Variable(). * @param mg Should be from a Variable(). * @param ms Should be from a Variable(). @@ -315,7 +362,8 @@ public ApplyAddSign applyAddSign(Operand var, Operand * @param momentum Momentum Scale. Must be a scalar. * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyCenteredRMSProp} output and operands * @return a new instance of ApplyCenteredRmsProp */ public ApplyCenteredRmsProp applyCenteredRmsProp(Operand var, @@ -327,16 +375,14 @@ public ApplyCenteredRmsProp applyCenteredRmsProp(Operand /** * Update '*var' according to the Ftrl-proximal scheme. - *

* grad_with_shrinkage = grad + 2 * l2_shrinkage * var * accum_new = accum + grad * grad * linear += grad_with_shrinkage - - * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var + * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var * quadratic = 1.0 / (accum_new^(lr_power) * lr) + 2 * l2 - * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 + * 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(). @@ -344,9 +390,10 @@ 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 + * @param l2Shrinkage The l2Shrinkage value * @param lrPower Scaling factor. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyFtrlV2} output and operands * @return a new instance of ApplyFtrl */ public ApplyFtrl applyFtrl(Operand var, Operand accum, @@ -358,11 +405,11 @@ 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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyGradientDescent} output and operands * @return a new instance of ApplyGradientDescent */ public ApplyGradientDescent applyGradientDescent(Operand var, @@ -372,19 +419,17 @@ public ApplyGradientDescent applyGradientDescent(Operand /** * Update '*var' according to the momentum scheme. - *

* Set use_nesterov = True if you want to use Nesterov momentum. - *

- * accum = accum * momentum + grad + *

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. * @param grad The gradient. * @param momentum Momentum. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyMomentum} output and operands * @return a new instance of ApplyMomentum */ public ApplyMomentum applyMomentum(Operand var, Operand accum, @@ -394,12 +439,10 @@ public ApplyMomentum applyMomentum(Operand var, Operand< /** * Update '*var' according to the AddSign update. - *

- * 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 + * 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 * @param var Should be from a Variable(). * @param m Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. @@ -407,7 +450,8 @@ public ApplyMomentum applyMomentum(Operand var, Operand< * @param signDecay Must be a scalar. * @param beta Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyPowerSign} output and operands * @return a new instance of ApplyPowerSign */ public ApplyPowerSign applyPowerSign(Operand var, Operand m, @@ -418,19 +462,18 @@ public ApplyPowerSign applyPowerSign(Operand var, Operan /** * Update '*var' and '*accum' according to FOBOS with Adagrad learning rate. - *

- * accum += grad grad - * prox_v = var - lr grad (1 / sqrt(accum)) - * var = sign(prox_v)/(1+lrl2) max{|prox_v|-lrl1,0} + * 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 * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 regularization. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyProximalAdagrad} output and operands * @return a new instance of ApplyProximalAdagrad */ public ApplyProximalAdagrad applyProximalAdagrad(Operand var, @@ -441,17 +484,16 @@ public ApplyProximalAdagrad applyProximalAdagrad(Operand /** * 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} + * 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. * @param l2 L2 regularization. Must be a scalar. * @param delta The change. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyProximalGradientDescent} output and operands * @return a new instance of ApplyProximalGradientDescent */ public ApplyProximalGradientDescent applyProximalGradientDescent( @@ -462,28 +504,25 @@ public ApplyProximalGradientDescent applyProximalGradientDe /** * Update '*var' according to the RMSProp algorithm. - *

* Note that in dense implementation of this algorithm, ms and mom will * update even if the grad is zero, but in this sparse implementation, ms * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * Delta = learning_rate * gradient / sqrt(mean_square + epsilon) - *

- * ms <- rho * ms_{t-1} + (1-rho) * grad * grad - * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) - * var <- var - mom + *

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 * @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 + * @param momentum The momentum value * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyRMSProp} output and operands * @return a new instance of ApplyRmsProp */ public ApplyRmsProp applyRmsProp(Operand var, Operand ms, @@ -494,44 +533,51 @@ public ApplyRmsProp applyRmsProp(Operand var, Operand /** * Multiplies slices of two tensors in batches. - *

- * Multiplies all slices of `Tensor` `x` and `y` (each slice can be + * Multiplies all slices of {@code Tensor} {@code x} and {@code y} (each slice can be * viewed as an element of a batch), and arranges the individual results * in a single output tensor of the same batch size. Each of the * individual slices can optionally be adjointed (to adjoint a matrix * means to transpose and conjugate it) before multiplication by setting - * the `adj_x` or `adj_y` flag to `True`, which are by default `False`. - *

- * The input tensors `x` and `y` are 2-D or higher with shape `[..., r_x, c_x]` - * and `[..., r_y, c_y]`. - *

- * The output tensor is 2-D or higher with shape `[..., r_o, c_o]`, where: - *

- * r_o = c_x if adj_x else r_x - * c_o = r_y if adj_y else c_y - *

- * It is computed as: - *

- * output[..., :, :] = matrix(x[..., :, :]) * matrix(y[..., :, :]) - *

- * NOTE: `train.BatchMatMul` supports broadcasting in the batch dimensions. More + * the {@code adj_x} or {@code adj_y} flag to {@code True}, which are by default {@code False}. + *

The input tensors {@code x} and {@code y} are 2-D or higher with shape {@code [..., r_x, c_x]} + * and {@code [..., r_y, c_y]}. + *

The output tensor is 2-D or higher with shape {@code [..., r_o, c_o]}, where: + *

+   *  r_o = c_x if adj_x else r_x
+   *  c_o = r_y if adj_y else c_y
+   *  
+ *

It is computed as: + *

+   *  output[..., :, :] = matrix(x[..., :, :]) * matrix(y[..., :, :])
+   *  
+ *

NOTE: {@code train.BatchMatMul} supports broadcasting in the batch dimensions. More * about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html). + * here . * - * @param data type for {@code output()} output - * @param x 2-D or higher with shape `[..., r_x, c_x]`. - * @param y 2-D or higher with shape `[..., r_y, c_y]`. - * @param options carries optional attributes values + * @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. + * @param options carries optional attribute values + * @param data type for {@code BatchMatMulV3} output and operands * @return a new instance of BatchMatMul */ - public BatchMatMul batchMatMul(Operand x, Operand y, - BatchMatMul.Options... options) { - return BatchMatMul.create(scope, x, y, options); + public BatchMatMul batchMatMul(Operand x, + Operand y, Class Tout, BatchMatMul.Options... options) { + 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 * equal to the most recent global_step known to the accumulator. The * average can be extracted from the accumulator, provided sufficient @@ -541,7 +587,8 @@ public BatchMatMul batchMatMul(Operand x, Operand y, * * @param dtype The type of the value being accumulated. * @param shape The shape of the values, can be [], in which case shape is unknown. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ConditionalAccumulator} output and operands * @return a new instance of ConditionalAccumulator */ public ConditionalAccumulator conditionalAccumulator(Class dtype, @@ -549,31 +596,40 @@ 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 `num_new_vocab`, where `remapping[i]` contains the row number in the old - * vocabulary that corresponds to row `i` in the new vocabulary (starting at line - * `new_vocab_offset` and up to `num_new_vocab` entities), or `-1` if entry `i` + * length {@code num_new_vocab}, where {@code remapping[i]} contains the row number in the old + * vocabulary that corresponds to row {@code i} in the new vocabulary (starting at line + * {@code new_vocab_offset} and up to {@code num_new_vocab} entities), or {@code -1} if entry {@code i} * in the new vocabulary is not in the old vocabulary. The old vocabulary is - * constrained to the first `old_vocab_size` entries if `old_vocab_size` is not the + * constrained to the first {@code old_vocab_size} entries if {@code old_vocab_size} is not the * default value of -1. - *

- * `num_vocab_offset` enables + *

{@code num_vocab_offset} enables * use in the partitioned variable case, and should generally be set through * examining partitioning info. The format of the files should be a text file, * with each line containing a single entity within the vocabulary. - *

- * For example, with `new_vocab_file` a text file containing each of the following - * elements on a single line: `[f0, f1, f2, f3]`, old_vocab_file = [f1, f0, f3], - * `num_new_vocab = 3, new_vocab_offset = 1`, the returned remapping would be - * `[0, -1, 2]`. - *

- * The op also returns a count of how many entries in the new vocabulary + *

For example, with {@code new_vocab_file} a text file containing each of the following + * elements on a single line: {@code [f0, f1, f2, f3]}, old_vocab_file = [f1, f0, f3], + * {@code num_new_vocab = 3, new_vocab_offset = 1}, the returned remapping would be + * {@code [0, -1, 2]}. + *

The op also returns a count of how many entries in the new vocabulary * were present in the old vocabulary, which is used to calculate the number of * values to initialize in a weight matrix remapping - *

- * This functionality can be used to remap both row vocabularies (typically, + *

This functionality can be used to remap both row vocabularies (typically, * features) and column vocabularies (typically, classes) from TensorFlow * checkpoints. Note that the partitioning logic relies on contiguous vocabularies * corresponding to div-partitioned variables. Moreover, the underlying remapping @@ -585,7 +641,7 @@ public ConditionalAccumulator conditionalAccumulator(Class * @param oldVocabFile Path to the old vocab file. * @param newVocabOffset How many entries into the new vocab file to start reading. * @param numNewVocab Number of entries in the new vocab file to remap. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of GenerateVocabRemapping */ public GenerateVocabRemapping generateVocabRemapping(Operand newVocabFile, @@ -596,20 +652,20 @@ public GenerateVocabRemapping generateVocabRemapping(Operand newVocabFi /** * V2 format specific: merges the metadata files of sharded checkpoints. The - *

* result is one logical checkpoint, with one physical metadata file and renamed * data files. - *

- * Intended for "grouping" multiple checkpoints in a sharded checkpoint setup. - *

- * If delete_old_dirs is true, attempts to delete recursively the dirname of each + *

Intended for "grouping" multiple checkpoints in a sharded checkpoint setup. + *

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 * as one of the checkpoint_prefixes. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of MergeV2Checkpoints */ public MergeV2Checkpoints mergeV2Checkpoints(Operand checkpointPrefixes, @@ -624,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 + * @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 @@ -637,18 +693,16 @@ public NegTrain negTrain(Operand wIn, Operand wOut, Operand< /** * An identity op that triggers an error if a gradient is requested. - *

* When executed in a graph, this op outputs its input tensor as-is. - *

- * When building ops to compute gradients, the TensorFlow gradient system + *

When building ops to compute gradients, the TensorFlow gradient system * will return an error when trying to lookup the gradient of this op, * 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 * @param input any tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code PreventGradient} output and operands * @return a new instance of PreventGradient */ public PreventGradient preventGradient(Operand input, @@ -656,9 +710,94 @@ 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(); * update = (update_accum + epsilon).sqrt() * (accum + epsilon()).rsqrt() * grad; * update_accum = rho() * update_accum + (1 - rho()) * update.square(); @@ -671,15 +810,37 @@ public PreventGradient preventGradient(Operand input, * @param rho Decay factor. Must be a scalar. * @param epsilon Constant factor. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyAdadelta} output and operands * @return a new instance of ResourceApplyAdadelta */ - public ResourceApplyAdadelta resourceApplyAdadelta(Operand var, - Operand accum, Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, - Operand grad, ResourceApplyAdadelta.Options... options) { + public ResourceApplyAdadelta resourceApplyAdadelta(Operand var, + Operand accum, Operand accumUpdate, Operand lr, + Operand rho, Operand epsilon, Operand grad, + ResourceApplyAdadelta.Options... options) { return ResourceApplyAdadelta.create(scope, var, accum, accumUpdate, lr, rho, epsilon, grad, options); } + /** + * Update '*var' according to the adagrad scheme. + * accum += grad * grad + * var -= lr * grad * (1 / (sqrt(accum) + epsilon)) + * + * @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 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,23 +852,24 @@ public ResourceApplyAdadelta resourceApplyAdadelta(Operand * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 regularization. Must be a scalar. * @param globalStep Training step number. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyAdagradDA} output and operands * @return a new instance of ResourceApplyAdagradDa */ - public ResourceApplyAdagradDa resourceApplyAdagradDa(Operand var, - Operand gradientAccumulator, Operand gradientSquaredAccumulator, Operand grad, - Operand lr, Operand l1, Operand l2, Operand globalStep, + public ResourceApplyAdagradDa resourceApplyAdagradDa( + Operand var, Operand gradientAccumulator, + Operand gradientSquaredAccumulator, Operand grad, Operand lr, + Operand l1, Operand l2, Operand globalStep, ResourceApplyAdagradDa.Options... options) { return ResourceApplyAdagradDa.create(scope, var, gradientAccumulator, gradientSquaredAccumulator, grad, lr, l1, l2, globalStep, options); } /** * 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(). @@ -719,22 +881,23 @@ public ResourceApplyAdagradDa resourceApplyAdagradDa(Operand data type for {@code ResourceApplyAdam} output and operands * @return a new instance of ResourceApplyAdam */ - public ResourceApplyAdam resourceApplyAdam(Operand var, Operand m, - Operand v, Operand beta1Power, Operand beta2Power, Operand lr, Operand beta1, - Operand beta2, Operand epsilon, Operand grad, ResourceApplyAdam.Options... options) { + public ResourceApplyAdam resourceApplyAdam(Operand var, + Operand m, Operand v, Operand beta1Power, + Operand beta2Power, Operand lr, Operand beta1, Operand beta2, Operand epsilon, + Operand grad, ResourceApplyAdam.Options... options) { return ResourceApplyAdam.create(scope, var, m, v, beta1Power, beta2Power, lr, beta1, beta2, epsilon, grad, options); } /** * 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$$ + * $$\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$$ - * $$\hat{v}_t := max{\hat{v}_{t-1}, v_t}$$ + * $$\hat{v}t := max{\hat{v}{t-1}, v_t}$$ * $$\text{variable} := \text{variable} - \text{lr}_t * m_t / (\sqrt{\hat{v}_t} + \epsilon)$$ * * @param var Should be from a Variable(). @@ -748,22 +911,23 @@ public ResourceApplyAdam resourceApplyAdam(Operand var, Ope * @param beta2 Momentum factor. Must be a scalar. * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyAdamWithAmsgrad} output and operands * @return a new instance of ResourceApplyAdamWithAmsgrad */ - public ResourceApplyAdamWithAmsgrad resourceApplyAdamWithAmsgrad(Operand var, - Operand m, Operand v, Operand vhat, Operand beta1Power, Operand beta2Power, - Operand lr, Operand beta1, Operand beta2, Operand epsilon, Operand grad, + public ResourceApplyAdamWithAmsgrad resourceApplyAdamWithAmsgrad( + Operand var, Operand m, Operand v, + Operand vhat, Operand beta1Power, Operand beta2Power, Operand lr, + Operand beta1, Operand beta2, Operand epsilon, Operand grad, ResourceApplyAdamWithAmsgrad.Options... options) { return ResourceApplyAdamWithAmsgrad.create(scope, var, m, v, vhat, beta1Power, beta2Power, lr, beta1, beta2, epsilon, grad, options); } /** * Update '*var' according to the AddSign update. - *

- * m_t <- beta1 * m_{t-1} + (1 - beta1) * g - * update <- (alpha + sign_decay * sign(g) *sign(m)) * g - * variable <- variable - lr_t * update + * m_t <- beta1 * m_{t-1} + (1 - beta1) * g + * update <- (alpha + sign_decay * sign(g) *sign(m)) * g + * variable <- variable - lr_t * update * * @param var Should be from a Variable(). * @param m Should be from a Variable(). @@ -772,36 +936,32 @@ public ResourceApplyAdamWithAmsgrad resourceApplyAdamWithAmsgr * @param signDecay Must be a scalar. * @param beta Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyAddSign} output and operands * @return a new instance of ResourceApplyAddSign */ - public ResourceApplyAddSign resourceApplyAddSign(Operand var, Operand m, - Operand lr, Operand alpha, Operand signDecay, Operand beta, Operand grad, - ResourceApplyAddSign.Options... options) { + public ResourceApplyAddSign resourceApplyAddSign(Operand var, + Operand m, Operand lr, Operand alpha, Operand signDecay, + Operand beta, Operand grad, ResourceApplyAddSign.Options... options) { return ResourceApplyAddSign.create(scope, var, m, lr, alpha, signDecay, beta, grad, options); } /** * Update '*var' according to the centered RMSProp algorithm. - *

* The centered RMSProp algorithm uses an estimate of the centered second moment * (i.e., the variance) for normalization, as opposed to regular RMSProp, which * uses the (uncentered) second moment. This often helps with training, but is * slightly more expensive in terms of computation and memory. - *

- * Note that in dense implementation of this algorithm, mg, ms, and mom will + *

Note that in dense implementation of this algorithm, mg, ms, and mom will * update even if the grad is zero, but in this sparse implementation, mg, ms, * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * mean_grad = decay * mean_grad + (1-decay) * gradient - *

- * Delta = learning_rate * gradient / sqrt(mean_square + epsilon - mean_grad ** 2) - *

- * mg <- rho * mg_{t-1} + (1-rho) * grad - * ms <- rho * ms_{t-1} + (1-rho) * grad * grad - * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms - mg * mg + epsilon) - * var <- var - mom + *

Delta = learning_rate * gradient / sqrt(mean_square + epsilon - mean_grad ** 2) + *

mg <- rho * mg_{t-1} + (1-rho) * grad + * 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 var Should be from a Variable(). * @param mg Should be from a Variable(). @@ -812,25 +972,25 @@ public ResourceApplyAddSign resourceApplyAddSign(Operand va * @param momentum Momentum Scale. Must be a scalar. * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyCenteredRMSProp} output and operands * @return a new instance of ResourceApplyCenteredRmsProp */ - public ResourceApplyCenteredRmsProp resourceApplyCenteredRmsProp(Operand var, - Operand mg, Operand ms, Operand mom, Operand lr, Operand rho, - Operand momentum, Operand epsilon, Operand grad, - ResourceApplyCenteredRmsProp.Options... options) { + public ResourceApplyCenteredRmsProp resourceApplyCenteredRmsProp( + Operand var, Operand mg, Operand ms, + Operand mom, Operand lr, Operand rho, Operand momentum, + Operand epsilon, Operand grad, ResourceApplyCenteredRmsProp.Options... options) { return ResourceApplyCenteredRmsProp.create(scope, var, mg, ms, mom, lr, rho, momentum, epsilon, grad, options); } /** * Update '*var' according to the Ftrl-proximal scheme. - *

+ * accum_new = accum + grad * grad * grad_with_shrinkage = grad + 2 * l2_shrinkage * var - * accum_new = accum + grad_with_shrinkage * grad_with_shrinkage * linear += grad_with_shrinkage + - * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var + * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var * quadratic = 1.0 / (accum_new^(lr_power) * lr) + 2 * l2 - * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 + * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 * accum = accum_new * * @param var Should be from a Variable(). @@ -840,14 +1000,16 @@ 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 + * @param l2Shrinkage The l2Shrinkage value * @param lrPower Scaling factor. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyFtrlV2} output and operands * @return a new instance of ResourceApplyFtrl */ - public ResourceApplyFtrl resourceApplyFtrl(Operand var, Operand accum, - Operand linear, Operand grad, Operand lr, Operand l1, Operand l2, - Operand l2Shrinkage, Operand lrPower, ResourceApplyFtrl.Options... options) { + public ResourceApplyFtrl resourceApplyFtrl(Operand var, + Operand accum, Operand linear, Operand grad, + Operand lr, Operand l1, Operand l2, Operand l2Shrinkage, Operand lrPower, + ResourceApplyFtrl.Options... options) { return ResourceApplyFtrl.create(scope, var, accum, linear, grad, lr, l1, l2, l2Shrinkage, lrPower, options); } @@ -857,20 +1019,20 @@ public ResourceApplyFtrl resourceApplyFtrl(Operand var, Ope * @param var Should be from a Variable(). * @param alpha Scaling factor. Must be a scalar. * @param delta The change. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyGradientDescent} output and operands * @return a new instance of ResourceApplyGradientDescent */ - public ResourceApplyGradientDescent resourceApplyGradientDescent(Operand var, - Operand alpha, Operand delta, ResourceApplyGradientDescent.Options... options) { + public ResourceApplyGradientDescent resourceApplyGradientDescent( + Operand var, Operand alpha, Operand delta, + ResourceApplyGradientDescent.Options... options) { return ResourceApplyGradientDescent.create(scope, var, alpha, delta, options); } /** * Update '*var' according to the momentum scheme. - *

* Set use_nesterov = True if you want to use Nesterov momentum. - *

- * accum = accum * momentum - lr * grad + *

accum = accum * momentum - lr * grad * var += accum * * @param var Should be from a Variable(). @@ -878,21 +1040,20 @@ public ResourceApplyGradientDescent resourceApplyGradientDesce * @param lr Scaling factor. Must be a scalar. * @param grad The gradient. * @param momentum Momentum. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyKerasMomentum} output and operands * @return a new instance of ResourceApplyKerasMomentum */ - public ResourceApplyKerasMomentum resourceApplyKerasMomentum(Operand var, - Operand accum, Operand lr, Operand grad, Operand momentum, - ResourceApplyKerasMomentum.Options... options) { + public ResourceApplyKerasMomentum resourceApplyKerasMomentum( + Operand var, Operand accum, Operand lr, Operand grad, + Operand momentum, ResourceApplyKerasMomentum.Options... options) { return ResourceApplyKerasMomentum.create(scope, var, accum, lr, grad, momentum, options); } /** * Update '*var' according to the momentum scheme. - *

* Set use_nesterov = True if you want to use Nesterov momentum. - *

- * accum = accum * momentum + grad + *

accum = accum * momentum + grad * var -= lr * accum * * @param var Should be from a Variable(). @@ -900,21 +1061,21 @@ public ResourceApplyKerasMomentum resourceApplyKerasMomentum(O * @param lr Scaling factor. Must be a scalar. * @param grad The gradient. * @param momentum Momentum. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyMomentum} output and operands * @return a new instance of ResourceApplyMomentum */ - public ResourceApplyMomentum resourceApplyMomentum(Operand var, - Operand accum, Operand lr, Operand grad, Operand momentum, + public ResourceApplyMomentum resourceApplyMomentum(Operand var, + Operand accum, Operand lr, Operand grad, Operand momentum, ResourceApplyMomentum.Options... options) { return ResourceApplyMomentum.create(scope, var, accum, lr, grad, momentum, options); } /** * Update '*var' according to the AddSign update. - *

- * 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 + * 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 var Should be from a Variable(). * @param m Should be from a Variable(). @@ -923,21 +1084,22 @@ public ResourceApplyMomentum resourceApplyMomentum(Operand * @param signDecay Must be a scalar. * @param beta Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyPowerSign} output and operands * @return a new instance of ResourceApplyPowerSign */ - public ResourceApplyPowerSign resourceApplyPowerSign(Operand var, - Operand m, Operand lr, Operand logbase, Operand signDecay, Operand beta, - Operand grad, ResourceApplyPowerSign.Options... options) { + public ResourceApplyPowerSign resourceApplyPowerSign( + Operand var, Operand m, Operand lr, Operand logbase, + Operand signDecay, Operand beta, Operand grad, + ResourceApplyPowerSign.Options... options) { return ResourceApplyPowerSign.create(scope, var, m, lr, logbase, signDecay, beta, grad, options); } /** * Update '*var' and '*accum' according to FOBOS with Adagrad learning rate. - *

- * accum += grad grad - * prox_v = var - lr grad (1 / sqrt(accum)) - * var = sign(prox_v)/(1+lrl2) max{|prox_v|-lrl1,0} + * accum += grad * grad + * prox_v = var - lr * grad * (1 / sqrt(accum)) + * var = sign(prox_v)/(1+lrl2) * max{|prox_v|-lrl1,0} * * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -945,70 +1107,92 @@ public ResourceApplyPowerSign resourceApplyPowerSign(Operand data type for {@code ResourceApplyProximalAdagrad} output and operands * @return a new instance of ResourceApplyProximalAdagrad */ - public ResourceApplyProximalAdagrad resourceApplyProximalAdagrad(Operand var, - Operand accum, Operand lr, Operand l1, Operand l2, Operand grad, - ResourceApplyProximalAdagrad.Options... options) { + public ResourceApplyProximalAdagrad resourceApplyProximalAdagrad( + Operand var, Operand accum, Operand lr, Operand l1, + Operand l2, Operand grad, ResourceApplyProximalAdagrad.Options... options) { return ResourceApplyProximalAdagrad.create(scope, var, accum, lr, l1, l2, grad, options); } /** * 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} + * prox_v = var - alpha * delta + * var = sign(prox_v)/(1+alphal2) * max{|prox_v|-alphal1,0} * * @param var Should be from a Variable(). * @param alpha Scaling factor. Must be a scalar. * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 regularization. Must be a scalar. * @param delta The change. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyProximalGradientDescent} output and operands * @return a new instance of ResourceApplyProximalGradientDescent */ public ResourceApplyProximalGradientDescent resourceApplyProximalGradientDescent( - Operand var, Operand alpha, Operand l1, Operand l2, Operand delta, - ResourceApplyProximalGradientDescent.Options... options) { + Operand var, Operand alpha, Operand l1, Operand l2, + Operand delta, ResourceApplyProximalGradientDescent.Options... options) { return ResourceApplyProximalGradientDescent.create(scope, var, alpha, l1, l2, delta, options); } /** * Update '*var' according to the RMSProp algorithm. - *

* Note that in dense implementation of this algorithm, ms and mom will * update even if the grad is zero, but in this sparse implementation, ms * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * Delta = learning_rate * gradient / sqrt(mean_square + epsilon) - *

- * ms <- rho * ms_{t-1} + (1-rho) * grad * grad - * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) - * var <- var - mom + *

ms <- rho * ms_{t-1} + (1-rho) * grad * grad + * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) + * var <- var - mom * * @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 + * @param momentum The momentum value * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyRMSProp} output and operands * @return a new instance of ResourceApplyRmsProp */ - public ResourceApplyRmsProp resourceApplyRmsProp(Operand var, Operand ms, - Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, - Operand grad, ResourceApplyRmsProp.Options... options) { + public ResourceApplyRmsProp resourceApplyRmsProp(Operand var, + Operand ms, Operand mom, Operand lr, Operand rho, + Operand momentum, Operand epsilon, Operand grad, + ResourceApplyRmsProp.Options... options) { return ResourceApplyRmsProp.create(scope, var, ms, mom, lr, rho, momentum, epsilon, grad, options); } + /** + * A conditional accumulator for aggregating gradients. + * The accumulator accepts gradients marked with local_step greater or + * equal to the most recent global_step known to the accumulator. The + * average can be extracted from the accumulator, provided sufficient + * gradients have been accumulated. Extracting the average automatically + * resets the aggregate to 0, and increments the global_step recorded by + * the accumulator. + * This is a resource version of ConditionalAccumulator that will work in TF2.0 + * with tf.cond version 2. + * + * @param dtype The type of the value being accumulated. + * @param shape The shape of the values, can be [], in which case shape is unknown. + * @param options carries optional attribute values + * @param 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 + * @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. @@ -1016,11 +1200,13 @@ public ResourceApplyRmsProp resourceApplyRmsProp(Operand va * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyAdadelta} output and operands * @return a new instance of ResourceSparseApplyAdadelta */ - public ResourceSparseApplyAdadelta resourceSparseApplyAdadelta(Operand var, - Operand accum, Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, + public ResourceSparseApplyAdadelta resourceSparseApplyAdadelta( + Operand var, Operand accum, + Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, Operand grad, Operand indices, ResourceSparseApplyAdadelta.Options... options) { return ResourceSparseApplyAdadelta.create(scope, var, accum, accumUpdate, lr, rho, epsilon, grad, indices, options); @@ -1028,7 +1214,6 @@ public ResourceSparseApplyAdadelta resourceSparseApplyAdadelta /** * 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)) @@ -1038,12 +1223,13 @@ public ResourceSparseApplyAdadelta resourceSparseApplyAdadelta * @param lr Learning rate. 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyAdagrad} output and operands * @return a new instance of ResourceSparseApplyAdagrad */ - public ResourceSparseApplyAdagrad resourceSparseApplyAdagrad(Operand var, - Operand accum, Operand lr, Operand grad, Operand indices, - ResourceSparseApplyAdagrad.Options... options) { + public ResourceSparseApplyAdagrad resourceSparseApplyAdagrad( + Operand var, Operand accum, Operand lr, Operand grad, + Operand indices, ResourceSparseApplyAdagrad.Options... options) { return ResourceSparseApplyAdagrad.create(scope, var, accum, lr, grad, indices, options); } @@ -1059,35 +1245,56 @@ public ResourceSparseApplyAdagrad resourceSparseApplyAdagrad(O * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 regularization. Must be a scalar. * @param globalStep Training step number. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyAdagradDA} output and operands * @return a new instance of ResourceSparseApplyAdagradDa */ - public ResourceSparseApplyAdagradDa resourceSparseApplyAdagradDa(Operand var, - Operand gradientAccumulator, Operand gradientSquaredAccumulator, Operand grad, + public ResourceSparseApplyAdagradDa resourceSparseApplyAdagradDa( + Operand var, Operand gradientAccumulator, + Operand gradientSquaredAccumulator, Operand grad, Operand indices, Operand lr, Operand l1, Operand l2, Operand globalStep, ResourceSparseApplyAdagradDa.Options... options) { 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 * (i.e., the variance) for normalization, as opposed to regular RMSProp, which * uses the (uncentered) second moment. This often helps with training, but is * slightly more expensive in terms of computation and memory. - *

- * Note that in dense implementation of this algorithm, mg, ms, and mom will + *

Note that in dense implementation of this algorithm, mg, ms, and mom will * update even if the grad is zero, but in this sparse implementation, mg, ms, * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * mean_grad = decay * mean_grad + (1-decay) * gradient * Delta = learning_rate * gradient / sqrt(mean_square + epsilon - mean_grad ** 2) - *

- * ms <- rho * ms_{t-1} + (1-rho) * grad * grad - * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) - * var <- var - mom + *

ms <- rho * ms_{t-1} + (1-rho) * grad * grad + * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) + * var <- var - mom * * @param var Should be from a Variable(). * @param mg Should be from a Variable(). @@ -1095,30 +1302,31 @@ 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 + * @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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyCenteredRMSProp} output and operands * @return a new instance of ResourceSparseApplyCenteredRmsProp */ public ResourceSparseApplyCenteredRmsProp resourceSparseApplyCenteredRmsProp( - Operand var, Operand mg, Operand ms, Operand mom, Operand lr, Operand rho, - Operand momentum, Operand epsilon, Operand grad, Operand indices, + Operand var, Operand mg, Operand ms, + Operand mom, Operand lr, Operand rho, Operand momentum, + Operand epsilon, Operand grad, Operand indices, ResourceSparseApplyCenteredRmsProp.Options... options) { return ResourceSparseApplyCenteredRmsProp.create(scope, var, mg, ms, mom, lr, rho, momentum, epsilon, grad, indices, options); } /** * Update relevant entries in '*var' according to the Ftrl-proximal scheme. - *

* That is for rows we have grad for, we update var, accum and linear as follows: * grad_with_shrinkage = grad + 2 * l2_shrinkage * var * accum_new = accum + grad_with_shrinkage * grad_with_shrinkage * linear += grad_with_shrinkage + - * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var + * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var * quadratic = 1.0 / (accum_new^(lr_power) * lr) + 2 * l2 - * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 + * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 * accum = accum_new * * @param var Should be from a Variable(). @@ -1129,26 +1337,25 @@ 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 + * @param l2Shrinkage The l2Shrinkage value * @param lrPower Scaling factor. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyFtrlV2} output and operands * @return a new instance of ResourceSparseApplyFtrl */ - public ResourceSparseApplyFtrl resourceSparseApplyFtrl(Operand var, - Operand accum, Operand linear, Operand grad, Operand indices, - Operand lr, Operand l1, Operand l2, Operand l2Shrinkage, Operand lrPower, + public ResourceSparseApplyFtrl resourceSparseApplyFtrl( + Operand var, Operand accum, Operand linear, + Operand grad, Operand indices, Operand lr, Operand l1, + Operand l2, Operand l2Shrinkage, Operand lrPower, ResourceSparseApplyFtrl.Options... options) { return ResourceSparseApplyFtrl.create(scope, var, accum, linear, grad, indices, lr, l1, l2, l2Shrinkage, lrPower, options); } /** * Update relevant entries in '*var' and '*accum' according to the momentum scheme. - *

* Set use_nesterov = True if you want to use Nesterov momentum. - *

- * That is for rows we have grad for, we update var and accum as follows: - *

- * accum = accum * momentum - lr * grad + *

That is for rows we have grad for, we update var and accum as follows: + *

accum = accum * momentum - lr * grad * var += accum * * @param var Should be from a Variable(). @@ -1157,11 +1364,12 @@ public ResourceSparseApplyFtrl resourceSparseApplyFtrl(Operand * @param grad The gradient. * @param indices A vector of indices into the first dimension of var and accum. * @param momentum Momentum. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyKerasMomentum} output and operands * @return a new instance of ResourceSparseApplyKerasMomentum */ public ResourceSparseApplyKerasMomentum resourceSparseApplyKerasMomentum( - Operand var, Operand accum, Operand lr, Operand grad, + Operand var, Operand accum, Operand lr, Operand grad, Operand indices, Operand momentum, ResourceSparseApplyKerasMomentum.Options... options) { return ResourceSparseApplyKerasMomentum.create(scope, var, accum, lr, grad, indices, momentum, options); @@ -1169,12 +1377,9 @@ public ResourceSparseApplyKerasMomentum resourceSparseApplyKer /** * Update relevant entries in '*var' and '*accum' according to the momentum scheme. - *

* Set use_nesterov = True if you want to use Nesterov momentum. - *

- * That is for rows we have grad for, we update var and accum as follows: - *

- * accum = accum * momentum + grad + *

That is for rows we have grad for, we update var and accum as follows: + *

accum = accum * momentum + grad * var -= lr * accum * * @param var Should be from a Variable(). @@ -1183,23 +1388,24 @@ public ResourceSparseApplyKerasMomentum resourceSparseApplyKer * @param grad The gradient. * @param indices A vector of indices into the first dimension of var and accum. * @param momentum Momentum. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyMomentum} output and operands * @return a new instance of ResourceSparseApplyMomentum */ - public ResourceSparseApplyMomentum resourceSparseApplyMomentum(Operand var, - Operand accum, Operand lr, Operand grad, Operand indices, - Operand momentum, ResourceSparseApplyMomentum.Options... options) { + public ResourceSparseApplyMomentum resourceSparseApplyMomentum( + Operand var, Operand accum, Operand lr, Operand grad, + Operand indices, Operand momentum, + ResourceSparseApplyMomentum.Options... options) { return ResourceSparseApplyMomentum.create(scope, var, accum, lr, grad, indices, momentum, options); } /** * Sparse update entries in '*var' and '*accum' according to FOBOS algorithm. - *

* That is for rows we have grad for, we update var and accum as follows: - * accum += grad grad + * accum += grad * grad * prox_v = var - * prox_v -= lr grad (1 / sqrt(accum)) - * var = sign(prox_v)/(1+lrl2) max{|prox_v|-lrl1,0} + * prox_v -= lr * grad * (1 / sqrt(accum)) + * var = sign(prox_v)/(1+lrl2) * max{|prox_v|-lrl1,0} * * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -1208,22 +1414,22 @@ public ResourceSparseApplyMomentum resourceSparseApplyMomentum * @param l2 L2 regularization. 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyProximalAdagrad} output and operands * @return a new instance of ResourceSparseApplyProximalAdagrad */ public ResourceSparseApplyProximalAdagrad resourceSparseApplyProximalAdagrad( - Operand var, Operand accum, Operand lr, Operand l1, Operand l2, - Operand grad, Operand indices, + Operand var, Operand accum, Operand lr, Operand l1, + Operand l2, Operand grad, Operand indices, ResourceSparseApplyProximalAdagrad.Options... options) { return ResourceSparseApplyProximalAdagrad.create(scope, var, accum, lr, l1, l2, grad, indices, options); } /** * Sparse update '*var' as FOBOS algorithm with fixed learning rate. - *

* 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} + * prox_v = var - alpha * grad + * var = sign(prox_v)/(1+alphal2) * max{|prox_v|-alphal1,0} * * @param var Should be from a Variable(). * @param alpha Scaling factor. Must be a scalar. @@ -1231,11 +1437,12 @@ public ResourceSparseApplyProximalAdagrad resourceSparseApplyP * @param l2 L2 regularization. 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyProximalGradientDescent} output and operands * @return a new instance of ResourceSparseApplyProximalGradientDescent */ public ResourceSparseApplyProximalGradientDescent resourceSparseApplyProximalGradientDescent( - Operand var, Operand alpha, Operand l1, Operand l2, Operand grad, + Operand var, Operand alpha, Operand l1, Operand l2, Operand grad, Operand indices, ResourceSparseApplyProximalGradientDescent.Options... options) { return ResourceSparseApplyProximalGradientDescent.create(scope, var, alpha, l1, l2, grad, indices, options); @@ -1243,53 +1450,50 @@ public ResourceSparseApplyProximalGradientDescent resourceSpar /** * Update '*var' according to the RMSProp algorithm. - *

* Note that in dense implementation of this algorithm, ms and mom will * update even if the grad is zero, but in this sparse implementation, ms * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * Delta = learning_rate * gradient / sqrt(mean_square + epsilon) - *

- * ms <- rho * ms_{t-1} + (1-rho) * grad * grad - * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) - * var <- var - mom + *

ms <- rho * ms_{t-1} + (1-rho) * grad * grad + * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) + * var <- var - mom * * @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 + * @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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyRMSProp} output and operands * @return a new instance of ResourceSparseApplyRmsProp */ - public ResourceSparseApplyRmsProp resourceSparseApplyRmsProp(Operand var, - Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, - Operand epsilon, Operand grad, Operand indices, - ResourceSparseApplyRmsProp.Options... options) { + public ResourceSparseApplyRmsProp resourceSparseApplyRmsProp( + Operand var, Operand ms, Operand mom, + Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, + Operand indices, ResourceSparseApplyRmsProp.Options... options) { return ResourceSparseApplyRmsProp.create(scope, var, ms, mom, lr, rho, momentum, epsilon, grad, indices, options); } /** * Restores tensors from a V2 checkpoint. - *

* For backward compatibility with the V1 format, this Op currently allows * restoring from a V1 checkpoint as well: - * - This Op first attempts to find the V2 index file pointed to by "prefix", and - * if found proceed to read it as a V2 checkpoint; - * - Otherwise the V1 read path is invoked. + *

    + *
  • This Op first attempts to find the V2 index file pointed to by "prefix", and + * if found proceed to read it as a V2 checkpoint;
  • + *
  • Otherwise the V1 read path is invoked. * Relying on this behavior is not recommended, as the ability to fall back to read - * V1 might be deprecated and eventually removed. - *

    - * By default, restores the named tensors in full. If the caller wishes to restore - * specific slices of stored tensors, "shape_and_slices" should be non-empty + * V1 might be deprecated and eventually removed.

  • + *
+ *

By default, restores the named tensors in full. If the caller wishes to restore + * specific slices of stored tensors, "shape_and_slices" should be non-empty * strings and correspondingly well-formed. - *

- * Callers must ensure all the named tensors are indeed stored in the checkpoint. + *

Callers must ensure all the named tensors are indeed stored in the checkpoint. * * @param prefix Must have a single element. The prefix of a V2 checkpoint. * @param tensorNames shape {N}. The names of the tensors to be restored. @@ -1306,15 +1510,12 @@ public Restore restore(Operand prefix, Operand tensorNames, /** * Restores a tensor from checkpoint files. - *

- * This is like `Restore` except that restored tensor can be listed as filling - * only a slice of a larger tensor. `shape_and_slice` specifies the shape of the + * This is like {@code Restore} except that restored tensor can be listed as filling + * only a slice of a larger tensor. {@code shape_and_slice} specifies the shape of the * larger tensor and the slice that the restored tensor covers. - *

- * The `shape_and_slice` input has the same format as the - * elements of the `shapes_and_slices` input of the `SaveSlices` op. + *

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 @@ -1322,7 +1523,8 @@ public Restore restore(Operand prefix, Operand tensorNames, * @param shapeAndSlice Scalar. The shapes and slice specifications to use when * restoring a tensors. * @param dt The type of the tensor to be restored. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code RestoreSlice} output and operands * @return a new instance of RestoreSlice */ public RestoreSlice restoreSlice(Operand filePattern, @@ -1333,9 +1535,8 @@ public RestoreSlice restoreSlice(Operand filePatte /** * Saves tensors in V2 checkpoint format. - *

* By default, saves the named tensors in full. If the caller wishes to save - * specific slices of full tensors, "shape_and_slices" should be non-empty strings + * specific slices of full tensors, "shape_and_slices" should be non-empty strings * and correspondingly well-formed. * * @param prefix Must have a single element. The prefix of the V2 checkpoint to which we @@ -1343,7 +1544,7 @@ public RestoreSlice restoreSlice(Operand filePatte * @param tensorNames shape {N}. The names of the tensors to be saved. * @param shapeAndSlices shape {N}. The slice specs of the tensors to be saved. * Empty strings indicate that they are non-partitioned tensors. - * @param tensors `N` tensors to save. + * @param tensors {@code N} tensors to save. * @return a new instance of Save */ public Save save(Operand prefix, Operand tensorNames, @@ -1353,43 +1554,33 @@ public Save save(Operand prefix, Operand tensorNames, /** * Saves input tensors slices to disk. - *

- * This is like `Save` except that tensors can be listed in the saved file as being - * a slice of a larger tensor. `shapes_and_slices` specifies the shape of the - * larger tensor and the slice that this tensor covers. `shapes_and_slices` must - * have as many elements as `tensor_names`. - *

- * Elements of the `shapes_and_slices` input must either be: + * This is like {@code Save} except that tensors can be listed in the saved file as being + * a slice of a larger tensor. {@code shapes_and_slices} specifies the shape of the + * larger tensor and the slice that this tensor covers. {@code shapes_and_slices} must + * have as many elements as {@code tensor_names}. + *

Elements of the {@code shapes_and_slices} input must either be: *

    - *
  • - * The empty string, in which case the corresponding tensor is - * saved normally. - *
  • - *
  • - * A string of the form `dim0 dim1 ... dimN-1 slice-spec` where the - * `dimI` are the dimensions of the larger tensor and `slice-spec` - * specifies what part is covered by the tensor to save. - *
  • + *
  • The empty string, in which case the corresponding tensor is + * saved normally.
  • + *
  • A string of the form {@code dim0 dim1 ... dimN-1 slice-spec} where the + * {@code dimI} are the dimensions of the larger tensor and {@code slice-spec} + * specifies what part is covered by the tensor to save.
  • *
- * `slice-spec` itself is a `:`-separated list: `slice0:slice1:...:sliceN-1` - * where each `sliceI` is either: + *

{@code slice-spec} itself is a {@code :}-separated list: {@code slice0:slice1:...:sliceN-1} + * where each {@code sliceI} is either: *

    - *
  • - * The string `-` meaning that the slice covers all indices of this dimension - *
  • - *
  • - * `start,length` where `start` and `length` are integers. In that - * case the slice covers `length` indices starting at `start`. - *
  • + *
  • The string {@code -} meaning that the slice covers all indices of this dimension
  • + *
  • {@code start,length} where {@code start} and {@code length} are integers. In that + * case the slice covers {@code length} indices starting at {@code start}.
  • *
- * See also `Save`. + *

See also {@code Save}. * * @param filename Must have a single element. The name of the file to which we write the * tensor. - * @param tensorNames Shape `[N]`. The names of the tensors to be saved. - * @param shapesAndSlices Shape `[N]`. The shapes and slice specifications to use when + * @param tensorNames Shape {@code [N]}. The names of the tensors to be saved. + * @param shapesAndSlices Shape {@code [N]}. The shapes and slice specifications to use when * saving the tensors. - * @param data `N` tensors to save. + * @param data {@code N} tensors to save. * @return a new instance of SaveSlices */ public SaveSlices saveSlices(Operand filename, Operand tensorNames, @@ -1407,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. * @@ -1423,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 + * @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. @@ -1432,7 +1675,8 @@ public SdcaShrinkL1 sdcaShrinkL1(Iterable> weights, Float l1, * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyAdadelta} output and operands * @return a new instance of SparseApplyAdadelta */ public SparseApplyAdadelta sparseApplyAdadelta(Operand var, @@ -1441,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,7 +1719,8 @@ public SparseApplyAdadelta sparseApplyAdadelta(Operand v * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 regularization. Must be a scalar. * @param globalStep Training step number. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyAdagradDA} output and operands * @return a new instance of SparseApplyAdagradDa */ public SparseApplyAdagradDa sparseApplyAdagradDa(Operand var, @@ -1466,36 +1732,32 @@ public SparseApplyAdagradDa sparseApplyAdagradDa(Operand /** * Update '*var' according to the centered RMSProp algorithm. - *

* The centered RMSProp algorithm uses an estimate of the centered second moment * (i.e., the variance) for normalization, as opposed to regular RMSProp, which * uses the (uncentered) second moment. This often helps with training, but is * slightly more expensive in terms of computation and memory. - *

- * Note that in dense implementation of this algorithm, mg, ms, and mom will + *

Note that in dense implementation of this algorithm, mg, ms, and mom will * update even if the grad is zero, but in this sparse implementation, mg, ms, * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * mean_grad = decay * mean_grad + (1-decay) * gradient * Delta = learning_rate * gradient / sqrt(mean_square + epsilon - mean_grad ** 2) - *

- * $$ms <- rho * ms_{t-1} + (1-rho) * grad * grad$$ - * $$mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon)$$ - * $$var <- var - mom$$ + *

$$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 * @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 + * @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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyCenteredRMSProp} output and operands * @return a new instance of SparseApplyCenteredRmsProp */ public SparseApplyCenteredRmsProp sparseApplyCenteredRmsProp(Operand var, @@ -1507,17 +1769,15 @@ public SparseApplyCenteredRmsProp sparseApplyCenteredRmsPro /** * Update relevant entries in '*var' according to the Ftrl-proximal scheme. - *

* That is for rows we have grad for, we update var, accum and linear as follows: * grad_with_shrinkage = grad + 2 * l2_shrinkage * var * accum_new = accum + grad * grad * linear += grad_with_shrinkage - - * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var + * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var * quadratic = 1.0 / (accum_new^(lr_power) * lr) + 2 * l2 - * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 + * 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(). @@ -1526,9 +1786,10 @@ 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 + * @param l2Shrinkage The l2Shrinkage value * @param lrPower Scaling factor. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyFtrlV2} output and operands * @return a new instance of SparseApplyFtrl */ public SparseApplyFtrl sparseApplyFtrl(Operand var, Operand accum, @@ -1540,22 +1801,19 @@ public SparseApplyFtrl sparseApplyFtrl(Operand var, Oper /** * Update relevant entries in '*var' and '*accum' according to the momentum scheme. - *

* Set use_nesterov = True if you want to use Nesterov momentum. - *

- * That is for rows we have grad for, we update var and accum as follows: - *

- * $$accum = accum * momentum + grad$$ + *

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 * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param lr Learning rate. Must be a scalar. * @param grad The gradient. * @param indices A vector of indices into the first dimension of var and accum. * @param momentum Momentum. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyMomentum} output and operands * @return a new instance of SparseApplyMomentum */ public SparseApplyMomentum sparseApplyMomentum(Operand var, @@ -1566,14 +1824,12 @@ public SparseApplyMomentum sparseApplyMomentum(Operand v /** * Sparse update entries in '*var' and '*accum' according to FOBOS algorithm. - *

* That is for rows we have grad for, we update var and accum as follows: - * $$accum += grad grad$$ + * $$accum += grad * grad$$ * $$prox_v = var$$ - * $$prox_v -= lr grad (1 / sqrt(accum))$$ - * $$var = sign(prox_v)/(1+lrl2) max{|prox_v|-lrl1,0}$$ + * $$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. @@ -1581,7 +1837,8 @@ public SparseApplyMomentum sparseApplyMomentum(Operand v * @param l2 L2 regularization. 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyProximalAdagrad} output and operands * @return a new instance of SparseApplyProximalAdagrad */ public SparseApplyProximalAdagrad sparseApplyProximalAdagrad(Operand var, @@ -1592,19 +1849,18 @@ public SparseApplyProximalAdagrad sparseApplyProximalAdagra /** * Sparse update '*var' as FOBOS algorithm with fixed learning rate. - *

* 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}$$ + * $$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. * @param l2 L2 regularization. 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyProximalGradientDescent} output and operands * @return a new instance of SparseApplyProximalGradientDescent */ public SparseApplyProximalGradientDescent sparseApplyProximalGradientDescent( @@ -1615,29 +1871,26 @@ public SparseApplyProximalGradientDescent sparseApplyProxim /** * Update '*var' according to the RMSProp algorithm. - *

* Note that in dense implementation of this algorithm, ms and mom will * update even if the grad is zero, but in this sparse implementation, ms * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * Delta = learning_rate * gradient / sqrt(mean_square + epsilon) - *

- * $$ms <- rho * ms_{t-1} + (1-rho) * grad * grad$$ - * $$mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon)$$ - * $$var <- var - mom$$ + *

$$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 * @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 + * @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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyRMSProp} output and operands * @return a new instance of SparseApplyRmsProp */ public SparseApplyRmsProp sparseApplyRmsProp(Operand var, Operand ms, @@ -1647,15 +1900,40 @@ public SparseApplyRmsProp sparseApplyRmsProp(Operand var } /** - * Returns the gradient of `Tile`. - *

- * Since `Tile` takes an input and repeats the input `multiples` times - * along each dimension, `train.TileGrad` takes in `multiples` and aggregates - * each repeated tile of `input` into `output`. + * Computes the gradient function for function f via backpropagation. + * + * @param input a list of input tensors of size N + M; + * @param Tout the type list for the input list. + * @param f The function we want to compute the gradient for. + *

The function 'f' must be a numerical function which takes N inputs and + * produces M outputs. Its gradient function 'g', which is computed by + * this SymbolicGradient op 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. + *

(Needs some math expert to say the comment above better.) + * @return a new instance of SymbolicGradient + */ + public SymbolicGradient symbolicGradient(Iterable> input, + List> Tout, ConcreteFunction f) { + return SymbolicGradient.create(scope, input, Tout, f); + } + + /** + * Returns the gradient of {@code Tile}. + * 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 - * @param input - * @param multiples + * @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 */ public TileGrad tileGrad(Operand input, Operand multiples) { 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 393a754ff47..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. @@ -17,29 +17,36 @@ // 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.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.KeyValueSort; -import org.tensorflow.op.xla.Pad; -import org.tensorflow.op.xla.Recv; -import org.tensorflow.op.xla.ReplicaId; -import org.tensorflow.op.xla.SelfAdjointEig; -import org.tensorflow.op.xla.Send; -import org.tensorflow.op.xla.Sharding; -import org.tensorflow.op.xla.Sort; -import org.tensorflow.op.xla.Svd; +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.XlaRecvFromHost; import org.tensorflow.op.xla.XlaSendToHost; -import org.tensorflow.op.xla.XlaSetBound; +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; @@ -47,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; @@ -60,377 +67,765 @@ public final class XlaOps { } /** - * Helper operator for performing XLA-style broadcasts - *

- * Broadcasts `lhs` and `rhs` to the same rank, by adding size 1 dimensions to - * whichever of `lhs` and `rhs` has the lower rank, using XLA's broadcasting rules - * for binary operators. + * 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]]
+   *  
* - * @param data type for {@code lhsOutput()} output - * @param lhs the LHS input tensor - * @param rhs the RHS input tensor - * @param broadcastDims an XLA-style broadcast dimension specification - * @return a new instance of BroadcastHelper + * @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 */ - public BroadcastHelper broadcastHelper(Operand lhs, Operand rhs, - Operand broadcastDims) { - return BroadcastHelper.create(scope, lhs, rhs, broadcastDims); + public AssignVariableConcatND assignVariableConcatND(Operand resource, + Iterable> inputs, List numConcats, + AssignVariableConcatND.Options... options) { + return AssignVariableConcatND.create(scope, resource, inputs, numConcats, options); } /** - * Operator that connects the output of an XLA computation to other consumer graph nodes. + * 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 outputs()} output - * @param input - * @return a new instance of ClusterOutput + * @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 ClusterOutput clusterOutput(Operand input) { - return ClusterOutput.create(scope, input); + public ConcatND concatND(Iterable> inputs, List numConcats, + ConcatND.Options... options) { + return ConcatND.create(scope, inputs, numConcats, options); } /** - * Wraps the XLA ConvGeneralDilated operator, documented at - *

- * https://www.tensorflow.org/performance/xla/operation_semantics#conv_convolution - * . + * 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 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. - * @return a new instance of Conv + * @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 Conv conv(Operand lhs, Operand rhs, - Operand windowStrides, Operand padding, Operand lhsDilation, Operand rhsDilation, - Operand featureGroupCount, String dimensionNumbers, String precisionConfig) { - return Conv.create(scope, lhs, rhs, windowStrides, padding, lhsDilation, rhsDilation, featureGroupCount, dimensionNumbers, precisionConfig); + public ReadVariableSplitND readVariableSplitND( + Operand resource, Class T, Long N, List numSplits, + ReadVariableSplitND.Options... options) { + return ReadVariableSplitND.create(scope, resource, T, N, numSplits, options); } /** - * Takes the packed uint32 input and unpacks the input to uint8 to do - *

- * Dequantization on device. + * 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 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 + * @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 Dequantize dequantize(Operand input, Float minRange, Float maxRange, String mode, - Boolean transposeOutput) { - return Dequantize.create(scope, input, minRange, maxRange, mode, transposeOutput); + public SplitND splitND(Operand input, Long N, List numSplits, + SplitND.Options... options) { + return SplitND.create(scope, input, N, numSplits, options); } /** - * Wraps the XLA DotGeneral operator, documented at - *

- * https://www.tensorflow.org/performance/xla/operation_semantics#dotgeneral - * . + * A pseudo-op to represent host-side computation in an XLA program. * - * @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. - * @return a new instance of Dot + * @param inputs A list of tensors that will be sent to the host. + * @param Toutputs The element types of each element in {@code outputs}. + * @param ancestors A list of names of HostCompute computations that must be + * sequenced before this computation. + * @param shapes If shape_inference_graph is empty, a list of the shapes of {@code outputs}. + * @param shapeInferenceGraph If non-empty, a serialized GraphDef representing a graph + * that must be analyzed at compile time to determine the shapes of the outputs. + * @param key A unique identifier for this region used to match up host transfers. + * @param options carries optional attribute values + * @return a new instance of XlaHostCompute */ - public Dot dot(Operand lhs, Operand rhs, String dimensionNumbers, - String precisionConfig) { - return Dot.create(scope, lhs, rhs, dimensionNumbers, precisionConfig); + public XlaHostCompute xlaHostCompute(Iterable> inputs, + List> Toutputs, List ancestors, List shapes, + ConcreteFunction shapeInferenceGraph, String key, XlaHostCompute.Options... options) { + return XlaHostCompute.create(scope, inputs, Toutputs, ancestors, shapes, shapeInferenceGraph, key, options); } /** - * 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. + * An op to receive a tensor from the host. + * output: the tensor that will be received from the host. + * Toutput: element type for output. + * shape: shape for output. + * key: A unique identifier for this region used to match up host transfers. * - * @param data type for {@code output()} output - * @param input A `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 - * @return a new instance of DynamicSlice + * @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 */ - public DynamicSlice dynamicSlice(Operand input, - Operand startIndices, Operand sizeIndices) { - return DynamicSlice.create(scope, input, startIndices, sizeIndices); + public XlaRecvFromHost xlaRecvFromHost(Class Toutput, Shape shape, + String key) { + return XlaRecvFromHost.create(scope, Toutput, shape, key); } /** - * 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 `input` - * operand, with a slice update overwritten at `indices`. The shape of `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 `input`. - *

- * Handling of out-of-bounds slice indices is implementation-defined. + * An op to send a tensor to the host. + * input: the tensor that will be sent to the host. + * Tinput: element type for input. + * key: A unique identifier for this region used to match up host transfers. * - * @param data type for {@code output()} output - * @param input A `Tensor` of type T. - * @param update A `Tensor` of type T. Same rank as `input`. - * @param indices A vector of indices into `input`. Must have length equal to the rank of - * `input`. - * @return a new instance of DynamicUpdateSlice + * @param input The input value + * @param key The value of the key attribute + * @return a new instance of XlaSendToHost */ - public DynamicUpdateSlice dynamicUpdateSlice(Operand input, - Operand update, Operand indices) { - return DynamicUpdateSlice.create(scope, input, update, indices); + public XlaSendToHost xlaSendToHost(Operand input, String key) { + return XlaSendToHost.create(scope, input, key); } /** - * 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. + * The XlaSparseActivationsUnstack operation * - * @param data type for {@code product()} output - * @param a - * @param b - * @param equation - * @return a new instance of Einsum + * @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 Einsum einsum(Operand a, Operand b, String equation) { - return Einsum.create(scope, a, b, equation); + 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 XLA Gather operator documented at - *

- * https://www.tensorflow.org/xla/operation_semantics#gather + * The XlaSparseCoreAdagrad operation * - * @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. - * @return a new instance of Gather + * @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 Gather gather(Operand operand, - Operand startIndices, Operand sliceSizes, String dimensionNumbers, - Boolean indicesAreSorted) { - return Gather.create(scope, operand, startIndices, sliceSizes, dimensionNumbers, indicesAreSorted); + 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 a tensor. Currently only sorts in ascending order are supported. + * The XlaSparseCoreAdagradMomentum operation * - * @param data type for {@code sortedKeys()} output - * @param data type for {@code sortedValues()} output - * @param keys A `Tensor` of type K. - * @param values A `Tensor` of type V. - * @return a new instance of KeyValueSort + * @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 KeyValueSort keyValueSort(Operand keys, - Operand values) { - return KeyValueSort.create(scope, keys, values); + 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); } /** - * Wraps the XLA Pad operator, documented at - *

- * https://www.tensorflow.org/performance/xla/operation_semantics#pad - * . + * The XlaSparseCoreAdam operation * - * @param data type for {@code output()} output - * @param input A `Tensor` of type T. - * @param paddingValue A scalar `Tensor` of type T. - * @param paddingLow the padding to apply at the start of each input dimensions - * @param paddingHigh the padding to apply at the end of each input dimension. - * @param paddingInterior the padding to apply between each input element. - * @return a new instance of Pad + * @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 Pad pad(Operand input, Operand paddingValue, - Operand paddingLow, Operand paddingHigh, Operand paddingInterior) { - return Pad.create(scope, input, paddingValue, paddingLow, paddingHigh, paddingInterior); + 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); } /** - * Receives the named tensor from another XLA computation. Wraps the XLA Recv - *

- * operator documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#recv . + * The XlaSparseCoreFtrl operation * - * @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. - * @return a new instance of Recv + * @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 Recv recv(Class dtype, String tensorName, Shape shape) { - return Recv.create(scope, dtype, tensorName, shape); + 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); } /** - * Replica ID. + * The XlaSparseCoreSgd operation * - * @return a new instance of ReplicaId + * @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 ReplicaId replicaId() { - return ReplicaId.create(scope); + public XlaSparseCoreSgd xlaSparseCoreSgd(Operand indices, Operand gradient, + Operand learningRate, Operand embeddingTable, Long featureWidth) { + return XlaSparseCoreSgd.create(scope, indices, gradient, learningRate, embeddingTable, featureWidth); } /** - * 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. + * The XlaSparseDenseMatmul operation * - * @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. - * @return a new instance of SelfAdjointEig + * @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 SelfAdjointEig selfAdjointEig(Operand a, Boolean lower, - Long maxIter, Float epsilon) { - return SelfAdjointEig.create(scope, a, lower, maxIter, epsilon); + 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); } /** - * Sends the named tensor to another XLA computation. Wraps the XLA Send operator - *

- * documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#send . + * The XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput operation * - * @param tensor The tensor to send. - * @param tensorName A string key that identifies the channel. - * @return a new instance of Send + * @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 Send send(Operand tensor, String tensorName) { - return Send.create(scope, tensor, tensorName); + 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); } /** - * An op which shards the input based on the given sharding attribute. + * The XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput operation * - * @param data type for {@code output()} output - * @param input - * @return a new instance of Sharding + * @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 Sharding sharding(Operand input) { - return Sharding.create(scope, input); + 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); } /** - * 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. + * The XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput operation * - * @param data type for {@code output()} output - * @param input A `Tensor` of type T. - * @return a new instance of Sort + * @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 Sort sort(Operand input) { - return Sort.create(scope, input); + 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); } /** - * 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[...,:,:]). + * The XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput operation * - * @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. - * @return a new instance of Svd + * @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 Svd svd(Operand a, Long maxIter, Float epsilon, - String precisionConfig) { - return Svd.create(scope, a, maxIter, epsilon, precisionConfig); + 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); } /** - * An op to receive a tensor from the host. - *

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

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

- * returns the same value. + * The XlaSparseDenseMatmulWithCsrInput operation * - * @param input - * @param bound - * @return a new instance of XlaSetBound + * @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 XlaSetBound xlaSetBound(Operand input, Operand bound) { - return XlaSetBound.create(scope, input, bound); + 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 fd70471e100..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.4: DO NOT EDIT THIS FILE - -package org.tensorflow.internal.c_api; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.tensorflow.internal.c_api.global.tensorflow.*; - -@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) -public class 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 8f951ea6a73..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.4: DO NOT EDIT THIS FILE - -package org.tensorflow.internal.c_api; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.tensorflow.internal.c_api.global.tensorflow.*; - - -// 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 734040f20f4..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.4: DO NOT EDIT THIS FILE - -package org.tensorflow.internal.c_api; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.tensorflow.internal.c_api.global.tensorflow.*; - -@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) -public class 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 56e99923a0b..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.4: DO NOT EDIT THIS FILE - -package org.tensorflow.internal.c_api; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.tensorflow.internal.c_api.global.tensorflow.*; - - -// 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 2eb78c52b75..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.4: DO NOT EDIT THIS FILE - -package org.tensorflow.internal.c_api; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.tensorflow.internal.c_api.global.tensorflow.*; - -// #endif - -@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 796bfa5aefc..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.4: DO NOT EDIT THIS FILE - -package org.tensorflow.internal.c_api; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.tensorflow.internal.c_api.global.tensorflow.*; - - -// -------------------------------------------------------------------------- -// 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 ef8a6b7d7f1..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.4: DO NOT EDIT THIS FILE - -package org.tensorflow.internal.c_api; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.tensorflow.internal.c_api.global.tensorflow.*; - -@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 6a984f2a25d..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.4: DO NOT EDIT THIS FILE - -package org.tensorflow.internal.c_api; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.tensorflow.internal.c_api.global.tensorflow.*; - -@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 9c145e89bdf..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.4: DO NOT EDIT THIS FILE - -package org.tensorflow.internal.c_api; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.tensorflow.internal.c_api.global.tensorflow.*; - -@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 7fc4dd37276..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.4: DO NOT EDIT THIS FILE - -package org.tensorflow.internal.c_api; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.tensorflow.internal.c_api.global.tensorflow.*; - -@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 4d2bd0c7441..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.4: DO NOT EDIT THIS FILE - -package org.tensorflow.internal.c_api; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.tensorflow.internal.c_api.global.tensorflow.*; - -@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 f83bc6c1394..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/global/tensorflow.java +++ /dev/null @@ -1,4382 +0,0 @@ -// Targeted by JavaCPP version 1.5.4: 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 @Cast("char*") BytePointer TF_TString_Resize(TF_TString str, @Cast("size_t") long new_size, - @Cast("char") byte c); - -public static native void TF_TString_AssignView(TF_TString dst, @Cast("const char*") BytePointer src, - @Cast("size_t") long size); -public static native void TF_TString_AssignView(TF_TString dst, String src, - @Cast("size_t") long size); - -public static native void TF_TString_AppendN(TF_TString dst, @Cast("const char*") BytePointer src, - @Cast("size_t") long src_size); -public static native void TF_TString_AppendN(TF_TString dst, String src, - @Cast("size_t") long src_size); - -public static native void TF_TString_Append(TF_TString dst, @Const TF_TString src); - -public static native void TF_TString_Copy(TF_TString dst, @Cast("const char*") BytePointer src, - @Cast("size_t") long size); -public static native void TF_TString_Copy(TF_TString dst, String src, - @Cast("size_t") long size); - -public static native void TF_TString_Assign(TF_TString dst, @Const TF_TString src); - -public static native void TF_TString_Move(TF_TString dst, TF_TString src); - -// #endif // TENSORFLOW_CORE_PLATFORM_CTSTRING_INTERNAL_H_ - - -// Parsed from tensorflow/core/platform/ctstring.h - -/* Copyright 2019 The TensorFlow Authors. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -==============================================================================*/ - -// #ifndef TENSORFLOW_CORE_PLATFORM_CTSTRING_H_ -// #define TENSORFLOW_CORE_PLATFORM_CTSTRING_H_ - -// #include -// #include - -// #include "tensorflow/core/platform/ctstring_internal.h" - -// Initialize a new tstring. This must be called before using any function -// below. -// Deallocate a tstring. - -// Resizes `str' to `new_size'. This function will appropriately grow or shrink -// the string buffer to fit a `new_size' string. Grown regions of the string -// will be initialized with `c'. -// Similar to TF_TString_Resize, except the newly allocated regions will remain -// uninitialized. This is useful if you plan on overwriting the newly grown -// regions immediately after allocation; doing so will elide a superfluous -// initialization of the new buffer. -// Reserves a string buffer with a capacity of at least `new_cap'. -// ResizeUninitialized will not change the size, or the contents of the existing -// string. This is useful if you have a rough idea of `str's upperbound in -// size, and want to avoid allocations as you append to `str'. It should not be -// considered safe to write in the region between size and capacity; explicitly -// resize before doing so. - -// Returns the size of the string. -// Returns the capacity of the string buffer. It should not be considered safe -// to write in the region between size and capacity---call Resize or -// ResizeUninitialized before doing so. -// Returns the underlying type of the tstring: -// TF_TSTR_SMALL: -// Small string optimization; the contents of strings -// less than 22-bytes are stored in the TF_TString struct. This avoids any -// heap allocations. -// TF_TSTR_LARGE: -// Heap allocated string. -// TF_TSTR_OFFSET: (currently unused) -// An offset defined string. The string buffer begins at an internally -// defined little-endian offset from `str'; i.e. GetDataPointer() = str + -// offset. This type is useful for memory mapping or reading string tensors -// directly from file, without the need to deserialize the data. For -// security reasons, it is imperative that OFFSET based string tensors are -// validated before use, or are from a trusted source. -// TF_TSTR_VIEW: -// A view into an unowned character string. -// -// NOTE: -// VIEW and OFFSET types are immutable, so any modifcation via Append, -// AppendN, or GetMutableDataPointer of a VIEW/OFFSET based tstring will -// result in a conversion to an owned type (SMALL/LARGE). - -// Returns a const char pointer to the start of the underlying string. The -// underlying character buffer may not be null-terminated. -// Returns a char pointer to a mutable representation of the underlying string. -// In the case of VIEW and OFFSET types, `src' is converted to an owned type -// (SMALL/LARGE). The underlying character buffer may not be null-terminated. - -// Sets `dst' as a VIEW type to `src'. `dst' will not take ownership of `src'. -// It is the user's responsibility to ensure that the lifetime of `src' exceeds -// `dst'. Any mutations to `dst' via Append, AppendN, or GetMutableDataPointer, -// will result in a copy into an owned SMALL or LARGE type, and will not modify -// `src'. - -// Appends `src' onto `dst'. If `dst' is a VIEW or OFFSET type, it will first -// be converted to an owned LARGE or SMALL type. `dst' should not point to -// memory owned by `src'. - -// Copy/Move/Assign semantics -// -// | src | dst | complexity -// Copy | * | SMALL/LARGE | fixed/O(size) -// Assign | SMALL | SMALL | fixed -// Assign | OFFSET | VIEW | fixed -// Assign | VIEW | VIEW | fixed -// Assign | LARGE | LARGE | O(size) -// Move | * | same as src | fixed - -// Copies `src' to `dst'. `dst' will be an owned type (SMALL/LARGE). `src' -// should not point to memory owned by `dst'. -// Assigns a `src' tstring to `dst'. An OFFSET `src' type will yield a `VIEW' -// `dst'. LARGE `src' types will be copied to a new buffer; all other `src' -// types will incur a fixed cost. -// Moves a `src' tstring to `dst'. Moving a LARGE `src' to `dst' will result in -// a valid but unspecified `src'. This function incurs a fixed cost for all -// inputs. - -// #endif // TENSORFLOW_CORE_PLATFORM_CTSTRING_H_ - - -// Parsed from tensorflow/core/util/port.h - -/* Copyright 2015 The TensorFlow Authors. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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/core/platform/ctstring.h" - -// #endif // THIRD_PARTY_TENSORFLOW_C_TF_TSTRING_H_ - - -// Parsed from tensorflow/c/c_api.h - -/* Copyright 2015 The TensorFlow Authors. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 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/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 - - -// 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_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); - -// 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); - -// 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 6d53cfe0347..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,84 +17,84 @@ 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; /** * Produces a visualization of audio data over time. - *

* Spectrograms are a standard way of representing audio information as a series of * slices of frequency information, one slice for each window of time. By joining * these together into a sequence, they form a distinctive fingerprint of the sound * over time. - *

- * This op expects to receive audio data as an input, stored as floats in the range + *

This op expects to receive audio data as an input, stored as floats in the range * -1 to 1, together with a window width in samples, and a stride specifying how * far to move the window between slices. From this it generates a three * dimensional output. The first dimension is for the channels in the input, so a * stereo audio input would have two here for example. The second dimension is time, * with successive frequency slices. The third dimension has an amplitude value for * each frequency during that time slice. - *

- * This means the layout when converted and saved as an image is rotated 90 degrees + *

This means the layout when converted and saved as an image is rotated 90 degrees * clockwise from a typical spectrogram. Time is descending down the Y axis, and * the frequency decreases from left to right. - *

- * Each value in the result represents the square root of the sum of the real and + *

Each value in the result represents the square root of the sum of the real and * imaginary parts of an FFT on the current window of samples. In this way, the * lowest dimension represents the power of each frequency in the current window, * and adjacent windows are concatenated in the next dimension. - *

- * To get a more intuitive and visual look at what this operation does, you can run + *

To get a more intuitive and visual look at what this operation does, you can run * tensorflow/examples/wav_to_spectrogram to read in an audio file and save out the * resulting spectrogram as a PNG image. */ -@Operator(group = "audio") +@OpMetadata( + opType = AudioSpectrogram.OP_NAME, + inputsClass = AudioSpectrogram.Inputs.class +) +@Operator( + group = "audio" +) public final class AudioSpectrogram extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.audio.AudioSpectrogram} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param magnitudeSquared Whether to return the squared magnitude or just the - * magnitude. Using squared magnitude can avoid extra calculations. - */ - public Options magnitudeSquared(Boolean magnitudeSquared) { - this.magnitudeSquared = magnitudeSquared; - return this; - } - - private Boolean magnitudeSquared; - - private Options() { - } + public static final String OP_NAME = "AudioSpectrogram"; + + private Output spectrogram; + + public AudioSpectrogram(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + spectrogram = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new AudioSpectrogram operation. - * + * * @param scope current scope * @param input Float representation of audio data. * @param windowSize How wide the input window is in samples. For the highest efficiency * this should be a power of two, but other values are accepted. * @param stride How widely apart the center of adjacent sample windows should be. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of AudioSpectrogram */ - @Endpoint(describeByClass = true) - public static AudioSpectrogram create(Scope scope, Operand input, Long windowSize, Long stride, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("AudioSpectrogram", scope.makeOpName("AudioSpectrogram")); + @Endpoint( + describeByClass = true + ) + public static AudioSpectrogram create(Scope scope, Operand input, Long windowSize, + Long stride, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AudioSpectrogram"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("window_size", windowSize); opBuilder.setAttr("stride", stride); if (options != null) { @@ -106,35 +106,87 @@ public static AudioSpectrogram create(Scope scope, Operand input, Long } return new AudioSpectrogram(opBuilder.build()); } - + /** + * Sets the magnitudeSquared option. + * * @param magnitudeSquared Whether to return the squared magnitude or just the * magnitude. Using squared magnitude can avoid extra calculations. + * @return this Options instance. */ public static Options magnitudeSquared(Boolean magnitudeSquared) { return new Options().magnitudeSquared(magnitudeSquared); } - + /** + * Gets spectrogram. * 3D representation of the audio frequencies as an image. + * @return spectrogram. */ public Output spectrogram() { return spectrogram; } - + @Override public Output asOutput() { return spectrogram; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AudioSpectrogram"; - - private Output spectrogram; - - private AudioSpectrogram(Operation operation) { - super(operation); - int outputIdx = 0; - spectrogram = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.audio.AudioSpectrogram} + */ + public static class Options { + private Boolean magnitudeSquared; + + private Options() { + } + + /** + * Sets the magnitudeSquared option. + * + * @param magnitudeSquared Whether to return the squared magnitude or just the + * magnitude. Using squared magnitude can avoid extra calculations. + * @return this Options instance. + */ + public Options magnitudeSquared(Boolean magnitudeSquared) { + this.magnitudeSquared = 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 09dfa3af31f..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; @@ -31,66 +36,56 @@ /** * Decode a 16-bit PCM WAV file to a float tensor. - *

* The -32768 to 32767 signed 16-bit values will be scaled to -1.0 to 1.0 in float. - *

- * When desired_channels is set, if the input contains fewer channels than this + *

When desired_channels is set, if the input contains fewer channels than this * then the last channel will be duplicated to give the requested number, else if * the input has more channels than requested then the additional channels will be * ignored. - *

- * If desired_samples is set, then the audio will be cropped or padded with zeroes + *

If desired_samples is set, then the audio will be cropped or padded with zeroes * to the requested length. - *

- * The first output contains a Tensor with the content of the audio samples. The + *

The first output contains a Tensor with the content of the audio samples. The * lowest dimension will be the number of channels, and the second will be the * number of samples. For example, a ten-sample-long stereo WAV file should give an * output shape of [10, 2]. */ -@Operator(group = "audio") +@OpMetadata( + opType = DecodeWav.OP_NAME, + inputsClass = DecodeWav.Inputs.class +) +@Operator( + group = "audio" +) public final class DecodeWav extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.audio.DecodeWav} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param desiredChannels Number of sample channels wanted. - */ - public Options desiredChannels(Long desiredChannels) { - this.desiredChannels = desiredChannels; - return this; - } - - /** - * @param desiredSamples Length of audio requested. - */ - public Options desiredSamples(Long desiredSamples) { - this.desiredSamples = desiredSamples; - return this; - } - - private Long desiredChannels; - private Long desiredSamples; - - private Options() { - } + public static final String OP_NAME = "DecodeWav"; + + private Output audio; + + private Output sampleRate; + + public DecodeWav(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + audio = operation.output(outputIdx++); + sampleRate = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DecodeWav operation. - * + * * @param scope current scope * @param contents The WAV-encoded audio, usually from a file. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of DecodeWav */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DecodeWav create(Scope scope, Operand contents, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DecodeWav", scope.makeOpName("DecodeWav")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DecodeWav"); opBuilder.addInput(contents.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.desiredChannels != null) { @@ -103,45 +98,104 @@ public static DecodeWav create(Scope scope, Operand contents, Options.. } return new DecodeWav(opBuilder.build()); } - + /** + * Sets the desiredChannels option. + * * @param desiredChannels Number of sample channels wanted. + * @return this Options instance. */ public static Options desiredChannels(Long desiredChannels) { return new Options().desiredChannels(desiredChannels); } - + /** + * Sets the desiredSamples option. + * * @param desiredSamples Length of audio requested. + * @return this Options instance. */ public static Options desiredSamples(Long desiredSamples) { return new Options().desiredSamples(desiredSamples); } - + /** - * 2-D with shape `[length, channels]`. + * Gets audio. + * 2-D with shape {@code [length, channels]}. + * @return audio. */ public Output audio() { return audio; } - + /** + * Gets sampleRate. * Scalar holding the sample rate found in the WAV header. + * @return sampleRate. */ public Output sampleRate() { return sampleRate; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeWav"; - - private Output audio; - private Output sampleRate; - - private DecodeWav(Operation operation) { - super(operation); - int outputIdx = 0; - audio = operation.output(outputIdx++); - sampleRate = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.audio.DecodeWav} + */ + public static class Options { + private Long desiredChannels; + + private Long desiredSamples; + + private Options() { + } + + /** + * Sets the desiredChannels option. + * + * @param desiredChannels Number of sample channels wanted. + * @return this Options instance. + */ + public Options desiredChannels(Long desiredChannels) { + this.desiredChannels = desiredChannels; + return this; + } + + /** + * Sets the desiredSamples option. + * + * @param desiredSamples Length of audio requested. + * @return this Options instance. + */ + public Options desiredSamples(Long desiredSamples) { + this.desiredSamples = 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 a1128280152..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; @@ -31,55 +36,85 @@ /** * Encode audio data using the WAV file format. - *

* This operation will generate a string suitable to be saved out to create a .wav * audio file. It will be encoded in the 16-bit PCM format. It takes in float * values in the range -1.0f to 1.0f, and any outside that value will be clamped to * that range. - *

- * `audio` is a 2-D float Tensor of shape `[length, channels]`. - * `sample_rate` is a scalar Tensor holding the rate to use (e.g. 44100). + *

{@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). */ -@Operator(group = "audio") +@OpMetadata( + opType = EncodeWav.OP_NAME, + inputsClass = EncodeWav.Inputs.class +) +@Operator( + group = "audio" +) public final class EncodeWav extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "EncodeWav"; + + private Output contents; + + public EncodeWav(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + contents = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new EncodeWav operation. - * + * * @param scope current scope - * @param audio 2-D with shape `[length, channels]`. + * @param audio 2-D with shape {@code [length, channels]}. * @param sampleRate Scalar containing the sample frequency. * @return a new instance of EncodeWav */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static EncodeWav create(Scope scope, Operand audio, Operand sampleRate) { - OperationBuilder opBuilder = scope.env().opBuilder("EncodeWav", scope.makeOpName("EncodeWav")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "EncodeWav"); opBuilder.addInput(audio.asOutput()); opBuilder.addInput(sampleRate.asOutput()); - opBuilder = scope.apply(opBuilder); return new EncodeWav(opBuilder.build()); } - + /** + * Gets contents. * 0-D. WAV-encoded file contents. + * @return contents. */ public Output contents() { return contents; } - + @Override public Output asOutput() { return contents; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EncodeWav"; - - private Output contents; - - private EncodeWav(Operation operation) { - super(operation); - int outputIdx = 0; - contents = operation.output(outputIdx++); + + @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 a7b618fd070..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,20 +17,24 @@ 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; /** * Transforms a spectrogram into a form that's useful for speech recognition. - *

* Mel Frequency Cepstral Coefficients are a way of representing audio data that's * been effective as an input feature for machine learning. They are created by * taking the spectrum of a spectrogram (a 'cepstrum'), and discarding some of the @@ -38,73 +42,45 @@ * history in the speech recognition world, and https://en.wikipedia.org/wiki/Mel-frequency_cepstrum * is a good resource to learn more. */ -@Operator(group = "audio") +@OpMetadata( + opType = Mfcc.OP_NAME, + inputsClass = Mfcc.Inputs.class +) +@Operator( + group = "audio" +) public final class Mfcc extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.audio.Mfcc} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param upperFrequencyLimit The highest frequency to use when calculating the - * ceptstrum. - */ - public Options upperFrequencyLimit(Float upperFrequencyLimit) { - this.upperFrequencyLimit = upperFrequencyLimit; - return this; - } - - /** - * @param lowerFrequencyLimit The lowest frequency to use when calculating the - * ceptstrum. - */ - public Options lowerFrequencyLimit(Float lowerFrequencyLimit) { - this.lowerFrequencyLimit = lowerFrequencyLimit; - return this; - } - - /** - * @param filterbankChannelCount Resolution of the Mel bank used internally. - */ - public Options filterbankChannelCount(Long filterbankChannelCount) { - this.filterbankChannelCount = filterbankChannelCount; - return this; - } - - /** - * @param dctCoefficientCount How many output channels to produce per time slice. - */ - public Options dctCoefficientCount(Long dctCoefficientCount) { - this.dctCoefficientCount = dctCoefficientCount; - return this; - } - - private Float upperFrequencyLimit; - private Float lowerFrequencyLimit; - private Long filterbankChannelCount; - private Long dctCoefficientCount; - - private Options() { - } + public static final String OP_NAME = "Mfcc"; + + private Output output; + + public Mfcc(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Mfcc operation. - * + * * @param scope current scope * @param spectrogram Typically produced by the Spectrogram op, with magnitude_squared * set to true. * @param sampleRate How many samples per second the source audio used. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Mfcc */ - @Endpoint(describeByClass = true) - public static Mfcc create(Scope scope, Operand spectrogram, Operand sampleRate, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Mfcc", scope.makeOpName("Mfcc")); + @Endpoint( + describeByClass = true + ) + public static Mfcc create(Scope scope, Operand spectrogram, Operand sampleRate, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Mfcc"); opBuilder.addInput(spectrogram.asOutput()); opBuilder.addInput(sampleRate.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.upperFrequencyLimit != null) { @@ -123,56 +99,171 @@ public static Mfcc create(Scope scope, Operand spectrogram, Operand output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Mfcc"; - - private Output output; - - private Mfcc(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.audio.Mfcc} + */ + public static class Options { + private Float upperFrequencyLimit; + + private Float lowerFrequencyLimit; + + private Long filterbankChannelCount; + + private Long dctCoefficientCount; + + private Options() { + } + + /** + * Sets the upperFrequencyLimit option. + * + * @param upperFrequencyLimit The highest frequency to use when calculating the + * ceptstrum. + * @return this Options instance. + */ + public Options upperFrequencyLimit(Float upperFrequencyLimit) { + this.upperFrequencyLimit = upperFrequencyLimit; + return this; + } + + /** + * Sets the lowerFrequencyLimit option. + * + * @param lowerFrequencyLimit The lowest frequency to use when calculating the + * ceptstrum. + * @return this Options instance. + */ + public Options lowerFrequencyLimit(Float lowerFrequencyLimit) { + this.lowerFrequencyLimit = lowerFrequencyLimit; + return this; + } + + /** + * Sets the filterbankChannelCount option. + * + * @param filterbankChannelCount Resolution of the Mel bank used internally. + * @return this Options instance. + */ + public Options filterbankChannelCount(Long filterbankChannelCount) { + this.filterbankChannelCount = filterbankChannelCount; + return this; + } + + /** + * Sets the dctCoefficientCount option. + * + * @param dctCoefficientCount How many output channels to produce per time slice. + * @return this Options instance. + */ + public Options dctCoefficientCount(Long dctCoefficientCount) { + this.dctCoefficientCount = 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 86fad697878..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,80 +17,121 @@ 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; /** - * Elementwise computes the bitwise AND of `x` and `y`. - *

- * The result will have those bits set, that are set in both `x` and `y`. The - * computation is performed on the underlying representations of `x` and `y`. - *

- * For example: - *

{@code
+ * Elementwise computes the bitwise AND of {@code x} and {@code y}.
+ * The result will have those bits set, that are set in both {@code x} and {@code y}. The
+ * computation is performed on the underlying representations of {@code x} and {@code y}.
+ * 

For example: + *

  * import tensorflow as tf
  * from tensorflow.python.ops import bitwise_ops
  * dtype_list = [tf.int8, tf.int16, tf.int32, tf.int64,
  *               tf.uint8, tf.uint16, tf.uint32, tf.uint64]
- * 
+ *
  * for dtype in dtype_list:
  *   lhs = tf.constant([0, 5, 3, 14], dtype=dtype)
  *   rhs = tf.constant([5, 0, 7, 11], dtype=dtype)
  *   exp = tf.constant([0, 0, 3, 10], dtype=tf.float32)
- * 
+ *
  *   res = bitwise_ops.bitwise_and(lhs, rhs)
  *   tf.assert_equal(tf.cast(res, tf.float32), exp) # TRUE
- * }
- * - * - * @param data type for {@code z()} output + *
*/ -@Operator(group = "bitwise") +@OpMetadata( + opType = BitwiseAnd.OP_NAME, + inputsClass = BitwiseAnd.Inputs.class +) +@Operator( + group = "bitwise" +) public final class BitwiseAnd extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BitwiseAnd"; + + private Output z; + + public BitwiseAnd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BitwiseAnd operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BitwiseAnd create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("BitwiseAnd", scope.makeOpName("BitwiseAnd")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BitwiseAnd"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BitwiseAnd(opBuilder.build()); + return new BitwiseAnd<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BitwiseAnd"; - - private Output z; - - private BitwiseAnd(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 cea0b766cfe..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,80 +17,121 @@ 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; /** - * Elementwise computes the bitwise OR of `x` and `y`. - *

- * The result will have those bits set, that are set in `x`, `y` or both. The - * computation is performed on the underlying representations of `x` and `y`. - *

- * For example: - *

{@code
+ * Elementwise computes the bitwise OR of {@code x} and {@code y}.
+ * The result will have those bits set, that are set in {@code x}, {@code y} or both. The
+ * computation is performed on the underlying representations of {@code x} and {@code y}.
+ * 

For example: + *

  * import tensorflow as tf
  * from tensorflow.python.ops import bitwise_ops
  * dtype_list = [tf.int8, tf.int16, tf.int32, tf.int64,
  *               tf.uint8, tf.uint16, tf.uint32, tf.uint64]
- * 
+ *
  * for dtype in dtype_list:
  *   lhs = tf.constant([0, 5, 3, 14], dtype=dtype)
  *   rhs = tf.constant([5, 0, 7, 11], dtype=dtype)
  *   exp = tf.constant([5, 5, 7, 15], dtype=tf.float32)
- * 
+ *
  *   res = bitwise_ops.bitwise_or(lhs, rhs)
  *   tf.assert_equal(tf.cast(res,  tf.float32), exp)  # TRUE
- * }
- * - * - * @param data type for {@code z()} output + *
*/ -@Operator(group = "bitwise") +@OpMetadata( + opType = BitwiseOr.OP_NAME, + inputsClass = BitwiseOr.Inputs.class +) +@Operator( + group = "bitwise" +) public final class BitwiseOr extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BitwiseOr"; + + private Output z; + + public BitwiseOr(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BitwiseOr operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BitwiseOr create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("BitwiseOr", scope.makeOpName("BitwiseOr")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BitwiseOr"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BitwiseOr(opBuilder.build()); + return new BitwiseOr<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BitwiseOr"; - - private Output z; - - private BitwiseOr(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 f209732bb5c..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,80 +17,121 @@ 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; /** - * Elementwise computes the bitwise XOR of `x` and `y`. - *

- * The result will have those bits set, that are different in `x` and `y`. The - * computation is performed on the underlying representations of `x` and `y`. - *

- * For example: - *

{@code
+ * Elementwise computes the bitwise XOR of {@code x} and {@code y}.
+ * The result will have those bits set, that are different in {@code x} and {@code y}. The
+ * computation is performed on the underlying representations of {@code x} and {@code y}.
+ * 

For example: + *

  * import tensorflow as tf
  * from tensorflow.python.ops import bitwise_ops
  * dtype_list = [tf.int8, tf.int16, tf.int32, tf.int64,
  *               tf.uint8, tf.uint16, tf.uint32, tf.uint64]
- * 
+ *
  * for dtype in dtype_list:
  *   lhs = tf.constant([0, 5, 3, 14], dtype=dtype)
  *   rhs = tf.constant([5, 0, 7, 11], dtype=dtype)
  *   exp = tf.constant([5, 5, 4, 5],  dtype=tf.float32)
- * 
+ *
  *   res = bitwise_ops.bitwise_xor(lhs, rhs)
  *   tf.assert_equal(tf.cast(res, tf.float32), exp) # TRUE
- * }
- * - * - * @param data type for {@code z()} output + *
*/ -@Operator(group = "bitwise") +@OpMetadata( + opType = BitwiseXor.OP_NAME, + inputsClass = BitwiseXor.Inputs.class +) +@Operator( + group = "bitwise" +) public final class BitwiseXor extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BitwiseXor"; + + private Output z; + + public BitwiseXor(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BitwiseXor operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BitwiseXor create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("BitwiseXor", scope.makeOpName("BitwiseXor")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BitwiseXor"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BitwiseXor(opBuilder.build()); + return new BitwiseXor<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BitwiseXor"; - - private Output z; - - private BitwiseXor(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 4f4e063ed50..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,33 +17,37 @@ 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; /** - * Invert (flip) each bit of supported types; for example, type `uint8` value 01010101 becomes 10101010. - *

- * Flip each bit of supported types. For example, type `int8` (decimal 2) binary 00000010 becomes (decimal -3) binary 11111101. - * This operation is performed on each element of the tensor argument `x`. - *

- * Example: - *

{@code
+ * Invert (flip) each bit of supported types; for example, type {@code uint8} value 01010101 becomes 10101010.
+ * Flip each bit of supported types.  For example, type {@code int8} (decimal 2) binary 00000010 becomes (decimal -3) binary 11111101.
+ * This operation is performed on each element of the tensor argument {@code x}.
+ * 

Example: + *

  * import tensorflow as tf
  * from tensorflow.python.ops import bitwise_ops
- * 
+ *
  * # flip 2 (00000010) to -3 (11111101)
  * tf.assert_equal(-3, bitwise_ops.invert(2))
- * 
+ *
  * dtype_list = [dtypes.int8, dtypes.int16, dtypes.int32, dtypes.int64,
  *               dtypes.uint8, dtypes.uint16, dtypes.uint32, dtypes.uint64]
- * 
+ *
  * inputs = [0, 5, 3, 14]
  * for dtype in dtype_list:
  *   # Because of issues with negative numbers, let's test this indirectly.
@@ -56,60 +60,91 @@
  *                                       input_tensor, bitwise_ops.invert(input_tensor)),
  *                                     bitwise_ops.invert(
  *                                       tf.constant(0, dtype=dtype))]
- * 
+ *
  *   expected = tf.constant([0, 0, 0, 0], dtype=tf.float32)
  *   tf.assert_equal(tf.cast(not_a_and_a, tf.float32), expected)
- * 
+ *
  *   expected = tf.cast([not_0] * 4, tf.float32)
  *   tf.assert_equal(tf.cast(not_a_or_a, tf.float32), expected)
- * 
+ *
  *   # For unsigned dtypes let's also check the result directly.
  *   if dtype.is_unsigned:
  *     inverted = bitwise_ops.invert(input_tensor)
  *     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 + *
*/ -@Operator(group = "bitwise") +@OpMetadata( + opType = Invert.OP_NAME, + inputsClass = Invert.Inputs.class +) +@Operator( + group = "bitwise" +) public final class Invert extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Invert"; + + private Output y; + + public Invert(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Invert operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Invert} output and operands * @return a new instance of Invert */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Invert create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Invert", scope.makeOpName("Invert")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Invert"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Invert(opBuilder.build()); + return new Invert<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Invert"; - - private Output y; - - private Invert(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 98ca43ae889..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,91 +17,132 @@ 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; /** - * Elementwise computes the bitwise left-shift of `x` and `y`. - *

- * If `y` is negative, or greater than or equal to the width of `x` in bits the + * Elementwise computes the bitwise left-shift of {@code x} and {@code y}. + * If {@code y} is negative, or greater than or equal to the width of {@code x} in bits the * result is implementation defined. - *

- * Example: - *

{@code
+ * 

Example: + *

  * import tensorflow as tf
  * from tensorflow.python.ops import bitwise_ops
  * import numpy as np
  * dtype_list = [tf.int8, tf.int16, tf.int32, tf.int64]
- * 
+ *
  * for dtype in dtype_list:
  *   lhs = tf.constant([-1, -5, -3, -14], dtype=dtype)
  *   rhs = tf.constant([5, 0, 7, 11], dtype=dtype)
- * 
+ *
  *   left_shift_result = bitwise_ops.left_shift(lhs, rhs)
- * 
+ *
  *   print(left_shift_result)
- * 
+ *
  * # This will print:
  * # tf.Tensor([ -32   -5 -128    0], shape=(4,), dtype=int8)
  * # tf.Tensor([   -32     -5   -384 -28672], shape=(4,), dtype=int16)
  * # tf.Tensor([   -32     -5   -384 -28672], shape=(4,), dtype=int32)
  * # tf.Tensor([   -32     -5   -384 -28672], shape=(4,), dtype=int64)
- * 
+ *
  * lhs = np.array([-2, 64, 101, 32], dtype=np.int8)
  * rhs = np.array([-1, -5, -3, -14], dtype=np.int8)
  * bitwise_ops.left_shift(lhs, rhs)
- * # 
- * }
- * - * - * @param data type for {@code z()} output + * # <tf.Tensor: shape=(4,), dtype=int8, numpy=array([ -2, 64, 101, 32], dtype=int8)> + *
*/ -@Operator(group = "bitwise") +@OpMetadata( + opType = LeftShift.OP_NAME, + inputsClass = LeftShift.Inputs.class +) +@Operator( + group = "bitwise" +) public final class LeftShift extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LeftShift"; + + private Output z; + + public LeftShift(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LeftShift operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static LeftShift create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("LeftShift", scope.makeOpName("LeftShift")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LeftShift"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new LeftShift(opBuilder.build()); + return new LeftShift<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LeftShift"; - - private Output z; - - private LeftShift(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 4d08a05bf1a..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,94 +17,134 @@ 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; /** - * Elementwise computes the bitwise right-shift of `x` and `y`. - *

+ * Elementwise computes the bitwise right-shift of {@code x} and {@code y}. * Performs a logical shift for unsigned integer types, and an arithmetic shift * for signed integer types. - *

- * If `y` is negative, or greater than or equal to than the width of `x` in bits + *

If {@code y} is negative, or greater than or equal to than the width of {@code x} in bits * the result is implementation defined. - *

- * Example: - *

{@code
+ * 

Example: + *

  * import tensorflow as tf
  * from tensorflow.python.ops import bitwise_ops
  * import numpy as np
  * dtype_list = [tf.int8, tf.int16, tf.int32, tf.int64]
- * 
+ *
  * for dtype in dtype_list:
  *   lhs = tf.constant([-1, -5, -3, -14], dtype=dtype)
  *   rhs = tf.constant([5, 0, 7, 11], dtype=dtype)
- * 
+ *
  *   right_shift_result = bitwise_ops.right_shift(lhs, rhs)
- * 
+ *
  *   print(right_shift_result)
- * 
+ *
  * # This will print:
  * # tf.Tensor([-1 -5 -1 -1], shape=(4,), dtype=int8)
  * # tf.Tensor([-1 -5 -1 -1], shape=(4,), dtype=int16)
  * # tf.Tensor([-1 -5 -1 -1], shape=(4,), dtype=int32)
  * # tf.Tensor([-1 -5 -1 -1], shape=(4,), dtype=int64)
- * 
+ *
  * lhs = np.array([-2, 64, 101, 32], dtype=np.int8)
  * rhs = np.array([-1, -5, -3, -14], dtype=np.int8)
  * bitwise_ops.right_shift(lhs, rhs)
- * # 
- * }
- * - * - * @param data type for {@code z()} output + * # <tf.Tensor: shape=(4,), dtype=int8, numpy=array([ -2, 64, 101, 32], dtype=int8)> + *
*/ -@Operator(group = "bitwise") +@OpMetadata( + opType = RightShift.OP_NAME, + inputsClass = RightShift.Inputs.class +) +@Operator( + group = "bitwise" +) public final class RightShift extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RightShift"; + + private Output z; + + public RightShift(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RightShift operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static RightShift create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("RightShift", scope.makeOpName("RightShift")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RightShift"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new RightShift(opBuilder.build()); + return new RightShift<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RightShift"; - - private Output z; - - private RightShift(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 82e9b43cf61..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,65 +17,104 @@ 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; /** * 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. */ +@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 + */ + public static final String OP_NAME = "KMC2ChainInitialization"; + + private Output index; + + public KMC2ChainInitialization(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + index = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new KMC2ChainInitialization operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static KMC2ChainInitialization create(Scope scope, Operand distances, Operand seed) { - OperationBuilder opBuilder = scope.env().opBuilder("KMC2ChainInitialization", scope.makeOpName("KMC2ChainInitialization")); + @Endpoint( + describeByClass = true + ) + public static KMC2ChainInitialization create(Scope scope, Operand distances, + Operand seed) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "KMC2ChainInitialization"); opBuilder.addInput(distances.asOutput()); opBuilder.addInput(seed.asOutput()); - opBuilder = scope.apply(opBuilder); return new KMC2ChainInitialization(opBuilder.build()); } - + /** + * Gets index. * Scalar with the index of the sampled point. + * @return index. */ public Output index() { return index; } - + @Override public Output asOutput() { return index; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "KMC2ChainInitialization"; - - private Output index; - - private KMC2ChainInitialization(Operation operation) { - super(operation); - int outputIdx = 0; - index = operation.output(outputIdx++); + + @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 cc163969960..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,30 +17,53 @@ 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; /** * 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. */ +@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 + */ + public static final String OP_NAME = "KmeansPlusPlusInitialization"; + + private Output samples; + + public KmeansPlusPlusInitialization(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + samples = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new KmeansPlusPlusInitialization operation. - * + * * @param scope current scope * @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. @@ -51,37 +74,67 @@ public final class KmeansPlusPlusInitialization extends RawOp implements Operand * heuristic is used to sample O(log(num_to_sample)) additional points. * @return a new instance of KmeansPlusPlusInitialization */ - @Endpoint(describeByClass = true) - public static KmeansPlusPlusInitialization create(Scope scope, Operand points, Operand numToSample, Operand seed, Operand numRetriesPerSample) { - OperationBuilder opBuilder = scope.env().opBuilder("KmeansPlusPlusInitialization", scope.makeOpName("KmeansPlusPlusInitialization")); + @Endpoint( + describeByClass = true + ) + public static KmeansPlusPlusInitialization create(Scope scope, Operand points, + Operand numToSample, Operand seed, Operand numRetriesPerSample) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "KmeansPlusPlusInitialization"); opBuilder.addInput(points.asOutput()); opBuilder.addInput(numToSample.asOutput()); opBuilder.addInput(seed.asOutput()); opBuilder.addInput(numRetriesPerSample.asOutput()); - opBuilder = scope.apply(opBuilder); return new KmeansPlusPlusInitialization(opBuilder.build()); } - + /** + * Gets samples. * Matrix of shape (num_to_sample, d). The sampled rows. + * @return samples. */ public Output samples() { return samples; } - + @Override public Output asOutput() { return samples; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "KmeansPlusPlusInitialization"; - - private Output samples; - - private KmeansPlusPlusInitialization(Operation operation) { - super(operation); - int outputIdx = 0; - samples = operation.output(outputIdx++); + + @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 443ca7dfb98..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/AllReduce.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.collective; - -import java.util.List; -import org.tensorflow.Operand; -import org.tensorflow.Operation; -import org.tensorflow.OperationBuilder; -import org.tensorflow.Output; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.family.TNumber; - -/** - * Mutually reduces multiple tensors of identical type and shape. - * - * @param data type for {@code data()} output - */ -public final class AllReduce extends RawOp implements Operand { - - /** - * Optional attributes for {@link org.tensorflow.op.collective.AllReduce} - */ - public static class Options { - - /** - * @param waitFor - */ - public Options waitFor(List waitFor) { - this.waitFor = waitFor; - return this; - } - - /** - * @param communicationHint - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * @param timeoutSeconds - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - - private List waitFor; - private String communicationHint; - private Float timeoutSeconds; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new AllReduce operation. - * - * @param scope current scope - * @param input - * @param groupSize - * @param groupKey - * @param instanceKey - * @param mergeOp - * @param finalOp - * @param subdivOffsets - * @param options carries optional attributes values - * @return a new instance of 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.env().opBuilder("CollectiveReduce", scope.makeOpName("AllReduce")); - opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("group_size", groupSize); - opBuilder.setAttr("group_key", groupKey); - opBuilder.setAttr("instance_key", instanceKey); - opBuilder.setAttr("merge_op", mergeOp); - opBuilder.setAttr("final_op", finalOp); - long[] subdivOffsetsArray = new long[subdivOffsets.size()]; - for (int i = 0; i < subdivOffsetsArray.length; ++i) { - subdivOffsetsArray[i] = subdivOffsets.get(i); - } - opBuilder.setAttr("subdiv_offsets", subdivOffsetsArray); - if (options != null) { - for (Options opts : options) { - if (opts.waitFor != null) { - long[] waitForArray = new long[opts.waitFor.size()]; - for (int i = 0; i < waitForArray.length; ++i) { - waitForArray[i] = opts.waitFor.get(i); - } - opBuilder.setAttr("wait_for", waitForArray); - } - if (opts.communicationHint != null) { - opBuilder.setAttr("communication_hint", opts.communicationHint); - } - if (opts.timeoutSeconds != null) { - opBuilder.setAttr("timeout_seconds", opts.timeoutSeconds); - } - } - } - return new AllReduce(opBuilder.build()); - } - - /** - * @param waitFor - */ - public static Options waitFor(List waitFor) { - return new Options().waitFor(waitFor); - } - - /** - * @param communicationHint - */ - public static Options communicationHint(String communicationHint) { - return new Options().communicationHint(communicationHint); - } - - /** - * @param timeoutSeconds - */ - public static Options timeoutSeconds(Float timeoutSeconds) { - return new Options().timeoutSeconds(timeoutSeconds); - } - - /** - */ - public Output data() { - return data; - } - - @Override - public Output asOutput() { - return data; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CollectiveReduce"; - - private Output data; - - private AllReduce(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastRecv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastRecv.java deleted file mode 100644 index 4ade0cfc0a6..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastRecv.java +++ /dev/null @@ -1,136 +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.op.annotation.Operator; -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 { - - /** - * Optional attributes for {@link org.tensorflow.op.collective.BroadcastRecv} - */ - public static class Options { - - /** - * @param communicationHint - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * @param timeoutSeconds - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - - private String communicationHint; - private Float timeoutSeconds; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new BroadcastRecv operation. - * - * @param scope current scope - * @param T - * @param groupSize - * @param groupKey - * @param instanceKey - * @param shape - * @param options carries optional attributes values - * @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.env().opBuilder("CollectiveBcastRecv", scope.makeOpName("BroadcastRecv")); - opBuilder = scope.apply(opBuilder); - 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()); - } - - /** - * @param communicationHint - */ - public static Options communicationHint(String communicationHint) { - return new Options().communicationHint(communicationHint); - } - - /** - * @param timeoutSeconds - */ - public static Options timeoutSeconds(Float timeoutSeconds) { - return new Options().timeoutSeconds(timeoutSeconds); - } - - /** - */ - public Output data() { - return data; - } - - @Override - public Output asOutput() { - return data; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CollectiveBcastRecv"; - - private Output data; - - private BroadcastRecv(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastSend.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastSend.java deleted file mode 100644 index 9a2646dc630..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastSend.java +++ /dev/null @@ -1,135 +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.op.annotation.Operator; -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 { - - /** - * Optional attributes for {@link org.tensorflow.op.collective.BroadcastSend} - */ - public static class Options { - - /** - * @param communicationHint - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * @param timeoutSeconds - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - - private String communicationHint; - private Float timeoutSeconds; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new BroadcastSend operation. - * - * @param scope current scope - * @param input - * @param groupSize - * @param groupKey - * @param instanceKey - * @param shape - * @param options carries optional attributes values - * @return a new instance of 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.env().opBuilder("CollectiveBcastSend", scope.makeOpName("BroadcastSend")); - opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("group_size", groupSize); - opBuilder.setAttr("group_key", groupKey); - opBuilder.setAttr("instance_key", instanceKey); - opBuilder.setAttr("shape", shape); - if (options != null) { - for (Options opts : options) { - if (opts.communicationHint != null) { - opBuilder.setAttr("communication_hint", opts.communicationHint); - } - if (opts.timeoutSeconds != null) { - opBuilder.setAttr("timeout_seconds", opts.timeoutSeconds); - } - } - } - return new BroadcastSend(opBuilder.build()); - } - - /** - * @param communicationHint - */ - public static Options communicationHint(String communicationHint) { - return new Options().communicationHint(communicationHint); - } - - /** - * @param timeoutSeconds - */ - public static Options timeoutSeconds(Float timeoutSeconds) { - return new Options().timeoutSeconds(timeoutSeconds); - } - - /** - */ - public Output data() { - return data; - } - - @Override - public Output asOutput() { - return data; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CollectiveBcastSend"; - - private Output data; - - private BroadcastSend(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/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 be698afc2e7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/Gather.java +++ /dev/null @@ -1,135 +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.op.annotation.Operator; -import org.tensorflow.types.family.TNumber; - -/** - * Mutually accumulates multiple tensors of identical type and shape. - * - * @param data type for {@code data()} output - */ -public final class Gather extends RawOp implements Operand { - - /** - * Optional attributes for {@link org.tensorflow.op.collective.Gather} - */ - public static class Options { - - /** - * @param communicationHint - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * @param timeoutSeconds - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - - private String communicationHint; - private Float timeoutSeconds; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new Gather operation. - * - * @param scope current scope - * @param input - * @param groupSize - * @param groupKey - * @param instanceKey - * @param shape - * @param options carries optional attributes values - * @return a new instance of Gather - */ - @Endpoint(describeByClass = true) - public static Gather create(Scope scope, Operand input, Long groupSize, Long groupKey, Long instanceKey, Shape shape, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("CollectiveGather", scope.makeOpName("Gather")); - opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("group_size", groupSize); - opBuilder.setAttr("group_key", groupKey); - opBuilder.setAttr("instance_key", instanceKey); - opBuilder.setAttr("shape", shape); - if (options != null) { - for (Options opts : options) { - if (opts.communicationHint != null) { - opBuilder.setAttr("communication_hint", opts.communicationHint); - } - if (opts.timeoutSeconds != null) { - opBuilder.setAttr("timeout_seconds", opts.timeoutSeconds); - } - } - } - return new Gather(opBuilder.build()); - } - - /** - * @param communicationHint - */ - public static Options communicationHint(String communicationHint) { - return new Options().communicationHint(communicationHint); - } - - /** - * @param timeoutSeconds - */ - public static Options timeoutSeconds(Float timeoutSeconds) { - return new Options().timeoutSeconds(timeoutSeconds); - } - - /** - */ - public Output data() { - return data; - } - - @Override - public Output asOutput() { - return data; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CollectiveGather"; - - private Output data; - - private Gather(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/GatherV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/GatherV2.java deleted file mode 100644 index 0b90160e904..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/GatherV2.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.collective; - -import org.tensorflow.Operand; -import org.tensorflow.Operation; -import org.tensorflow.OperationBuilder; -import org.tensorflow.Output; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.TInt32; -import org.tensorflow.types.family.TNumber; - -/** - * Mutually accumulates multiple tensors of identical type and shape. - * - * @param data type for {@code data()} output - */ -public final class GatherV2 extends RawOp implements Operand { - - /** - * Optional attributes for {@link org.tensorflow.op.collective.GatherV2} - */ - public static class Options { - - /** - * @param communicationHint - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * @param timeoutSeconds - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - - private String communicationHint; - private Float timeoutSeconds; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new GatherV2 operation. - * - * @param scope current scope - * @param input - * @param groupSize - * @param groupKey - * @param instanceKey - * @param options carries optional attributes values - * @return a new instance of GatherV2 - */ - @Endpoint(describeByClass = true) - public static GatherV2 create(Scope scope, Operand input, Operand groupSize, Operand groupKey, Operand instanceKey, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("CollectiveGatherV2", scope.makeOpName("GatherV2")); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(groupSize.asOutput()); - opBuilder.addInput(groupKey.asOutput()); - opBuilder.addInput(instanceKey.asOutput()); - opBuilder = scope.apply(opBuilder); - if (options != null) { - for (Options opts : options) { - if (opts.communicationHint != null) { - opBuilder.setAttr("communication_hint", opts.communicationHint); - } - if (opts.timeoutSeconds != null) { - opBuilder.setAttr("timeout_seconds", opts.timeoutSeconds); - } - } - } - return new GatherV2(opBuilder.build()); - } - - /** - * @param communicationHint - */ - public static Options communicationHint(String communicationHint) { - return new Options().communicationHint(communicationHint); - } - - /** - * @param timeoutSeconds - */ - public static Options timeoutSeconds(Float timeoutSeconds) { - return new Options().timeoutSeconds(timeoutSeconds); - } - - /** - */ - public Output data() { - return data; - } - - @Override - public Output asOutput() { - return data; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CollectiveGatherV2"; - - private Output data; - - private GatherV2(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/Reduce.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/Reduce.java deleted file mode 100644 index 71f4b0804e8..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/Reduce.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.collective; - -import java.util.List; -import org.tensorflow.Operand; -import org.tensorflow.Operation; -import org.tensorflow.OperationBuilder; -import org.tensorflow.Output; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.family.TNumber; - -/** - * Mutually reduces multiple tensors of identical type and shape. - * - * @param data type for {@code data()} output - */ -public final class Reduce extends RawOp implements Operand { - - /** - * Optional attributes for {@link org.tensorflow.op.collective.Reduce} - */ - public static class Options { - - /** - * @param waitFor - */ - public Options waitFor(List waitFor) { - this.waitFor = waitFor; - return this; - } - - /** - * @param communicationHint - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * @param timeoutSeconds - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - - private List waitFor; - private String communicationHint; - private Float timeoutSeconds; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new Reduce operation. - * - * @param scope current scope - * @param input - * @param groupSize - * @param groupKey - * @param instanceKey - * @param mergeOp - * @param finalOp - * @param subdivOffsets - * @param options carries optional attributes values - * @return a new instance of Reduce - */ - @Endpoint(describeByClass = true) - public static Reduce create(Scope scope, Operand input, Long groupSize, Long groupKey, Long instanceKey, String mergeOp, String finalOp, List subdivOffsets, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("CollectiveReduce", scope.makeOpName("Reduce")); - opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("group_size", groupSize); - opBuilder.setAttr("group_key", groupKey); - opBuilder.setAttr("instance_key", instanceKey); - opBuilder.setAttr("merge_op", mergeOp); - opBuilder.setAttr("final_op", finalOp); - long[] subdivOffsetsArray = new long[subdivOffsets.size()]; - for (int i = 0; i < subdivOffsetsArray.length; ++i) { - subdivOffsetsArray[i] = subdivOffsets.get(i); - } - opBuilder.setAttr("subdiv_offsets", subdivOffsetsArray); - if (options != null) { - for (Options opts : options) { - if (opts.waitFor != null) { - long[] waitForArray = new long[opts.waitFor.size()]; - for (int i = 0; i < waitForArray.length; ++i) { - waitForArray[i] = opts.waitFor.get(i); - } - opBuilder.setAttr("wait_for", waitForArray); - } - if (opts.communicationHint != null) { - opBuilder.setAttr("communication_hint", opts.communicationHint); - } - if (opts.timeoutSeconds != null) { - opBuilder.setAttr("timeout_seconds", opts.timeoutSeconds); - } - } - } - return new Reduce(opBuilder.build()); - } - - /** - * @param waitFor - */ - public static Options waitFor(List waitFor) { - return new Options().waitFor(waitFor); - } - - /** - * @param communicationHint - */ - public static Options communicationHint(String communicationHint) { - return new Options().communicationHint(communicationHint); - } - - /** - * @param timeoutSeconds - */ - public static Options timeoutSeconds(Float timeoutSeconds) { - return new Options().timeoutSeconds(timeoutSeconds); - } - - /** - */ - public Output data() { - return data; - } - - @Override - public Output asOutput() { - return data; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CollectiveReduce"; - - private Output data; - - private Reduce(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/ReduceV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/ReduceV2.java deleted file mode 100644 index 3e57567a099..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/ReduceV2.java +++ /dev/null @@ -1,137 +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.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.TInt32; -import org.tensorflow.types.family.TNumber; - -/** - * Mutually reduces multiple tensors of identical type and shape. - * - * @param data type for {@code data()} output - */ -public final class ReduceV2 extends RawOp implements Operand { - - /** - * Optional attributes for {@link org.tensorflow.op.collective.ReduceV2} - */ - public static class Options { - - /** - * @param communicationHint - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * @param timeoutSeconds - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - - private String communicationHint; - private Float timeoutSeconds; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new ReduceV2 operation. - * - * @param scope current scope - * @param input - * @param groupSize - * @param groupKey - * @param instanceKey - * @param mergeOp - * @param finalOp - * @param options carries optional attributes values - * @return a new instance of ReduceV2 - */ - @Endpoint(describeByClass = true) - public static ReduceV2 create(Scope scope, Operand input, Operand groupSize, Operand groupKey, Operand instanceKey, String mergeOp, String finalOp, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("CollectiveReduceV2", scope.makeOpName("ReduceV2")); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(groupSize.asOutput()); - opBuilder.addInput(groupKey.asOutput()); - opBuilder.addInput(instanceKey.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("merge_op", mergeOp); - opBuilder.setAttr("final_op", finalOp); - if (options != null) { - for (Options opts : options) { - if (opts.communicationHint != null) { - opBuilder.setAttr("communication_hint", opts.communicationHint); - } - if (opts.timeoutSeconds != null) { - opBuilder.setAttr("timeout_seconds", opts.timeoutSeconds); - } - } - } - return new ReduceV2(opBuilder.build()); - } - - /** - * @param communicationHint - */ - public static Options communicationHint(String communicationHint) { - return new Options().communicationHint(communicationHint); - } - - /** - * @param timeoutSeconds - */ - public static Options timeoutSeconds(Float timeoutSeconds) { - return new Options().timeoutSeconds(timeoutSeconds); - } - - /** - */ - public Output data() { - return data; - } - - @Override - public Output asOutput() { - return data; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CollectiveReduceV2"; - - private Output data; - - private ReduceV2(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Abort.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Abort.java index 9ba58260fda..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,63 +17,51 @@ 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; /** * Raise a exception to abort the process when called. - *

* If exit_without_error is true, the process will exit normally, * otherwise it will exit with a SIGABORT signal. - *

- * Returns nothing but an exception. + *

Returns nothing but an exception. */ +@OpMetadata( + opType = Abort.OP_NAME, + inputsClass = Abort.Inputs.class +) @Operator public final class Abort extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.Abort} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param errorMsg A string which is the message associated with the exception. - */ - public Options errorMsg(String errorMsg) { - this.errorMsg = errorMsg; - return this; - } - - /** - * @param exitWithoutError - */ - public Options exitWithoutError(Boolean exitWithoutError) { - this.exitWithoutError = exitWithoutError; - return this; - } - - private String errorMsg; - private Boolean exitWithoutError; - - private Options() { - } + public static final String OP_NAME = "Abort"; + + public Abort(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new Abort operation. - * + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Abort */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Abort create(Scope scope, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Abort", scope.makeOpName("Abort")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Abort"); if (options != null) { for (Options opts : options) { if (opts.errorMsg != null) { @@ -86,25 +74,80 @@ public static Abort create(Scope scope, Options... options) { } return new Abort(opBuilder.build()); } - + /** + * Sets the errorMsg option. + * * @param errorMsg A string which is the message associated with the exception. + * @return this Options instance. */ public static Options errorMsg(String errorMsg) { return new Options().errorMsg(errorMsg); } - + /** - * @param exitWithoutError + * Sets the exitWithoutError option. + * + * @param exitWithoutError the exitWithoutError option + * @return this Options instance. */ public static Options exitWithoutError(Boolean exitWithoutError) { return new Options().exitWithoutError(exitWithoutError); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Abort"; - - private Abort(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Abort} + */ + public static class Options { + private String errorMsg; + + private Boolean exitWithoutError; + + private Options() { + } + + /** + * Sets the errorMsg option. + * + * @param errorMsg A string which is the message associated with the exception. + * @return this Options instance. + */ + public Options errorMsg(String errorMsg) { + this.errorMsg = errorMsg; + return this; + } + + /** + * Sets the exitWithoutError option. + * + * @param exitWithoutError the exitWithoutError option + * @return this Options instance. + */ + public Options exitWithoutError(Boolean exitWithoutError) { + this.exitWithoutError = 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 c0d9108cc7f..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,63 +17,67 @@ 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; /** - * Computes the "logical and" of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Computes the "logical and" of elements across dimensions of a tensor. + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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. */ +@OpMetadata( + opType = All.OP_NAME, + inputsClass = All.Inputs.class +) @Operator public final class All extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.All} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "All"; + + private Output output; + + public All(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new All operation. - * + * * @param scope current scope * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values * @return a new instance of All */ - @Endpoint(describeByClass = true) - public static All create(Scope scope, Operand input, Operand axis, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("All", scope.makeOpName("All")); + @Endpoint( + describeByClass = true + ) + public static All create(Scope scope, Operand input, Operand axis, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "All"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.keepDims != null) { @@ -83,34 +87,84 @@ public static All create(Scope scope, Operand input, Operand output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "All"; - - private Output output; - - private All(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.All} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = 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 d9b339923a0..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,63 +17,67 @@ 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; /** - * Computes the "logical or" of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Computes the "logical or" of elements across dimensions of a tensor. + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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. */ +@OpMetadata( + opType = Any.OP_NAME, + inputsClass = Any.Inputs.class +) @Operator public final class Any extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Any} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "Any"; + + private Output output; + + public Any(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Any operation. - * + * * @param scope current scope * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values * @return a new instance of Any */ - @Endpoint(describeByClass = true) - public static Any create(Scope scope, Operand input, Operand axis, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Any", scope.makeOpName("Any")); + @Endpoint( + describeByClass = true + ) + public static Any create(Scope scope, Operand input, Operand axis, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Any"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.keepDims != null) { @@ -83,34 +87,84 @@ public static Any create(Scope scope, Operand input, Operand output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Any"; - - private Output output; - - private Any(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Any} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = 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 18b628ac153..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,59 +17,59 @@ 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; /** * Asserts that the given condition is true. - *

- * If `condition` evaluates to false, print the list of tensors in `data`. - * `summarize` determines how many entries of the tensors to print. + * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.AssertThat} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param summarize Print this many entries of each tensor. - */ - public Options summarize(Long summarize) { - this.summarize = summarize; - return this; - } - - private Long summarize; - - private Options() { - } + public static final String OP_NAME = "Assert"; + + public AssertThat(Operation operation) { + super(operation, OP_NAME); } - + /** - * Factory method to create a class wrapping a new AssertThat operation. - * + * Factory method to create a class wrapping a new Assert operation. + * * @param scope current scope * @param condition The condition to evaluate. * @param data The tensors to print out when condition is false. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of AssertThat */ - @Endpoint(describeByClass = true) - public static AssertThat create(Scope scope, Operand condition, Iterable> data, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Assert", scope.makeOpName("AssertThat")); + @Endpoint( + describeByClass = true + ) + public static AssertThat create(Scope scope, Operand condition, Iterable> data, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AssertThat"); opBuilder.addInput(condition.asOutput()); opBuilder.addInputList(Operands.asOutputs(data)); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.summarize != null) { @@ -79,18 +79,71 @@ public static AssertThat create(Scope scope, Operand condition, Iterable< } return new AssertThat(opBuilder.build()); } - + /** + * Sets the summarize option. + * * @param summarize Print this many entries of each tensor. + * @return this Options instance. */ public static Options summarize(Long summarize) { return new Options().summarize(summarize); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Assert"; - - private AssertThat(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.AssertThat} + */ + public static class Options { + private Long summarize; + + private Options() { + } + + /** + * Sets the summarize option. + * + * @param summarize Print this many entries of each tensor. + * @return this Options instance. + */ + public Options summarize(Long summarize) { + this.summarize = 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 e1a52db8d79..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,73 +17,64 @@ 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 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 outputRef()} output */ +@OpMetadata( + opType = Assign.OP_NAME, + inputsClass = Assign.Inputs.class +) @Operator public final class Assign extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Assign} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param validateShape 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 Options validateShape(Boolean validateShape) { - this.validateShape = validateShape; - return this; - } - - /** - * @param useLocking If True, the assignment will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean validateShape; - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "Assign"; + + private Output outputRef; + + public Assign(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Assign operation. - * + * * @param scope current scope - * @param ref Should be from a `Variable` node. May be uninitialized. + * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code Assign} output and operands * @return a new instance of Assign */ - @Endpoint(describeByClass = true) - public static Assign create(Scope scope, Operand ref, Operand value, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Assign", scope.makeOpName("Assign")); + @Endpoint( + describeByClass = true + ) + public static Assign create(Scope scope, Operand ref, Operand value, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Assign"); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(value.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.validateShape != null) { @@ -94,47 +85,124 @@ public static Assign create(Scope scope, Operand ref, Op } } } - return new Assign(opBuilder.build()); + return new Assign<>(opBuilder.build()); } - + /** + * Sets the validateShape option. + * * @param validateShape 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'. + * @return this Options instance. */ public static Options validateShape(Boolean validateShape) { return new Options().validateShape(validateShape); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the assignment will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * = Same as "ref". Returned as a convenience for operations that want + * Gets outputRef. + * = Same as "ref". Returned as a convenience for operations that want * to use the new value after the variable has been reset. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Assign"; - - private Output outputRef; - - private Assign(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Assign} + */ + public static class Options { + private Boolean validateShape; + + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the validateShape option. + * + * @param validateShape 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'. + * @return this Options instance. + */ + public Options validateShape(Boolean validateShape) { + this.validateShape = validateShape; + return this; + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the assignment will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 9aa0c54959a..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,62 +17,64 @@ 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 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 outputRef()} output */ +@OpMetadata( + opType = AssignAdd.OP_NAME, + inputsClass = AssignAdd.Inputs.class +) @Operator public final class AssignAdd extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.AssignAdd} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the addition will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "AssignAdd"; + + private Output outputRef; + + public AssignAdd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new AssignAdd operation. - * + * * @param scope current scope - * @param ref Should be from a `Variable` node. + * @param ref Should be from a {@code Variable} node. * @param value The value to be added to the variable. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code AssignAdd} output and operands * @return a new instance of AssignAdd */ - @Endpoint(describeByClass = true) - public static AssignAdd create(Scope scope, Operand ref, Operand value, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("AssignAdd", scope.makeOpName("AssignAdd")); + @Endpoint( + describeByClass = true + ) + public static AssignAdd create(Scope scope, Operand ref, Operand value, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AssignAdd"); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(value.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -80,38 +82,89 @@ public static AssignAdd create(Scope scope, Operand ref, } } } - return new AssignAdd(opBuilder.build()); + return new AssignAdd<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the addition will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * = Same as "ref". Returned as a convenience for operations that want + * Gets outputRef. + * = Same as "ref". Returned as a convenience for operations that want * to use the new value after the variable has been updated. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AssignAdd"; - - private Output outputRef; - - private AssignAdd(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.AssignAdd} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the addition will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 6bb441bd9c7..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,45 +17,85 @@ 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; /** * Adds a value to the current value of a variable. - *

* 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AssignAddVariableOp"; + + public AssignAddVariableOp(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new AssignAddVariableOp operation. - * + * * @param scope current scope * @param resource handle to the resource in which to store the variable. * @param value the value by which the variable will be incremented. * @return a new instance of AssignAddVariableOp */ - @Endpoint(describeByClass = true) - public static AssignAddVariableOp create(Scope scope, Operand resource, Operand value) { - OperationBuilder opBuilder = scope.env().opBuilder("AssignAddVariableOp", scope.makeOpName("AssignAddVariableOp")); + @Endpoint( + describeByClass = true + ) + public static AssignAddVariableOp create(Scope scope, Operand resource, + Operand value) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AssignAddVariableOp"); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(value.asOutput()); - opBuilder = scope.apply(opBuilder); return new AssignAddVariableOp(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AssignAddVariableOp"; - - private AssignAddVariableOp(Operation operation) { - super(operation); + + @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 5b7a24d763a..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,62 +17,64 @@ 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 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 outputRef()} output */ +@OpMetadata( + opType = AssignSub.OP_NAME, + inputsClass = AssignSub.Inputs.class +) @Operator public final class AssignSub extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.AssignSub} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the subtraction will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "AssignSub"; + + private Output outputRef; + + public AssignSub(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new AssignSub operation. - * + * * @param scope current scope - * @param ref Should be from a `Variable` node. + * @param ref Should be from a {@code Variable} node. * @param value The value to be subtracted to the variable. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code AssignSub} output and operands * @return a new instance of AssignSub */ - @Endpoint(describeByClass = true) - public static AssignSub create(Scope scope, Operand ref, Operand value, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("AssignSub", scope.makeOpName("AssignSub")); + @Endpoint( + describeByClass = true + ) + public static AssignSub create(Scope scope, Operand ref, Operand value, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AssignSub"); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(value.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -80,38 +82,89 @@ public static AssignSub create(Scope scope, Operand ref, } } } - return new AssignSub(opBuilder.build()); + return new AssignSub<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the subtraction will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * = Same as "ref". Returned as a convenience for operations that want + * Gets outputRef. + * = Same as "ref". Returned as a convenience for operations that want * to use the new value after the variable has been updated. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AssignSub"; - - private Output outputRef; - - private AssignSub(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.AssignSub} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 dc2ce281c7e..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,45 +17,85 @@ 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; /** * Subtracts a value from the current value of a variable. - *

* 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AssignSubVariableOp"; + + public AssignSubVariableOp(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new AssignSubVariableOp operation. - * + * * @param scope current scope * @param resource handle to the resource in which to store the variable. * @param value the value by which the variable will be incremented. * @return a new instance of AssignSubVariableOp */ - @Endpoint(describeByClass = true) - public static AssignSubVariableOp create(Scope scope, Operand resource, Operand value) { - OperationBuilder opBuilder = scope.env().opBuilder("AssignSubVariableOp", scope.makeOpName("AssignSubVariableOp")); + @Endpoint( + describeByClass = true + ) + public static AssignSubVariableOp create(Scope scope, Operand resource, + Operand value) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AssignSubVariableOp"); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(value.asOutput()); - opBuilder = scope.apply(opBuilder); return new AssignSubVariableOp(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AssignSubVariableOp"; - - private AssignSubVariableOp(Operation operation) { - super(operation); + + @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 4fd1a56a06f..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,45 +17,130 @@ 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; /** * Assigns a new value to a variable. - *

* 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AssignVariableOp"; + + public AssignVariableOp(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new AssignVariableOp 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) { - OperationBuilder opBuilder = scope.env().opBuilder("AssignVariableOp", scope.makeOpName("AssignVariableOp")); + @Endpoint( + describeByClass = true + ) + public static AssignVariableOp create(Scope scope, Operand resource, + Operand value, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AssignVariableOp"); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(value.asOutput()); - opBuilder = scope.apply(opBuilder); + if (options != null) { + for (Options opts : options) { + if (opts.validateShape != null) { + opBuilder.setAttr("validate_shape", opts.validateShape); + } + } + } return new AssignVariableOp(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AssignVariableOp"; - - private AssignVariableOp(Operation operation) { - super(operation); + + /** + * 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 b429cce3084..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. @@ -17,7 +17,9 @@ 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; @@ -25,96 +27,65 @@ 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; /** * Defines a barrier that persists across different graph executions. - *

* A barrier represents a key-value map, where each key is a string, and * each value is a tuple of tensors. - *

- * At runtime, the barrier contains 'complete' and 'incomplete' + *

At runtime, the barrier contains 'complete' and 'incomplete' * elements. A complete element has defined tensors for all components of * its value tuple, and may be accessed using BarrierTakeMany. An * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.Barrier} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param shapes 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 Options shapes(List shapes) { - this.shapes = shapes; - return this; - } - - /** - * @param capacity The capacity of the barrier. The default capacity is MAX_INT32, - * which is the largest capacity of the underlying queue. - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param container If non-empty, this barrier is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this barrier will be shared under the given name - * across multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private List shapes; - private Long capacity; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "Barrier"; + + private Output handle; + + public Barrier(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Barrier operation. - * + * * @param scope current scope * @param componentTypes The type of each component in a value. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Barrier */ - @Endpoint(describeByClass = true) - public static Barrier create(Scope scope, List> componentTypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Barrier", scope.makeOpName("Barrier")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static Barrier create(Scope scope, List> componentTypes, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Barrier"); opBuilder.setAttr("component_types", Operands.toDataTypes(componentTypes)); if (options != null) { for (Options opts : options) { if (opts.shapes != null) { Shape[] shapesArray = new Shape[opts.shapes.size()]; - for (int i = 0; i < shapesArray.length; ++i) { + for (int i = 0 ; i < shapesArray.length ; i++) { shapesArray[i] = opts.shapes.get(i); } opBuilder.setAttr("shapes", shapesArray); @@ -132,60 +103,198 @@ public static Barrier create(Scope scope, List> component } return new Barrier(opBuilder.build()); } - + /** + * Sets the shapes option. + * * @param shapes 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. + * @return this Options instance. */ public static Options shapes(List shapes) { return new Options().shapes(shapes); } - + /** + * Sets the shapes option. + * + * @param shapes 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. + * @return this Options instance. + */ + public static Options shapes(Shape... shapes) { + return new Options().shapes(shapes); + } + + /** + * Sets the capacity option. + * * @param capacity The capacity of the barrier. The default capacity is MAX_INT32, * which is the largest capacity of the underlying queue. + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** + * Sets the container option. + * * @param container If non-empty, this barrier is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this barrier will be shared under the given name * across multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets handle. * The handle to the barrier. + * @return handle. */ public Output handle() { return handle; } - + @Override public Output asOutput() { return handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Barrier"; - - private Output handle; - - private Barrier(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Barrier} + */ + public static class Options { + private List shapes; + + private Long capacity; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the shapes option. + * + * @param shapes 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. + * @return this Options instance. + */ + public Options shapes(List shapes) { + this.shapes = shapes; + return this; + } + + /** + * Sets the shapes option. + * + * @param shapes 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. + * @return this Options instance. + */ + public Options shapes(Shape... shapes) { + this.shapes = Arrays.asList(shapes); + return this; + } + + /** + * Sets the capacity option. + * + * @param capacity The capacity of the barrier. The default capacity is MAX_INT32, + * which is the largest capacity of the underlying queue. + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the container option. + * + * @param container If non-empty, this barrier is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this barrier will be shared under the given name + * across multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = 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 6cb3ba70661..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,18 +17,22 @@ 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; /** * Closes the given barrier. - *

* This operation signals that no more new elements will be inserted in the * given barrier. Subsequent InsertMany that try to introduce a new key will fail. * Subsequent InsertMany operations that just add missing components to already @@ -36,43 +40,35 @@ * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.BarrierClose} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param cancelPendingEnqueues 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 Options cancelPendingEnqueues(Boolean cancelPendingEnqueues) { - this.cancelPendingEnqueues = cancelPendingEnqueues; - return this; - } - - private Boolean cancelPendingEnqueues; - - private Options() { - } + public static final String OP_NAME = "BarrierClose"; + + public BarrierClose(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new BarrierClose operation. - * + * * @param scope current scope * @param handle The handle to a barrier. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of BarrierClose */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BarrierClose create(Scope scope, Operand handle, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("BarrierClose", scope.makeOpName("BarrierClose")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BarrierClose"); opBuilder.addInput(handle.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.cancelPendingEnqueues != null) { @@ -82,20 +78,63 @@ public static BarrierClose create(Scope scope, Operand handle, Options. } return new BarrierClose(opBuilder.build()); } - + /** + * Sets the cancelPendingEnqueues option. + * * @param cancelPendingEnqueues 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. + * @return this Options instance. */ public static Options cancelPendingEnqueues(Boolean cancelPendingEnqueues) { return new Options().cancelPendingEnqueues(cancelPendingEnqueues); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BarrierClose"; - - private BarrierClose(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.BarrierClose} + */ + public static class Options { + private Boolean cancelPendingEnqueues; + + private Options() { + } + + /** + * Sets the cancelPendingEnqueues option. + * + * @param cancelPendingEnqueues 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. + * @return this Options instance. + */ + public Options cancelPendingEnqueues(Boolean cancelPendingEnqueues) { + this.cancelPendingEnqueues = 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 e7775646c69..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,45 +36,69 @@ /** * 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BarrierIncompleteSize"; + + private Output output; + + public BarrierIncompleteSize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BarrierIncompleteSize operation. - * + * * @param scope current scope * @param handle The handle to a barrier. * @return a new instance of BarrierIncompleteSize */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BarrierIncompleteSize create(Scope scope, Operand handle) { - OperationBuilder opBuilder = scope.env().opBuilder("BarrierIncompleteSize", scope.makeOpName("BarrierIncompleteSize")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BarrierIncompleteSize"); opBuilder.addInput(handle.asOutput()); - opBuilder = scope.apply(opBuilder); return new BarrierIncompleteSize(opBuilder.build()); } - + /** + * Gets output. * The number of incomplete elements (i.e. those with some of their value * components not set) in the barrier. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BarrierIncompleteSize"; - - private Output output; - - private BarrierIncompleteSize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 5bd70a0a197..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,30 +17,47 @@ 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; /** * For each key, assigns the respective value to the specified component. - *

* If a key is not found in the barrier, this operation will create a new * incomplete element. If a key is found in the barrier, and the element * 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BarrierInsertMany"; + + public BarrierInsertMany(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new BarrierInsertMany operation. - * + * * @param scope current scope * @param handle The handle to a barrier. * @param keys A one-dimensional tensor of keys, with length n. @@ -49,21 +66,57 @@ public final class BarrierInsertMany extends RawOp { * @param componentIndex The component of the barrier elements that is being assigned. * @return a new instance of BarrierInsertMany */ - @Endpoint(describeByClass = true) - public static BarrierInsertMany create(Scope scope, Operand handle, Operand keys, Operand values, Long componentIndex) { - OperationBuilder opBuilder = scope.env().opBuilder("BarrierInsertMany", scope.makeOpName("BarrierInsertMany")); + @Endpoint( + describeByClass = true + ) + public static BarrierInsertMany create(Scope scope, Operand handle, + Operand keys, Operand values, Long componentIndex) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BarrierInsertMany"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(keys.asOutput()); opBuilder.addInput(values.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("component_index", componentIndex); return new BarrierInsertMany(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BarrierInsertMany"; - - private BarrierInsertMany(Operation operation) { - super(operation); + + @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 61c7412a003..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,45 +36,69 @@ /** * 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BarrierReadySize"; + + private Output output; + + public BarrierReadySize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BarrierReadySize operation. - * + * * @param scope current scope * @param handle The handle to a barrier. * @return a new instance of BarrierReadySize */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BarrierReadySize create(Scope scope, Operand handle) { - OperationBuilder opBuilder = scope.env().opBuilder("BarrierReadySize", scope.makeOpName("BarrierReadySize")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BarrierReadySize"); opBuilder.addInput(handle.asOutput()); - opBuilder = scope.apply(opBuilder); return new BarrierReadySize(opBuilder.build()); } - + /** + * Gets output. * The number of complete elements (i.e. those with all of their value * components set) in the barrier. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BarrierReadySize"; - - private Output output; - - private BarrierReadySize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 4bf16ef62e0..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; @@ -35,75 +40,61 @@ /** * Takes the given number of completed elements from a barrier. - *

* This operation concatenates completed-element component tensors along * the 0th dimension to make a single component tensor. - *

- * Elements come out of the barrier when they are complete, and in the order + *

Elements come out of the barrier when they are complete, and in the order * in which they were placed into the barrier. The indices output provides * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.BarrierTakeMany} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param allowSmallBatch Allow to return less than num_elements items if barrier is - * already closed. - */ - public Options allowSmallBatch(Boolean allowSmallBatch) { - this.allowSmallBatch = allowSmallBatch; - return this; - } - - /** - * @param waitForIncomplete - */ - public Options waitForIncomplete(Boolean waitForIncomplete) { - this.waitForIncomplete = waitForIncomplete; - return this; - } - - /** - * @param timeoutMs If the queue is empty, this operation will block for up to - * timeout_ms milliseconds. - * Note: This option is not supported yet. - */ - public Options timeoutMs(Long timeoutMs) { - this.timeoutMs = timeoutMs; - return this; - } - - private Boolean allowSmallBatch; - private Boolean waitForIncomplete; - private Long timeoutMs; - - private Options() { - } + public static final String OP_NAME = "BarrierTakeMany"; + + private Output indices; + + private Output keys; + + private List> values; + + @SuppressWarnings("unchecked") + public BarrierTakeMany(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + indices = operation.output(outputIdx++); + keys = operation.output(outputIdx++); + int valuesLength = operation.outputListLength("values"); + values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); + outputIdx += valuesLength; } - + /** * Factory method to create a class wrapping a new BarrierTakeMany operation. - * + * * @param scope current scope * @param handle The handle to a barrier. * @param numElements A single-element tensor containing the number of elements to * take. * @param componentTypes The type of each component in a value. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of BarrierTakeMany */ - @Endpoint(describeByClass = true) - public static BarrierTakeMany create(Scope scope, Operand handle, Operand numElements, List> componentTypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("BarrierTakeMany", scope.makeOpName("BarrierTakeMany")); + @Endpoint( + describeByClass = true + ) + public static BarrierTakeMany create(Scope scope, Operand handle, + Operand numElements, List> componentTypes, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BarrierTakeMany"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(numElements.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("component_types", Operands.toDataTypes(componentTypes)); if (options != null) { for (Options opts : options) { @@ -120,69 +111,167 @@ public static BarrierTakeMany create(Scope scope, Operand handle, Opera } return new BarrierTakeMany(opBuilder.build()); } - + /** + * Sets the allowSmallBatch option. + * * @param allowSmallBatch Allow to return less than num_elements items if barrier is * already closed. + * @return this Options instance. */ public static Options allowSmallBatch(Boolean allowSmallBatch) { return new Options().allowSmallBatch(allowSmallBatch); } - + /** - * @param waitForIncomplete + * Sets the waitForIncomplete option. + * + * @param waitForIncomplete the waitForIncomplete option + * @return this Options instance. */ public static Options waitForIncomplete(Boolean waitForIncomplete) { return new Options().waitForIncomplete(waitForIncomplete); } - + /** + * Sets the timeoutMs option. + * * @param timeoutMs If the queue is empty, this operation will block for up to * timeout_ms milliseconds. * Note: This option is not supported yet. + * @return this Options instance. */ public static Options timeoutMs(Long timeoutMs) { return new Options().timeoutMs(timeoutMs); } - + /** + * Gets indices. * A one-dimensional tensor of indices, with length num_elems. * These indices refer to the batch in which the values were placed into the * barrier (starting with MIN_LONG and increasing with each BarrierInsertMany). + * @return indices. */ public Output indices() { return indices; } - + /** + * Gets keys. * A one-dimensional tensor of keys, with length num_elements. + * @return keys. */ public Output keys() { return keys; } - + /** + * Gets values. * One any-dimensional tensor per component in a barrier element. All * values have length num_elements in the 0th dimension. + * @return values. */ public List> values() { return values; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BarrierTakeMany"; - - private Output indices; - private Output keys; - private List> values; - - private BarrierTakeMany(Operation operation) { - super(operation); - int outputIdx = 0; - indices = operation.output(outputIdx++); - keys = operation.output(outputIdx++); - int valuesLength = operation.outputListLength("values"); - values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); - outputIdx += valuesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.core.BarrierTakeMany} + */ + public static class Options { + private Boolean allowSmallBatch; + + private Boolean waitForIncomplete; + + private Long timeoutMs; + + private Options() { + } + + /** + * Sets the allowSmallBatch option. + * + * @param allowSmallBatch Allow to return less than num_elements items if barrier is + * already closed. + * @return this Options instance. + */ + public Options allowSmallBatch(Boolean allowSmallBatch) { + this.allowSmallBatch = allowSmallBatch; + return this; + } + + /** + * Sets the waitForIncomplete option. + * + * @param waitForIncomplete the waitForIncomplete option + * @return this Options instance. + */ + public Options waitForIncomplete(Boolean waitForIncomplete) { + this.waitForIncomplete = waitForIncomplete; + return this; + } + + /** + * Sets the timeoutMs option. + * + * @param timeoutMs If the queue is empty, this operation will block for up to + * timeout_ms milliseconds. + * Note: This option is not supported yet. + * @return this Options instance. + */ + public Options timeoutMs(Long timeoutMs) { + this.timeoutMs = 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 d68ed353822..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,132 +19,103 @@ 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; /** * Batches all input tensors nondeterministically. - *

* When many instances of this Op are being run concurrently with the same * container/shared_name in the same device, some will output zero-shaped Tensors * and others will output Tensors of size up to max_batch_size. - *

- * All Tensors in in_tensors are batched together (so, for example, labels and + *

All Tensors in in_tensors are batched together (so, for example, labels and * features should be batched with a single instance of this operation. - *

- * Each invocation of batch emits an `id` scalar which will be used to identify + *

Each invocation of batch emits an {@code id} scalar which will be used to identify * this particular invocation when doing unbatch or its gradient. - *

- * Each op which emits a non-empty batch will also emit a non-empty batch_index + *

Each op which emits a non-empty batch will also emit a non-empty batch_index * Tensor, which, is a [K, 3] matrix where each row contains the invocation's id, * start, and length of elements of each set of Tensors present in batched_tensors. - *

- * Batched tensors are concatenated along the first dimension, and all tensors in + *

Batched tensors are concatenated along the first dimension, and all tensors in * in_tensors must have the first dimension of the same size. - *

- * in_tensors: The tensors to be batched. + *

in_tensors: The tensors to be batched. * num_batch_threads: Number of scheduling threads for processing batches of work. - * Determines the number of batches processed in parallel. + * Determines the number of batches processed in parallel. * max_batch_size: Batch sizes will never be bigger than this. * batch_timeout_micros: Maximum number of microseconds to wait before outputting - * an incomplete batch. + * an incomplete batch. * allowed_batch_sizes: 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 equal max_batch_size. + * 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 equal max_batch_size. * grad_timeout_micros: The timeout to use for the gradient. See Unbatch. * batched_tensors: Either empty tensors or a batch of concatenated Tensors. * batch_index: If out_tensors is non-empty, has information to invert it. * container: Controls the scope of sharing of this batch. * id: always contains a scalar with a unique ID for this invocation of Batch. * shared_name: 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. + * same container and shared_name will batch their elements together. If left + * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.Batch} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param maxEnqueuedBatches - */ - public Options maxEnqueuedBatches(Long maxEnqueuedBatches) { - this.maxEnqueuedBatches = maxEnqueuedBatches; - return this; - } - - /** - * @param allowedBatchSizes - */ - public Options allowedBatchSizes(List allowedBatchSizes) { - this.allowedBatchSizes = allowedBatchSizes; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param batchingQueue - */ - public Options batchingQueue(String batchingQueue) { - this.batchingQueue = batchingQueue; - return this; - } - - private Long maxEnqueuedBatches; - private List allowedBatchSizes; - private String container; - private String sharedName; - private String batchingQueue; - - private Options() { - } + public static final String OP_NAME = "Batch"; + + private List> batchedTensors; + + private Output batchIndex; + + private Output id; + + @SuppressWarnings("unchecked") + public Batch(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int batchedTensorsLength = operation.outputListLength("batched_tensors"); + batchedTensors = Arrays.asList(operation.outputList(outputIdx, batchedTensorsLength)); + outputIdx += batchedTensorsLength; + batchIndex = operation.output(outputIdx++); + id = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Batch operation. - * + * * @param scope current scope - * @param inTensors - * @param numBatchThreads - * @param maxBatchSize - * @param batchTimeoutMicros - * @param gradTimeoutMicros - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static Batch create(Scope scope, Iterable> inTensors, Long numBatchThreads, Long maxBatchSize, Long batchTimeoutMicros, Long gradTimeoutMicros, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Batch", scope.makeOpName("Batch")); + @Endpoint( + describeByClass = true + ) + public static Batch create(Scope scope, Iterable> inTensors, Long numBatchThreads, + Long maxBatchSize, Long batchTimeoutMicros, Long gradTimeoutMicros, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Batch"); opBuilder.addInputList(Operands.asOutputs(inTensors)); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_batch_threads", numBatchThreads); opBuilder.setAttr("max_batch_size", maxBatchSize); opBuilder.setAttr("batch_timeout_micros", batchTimeoutMicros); @@ -156,7 +127,7 @@ public static Batch create(Scope scope, Iterable> inTensors, Long num } if (opts.allowedBatchSizes != null) { long[] allowedBatchSizesArray = new long[opts.allowedBatchSizes.size()]; - for (int i = 0; i < allowedBatchSizesArray.length; ++i) { + for (int i = 0 ; i < allowedBatchSizesArray.length ; i++) { allowedBatchSizesArray[i] = opts.allowedBatchSizes.get(i); } opBuilder.setAttr("allowed_batch_sizes", allowedBatchSizesArray); @@ -174,74 +145,253 @@ public static Batch create(Scope scope, Iterable> inTensors, Long num } return new Batch(opBuilder.build()); } - + /** - * @param maxEnqueuedBatches + * Sets the maxEnqueuedBatches option. + * + * @param maxEnqueuedBatches the maxEnqueuedBatches option + * @return this Options instance. */ public static Options maxEnqueuedBatches(Long maxEnqueuedBatches) { return new Options().maxEnqueuedBatches(maxEnqueuedBatches); } - + /** - * @param allowedBatchSizes + * Sets the allowedBatchSizes option. + * + * @param allowedBatchSizes the allowedBatchSizes option + * @return this Options instance. */ public static Options allowedBatchSizes(List allowedBatchSizes) { return new Options().allowedBatchSizes(allowedBatchSizes); } - + + /** + * Sets the allowedBatchSizes option. + * + * @param allowedBatchSizes the allowedBatchSizes option + * @return this Options instance. + */ + public static Options allowedBatchSizes(Long... allowedBatchSizes) { + return new Options().allowedBatchSizes(allowedBatchSizes); + } + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * @param batchingQueue + * Sets the batchingQueue option. + * + * @param batchingQueue the batchingQueue option + * @return this Options instance. */ public static Options batchingQueue(String batchingQueue) { return new Options().batchingQueue(batchingQueue); } - + /** + * Gets batchedTensors. + * + * @return batchedTensors. */ public List> batchedTensors() { return batchedTensors; } - + /** + * Gets batchIndex. + * + * @return batchIndex. */ public Output batchIndex() { return batchIndex; } - + /** + * Gets id. + * + * @return id. */ public Output id() { return id; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Batch"; - - private List> batchedTensors; - private Output batchIndex; - private Output id; - - private Batch(Operation operation) { - super(operation); - int outputIdx = 0; - int batchedTensorsLength = operation.outputListLength("batched_tensors"); - batchedTensors = Arrays.asList(operation.outputList(outputIdx, batchedTensorsLength)); - outputIdx += batchedTensorsLength; - batchIndex = operation.output(outputIdx++); - id = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Batch} + */ + public static class Options { + private Long maxEnqueuedBatches; + + private List allowedBatchSizes; + + private String container; + + private String sharedName; + + private String batchingQueue; + + private Options() { + } + + /** + * Sets the maxEnqueuedBatches option. + * + * @param maxEnqueuedBatches the maxEnqueuedBatches option + * @return this Options instance. + */ + public Options maxEnqueuedBatches(Long maxEnqueuedBatches) { + this.maxEnqueuedBatches = maxEnqueuedBatches; + return this; + } + + /** + * Sets the allowedBatchSizes option. + * + * @param allowedBatchSizes the allowedBatchSizes option + * @return this Options instance. + */ + public Options allowedBatchSizes(List allowedBatchSizes) { + this.allowedBatchSizes = allowedBatchSizes; + return this; + } + + /** + * Sets the allowedBatchSizes option. + * + * @param allowedBatchSizes the allowedBatchSizes option + * @return this Options instance. + */ + public Options allowedBatchSizes(Long... allowedBatchSizes) { + this.allowedBatchSizes = Arrays.asList(allowedBatchSizes); + return this; + } + + /** + * 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; + } + + /** + * Sets the batchingQueue option. + * + * @param batchingQueue the batchingQueue option + * @return this Options instance. + */ + public Options batchingQueue(String batchingQueue) { + this.batchingQueue = 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 new file mode 100644 index 00000000000..577f213f47d --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchFunction.java @@ -0,0 +1,686 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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; + +/** + * Batches all the inputs tensors to the computation done by the function. + * So, for example, in the following code + *

+ *
+ * # This input will be captured.
+ * y = tf.placeholder_with_default(1.0, shape=[])
+ *
+ * {@literal @}tf.Defun(tf.float32)
+ * def computation(a):
+ *   return tf.matmul(a, a) + y
+ *
+ * b = gen_batch_ops.batch_function(
+ *         f=computation
+ *         in_tensors=[a],
+ *         captured_tensors=computation.captured_inputs,
+ *         Tout=[o.type for o in computation.definition.signature.output_arg],
+ *         num_batch_threads=1,
+ *         max_batch_size=10,
+ *         batch_timeout_micros=100000,  # 100ms
+ *         allowed_batch_sizes=[3, 10],
+ *         batching_queue="")
+ * 
+ *

If more than one session.run call is simultaneously trying to compute {@code b} + * the values of {@code a} will be gathered, non-deterministically concatenated + * along the first axis, and only one thread will run the computation. + *

Assumes that all arguments of the function are Tensors which will be batched + * along their first dimension. + *

Arguments that are captured, are not batched. The session.run call which does + * the concatenation, will use the values of the captured tensors available to it. + * Therefore, typical uses of captured tensors should involve values which remain + * unchanged across session.run calls. Inference is a good example of this. + *

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> { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchFunction"; + + private List> outTensors; + + @SuppressWarnings("unchecked") + public BatchFunction(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int outTensorsLength = operation.outputListLength("out_tensors"); + outTensors = Arrays.asList(operation.outputList(outputIdx, outTensorsLength)); + outputIdx += outTensorsLength; + } + + /** + * Factory method to create a class wrapping a new BatchFunction operation. + * + * @param scope current scope + * @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 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. + * @param batchTimeoutMicros Maximum number of microseconds to wait before outputting + * an incomplete batch. + * @param Tout the types of the output tensors. + * @param options carries optional attribute values + * @return a new instance of BatchFunction + */ + @Endpoint( + describeByClass = true + ) + public static BatchFunction create(Scope scope, Iterable> inTensors, + Iterable> capturedTensors, ConcreteFunction f, Long numBatchThreads, + Long maxBatchSize, Long batchTimeoutMicros, List> Tout, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchFunction"); + opBuilder.addInputList(Operands.asOutputs(inTensors)); + opBuilder.addInputList(Operands.asOutputs(capturedTensors)); + opBuilder.setAttr("f", f); + opBuilder.setAttr("num_batch_threads", numBatchThreads); + opBuilder.setAttr("max_batch_size", maxBatchSize); + opBuilder.setAttr("batch_timeout_micros", batchTimeoutMicros); + opBuilder.setAttr("Tout", Operands.toDataTypes(Tout)); + if (options != null) { + for (Options opts : options) { + if (opts.maxEnqueuedBatches != null) { + opBuilder.setAttr("max_enqueued_batches", opts.maxEnqueuedBatches); + } + if (opts.allowedBatchSizes != null) { + long[] allowedBatchSizesArray = new long[opts.allowedBatchSizes.size()]; + for (int i = 0 ; i < allowedBatchSizesArray.length ; i++) { + allowedBatchSizesArray[i] = opts.allowedBatchSizes.get(i); + } + opBuilder.setAttr("allowed_batch_sizes", allowedBatchSizesArray); + } + if (opts.container != null) { + opBuilder.setAttr("container", opts.container); + } + if (opts.sharedName != null) { + opBuilder.setAttr("shared_name", opts.sharedName); + } + 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); + } + } + } + return new BatchFunction(opBuilder.build()); + } + + /** + * Sets the maxEnqueuedBatches option. + * + * @param maxEnqueuedBatches Maximum number of batches enqueued. Default: 10. + * @return this Options instance. + */ + public static Options maxEnqueuedBatches(Long maxEnqueuedBatches) { + return new Options().maxEnqueuedBatches(maxEnqueuedBatches); + } + + /** + * Sets the allowedBatchSizes option. + * + * @param 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. + * If enable_large_batch_splitting is false (i.e., large-input-split is not + * enabled) the final entry must equal max_batch_size. + * @return this Options instance. + */ + public static Options allowedBatchSizes(List allowedBatchSizes) { + return new Options().allowedBatchSizes(allowedBatchSizes); + } + + /** + * Sets the allowedBatchSizes option. + * + * @param 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. + * If enable_large_batch_splitting is false (i.e., large-input-split is not + * enabled) the final entry must equal max_batch_size. + * @return this Options instance. + */ + public static Options allowedBatchSizes(Long... allowedBatchSizes) { + return new Options().allowedBatchSizes(allowedBatchSizes); + } + + /** + * Sets the container option. + * + * @param container Controls the scope of sharing of this batch. + * @return this Options instance. + */ + public static Options container(String container) { + return new Options().container(container); + } + + /** + * Sets the sharedName option. + * + * @param sharedName 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. + * @return this Options instance. + */ + public static Options sharedName(String sharedName) { + return new Options().sharedName(sharedName); + } + + /** + * Sets the batchingQueue option. + * + * @param batchingQueue the batchingQueue option + * @return this Options instance. + */ + 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. + * + * @param enableLargeBatchSplitting 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. + * @return this Options instance. + */ + public static Options enableLargeBatchSplitting(Boolean enableLargeBatchSplitting) { + return new Options().enableLargeBatchSplitting(enableLargeBatchSplitting); + } + + /** + * Gets outTensors. + * The output tensors. + * @return outTensors. + */ + public List> outTensors() { + return outTensors; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + public Iterator> iterator() { + return (Iterator) outTensors.iterator(); + } + + /** + * Optional attributes for {@link org.tensorflow.op.core.BatchFunction} + */ + public static class Options { + private Long maxEnqueuedBatches; + + private List allowedBatchSizes; + + private String container; + + private String sharedName; + + 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() { + } + + /** + * Sets the maxEnqueuedBatches option. + * + * @param maxEnqueuedBatches Maximum number of batches enqueued. Default: 10. + * @return this Options instance. + */ + public Options maxEnqueuedBatches(Long maxEnqueuedBatches) { + this.maxEnqueuedBatches = maxEnqueuedBatches; + return this; + } + + /** + * Sets the allowedBatchSizes option. + * + * @param 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. + * If enable_large_batch_splitting is false (i.e., large-input-split is not + * enabled) the final entry must equal max_batch_size. + * @return this Options instance. + */ + public Options allowedBatchSizes(List allowedBatchSizes) { + this.allowedBatchSizes = allowedBatchSizes; + return this; + } + + /** + * Sets the allowedBatchSizes option. + * + * @param 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. + * If enable_large_batch_splitting is false (i.e., large-input-split is not + * enabled) the final entry must equal max_batch_size. + * @return this Options instance. + */ + public Options allowedBatchSizes(Long... allowedBatchSizes) { + this.allowedBatchSizes = Arrays.asList(allowedBatchSizes); + return this; + } + + /** + * Sets the container option. + * + * @param container Controls the scope of sharing of this batch. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName 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. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the batchingQueue option. + * + * @param batchingQueue the batchingQueue option + * @return this Options instance. + */ + public Options batchingQueue(String batchingQueue) { + this.batchingQueue = 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. + * + * @param enableLargeBatchSplitting 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. + * @return this Options instance. + */ + public Options enableLargeBatchSplitting(Boolean enableLargeBatchSplitting) { + this.enableLargeBatchSplitting = 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 bf5100836e8..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,131 +17,187 @@ 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; /** * BatchToSpace for 4-D tensors of type T. - *

* This is a legacy version of the more general BatchToSpaceND. - *

- * Rearranges (permutes) data from batch into blocks of spatial data, followed by + *

Rearranges (permutes) data from batch into blocks of spatial data, followed by * cropping. This is the reverse transformation of SpaceToBatch. More specifically, - * this op outputs a copy of the input tensor where values from the `batch` - * dimension are moved in spatial blocks to the `height` and `width` dimensions, - * followed by cropping along the `height` and `width` dimensions. - * - * @param data type for {@code output()} output + * 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. */ +@OpMetadata( + opType = BatchToSpace.OP_NAME, + inputsClass = BatchToSpace.Inputs.class +) @Operator public final class BatchToSpace extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchToSpace"; + + private Output output; + + public BatchToSpace(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BatchToSpace operation. - * + * * @param scope current scope * @param input 4-D tensor with shape - * `[batchblock_sizeblock_size, height_pad/block_size, width_pad/block_size, - * depth]`. Note that the batch size of the input tensor must be divisible by - * `block_size * block_size`. - * @param crops 2-D tensor of non-negative integers with shape `[2, 2]`. It specifies + * {@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}. + * @param crops 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]] - * @param blockSize + *

+   * crops = [[crop_top, crop_bottom], [crop_left, crop_right]]
+   * 
+ * @param blockSize The value of the blockSize attribute + * @param data type for {@code BatchToSpace} output and operands * @return a new instance of BatchToSpace */ - @Endpoint(describeByClass = true) - public static BatchToSpace create(Scope scope, Operand input, Operand crops, Long blockSize) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchToSpace", scope.makeOpName("BatchToSpace")); + @Endpoint( + describeByClass = true + ) + public static BatchToSpace create(Scope scope, Operand input, + Operand crops, Long blockSize) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchToSpace"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(crops.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("block_size", blockSize); - return new BatchToSpace(opBuilder.build()); + return new BatchToSpace<>(opBuilder.build()); } - + /** - * 4-D with shape `[batch, height, width, depth]`, where: - *

- * height = height_pad - crop_top - crop_bottom - * width = width_pad - crop_left - crop_right - *

- * The attr `block_size` must be greater than one. It indicates the block size. - *

- * Some examples: - *

- * (1) For the following input of shape `[4, 1, 1, 1]` and block_size of 2: - *

{@code
+   * Gets output.
+   * 4-D with shape {@code [batch, height, width, depth]}, where:
+   * 
+   *   height = height_pad - crop_top - crop_bottom
+   *   width = width_pad - crop_left - crop_right
+   * 
+ *

The attr {@code block_size} must be greater than one. It indicates the block size. + *

Some examples: + *

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

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

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

    * x = [[[[1], [2]], [[3], [4]]]]
-   * }
- * (2) For the following input of shape `[4, 1, 1, 3]` and block_size of 2: - *
{@code
+   * 
+ *

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

    * [[[[1, 2, 3]]], [[[4, 5, 6]]], [[[7, 8, 9]]], [[[10, 11, 12]]]]
-   * }
- * The output tensor has shape `[1, 2, 2, 3]` and value: - *
{@code
+   * 
+ *

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 `[4, 2, 2, 1]` and block_size of 2: - *
{@code
+   * 
+ *

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

    * x = [[[[1], [3]], [[9], [11]]],
    *      [[[2], [4]], [[10], [12]]],
    *      [[[5], [7]], [[13], [15]]],
    *      [[[6], [8]], [[14], [16]]]]
-   * }
- * The output tensor has shape `[1, 4, 4, 1]` and value: - *
{@code
+   * 
+ *

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 `[8, 1, 2, 1]` and block_size of 2: - *
{@code
+   * 
+ *

(4) For the following input of shape {@code [8, 1, 2, 1]} and block_size of 2: + *

    * x = [[[[1], [3]]], [[[9], [11]]], [[[2], [4]]], [[[10], [12]]],
    *      [[[5], [7]]], [[[13], [15]]], [[[6], [8]]], [[[14], [16]]]]
-   * }
- * The output tensor has shape `[2, 2, 4, 1]` and value: - *
{@code
+   * 
+ *

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

    * x = [[[[1], [3]], [[5], [7]]],
    *      [[[2], [4]], [[10], [12]]],
    *      [[[5], [7]], [[13], [15]]],
    *      [[[6], [8]], [[14], [16]]]]
-   * }
- * + *
+ * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchToSpace"; - - private Output output; - - private BatchToSpace(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 1890b0e5d54..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,165 +17,312 @@ 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; /** * BatchToSpace for N-D tensors of type T. - *

- * This operation reshapes the "batch" dimension 0 into `M + 1` dimensions of shape - * `block_shape + [batch]`, interleaves these blocks back into the grid defined by - * the spatial dimensions `[1, ..., M]`, to obtain a result with the same rank as + * This operation reshapes the "batch" dimension 0 into {@code M + 1} dimensions of shape + * {@code block_shape + [batch]}, interleaves these blocks back into the grid defined by + * the spatial dimensions {@code [1, ..., M]}, to obtain a result with the same rank as * the input. The spatial dimensions of this intermediate result are then - * optionally cropped according to `crops` to produce the output. This is the + * 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 { - /** - * Factory method to create a class wrapping a new BatchToSpaceNd operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchToSpaceND"; + + private Output output; + + public BatchToSpaceNd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new BatchToSpaceND operation. + * * @param scope current scope - * @param input N-D with shape `input_shape = [batch] + spatial_shape + remaining_shape`, + * @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 `[M]`, all values must be >= 1. - * @param crops 2-D with shape `[M, 2]`, all values must be >= 0. - * `crops[i] = [crop_start, crop_end]` specifies the amount to crop from input - * dimension `i + 1`, which corresponds to spatial dimension `i`. It is - * required that - * `crop_start[i] + crop_end[i] <= block_shape[i] * input_shape[i + 1]`. - *

- * This operation is equivalent to the following steps: - *

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

- * 2. Permute dimensions of `reshaped` to produce `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]] - *

- * 3. Reshape `permuted` to produce `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]] - *

- * 4. Crop the start and end of dimensions `[1, ..., M]` of - * `reshaped_permuted` according to `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]] - *

- * Some examples: - *

- * (1) For the following input of shape `[4, 1, 1, 1]`, `block_shape = [2, 2]`, and - * `crops = [[0, 0], [0, 0]]`: - *

{@code
+   * @param blockShape 1-D with shape {@code [M]}, all values must be >= 1.
+   * @param crops 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 `[1, 2, 2, 1]` and value: - *
{@code
+   * 
+ *

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

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

(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 `[1, 2, 2, 3]` and value: - *
{@code
+   * 
+ *

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 `[4, 2, 2, 1]`, `block_shape = [2, 2]`, and - * `crops = [[0, 0], [0, 0]]`: - *
{@code
+   * 
+ *

(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 `[1, 4, 4, 1]` and value: - *
{@code
+   * 
+ *

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 `[8, 1, 3, 1]`, `block_shape = [2, 2]`, and - * `crops = [[0, 0], [2, 0]]`: - *
{@code
+   * 
+ *

(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 `[2, 2, 4, 1]` and value: - *
{@code
+   * 
+ *

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]]]]
-   * }
- * + *
+ * @param data type for {@code BatchToSpaceND} output and operands * @return a new instance of BatchToSpaceNd */ - @Endpoint(describeByClass = true) - public static BatchToSpaceNd create(Scope scope, Operand input, Operand blockShape, Operand crops) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchToSpaceND", scope.makeOpName("BatchToSpaceNd")); + @Endpoint( + describeByClass = true + ) + public static BatchToSpaceNd create(Scope scope, Operand input, + Operand blockShape, Operand crops) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchToSpaceNd"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(blockShape.asOutput()); opBuilder.addInput(crops.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BatchToSpaceNd(opBuilder.build()); + return new BatchToSpaceNd<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchToSpaceND"; - - private Output output; - - private BatchToSpaceNd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 e9176b8dd99..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,112 +17,164 @@ 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; /** * Bitcasts a tensor from one type to another without copying data. - *

- * Given a tensor `input`, this operation returns a tensor that has the same buffer - * data as `input` with datatype `type`. - *

- * If the input datatype `T` is larger than the output datatype `type` then the - * shape changes from [...] to [..., sizeof(`T`)/sizeof(`type`)]. - *

- * If `T` is smaller than `type`, the operator requires that the rightmost - * dimension be equal to sizeof(`type`)/sizeof(`T`). The shape then goes from - * [..., sizeof(`type`)/sizeof(`T`)] to [...]. - *

- * tf.bitcast() and tf.cast() work differently when real dtype is casted as a complex dtype + * Given a tensor {@code input}, this operation returns a tensor that has the same buffer + * data as {@code input} with datatype {@code type}. + *

If the input datatype {@code T} is larger than the output datatype {@code type} then the + * shape changes from [...] to [..., sizeof({@code T})/sizeof({@code type})]. + *

If {@code T} is smaller than {@code type}, the operator requires that the rightmost + * dimension be equal to sizeof({@code type})/sizeof({@code T}). The shape then goes from + * [..., sizeof({@code type})/sizeof({@code T})] to [...]. + *

tf.bitcast() and tf.cast() work differently when real dtype is casted as a complex dtype * (e.g. tf.complex64 or tf.complex128) as tf.cast() make imaginary part 0 while tf.bitcast() * gives module error. * For example, - *

- * Example 1: - *

- * >>> a = [1., 2., 3.] - * >>> equality_bitcast = tf.bitcast(a, tf.complex128) + *

Example 1: + *

+ *
+ *
+ *

a = [1., 2., 3.] + * equality_bitcast = tf.bitcast(a, tf.complex128) * Traceback (most recent call last): * ... * InvalidArgumentError: Cannot bitcast from 1 to 18 [Op:Bitcast] - * >>> equality_cast = tf.cast(a, tf.complex128) - * >>> print(equality_cast) + * equality_cast = tf.cast(a, tf.complex128) + * print(equality_cast) * tf.Tensor([1.+0.j 2.+0.j 3.+0.j], shape=(3,), dtype=complex128) - *

- * Example 2: - *

- * >>> tf.bitcast(tf.constant(0xffffffff, dtype=tf.uint32), tf.uint8) - * - *

- * Example 3: - *

- * >>> x = [1., 2., 3.] - * >>> y = [0., 2., 3.] - * >>> equality= tf.equal(x,y) - * >>> equality_cast = tf.cast(equality,tf.float32) - * >>> equality_bitcast = tf.bitcast(equality_cast,tf.uint8) - * >>> print(equality) + *

+ *
+ *
+ *

Example 2: + *

+ *
+ *
+ *

tf.bitcast(tf.constant(0xffffffff, dtype=tf.uint32), tf.uint8) + * <tf.Tensor: shape=(4,), dtype=uint8, numpy=array([255, 255, 255, 255], dtype=uint8)> + *

+ *
+ *
+ *

Example 3: + *

+ *
+ *
+ *

x = [1., 2., 3.] + * y = [0., 2., 3.] + * equality= tf.equal(x,y) + * equality_cast = tf.cast(equality,tf.float32) + * equality_bitcast = tf.bitcast(equality_cast,tf.uint8) + * print(equality) * tf.Tensor([False True True], shape=(3,), dtype=bool) - * >>> print(equality_cast) + * print(equality_cast) * tf.Tensor([0. 1. 1.], shape=(3,), dtype=float32) - * >>> print(equality_bitcast) + * print(equality_bitcast) * tf.Tensor( - * [[ 0 0 0 0] - * [ 0 0 128 63] - * [ 0 0 128 63]], shape=(3, 4), dtype=uint8) - *

- * 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 + * [[ 0 0 0 0] + * [ 0 0 128 63] + * [ 0 0 128 63]], shape=(3, 4), dtype=uint8) + *

+ *
+ *
+ *

NOTE: Bitcast is implemented as a low-level cast, so machines with different + * 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Bitcast"; + + private Output output; + + public Bitcast(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Bitcast operation. - * + * * @param scope current scope - * @param input - * @param type + * @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 */ - @Endpoint(describeByClass = true) - public static Bitcast create(Scope scope, Operand input, Class type) { - OperationBuilder opBuilder = scope.env().opBuilder("Bitcast", scope.makeOpName("Bitcast")); + @Endpoint( + describeByClass = true + ) + public static Bitcast create(Scope scope, Operand input, + Class type) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Bitcast"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("type", Operands.toDataType(type)); - return new Bitcast(opBuilder.build()); + return new Bitcast<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Bitcast"; - - private Output output; - - private Bitcast(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 91611ab6888..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,63 +17,105 @@ 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 `s0` and `s1`, tensors that represent shapes, compute `r0`, the - * broadcasted shape. `s0`, `s1` and `r0` are all integer vectors. - * - * @param data type for {@code r0()} output + * 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. */ +@OpMetadata( + opType = BroadcastDynamicShape.OP_NAME, + inputsClass = BroadcastDynamicShape.Inputs.class +) @Operator public final class BroadcastDynamicShape extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new BroadcastDynamicShape operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BroadcastArgs"; + + private Output r0; + + public BroadcastDynamicShape(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + r0 = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new BroadcastArgs operation. + * * @param scope current scope - * @param s0 - * @param s1 + * @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 */ - @Endpoint(describeByClass = true) - public static BroadcastDynamicShape create(Scope scope, Operand s0, Operand s1) { - OperationBuilder opBuilder = scope.env().opBuilder("BroadcastArgs", scope.makeOpName("BroadcastDynamicShape")); + @Endpoint( + describeByClass = true + ) + public static BroadcastDynamicShape create(Scope scope, Operand s0, + Operand s1) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BroadcastDynamicShape"); opBuilder.addInput(s0.asOutput()); opBuilder.addInput(s1.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BroadcastDynamicShape(opBuilder.build()); + return new BroadcastDynamicShape<>(opBuilder.build()); } - + /** + * Gets r0. + * + * @return r0. */ public Output r0() { return r0; } - + @Override public Output asOutput() { return r0; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BroadcastArgs"; - - private Output r0; - - private BroadcastDynamicShape(Operation operation) { - super(operation); - int outputIdx = 0; - r0 = operation.output(outputIdx++); + + @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 8aa19f97259..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,64 +17,111 @@ 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 + */ + public static final String OP_NAME = "BroadcastGradientArgs"; + + private Output r0; + + private Output r1; + + public BroadcastGradientArgs(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + r0 = operation.output(outputIdx++); + r1 = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BroadcastGradientArgs operation. - * + * * @param scope current scope - * @param s0 - * @param s1 + * @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 */ - @Endpoint(describeByClass = true) - public static BroadcastGradientArgs create(Scope scope, Operand s0, Operand s1) { - OperationBuilder opBuilder = scope.env().opBuilder("BroadcastGradientArgs", scope.makeOpName("BroadcastGradientArgs")); + @Endpoint( + describeByClass = true + ) + public static BroadcastGradientArgs create(Scope scope, Operand s0, + Operand s1) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BroadcastGradientArgs"); opBuilder.addInput(s0.asOutput()); opBuilder.addInput(s1.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BroadcastGradientArgs(opBuilder.build()); + return new BroadcastGradientArgs<>(opBuilder.build()); } - + /** + * Gets r0. + * + * @return r0. */ public Output r0() { return r0; } - + /** + * Gets r1. + * + * @return r1. */ public Output r1() { return r1; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BroadcastGradientArgs"; - - private Output r0; - private Output r1; - - private BroadcastGradientArgs(Operation operation) { - super(operation); - int outputIdx = 0; - r0 = operation.output(outputIdx++); - r1 = operation.output(outputIdx++); + + @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 5cdf860d611..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,90 +17,146 @@ 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; /** * 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, - *

- * >>> x = tf.constant([1, 2, 3]) - * >>> y = tf.broadcast_to(x, [3, 3]) - * >>> print(y) + * dimension pair they are either equal or one of them is one. + *

For example: + *

+ *
+ *
+ *

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) - *

- * In the above example, the input Tensor with the shape of `[1, 3]` - * is broadcasted to output Tensor with shape of `[3, 3]`. - *

- * When doing broadcasted operations such as multiplying a tensor + * [[1 2 3] + * [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 [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. - *

- * However, `broadcast_to` does not carry with it any such benefits. + *

However, {@code broadcast_to} does not carry with it any such benefits. * The newly-created tensor takes the full memory of the broadcasted - * shape. (In a graph context, `broadcast_to` might be fused to + * 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BroadcastTo"; + + private Output output; + + public BroadcastTo(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BroadcastTo operation. - * + * * @param scope current scope * @param input A Tensor to broadcast. - * @param shape An 1-D `int` Tensor. The shape of the desired output. + * @param shape An 1-D {@code int} Tensor. The shape of the desired output. + * @param data type for {@code BroadcastTo} output and operands * @return a new instance of BroadcastTo */ - @Endpoint(describeByClass = true) - public static BroadcastTo create(Scope scope, Operand input, Operand shape) { - OperationBuilder opBuilder = scope.env().opBuilder("BroadcastTo", scope.makeOpName("BroadcastTo")); + @Endpoint( + describeByClass = true + ) + public static BroadcastTo create(Scope scope, Operand input, + Operand shape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BroadcastTo"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(shape.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BroadcastTo(opBuilder.build()); + return new BroadcastTo<>(opBuilder.build()); } - + /** + * Gets output. * A Tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BroadcastTo"; - - private Output output; - - private BroadcastTo(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 355c7b7a46e..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,80 +17,120 @@ 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; /** * Bucketizes 'input' based on 'boundaries'. - *

* For example, if the inputs are - * boundaries = [0, 10, 100] - * input = [[-5, 10000] - * [150, 10] - * [5, 100]] - *

- * then the output will be - * output = [[0, 3] - * [3, 2] - * [1, 3]] + * boundaries = [0, 10, 100] + * input = [[-5, 10000] + * [150, 10] + * [5, 100]] + *

then the output will be + * output = [[0, 3] + * [3, 2] + * [1, 3]] */ +@OpMetadata( + opType = Bucketize.OP_NAME, + inputsClass = Bucketize.Inputs.class +) @Operator public final class Bucketize extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Bucketize"; + + private Output output; + + public Bucketize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Bucketize operation. - * + * * @param scope current scope * @param input Any shape of Tensor contains with int or float type. * @param boundaries A sorted list of floats gives the boundary of the buckets. * @return a new instance of Bucketize */ - @Endpoint(describeByClass = true) - public static Bucketize create(Scope scope, Operand input, List boundaries) { - OperationBuilder opBuilder = scope.env().opBuilder("Bucketize", scope.makeOpName("Bucketize")); + @Endpoint( + describeByClass = true + ) + public static Bucketize create(Scope scope, Operand input, + List boundaries) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Bucketize"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); float[] boundariesArray = new float[boundaries.size()]; - for (int i = 0; i < boundariesArray.length; ++i) { + for (int i = 0 ; i < boundariesArray.length ; i++) { boundariesArray[i] = boundaries.get(i); } opBuilder.setAttr("boundaries", boundariesArray); return new Bucketize(opBuilder.build()); } - + /** + * Gets output. * Same shape with 'input', each value of input replaced with bucket index. - *

- * @compatibility(numpy) + *

{@literal @}compatibility(numpy)
* Equivalent to np.digitize. - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Bucketize"; - - private Output output; - - private Bucketize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 new file mode 100644 index 00000000000..7fbdce56dda --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Case.java @@ -0,0 +1,151 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.Output; +import org.tensorflow.ndarray.Shape; +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; + +/** + * 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;
+ * }
+ * ```
+ * 
+ * + *

Selects between {@link StatefulCase} and {@link StatelessCase} based on the statefulness of the function arguments. + */ +@Operator +public interface Case extends Iterable> { + /** + * Factory method to create a class wrapping a new Case operation. + * + * @param scope current scope + * @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 Case + */ + @Endpoint( + describeByClass = true, + name = "caseOp" + ) + static Case create(Scope scope, Operand branchIndex, Iterable> input, + List> Tout, List branches, Options... options) { + boolean isStateful = false; + if (branches.stream().anyMatch(x -> x.isStateful())) { + isStateful = true; + } + if (isStateful) { + return StatefulCase.create(scope, branchIndex, input, Tout, branches, options); + } else { + return StatelessCase.create(scope, branchIndex, input, Tout, branches, options); + } + } + + /** + * Sets the outputShapes option. + * + * @param outputShapes the outputShapes option + * @return this Options instance. + */ + static Options outputShapes(List outputShapes) { + return new Options().outputShapes(outputShapes); + } + + /** + * Sets the outputShapes option. + * + * @param outputShapes the outputShapes option + * @return this Options instance. + */ + static Options outputShapes(Shape... outputShapes) { + return new Options().outputShapes(outputShapes); + } + + /** + * Gets output. + * A list of return values. + * @return output. + */ + List> output(); + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + Iterator> iterator(); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Case} + */ + class Options { + List outputShapes; + + 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; + } + } +} 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 97740997852..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,70 +17,119 @@ 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; /** * Clips tensor values to a specified min and max. - *

- * Given a tensor `t`, this operation returns a tensor of the same type and - * shape as `t` with its values clipped to `clip_value_min` and `clip_value_max`. - * Any values less than `clip_value_min` are set to `clip_value_min`. Any values - * greater than `clip_value_max` are set to `clip_value_max`. - * - * @param data type for {@code output()} output + * Given a tensor {@code t}, this operation returns a tensor of the same type and + * 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}. */ +@OpMetadata( + opType = ClipByValue.OP_NAME, + inputsClass = ClipByValue.Inputs.class +) @Operator public final class ClipByValue extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ClipByValue"; + + private Output output; + + public ClipByValue(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ClipByValue operation. - * + * * @param scope current scope - * @param t A `Tensor`. - * @param clipValueMin A 0-D (scalar) `Tensor`, or a `Tensor` with the same shape - * as `t`. The minimum value to clip by. - * @param clipValueMax A 0-D (scalar) `Tensor`, or a `Tensor` with the same shape - * as `t`. The maximum value to clip by. + * @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. + * @param clipValueMax A 0-D (scalar) {@code Tensor}, or a {@code Tensor} with the same shape + * as {@code t}. The maximum value to clip by. + * @param data type for {@code ClipByValue} output and operands * @return a new instance of ClipByValue */ - @Endpoint(describeByClass = true) - public static ClipByValue create(Scope scope, Operand t, Operand clipValueMin, Operand clipValueMax) { - OperationBuilder opBuilder = scope.env().opBuilder("ClipByValue", scope.makeOpName("ClipByValue")); + @Endpoint( + describeByClass = true + ) + public static ClipByValue create(Scope scope, Operand t, + Operand clipValueMin, Operand clipValueMax) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ClipByValue"); opBuilder.addInput(t.asOutput()); opBuilder.addInput(clipValueMin.asOutput()); opBuilder.addInput(clipValueMax.asOutput()); - opBuilder = scope.apply(opBuilder); - return new ClipByValue(opBuilder.build()); + return new ClipByValue<>(opBuilder.build()); } - + /** - * A clipped `Tensor` with the same shape as input 't'. + * Gets output. + * A clipped {@code Tensor} with the same shape as input 't'. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ClipByValue"; - - private Output output; - - private ClipByValue(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 97fbec16aaf..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CollectiveGather.java +++ /dev/null @@ -1,135 +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.op.annotation.Operator; -import org.tensorflow.types.family.TNumber; - -/** - * Mutually accumulates multiple tensors of identical type and shape. - * - * @param data type for {@code data()} output - */ -public final class CollectiveGather extends RawOp implements Operand { - - /** - * Optional attributes for {@link org.tensorflow.op.core.CollectiveGather} - */ - public static class Options { - - /** - * @param communicationHint - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * @param timeoutSeconds - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - - private String communicationHint; - private Float timeoutSeconds; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new CollectiveGather operation. - * - * @param scope current scope - * @param input - * @param groupSize - * @param groupKey - * @param instanceKey - * @param shape - * @param options carries optional attributes values - * @return a new instance of 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.env().opBuilder("CollectiveGather", scope.makeOpName("CollectiveGather")); - opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("group_size", groupSize); - opBuilder.setAttr("group_key", groupKey); - opBuilder.setAttr("instance_key", instanceKey); - opBuilder.setAttr("shape", shape); - if (options != null) { - for (Options opts : options) { - if (opts.communicationHint != null) { - opBuilder.setAttr("communication_hint", opts.communicationHint); - } - if (opts.timeoutSeconds != null) { - opBuilder.setAttr("timeout_seconds", opts.timeoutSeconds); - } - } - } - return new CollectiveGather(opBuilder.build()); - } - - /** - * @param communicationHint - */ - public static Options communicationHint(String communicationHint) { - return new Options().communicationHint(communicationHint); - } - - /** - * @param timeoutSeconds - */ - public static Options timeoutSeconds(Float timeoutSeconds) { - return new Options().timeoutSeconds(timeoutSeconds); - } - - /** - */ - public Output data() { - return data; - } - - @Override - public Output asOutput() { - return data; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CollectiveGather"; - - private Output data; - - private CollectiveGather(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CompositeTensorVariantFromComponents.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CompositeTensorVariantFromComponents.java new file mode 100644 index 00000000000..bc5322574d7 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CompositeTensorVariantFromComponents.java @@ -0,0 +1,127 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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; + +/** + * 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. + */ +@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 + */ + public static final String OP_NAME = "CompositeTensorVariantFromComponents"; + + private Output encoded; + + @SuppressWarnings("unchecked") + public CompositeTensorVariantFromComponents(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + encoded = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new CompositeTensorVariantFromComponents operation. + * + * @param scope current scope + * @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 + */ + @Endpoint( + describeByClass = true + ) + public static CompositeTensorVariantFromComponents create(Scope scope, + Iterable> components, String metadata) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CompositeTensorVariantFromComponents"); + opBuilder.addInputList(Operands.asOutputs(components)); + opBuilder.setAttr("metadata", metadata); + return new CompositeTensorVariantFromComponents(opBuilder.build()); + } + + /** + * Gets encoded. + * A {@code variant} Tensor that containing the encoded value. + * @return encoded. + */ + public Output encoded() { + return encoded; + } + + @Override + @SuppressWarnings("unchecked") + 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 new file mode 100644 index 00000000000..e8288c59607 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CompositeTensorVariantToComponents.java @@ -0,0 +1,134 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.family.TType; + +/** + * 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}. + */ +@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 + */ + public static final String OP_NAME = "CompositeTensorVariantToComponents"; + + private List> components; + + @SuppressWarnings("unchecked") + public CompositeTensorVariantToComponents(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 CompositeTensorVariantToComponents operation. + * + * @param scope current scope + * @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 + */ + @Endpoint( + describeByClass = true + ) + public static CompositeTensorVariantToComponents create(Scope scope, + Operand encoded, String metadata, List> Tcomponents) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CompositeTensorVariantToComponents"); + opBuilder.addInput(encoded.asOutput()); + opBuilder.setAttr("metadata", metadata); + opBuilder.setAttr("Tcomponents", Operands.toDataTypes(Tcomponents)); + return new CompositeTensorVariantToComponents(opBuilder.build()); + } + + /** + * Gets components. + * The component tensors for the ExtensionType value in {@code encoded}. + * @return components. + */ + public List> components() { + return components; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + 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 279ae8e4b2f..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,67 +17,119 @@ 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 { - /** - * Factory method to create a class wrapping a new Concat operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ConcatV2"; + + private Output output; + + public Concat(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ConcatV2 operation. + * * @param scope current scope - * @param values List of `N` Tensors to concatenate. Their ranks and types must match, - * and their sizes must match in all dimensions except `concat_dim`. + * @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 * range [-rank(values), rank(values)). + * @param data type for {@code ConcatV2} output and operands * @return a new instance of Concat */ - @Endpoint(describeByClass = true) - public static Concat create(Scope scope, Iterable> values, Operand axis) { - OperationBuilder opBuilder = scope.env().opBuilder("ConcatV2", scope.makeOpName("Concat")); + @Endpoint( + describeByClass = true + ) + public static Concat create(Scope scope, Iterable> values, + Operand axis) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Concat"); opBuilder.addInputList(Operands.asOutputs(values)); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Concat(opBuilder.build()); + return new Concat<>(opBuilder.build()); } - + /** - * A `Tensor` with the concatenation of values stacked along the - * `concat_dim` dimension. This tensor's shape matches that of `values` except - * in `concat_dim` where it has the sum of the sizes. + * Gets output. + * A {@code Tensor} with the concatenation of values stacked along the + * {@code concat_dim} dimension. This tensor's shape matches that of {@code values} except + * in {@code concat_dim} where it has the sum of the sizes. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ConcatV2"; - - private Output output; - - private Concat(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 13f4905076b..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,47 +17,73 @@ 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; /** - * This op consumes a lock created by `MutexLock`. - *

- * This op exists to consume a tensor created by `MutexLock` (other than + * This op consumes a lock created by {@code MutexLock}. + * This op exists to consume a tensor created by {@code MutexLock} (other than * direct control dependencies). It should be the only that consumes the tensor, * and will raise an error if it is not. Its only purpose is to keep the * mutex lock tensor alive until it is consumed by this op. - *

- * NOTE: This operation must run on the same device as its input. This may - * be enforced via the `colocate_with` mechanism. + *

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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ConsumeMutexLock"; + + public ConsumeMutexLock(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new ConsumeMutexLock operation. - * + * * @param scope current scope - * @param mutexLock A tensor returned by `MutexLock`. + * @param mutexLock A tensor returned by {@code MutexLock}. * @return a new instance of ConsumeMutexLock */ - @Endpoint(describeByClass = true) - public static ConsumeMutexLock create(Scope scope, Operand mutexLock) { - OperationBuilder opBuilder = scope.env().opBuilder("ConsumeMutexLock", scope.makeOpName("ConsumeMutexLock")); + @Endpoint( + describeByClass = true + ) + public static ConsumeMutexLock create(Scope scope, Operand mutexLock) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ConsumeMutexLock"); opBuilder.addInput(mutexLock.asOutput()); - opBuilder = scope.apply(opBuilder); return new ConsumeMutexLock(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ConsumeMutexLock"; - - private ConsumeMutexLock(Operation operation) { - super(operation); + + @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 fa1281f84fa..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,38 +17,58 @@ 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ControlTrigger"; + + public ControlTrigger(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new ControlTrigger operation. - * + * * @param scope current scope * @return a new instance of ControlTrigger */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ControlTrigger create(Scope scope) { - OperationBuilder opBuilder = scope.env().opBuilder("ControlTrigger", scope.makeOpName("ControlTrigger")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ControlTrigger"); return new ControlTrigger(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ControlTrigger"; - - private ControlTrigger(Operation operation) { - super(operation); + + @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 7a314be7993..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. @@ -17,78 +17,66 @@ 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.Operator; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Copy a tensor from CPU-to-CPU or GPU-to-GPU. - *

* Performs CPU-to-CPU or GPU-to-GPU deep-copying of tensor, depending on the * device on which the tensor is allocated. * N.B.: If the all downstream attached debug ops are disabled given the current * 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 CopyHost Op, this op does not have HostMemory constraint on its + *

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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.Copy} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tensorName The name of the input tensor. - */ - public Options tensorName(String tensorName) { - this.tensorName = tensorName; - return this; - } - - /** - * @param debugOpsSpec A list of debug op spec (op, url, gated_grpc) for attached debug - * ops. Each element of the list has the format - * ;;, wherein gated_grpc is boolean represented - * as 0/1. E.g., "DebugIdentity;grpc://foo:3333;1", - * "DebugIdentity;file:///tmp/tfdbg_1;0". - */ - public Options debugOpsSpec(List debugOpsSpec) { - this.debugOpsSpec = debugOpsSpec; - return this; - } - - private String tensorName; - private List debugOpsSpec; - - private Options() { - } + public static final String OP_NAME = "Copy"; + + private Output output; + + public Copy(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Copy operation. - * + * * @param scope current scope * @param input Input tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Copy} output and operands * @return a new instance of Copy */ - @Endpoint(describeByClass = true) - public static Copy create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Copy", scope.makeOpName("Copy")); + @Endpoint( + describeByClass = true + ) + public static Copy create(Scope scope, Operand input, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Copy"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.tensorName != null) { @@ -96,53 +84,156 @@ public static Copy create(Scope scope, Operand input, Op } if (opts.debugOpsSpec != null) { String[] debugOpsSpecArray = new String[opts.debugOpsSpec.size()]; - for (int i = 0; i < debugOpsSpecArray.length; ++i) { + for (int i = 0 ; i < debugOpsSpecArray.length ; i++) { debugOpsSpecArray[i] = opts.debugOpsSpec.get(i); } opBuilder.setAttr("debug_ops_spec", debugOpsSpecArray); } } } - return new Copy(opBuilder.build()); + return new Copy<>(opBuilder.build()); } - + /** + * Sets the tensorName option. + * * @param tensorName The name of the input tensor. + * @return this Options instance. */ public static Options tensorName(String tensorName) { return new Options().tensorName(tensorName); } - + /** + * Sets the debugOpsSpec option. + * * @param debugOpsSpec A list of debug op spec (op, url, gated_grpc) for attached debug * ops. Each element of the list has the format - * ;;, wherein gated_grpc is boolean represented - * as 0/1. E.g., "DebugIdentity;grpc://foo:3333;1", - * "DebugIdentity;file:///tmp/tfdbg_1;0". + * <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". + * @return this Options instance. */ public static Options debugOpsSpec(List debugOpsSpec) { return new Options().debugOpsSpec(debugOpsSpec); } - + /** + * Sets the debugOpsSpec option. + * + * @param debugOpsSpec 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". + * @return this Options instance. + */ + public static Options debugOpsSpec(String... debugOpsSpec) { + return new Options().debugOpsSpec(debugOpsSpec); + } + + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Copy"; - - private Output output; - - private Copy(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Copy} + */ + public static class Options { + private String tensorName; + + private List debugOpsSpec; + + private Options() { + } + + /** + * Sets the tensorName option. + * + * @param tensorName The name of the input tensor. + * @return this Options instance. + */ + public Options tensorName(String tensorName) { + this.tensorName = tensorName; + return this; + } + + /** + * Sets the debugOpsSpec option. + * + * @param debugOpsSpec 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". + * @return this Options instance. + */ + public Options debugOpsSpec(List debugOpsSpec) { + this.debugOpsSpec = debugOpsSpec; + return this; + } + + /** + * Sets the debugOpsSpec option. + * + * @param debugOpsSpec 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". + * @return this Options instance. + */ + public Options debugOpsSpec(String... debugOpsSpec) { + this.debugOpsSpec = Arrays.asList(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 b638d662f9f..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. @@ -17,76 +17,64 @@ 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.Operator; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Copy a tensor to host. - *

* Performs CPU-to-CPU deep-copying of tensor. * N.B.: If the all downstream attached debug ops are disabled given the current * 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 + *

Unlike the Copy Op, this op has HostMemory constraint on its input or output. */ +@OpMetadata( + opType = CopyHost.OP_NAME, + inputsClass = CopyHost.Inputs.class +) public final class CopyHost extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.CopyHost} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tensorName The name of the input tensor. - */ - public Options tensorName(String tensorName) { - this.tensorName = tensorName; - return this; - } - - /** - * @param debugOpsSpec A list of debug op spec (op, url, gated_grpc) for attached debug - * ops. Each element of the list has the format - * ;;, wherein gated_grpc is boolean represented - * as 0/1. E.g., "DebugIdentity;grpc://foo:3333;1", - * "DebugIdentity;file:///tmp/tfdbg_1;0". - */ - public Options debugOpsSpec(List debugOpsSpec) { - this.debugOpsSpec = debugOpsSpec; - return this; - } - - private String tensorName; - private List debugOpsSpec; - - private Options() { - } + public static final String OP_NAME = "CopyHost"; + + private Output output; + + public CopyHost(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new CopyHost operation. - * + * * @param scope current scope * @param input Input tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code CopyHost} output and operands * @return a new instance of CopyHost */ - @Endpoint(describeByClass = true) - public static CopyHost create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("CopyHost", scope.makeOpName("CopyHost")); + @Endpoint( + describeByClass = true + ) + public static CopyHost create(Scope scope, Operand input, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CopyHost"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.tensorName != null) { @@ -94,53 +82,156 @@ public static CopyHost create(Scope scope, Operand input } if (opts.debugOpsSpec != null) { String[] debugOpsSpecArray = new String[opts.debugOpsSpec.size()]; - for (int i = 0; i < debugOpsSpecArray.length; ++i) { + for (int i = 0 ; i < debugOpsSpecArray.length ; i++) { debugOpsSpecArray[i] = opts.debugOpsSpec.get(i); } opBuilder.setAttr("debug_ops_spec", debugOpsSpecArray); } } } - return new CopyHost(opBuilder.build()); + return new CopyHost<>(opBuilder.build()); } - + /** + * Sets the tensorName option. + * * @param tensorName The name of the input tensor. + * @return this Options instance. */ public static Options tensorName(String tensorName) { return new Options().tensorName(tensorName); } - + /** + * Sets the debugOpsSpec option. + * * @param debugOpsSpec A list of debug op spec (op, url, gated_grpc) for attached debug * ops. Each element of the list has the format - * ;;, wherein gated_grpc is boolean represented - * as 0/1. E.g., "DebugIdentity;grpc://foo:3333;1", - * "DebugIdentity;file:///tmp/tfdbg_1;0". + * <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". + * @return this Options instance. */ public static Options debugOpsSpec(List debugOpsSpec) { return new Options().debugOpsSpec(debugOpsSpec); } - + /** + * Sets the debugOpsSpec option. + * + * @param debugOpsSpec 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". + * @return this Options instance. + */ + public static Options debugOpsSpec(String... debugOpsSpec) { + return new Options().debugOpsSpec(debugOpsSpec); + } + + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CopyHost"; - - private Output output; - - private CopyHost(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.CopyHost} + */ + public static class Options { + private String tensorName; + + private List debugOpsSpec; + + private Options() { + } + + /** + * Sets the tensorName option. + * + * @param tensorName The name of the input tensor. + * @return this Options instance. + */ + public Options tensorName(String tensorName) { + this.tensorName = tensorName; + return this; + } + + /** + * Sets the debugOpsSpec option. + * + * @param debugOpsSpec 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". + * @return this Options instance. + */ + public Options debugOpsSpec(List debugOpsSpec) { + this.debugOpsSpec = debugOpsSpec; + return this; + } + + /** + * Sets the debugOpsSpec option. + * + * @param debugOpsSpec 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". + * @return this Options instance. + */ + public Options debugOpsSpec(String... debugOpsSpec) { + this.debugOpsSpec = Arrays.asList(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 5d518629b78..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,63 +17,105 @@ 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CountUpTo"; + + private Output output; + + public CountUpTo(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new CountUpTo operation. - * + * * @param scope current scope - * @param ref Should be from a scalar `Variable` node. + * @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. + * @param data type for {@code CountUpTo} output and operands * @return a new instance of CountUpTo */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static CountUpTo create(Scope scope, Operand ref, Long limit) { - OperationBuilder opBuilder = scope.env().opBuilder("CountUpTo", scope.makeOpName("CountUpTo")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CountUpTo"); opBuilder.addInput(ref.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("limit", limit); - return new CountUpTo(opBuilder.build()); + return new CountUpTo<>(opBuilder.build()); } - + /** + * Gets output. * A copy of the input before increment. If nothing else modifies the * input, the values produced will all be distinct. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CountUpTo"; - - private Output output; - - private CountUpTo(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 807aa992ba9..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,131 +19,138 @@ 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 `decode_proto` op extracts fields from a serialized protocol buffers - * message into tensors. The fields in `field_names` are decoded and converted - * to the corresponding `output_types` if possible. - *

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

- * Each output tensor is a dense tensor. This means that it is padded to hold + * {@code descriptor_source} attribute. + *

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

- * For the most part, the mapping between Proto field types and TensorFlow dtypes + *

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

- * - A proto field that contains a submessage or group can only be converted - * to `DT_STRING` (the serialized submessage). This is to reduce the complexity + *

    + *
  • + *

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

    - * - TensorFlow lacks support for unsigned integers. The ops represent uint64 - * types as a `DT_INT64` with the same twos-complement bit pattern (the obvious + *

  • + *
  • + *

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

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

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

    - * - An empty string or "local://", in which case protocol descriptors are + * {@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. + *

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

    + *
  • + *

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

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

    - * - A "bytes://", in which protocol descriptors are created from ``, - * which is expected to be a `FileDescriptorSet` serialized as a string. + *

  • + *
  • + *

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

  • + *
  • + *

    A "bytes://<bytes>", in which protocol descriptors are created from {@code }, + * which is expected to be a {@code FileDescriptorSet} serialized as a string. + *

  • + *
*/ +@OpMetadata( + opType = DecodeProto.OP_NAME, + inputsClass = DecodeProto.Inputs.class +) @Operator public final class DecodeProto extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.DecodeProto} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param descriptorSource Either the special value `local://` or a path to a file containing - * a serialized `FileDescriptorSet`. - */ - public Options descriptorSource(String descriptorSource) { - this.descriptorSource = descriptorSource; - return this; - } - - /** - * @param messageFormat Either `binary` or `text`. - */ - public Options messageFormat(String messageFormat) { - this.messageFormat = messageFormat; - return this; - } - - /** - * @param sanitize Whether to sanitize the result or not. - */ - public Options sanitize(Boolean sanitize) { - this.sanitize = sanitize; - return this; - } - - private String descriptorSource; - private String messageFormat; - private Boolean sanitize; - - private Options() { - } + public static final String OP_NAME = "DecodeProtoV2"; + + private Output sizes; + + private List> values; + + @SuppressWarnings("unchecked") + public DecodeProto(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + sizes = operation.output(outputIdx++); + int valuesLength = operation.outputListLength("values"); + values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); + outputIdx += valuesLength; } - + /** - * Factory method to create a class wrapping a new DecodeProto operation. - * + * Factory method to create a class wrapping a new DecodeProtoV2 operation. + * * @param scope current scope - * @param bytes Tensor of serialized protos with shape `batch_shape`. + * @param bytes Tensor of serialized protos with shape {@code batch_shape}. * @param messageType Name of the proto message type to decode. * @param fieldNames List of strings containing proto field names. An extension field can be decoded * by using its full name, e.g. EXT_PACKAGE.EXT_FIELD_NAME. * @param outputTypes List of TF types to use for the respective field in field_names. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of DecodeProto */ - @Endpoint(describeByClass = true) - public static DecodeProto create(Scope scope, Operand bytes, String messageType, List fieldNames, List> outputTypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DecodeProtoV2", scope.makeOpName("DecodeProto")); + @Endpoint( + describeByClass = true + ) + public static DecodeProto create(Scope scope, Operand bytes, String messageType, + List fieldNames, List> outputTypes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DecodeProto"); opBuilder.addInput(bytes.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("message_type", messageType); String[] fieldNamesArray = new String[fieldNames.size()]; - for (int i = 0; i < fieldNamesArray.length; ++i) { + for (int i = 0 ; i < fieldNamesArray.length ; i++) { fieldNamesArray[i] = fieldNames.get(i); } opBuilder.setAttr("field_names", fieldNamesArray); @@ -163,59 +170,159 @@ public static DecodeProto create(Scope scope, Operand bytes, String mes } return new DecodeProto(opBuilder.build()); } - + /** - * @param descriptorSource Either the special value `local://` or a path to a file containing - * a serialized `FileDescriptorSet`. + * Sets the descriptorSource option. + * + * @param descriptorSource Either the special value {@code local://} or a path to a file containing + * a serialized {@code FileDescriptorSet}. + * @return this Options instance. */ public static Options descriptorSource(String descriptorSource) { return new Options().descriptorSource(descriptorSource); } - + /** - * @param messageFormat Either `binary` or `text`. + * Sets the messageFormat option. + * + * @param messageFormat Either {@code binary} or {@code text}. + * @return this Options instance. */ public static Options messageFormat(String messageFormat) { return new Options().messageFormat(messageFormat); } - + /** + * Sets the sanitize option. + * * @param sanitize Whether to sanitize the result or not. + * @return this Options instance. */ public static Options sanitize(Boolean sanitize) { return new Options().sanitize(sanitize); } - + /** - * Tensor of int32 with shape `[batch_shape, len(field_names)]`. + * Gets sizes. + * Tensor of int32 with shape {@code [batch_shape, len(field_names)]}. * Each entry is the number of values found for the corresponding field. * Optional fields may have 0 or 1 values. + * @return sizes. */ public Output sizes() { return sizes; } - + /** + * Gets values. * List of tensors containing values for the corresponding field. - * `values[i]` has datatype `output_types[i]` - * and shape `[batch_shape, max(sizes[...,i])]`. + * {@code values[i]} has datatype {@code output_types[i]} + * and shape {@code [batch_shape, max(sizes[...,i])]}. + * @return values. */ public List> values() { return values; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeProtoV2"; - - private Output sizes; - private List> values; - - private DecodeProto(Operation operation) { - super(operation); - int outputIdx = 0; - sizes = operation.output(outputIdx++); - int valuesLength = operation.outputListLength("values"); - values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); - outputIdx += valuesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.core.DecodeProto} + */ + public static class Options { + private String descriptorSource; + + private String messageFormat; + + private Boolean sanitize; + + private Options() { + } + + /** + * Sets the descriptorSource option. + * + * @param descriptorSource Either the special value {@code local://} or a path to a file containing + * a serialized {@code FileDescriptorSet}. + * @return this Options instance. + */ + public Options descriptorSource(String descriptorSource) { + this.descriptorSource = descriptorSource; + return this; + } + + /** + * Sets the messageFormat option. + * + * @param messageFormat Either {@code binary} or {@code text}. + * @return this Options instance. + */ + public Options messageFormat(String messageFormat) { + this.messageFormat = messageFormat; + return this; + } + + /** + * Sets the sanitize option. + * + * @param sanitize Whether to sanitize the result or not. + * @return this Options instance. + */ + public Options sanitize(Boolean sanitize) { + this.sanitize = 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 4d8e8268d8c..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,60 +17,97 @@ 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 `x`. - * - * @param data type for {@code y()} output + * Makes a copy of {@code x}. */ +@OpMetadata( + opType = DeepCopy.OP_NAME, + inputsClass = DeepCopy.Inputs.class +) @Operator public final class DeepCopy extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DeepCopy"; + + private Output y; + + public DeepCopy(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DeepCopy operation. - * + * * @param scope current scope - * @param x The source tensor of type `T`. + * @param x The source tensor of type {@code T}. + * @param data type for {@code DeepCopy} output and operands * @return a new instance of DeepCopy */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DeepCopy create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("DeepCopy", scope.makeOpName("DeepCopy")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DeepCopy"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new DeepCopy(opBuilder.build()); + return new DeepCopy<>(opBuilder.build()); } - + /** - * y: A `Tensor` of type `T`. A copy of `x`. Guaranteed that `y` - * is not an alias of `x`. + * Gets y. + *
+   * y: A `Tensor` of type `T`. A copy of `x`. Guaranteed that `y`
+   *   is not an alias of `x`.
+   * 
+ * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DeepCopy"; - - private Output y; - - private DeepCopy(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 bbcfafde693..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,40 +17,67 @@ 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DeleteSessionTensor"; + + public DeleteSessionTensor(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new DeleteSessionTensor operation. - * + * * @param scope current scope * @param handle The handle for a tensor stored in the session state. * @return a new instance of DeleteSessionTensor */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DeleteSessionTensor create(Scope scope, Operand handle) { - OperationBuilder opBuilder = scope.env().opBuilder("DeleteSessionTensor", scope.makeOpName("DeleteSessionTensor")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DeleteSessionTensor"); opBuilder.addInput(handle.asOutput()); - opBuilder = scope.apply(opBuilder); return new DeleteSessionTensor(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DeleteSessionTensor"; - - private DeleteSessionTensor(Operation operation) { - super(operation); + + @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 ea487a4d415..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,56 +17,55 @@ 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; /** * Deletes the resource specified by the handle. - *

* 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.DestroyResourceOp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param ignoreLookupError whether to ignore the error when the resource - * doesn't exist. - */ - public Options ignoreLookupError(Boolean ignoreLookupError) { - this.ignoreLookupError = ignoreLookupError; - return this; - } - - private Boolean ignoreLookupError; - - private Options() { - } + public static final String OP_NAME = "DestroyResourceOp"; + + public DestroyResourceOp(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new DestroyResourceOp operation. - * + * * @param scope current scope * @param resource handle to the resource to delete. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of DestroyResourceOp */ - @Endpoint(describeByClass = true) - public static DestroyResourceOp create(Scope scope, Operand resource, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DestroyResourceOp", scope.makeOpName("DestroyResourceOp")); + @Endpoint( + describeByClass = true + ) + public static DestroyResourceOp create(Scope scope, Operand resource, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DestroyResourceOp"); opBuilder.addInput(resource.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.ignoreLookupError != null) { @@ -76,19 +75,60 @@ public static DestroyResourceOp create(Scope scope, Operand resource, Options } return new DestroyResourceOp(opBuilder.build()); } - + /** + * Sets the ignoreLookupError option. + * * @param ignoreLookupError whether to ignore the error when the resource * doesn't exist. + * @return this Options instance. */ public static Options ignoreLookupError(Boolean ignoreLookupError) { return new Options().ignoreLookupError(ignoreLookupError); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DestroyResourceOp"; - - private DestroyResourceOp(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.DestroyResourceOp} + */ + public static class Options { + private Boolean ignoreLookupError; + + private Options() { + } + + /** + * Sets the ignoreLookupError option. + * + * @param ignoreLookupError whether to ignore the error when the resource + * doesn't exist. + * @return this Options instance. + */ + public Options ignoreLookupError(Boolean ignoreLookupError) { + this.ignoreLookupError = 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 25b2ef684c5..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,69 +17,111 @@ 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; /** * Destroys the temporary variable and returns its final value. - *

* Sets output to the value of the Tensor pointed to by 'ref', then destroys * the temporary variable called 'var_name'. - * All other uses of 'ref' must have executed before this op. + * All other uses of 'ref' must have executed before this op. * 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 + *

Outputs the final value of the tensor pointed to by 'ref'. */ +@OpMetadata( + opType = DestroyTemporaryVariable.OP_NAME, + inputsClass = DestroyTemporaryVariable.Inputs.class +) @Operator public final class DestroyTemporaryVariable extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DestroyTemporaryVariable"; + + private Output value; + + public DestroyTemporaryVariable(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + value = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DestroyTemporaryVariable operation. - * + * * @param scope current scope * @param ref A reference to the temporary variable tensor. * @param varName Name of the temporary variable, usually the name of the matching * 'TemporaryVariable' op. + * @param data type for {@code DestroyTemporaryVariable} output and operands * @return a new instance of DestroyTemporaryVariable */ - @Endpoint(describeByClass = true) - public static DestroyTemporaryVariable create(Scope scope, Operand ref, String varName) { - OperationBuilder opBuilder = scope.env().opBuilder("DestroyTemporaryVariable", scope.makeOpName("DestroyTemporaryVariable")); + @Endpoint( + describeByClass = true + ) + public static DestroyTemporaryVariable create(Scope scope, Operand ref, + String varName) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DestroyTemporaryVariable"); opBuilder.addInput(ref.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("var_name", varName); - return new DestroyTemporaryVariable(opBuilder.build()); + return new DestroyTemporaryVariable<>(opBuilder.build()); } - + /** + * Gets value. + * + * @return value. */ public Output value() { return value; } - + @Override public Output asOutput() { return value; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DestroyTemporaryVariable"; - - private Output value; - - private DestroyTemporaryVariable(Operation operation) { - super(operation); - int outputIdx = 0; - value = operation.output(outputIdx++); + + @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 cf0b0279c63..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,65 +17,95 @@ 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; /** * 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. */ +@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 + */ + public static final String OP_NAME = "DeviceIndex"; + + private Output index; + + public DeviceIndex(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + index = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DeviceIndex operation. - * + * * @param scope current scope - * @param deviceNames + * @param deviceNames The value of the deviceNames attribute * @return a new instance of DeviceIndex */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DeviceIndex create(Scope scope, List deviceNames) { - OperationBuilder opBuilder = scope.env().opBuilder("DeviceIndex", scope.makeOpName("DeviceIndex")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DeviceIndex"); String[] deviceNamesArray = new String[deviceNames.size()]; - for (int i = 0; i < deviceNamesArray.length; ++i) { + for (int i = 0 ; i < deviceNamesArray.length ; i++) { deviceNamesArray[i] = deviceNames.get(i); } opBuilder.setAttr("device_names", deviceNamesArray); return new DeviceIndex(opBuilder.build()); } - + /** + * Gets index. + * + * @return index. */ public Output index() { return index; } - + @Override public Output asOutput() { return index; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DeviceIndex"; - - private Output index; - - private DeviceIndex(Operation operation) { - super(operation); - int outputIdx = 0; - index = operation.output(outputIdx++); + + @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 615f2f8bdad..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,53 +17,80 @@ 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 + */ + public static final String OP_NAME = "DummyMemoryCache"; + + private Output handle; + + @SuppressWarnings("unchecked") + public DummyMemoryCache(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DummyMemoryCache operation. - * + * * @param scope current scope * @return a new instance of DummyMemoryCache */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DummyMemoryCache create(Scope scope) { - OperationBuilder opBuilder = scope.env().opBuilder("DummyMemoryCache", scope.makeOpName("DummyMemoryCache")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DummyMemoryCache"); return new DummyMemoryCache(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DummyMemoryCache"; - - private Output handle; - - private DummyMemoryCache(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 76bad0aecb7..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,101 +20,149 @@ 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; /** - * Partitions `data` into `num_partitions` tensors using indices from `partitions`. - *

- * For each index tuple `js` of size `partitions.ndim`, the slice `data[js, ...]` - * becomes part of `outputs[partitions[js]]`. The slices with `partitions[js] = i` - * are placed in `outputs[i]` in lexicographic order of `js`, and the first - * dimension of `outputs[i]` is the number of entries in `partitions` equal to `i`. + * 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, ...]} + * becomes part of {@code outputs[partitions[js]]}. The slices with {@code partitions[js] = i} + * are placed in {@code outputs[i]} in lexicographic order of {@code js}, and the first + * dimension of {@code outputs[i]} is the number of entries in {@code partitions} equal to {@code i}. * In detail, - *

{@code
+ * 
  *     outputs[i].shape = [sum(partitions == i)] + data.shape[partitions.ndim:]
- * 
+ *
  *     outputs[i] = pack([data[js, ...] for js if partitions[js] == i])
- * }
- * `data.shape` must start with `partitions.shape`. - *

- * For example: - *

{@code
+ * 
+ *

{@code data.shape} must start with {@code partitions.shape}. + *

For example: + *

  *     # Scalar partitions.
  *     partitions = 1
  *     num_partitions = 2
  *     data = [10, 20]
  *     outputs[0] = []  # Empty with shape [0, 2]
  *     outputs[1] = [[10, 20]]
- * 
+ *
  *     # Vector partitions.
  *     partitions = [0, 0, 1, 1, 0]
  *     num_partitions = 2
  *     data = [10, 20, 30, 40, 50]
  *     outputs[0] = [10, 20, 50]
  *     outputs[1] = [30, 40]
- * }
- * See `dynamic_stitch` for an example on how to merge partitions back. - *

+ *

+ *

See {@code dynamic_stitch} for an example on how to merge partitions back. *

* *
- * - * @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> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DynamicPartition"; + + private List> outputs; + + @SuppressWarnings("unchecked") + public DynamicPartition(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 DynamicPartition operation. - * + * * @param scope current scope - * @param data - * @param partitions Any shape. Indices in the range `[0, num_partitions)`. + * @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 * @return a new instance of DynamicPartition */ - @Endpoint(describeByClass = true) - public static DynamicPartition create(Scope scope, Operand data, Operand partitions, Long numPartitions) { - OperationBuilder opBuilder = scope.env().opBuilder("DynamicPartition", scope.makeOpName("DynamicPartition")); + @Endpoint( + describeByClass = true + ) + public static DynamicPartition create(Scope scope, Operand data, + Operand partitions, Long numPartitions) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DynamicPartition"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(partitions.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_partitions", numPartitions); - return new DynamicPartition(opBuilder.build()); + return new DynamicPartition<>(opBuilder.build()); } - + /** + * Gets outputs. + * + * @return outputs. */ public List> outputs() { return outputs; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) outputs.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DynamicPartition"; - - private List> outputs; - - @SuppressWarnings("unchecked") - private DynamicPartition(Operation operation) { - super(operation); - int outputIdx = 0; - int outputsLength = operation.outputListLength("outputs"); - outputs = Arrays.asList((Output[])operation.outputList(outputIdx, outputsLength)); - outputIdx += outputsLength; + + @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 5ec783fde16..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,47 +17,51 @@ 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; /** - * Interleave the values from the `data` tensors into a single tensor. - *

+ * Interleave the values from the {@code data} tensors into a single tensor. * Builds a merged tensor such that - *

{@code
+ * 
  *     merged[indices[m][i, ..., j], ...] = data[m][i, ..., j, ...]
- * }
- * For example, if each `indices[m]` is scalar or vector, we have - *
{@code
+ * 
+ *

For example, if each {@code indices[m]} is scalar or vector, we have + *

  *     # Scalar indices:
  *     merged[indices[m], ...] = data[m][...]
- * 
+ *
  *     # Vector indices:
  *     merged[indices[m][i], ...] = data[m][i, ...]
- * }
- * Each `data[i].shape` must start with the corresponding `indices[i].shape`, - * and the rest of `data[i].shape` must be constant w.r.t. `i`. That is, we - * must have `data[i].shape = indices[i].shape + constant`. In terms of this - * `constant`, the output shape is - *

- * merged.shape = [max(indices)] + constant - *

- * Values are merged in order, so if an index appears in both `indices[m][i]` and - * `indices[n][j]` for `(m,i) < (n,j)` the slice `data[n][j]` will appear in the + *

+ *

Each {@code data[i].shape} must start with the corresponding {@code indices[i].shape}, + * and the rest of {@code data[i].shape} must be constant w.r.t. {@code i}. That is, we + * must have {@code data[i].shape = indices[i].shape + constant}. In terms of this + * {@code constant}, the output shape is + *

+ * 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 * merged result. If you do not need this guarantee, ParallelDynamicStitch might * perform better on some devices. - *

- * For example: - *

{@code
+ * 

For example: + *

  *     indices[0] = 6
  *     indices[1] = [4, 1]
  *     indices[2] = [[5, 2], [0, 3]]
@@ -66,10 +70,10 @@
  *     data[2] = [[[51, 52], [21, 22]], [[1, 2], [31, 32]]]
  *     merged = [[1, 2], [11, 12], [21, 22], [31, 32], [41, 42],
  *               [51, 52], [61, 62]]
- * }
- * This method can be used to merge partitions created by `dynamic_partition` + *
+ *

This method can be used to merge partitions created by {@code dynamic_partition} * as illustrated on the following example: - *

{@code
+ * 
  *     # Apply function (increments x_i) on elements for which a certain condition
  *     # apply (x_i != -1 in this example).
  *     x=tf.constant([0.1, -1., 5.2, 4.3, -1., 7.4])
@@ -82,52 +86,93 @@
  *     x = tf.dynamic_stitch(condition_indices, partitioned_data)
  *     # Here x=[1.1, -1., 6.2, 5.3, -1, 8.4], the -1. values remain
  *     # unchanged.
- * }
+ *
*
* *
- * - * @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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DynamicStitch"; + + private Output merged; + + public DynamicStitch(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + merged = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DynamicStitch operation. - * + * * @param scope current scope - * @param indices - * @param data + * @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 */ - @Endpoint(describeByClass = true) - public static DynamicStitch create(Scope scope, Iterable> indices, Iterable> data) { - OperationBuilder opBuilder = scope.env().opBuilder("DynamicStitch", scope.makeOpName("DynamicStitch")); + @Endpoint( + describeByClass = true + ) + public static DynamicStitch create(Scope scope, + Iterable> indices, Iterable> data) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DynamicStitch"); opBuilder.addInputList(Operands.asOutputs(indices)); opBuilder.addInputList(Operands.asOutputs(data)); - opBuilder = scope.apply(opBuilder); - return new DynamicStitch(opBuilder.build()); + return new DynamicStitch<>(opBuilder.build()); } - + /** + * Gets merged. + * + * @return merged. */ public Output merged() { return merged; } - + @Override public Output asOutput() { return merged; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DynamicStitch"; - - private Output merged; - - private DynamicStitch(Operation operation) { - super(operation); - int outputIdx = 0; - merged = operation.output(outputIdx++); + + @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 8ae42ad6218..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,55 +17,54 @@ 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; /** * Computes the (possibly normalized) Levenshtein Edit Distance. - *

* The inputs are variable-length sequences provided by SparseTensors - * (hypothesis_indices, hypothesis_values, hypothesis_shape) + * (hypothesis_indices, hypothesis_values, hypothesis_shape) * and - * (truth_indices, truth_values, truth_shape). - *

- * The inputs are: + * (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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.EditDistance} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param normalize boolean (if true, edit distances are normalized by length of truth). - *

- * The output is: - */ - public Options normalize(Boolean normalize) { - this.normalize = normalize; - return this; - } - - private Boolean normalize; - - private Options() { - } + public static final String OP_NAME = "EditDistance"; + + private Output output; + + public EditDistance(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new EditDistance operation. - * + * * @param scope current scope * @param hypothesisIndices The indices of the hypothesis list SparseTensor. * This is an N x R int64 matrix. @@ -78,19 +77,24 @@ private Options() { * @param truthValues The values of the truth list SparseTensor. * This is an M-length vector. * @param truthShape truth indices, vector. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code EditDistance} output and operands * @return a new instance of EditDistance */ - @Endpoint(describeByClass = true) - public static EditDistance create(Scope scope, Operand hypothesisIndices, Operand hypothesisValues, Operand hypothesisShape, Operand truthIndices, Operand truthValues, Operand truthShape, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("EditDistance", scope.makeOpName("EditDistance")); + @Endpoint( + describeByClass = true + ) + public static EditDistance create(Scope scope, + Operand hypothesisIndices, Operand hypothesisValues, + Operand hypothesisShape, Operand truthIndices, Operand truthValues, + Operand truthShape, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "EditDistance"); opBuilder.addInput(hypothesisIndices.asOutput()); opBuilder.addInput(hypothesisValues.asOutput()); opBuilder.addInput(hypothesisShape.asOutput()); opBuilder.addInput(truthIndices.asOutput()); opBuilder.addInput(truthValues.asOutput()); opBuilder.addInput(truthShape.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.normalize != null) { @@ -100,65 +104,144 @@ public static EditDistance create(Scope scope, Operand } return new EditDistance(opBuilder.build()); } - + /** + * Sets the normalize option. + * * @param normalize boolean (if true, edit distances are normalized by length of truth). - *

- * The output is: + *

The output is: + * @return this Options instance. */ public static Options normalize(Boolean normalize) { return new Options().normalize(normalize); } - + /** + * Gets output. * A dense float tensor with rank R - 1. - *

- * For the example input: - *

- * // hypothesis represents a 2x1 matrix with variable-length values: - * // (0,0) = ["a"] - * // (1,0) = ["b"] - * hypothesis_indices = [[0, 0, 0], - * [1, 0, 0]] - * hypothesis_values = ["a", "b"] - * hypothesis_shape = [2, 1, 1] - *

- * // truth represents a 2x2 matrix with variable-length values: - * // (0,0) = [] - * // (0,1) = ["a"] - * // (1,0) = ["b", "c"] - * // (1,1) = ["a"] - * truth_indices = [[0, 1, 0], - * [1, 0, 0], - * [1, 0, 1], - * [1, 1, 0]] - * truth_values = ["a", "b", "c", "a"] - * truth_shape = [2, 2, 2] - * normalize = true - *

- * The output will be: - *

- * // output is a 2x2 matrix with edit distances normalized by truth lengths. - * output = [[inf, 1.0], // (0,0): no truth, (0,1): no hypothesis - * [0.5, 1.0]] // (1,0): addition, (1,1): no hypothesis + *

For the example input: + *

+   * // hypothesis represents a 2x1 matrix with variable-length values:
+   * //   (0,0) = ["a"]
+   * //   (1,0) = ["b"]
+   * hypothesis_indices = [[0, 0, 0],
+   *                       [1, 0, 0]]
+   * hypothesis_values = ["a", "b"]
+   * hypothesis_shape = [2, 1, 1]
+   *
+   * // truth represents a 2x2 matrix with variable-length values:
+   * //   (0,0) = []
+   * //   (0,1) = ["a"]
+   * //   (1,0) = ["b", "c"]
+   * //   (1,1) = ["a"]
+   * truth_indices = [[0, 1, 0],
+   *                  [1, 0, 0],
+   *                  [1, 0, 1],
+   *                  [1, 1, 0]]
+   * truth_values = ["a", "b", "c", "a"]
+   * truth_shape = [2, 2, 2]
+   * normalize = true
+   * 
+ *

The output will be: + *

+   * // output is a 2x2 matrix with edit distances normalized by truth lengths.
+   * output = [[inf, 1.0],  // (0,0): no truth, (0,1): no hypothesis
+   *           [0.5, 1.0]]  // (1,0): addition, (1,1): no hypothesis
+   * 
+ * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EditDistance"; - - private Output output; - - private EditDistance(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.EditDistance} + */ + public static class Options { + private Boolean normalize; + + private Options() { + } + + /** + * Sets the normalize option. + * + * @param normalize boolean (if true, edit distances are normalized by length of truth). + *

The output is: + * @return this Options instance. + */ + public Options normalize(Boolean normalize) { + this.normalize = 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 7e7140b9015..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,61 +17,64 @@ 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 `shape` and `dtype`. - * - * @param data type for {@code output()} output + *

This operation creates a tensor of {@code shape} and {@code dtype}. */ +@OpMetadata( + opType = Empty.OP_NAME, + inputsClass = Empty.Inputs.class +) @Operator public final class Empty extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Empty} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param init If True, initialize the returned tensor with the default value of dtype. Otherwise, the implementation is free not to initializethe tensor's content. - */ - public Options init(Boolean init) { - this.init = init; - return this; - } - - private Boolean init; - - private Options() { - } + public static final String OP_NAME = "Empty"; + + private Output output; + + public Empty(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Empty operation. - * + * * @param scope current scope * @param shape 1-D. Represents the shape of the output tensor. - * @param dtype - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static Empty create(Scope scope, Operand shape, Class dtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Empty", scope.makeOpName("Empty")); + @Endpoint( + describeByClass = true + ) + public static Empty create(Scope scope, Operand shape, + Class dtype, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Empty"); opBuilder.addInput(shape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); if (options != null) { for (Options opts : options) { @@ -80,36 +83,79 @@ public static Empty create(Scope scope, Operand sha } } } - return new Empty(opBuilder.build()); + return new Empty<>(opBuilder.build()); } - + /** + * Sets the init option. + * * @param init If True, initialize the returned tensor with the default value of dtype. Otherwise, the implementation is free not to initializethe tensor's content. + * @return this Options instance. */ public static Options init(Boolean init) { return new Options().init(init); } - + /** - * A `Tensor` of type `T`. + * Gets output. + * A {@code Tensor} of type {@code T}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Empty"; - - private Output output; - - private Empty(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Empty} + */ + public static class Options { + private Boolean init; + + private Options() { + } + + /** + * Sets the init option. + * + * @param init If True, initialize the returned tensor with the default value of dtype. Otherwise, the implementation is free not to initializethe tensor's content. + * @return this Options instance. + */ + public Options init(Boolean init) { + this.init = 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 db314701fe6..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,71 +17,122 @@ 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; /** * Creates and returns an empty tensor list. - *

* All list elements must be tensors of dtype element_dtype and shape compatible * with element_shape. - *

- * handle: an empty tensor list. + *

handle: an empty tensor list. * 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "EmptyTensorList"; + + private Output handle; + + @SuppressWarnings("unchecked") + public EmptyTensorList(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new EmptyTensorList operation. - * + * * @param scope current scope - * @param elementShape - * @param maxNumElements - * @param elementDtype + * @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 */ - @Endpoint(describeByClass = true) - public static EmptyTensorList create(Scope scope, Operand elementShape, Operand maxNumElements, Class elementDtype) { - OperationBuilder opBuilder = scope.env().opBuilder("EmptyTensorList", scope.makeOpName("EmptyTensorList")); + @Endpoint( + describeByClass = true + ) + public static EmptyTensorList create(Scope scope, + Operand elementShape, Operand maxNumElements, + Class elementDtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "EmptyTensorList"); opBuilder.addInput(elementShape.asOutput()); opBuilder.addInput(maxNumElements.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("element_dtype", Operands.toDataType(elementDtype)); return new EmptyTensorList(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EmptyTensorList"; - - private Output handle; - - private EmptyTensorList(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 6a2474076cf..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,57 +17,81 @@ 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 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "EmptyTensorMap"; + + private Output handle; + + @SuppressWarnings("unchecked") + public EmptyTensorMap(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new EmptyTensorMap operation. - * + * * @param scope current scope * @return a new instance of EmptyTensorMap */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static EmptyTensorMap create(Scope scope) { - OperationBuilder opBuilder = scope.env().opBuilder("EmptyTensorMap", scope.makeOpName("EmptyTensorMap")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "EmptyTensorMap"); return new EmptyTensorMap(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EmptyTensorMap"; - - private Output handle; - - private EmptyTensorMap(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 f0d22e0f6c1..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,104 +17,113 @@ 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; /** * The op serializes protobuf messages provided in the input tensors. - *

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

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

- * A `message_type` name must be provided to give context for the field names. + * The types of the tensors in {@code values} must match the schema for the fields + * specified in {@code field_names}. All the tensors in {@code values} must have a common + * shape prefix, batch_shape. + *

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

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

- * For the most part, the mapping between Proto field types and TensorFlow dtypes + * {@code descriptor_source} attribute. + *

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

- * - A proto field that contains a submessage or group can only be converted - * to `DT_STRING` (the serialized submessage). This is to reduce the complexity + *

    + *
  • + *

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

    - * - TensorFlow lacks support for unsigned integers. The ops represent uint64 - * types as a `DT_INT64` with the same twos-complement bit pattern (the obvious + *

  • + *
  • + *

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

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

    - * - An empty string or "local://", in which case protocol descriptors are + * {@code DT_INT64}, or using twos-complement if the caller specifies {@code DT_INT32} in + * the {@code output_types} attribute. + *

  • + *
+ *

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

    + *
  • + *

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

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

    - * - A "bytes://", in which protocol descriptors are created from ``, - * which is expected to be a `FileDescriptorSet` serialized as a string. + *

  • + *
  • + *

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

  • + *
  • + *

    A "bytes://<bytes>", in which protocol descriptors are created from {@code }, + * which is expected to be a {@code FileDescriptorSet} serialized as a string. + *

  • + *
*/ +@OpMetadata( + opType = EncodeProto.OP_NAME, + inputsClass = EncodeProto.Inputs.class +) @Operator public final class EncodeProto extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.EncodeProto} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param descriptorSource - */ - public Options descriptorSource(String descriptorSource) { - this.descriptorSource = descriptorSource; - return this; - } - - private String descriptorSource; - - private Options() { - } + public static final String OP_NAME = "EncodeProto"; + + private Output bytes; + + public EncodeProto(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + bytes = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new EncodeProto operation. - * + * * @param scope current scope - * @param sizes Tensor of int32 with shape `[batch_shape, len(field_names)]`. + * @param sizes Tensor of int32 with shape {@code [batch_shape, len(field_names)]}. * @param values List of tensors containing values for the corresponding field. * @param fieldNames List of strings containing proto field names. * @param messageType Name of the proto message type to decode. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of EncodeProto */ - @Endpoint(describeByClass = true) - public static EncodeProto create(Scope scope, Operand sizes, Iterable> values, List fieldNames, String messageType, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("EncodeProto", scope.makeOpName("EncodeProto")); + @Endpoint( + describeByClass = true + ) + public static EncodeProto create(Scope scope, Operand sizes, Iterable> values, + List fieldNames, String messageType, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "EncodeProto"); opBuilder.addInput(sizes.asOutput()); opBuilder.addInputList(Operands.asOutputs(values)); - opBuilder = scope.apply(opBuilder); String[] fieldNamesArray = new String[fieldNames.size()]; - for (int i = 0; i < fieldNamesArray.length; ++i) { + for (int i = 0 ; i < fieldNamesArray.length ; i++) { fieldNamesArray[i] = fieldNames.get(i); } opBuilder.setAttr("field_names", fieldNamesArray); @@ -128,34 +137,97 @@ public static EncodeProto create(Scope scope, Operand sizes, Iterable bytes() { return bytes; } - + @Override public Output asOutput() { return bytes; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EncodeProto"; - - private Output bytes; - - private EncodeProto(Operation operation) { - super(operation); - int outputIdx = 0; - bytes = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.EncodeProto} + */ + public static class Options { + private String descriptorSource; + + private Options() { + } + + /** + * Sets the descriptorSource option. + * + * @param descriptorSource the descriptorSource option + * @return this Options instance. + */ + public Options descriptorSource(String descriptorSource) { + this.descriptorSource = 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 f8c8b232554..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,65 +17,106 @@ 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "EnsureShape"; + + private Output output; + + public EnsureShape(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new EnsureShape operation. - * + * * @param scope current scope * @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 * @return a new instance of EnsureShape */ - @Endpoint(describeByClass = true) - public static EnsureShape create(Scope scope, Operand input, Shape shape) { - OperationBuilder opBuilder = scope.env().opBuilder("EnsureShape", scope.makeOpName("EnsureShape")); + @Endpoint( + describeByClass = true + ) + public static EnsureShape create(Scope scope, Operand input, + Shape shape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "EnsureShape"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("shape", shape); - return new EnsureShape(opBuilder.build()); + return new EnsureShape<>(opBuilder.build()); } - + /** + * Gets output. * A tensor with the same shape and contents as the input tensor or value. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EnsureShape"; - - private Output output; - - private EnsureShape(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 a958d23c259..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,71 +17,66 @@ 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; /** - * Creates or finds a child frame, and makes `data` available to the child frame. - *

- * This op is used together with `Exit` to create loops in the graph. - * The unique `frame_name` is used by the `Executor` to identify frames. If - * `is_constant` is true, `output` is a constant in the child frame; otherwise - * it may be changed in the child frame. At most `parallel_iterations` iterations + * 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 type for {@code output()} output */ +@OpMetadata( + opType = Enter.OP_NAME, + inputsClass = Enter.Inputs.class +) +@Operator public final class Enter extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Enter} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param isConstant If true, the output is constant within the child frame. - */ - public Options isConstant(Boolean isConstant) { - this.isConstant = isConstant; - return this; - } - - /** - * @param parallelIterations The number of iterations allowed to run in parallel. - */ - public Options parallelIterations(Long parallelIterations) { - this.parallelIterations = parallelIterations; - return this; - } - - private Boolean isConstant; - private Long parallelIterations; - - private Options() { - } + public static final String OP_NAME = "Enter"; + + private Output output; + + public Enter(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Enter operation. - * + * * @param scope current scope * @param data The tensor to be made available to the child frame. * @param frameName The name of the child frame. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Enter} output and operands * @return a new instance of Enter */ - @Endpoint(describeByClass = true) - public static Enter create(Scope scope, Operand data, String frameName, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Enter", scope.makeOpName("Enter")); + @Endpoint( + describeByClass = true + ) + public static Enter create(Scope scope, Operand data, String frameName, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Enter"); opBuilder.addInput(data.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("frame_name", frameName); if (options != null) { for (Options opts : options) { @@ -93,43 +88,114 @@ public static Enter create(Scope scope, Operand data, St } } } - return new Enter(opBuilder.build()); + return new Enter<>(opBuilder.build()); } - + /** + * Sets the isConstant option. + * * @param isConstant If true, the output is constant within the child frame. + * @return this Options instance. */ public static Options isConstant(Boolean isConstant) { return new Options().isConstant(isConstant); } - + /** + * Sets the parallelIterations option. + * * @param parallelIterations The number of iterations allowed to run in parallel. + * @return this Options instance. */ public static Options parallelIterations(Long parallelIterations) { return new Options().parallelIterations(parallelIterations); } - + /** - * The same tensor as `data`. + * Gets output. + * The same tensor as {@code data}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Enter"; - - private Output output; - - private Enter(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Enter} + */ + public static class Options { + private Boolean isConstant; + + private Long parallelIterations; + + private Options() { + } + + /** + * Sets the isConstant option. + * + * @param isConstant If true, the output is constant within the child frame. + * @return this Options instance. + */ + public Options isConstant(Boolean isConstant) { + this.isConstant = isConstant; + return this; + } + + /** + * Sets the parallelIterations option. + * + * @param parallelIterations The number of iterations allowed to run in parallel. + * @return this Options instance. + */ + public Options parallelIterations(Long parallelIterations) { + this.parallelIterations = 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 8f0562469c6..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,60 +17,95 @@ 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 `data` available to the parent frame. - * - * @param data type for {@code output()} output + * Exit makes its input {@code data} available to the parent frame. */ +@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 + */ + public static final String OP_NAME = "Exit"; + + private Output output; + + public Exit(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Exit operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Exit create(Scope scope, Operand data) { - OperationBuilder opBuilder = scope.env().opBuilder("Exit", scope.makeOpName("Exit")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Exit"); opBuilder.addInput(data.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Exit(opBuilder.build()); + return new Exit<>(opBuilder.build()); } - + /** - * The same tensor as `data`. + * Gets output. + * The same tensor as {@code data}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Exit"; - - private Output output; - - private Exit(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 c80e1809420..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,94 +17,138 @@ 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; /** * Inserts a dimension of 1 into a tensor's shape. - *

- * Given a tensor `input`, this operation inserts a dimension of 1 at the - * dimension index `axis` of `input`'s shape. The dimension index `axis` starts at - * zero; if you specify a negative number for `axis` it is counted backward from + * Given a tensor {@code input}, this operation inserts a dimension of 1 at the + * dimension index {@code axis} of {@code input}'s shape. The dimension index {@code axis} starts at + * zero; if you specify a negative number for {@code axis} it is counted backward from * the end. - *

- * This operation is useful if you want to add a batch dimension to a single - * element. For example, if you have a single image of shape `[height, width, - * channels]`, you can make it a batch of 1 image with `expand_dims(image, 0)`, - * which will make the shape `[1, height, width, channels]`. - *

- * Other examples: - *

{@code
+ * 

This operation is useful if you want to add a batch dimension to a single + * element. For example, if you have a single image of shape {@code [height, width, channels]}, you can make it a batch of 1 image with {@code expand_dims(image, 0)}, + * which will make the shape {@code [1, height, width, channels]}. + *

Other examples: + *

  * # 't' is a tensor of shape [2]
- * shape(expand_dims(t, 0)) ==> [1, 2]
- * shape(expand_dims(t, 1)) ==> [2, 1]
- * shape(expand_dims(t, -1)) ==> [2, 1]
- * 
+ * shape(expand_dims(t, 0)) ==> [1, 2]
+ * shape(expand_dims(t, 1)) ==> [2, 1]
+ * shape(expand_dims(t, -1)) ==> [2, 1]
+ *
  * # 't2' is a tensor of shape [2, 3, 5]
- * shape(expand_dims(t2, 0)) ==> [1, 2, 3, 5]
- * shape(expand_dims(t2, 2)) ==> [2, 3, 1, 5]
- * shape(expand_dims(t2, 3)) ==> [2, 3, 5, 1]
- * }
- * This operation requires that: - *

- * `-1-input.dims() <= dim <= input.dims()` - *

- * This operation is related to `squeeze()`, which removes dimensions of + * shape(expand_dims(t2, 0)) ==> [1, 2, 3, 5] + * shape(expand_dims(t2, 2)) ==> [2, 3, 1, 5] + * shape(expand_dims(t2, 3)) ==> [2, 3, 5, 1] + *

+ *

This operation requires that: + *

{@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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExpandDims"; + + private Output output; + + public ExpandDims(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ExpandDims operation. - * + * * @param scope current scope - * @param input + * @param input The input value * @param axis 0-D (scalar). Specifies the dimension index at which to - * expand the shape of `input`. Must be in the range - * `[-rank(input) - 1, rank(input)]`. + * expand the shape of {@code input}. Must be in the range + * {@code [-rank(input) - 1, rank(input)]}. + * @param data type for {@code ExpandDims} output and operands * @return a new instance of ExpandDims */ - @Endpoint(describeByClass = true) - public static ExpandDims create(Scope scope, Operand input, Operand axis) { - OperationBuilder opBuilder = scope.env().opBuilder("ExpandDims", scope.makeOpName("ExpandDims")); + @Endpoint( + describeByClass = true + ) + public static ExpandDims create(Scope scope, Operand input, + Operand axis) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ExpandDims"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); - return new ExpandDims(opBuilder.build()); + return new ExpandDims<>(opBuilder.build()); } - + /** - * Contains the same data as `input`, but its shape has an additional + * Gets output. + * Contains the same data as {@code input}, but its shape has an additional * dimension of size 1 added. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExpandDims"; - - private Output output; - - private ExpandDims(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 e733d79233a..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,86 +17,143 @@ 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 `patches` from `input` and put them in the `"depth"` output dimension. 3D extension of `extract_image_patches`. - * - * @param data type for {@code patches()} output + * Extract {@code patches} from {@code input} and put them in the {@code "depth"} output dimension. 3D extension of {@code extract_image_patches}. */ +@OpMetadata( + opType = ExtractVolumePatches.OP_NAME, + inputsClass = ExtractVolumePatches.Inputs.class +) @Operator public final class ExtractVolumePatches extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExtractVolumePatches"; + + private Output patches; + + public ExtractVolumePatches(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + patches = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ExtractVolumePatches operation. - * + * * @param scope current scope - * @param input 5-D Tensor with shape `[batch, in_planes, in_rows, in_cols, depth]`. - * @param ksizes The size of the sliding window for each dimension of `input`. + * @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 - * `input`. Must be: `[1, stride_planes, stride_rows, stride_cols, 1]`. + * {@code input}. Must be: {@code [1, stride_planes, stride_rows, stride_cols, 1]}. * @param padding The type of padding algorithm to use. - *

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

{@code
+   * 

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]
-   * }
- * + *
+ * @param data type for {@code ExtractVolumePatches} output and operands * @return a new instance of ExtractVolumePatches */ - @Endpoint(describeByClass = true) - public static ExtractVolumePatches create(Scope scope, Operand input, List ksizes, List strides, String padding) { - OperationBuilder opBuilder = scope.env().opBuilder("ExtractVolumePatches", scope.makeOpName("ExtractVolumePatches")); + @Endpoint( + describeByClass = true + ) + public static ExtractVolumePatches create(Scope scope, Operand input, + List ksizes, List strides, String padding) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ExtractVolumePatches"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); long[] ksizesArray = new long[ksizes.size()]; - for (int i = 0; i < ksizesArray.length; ++i) { + for (int i = 0 ; i < ksizesArray.length ; i++) { ksizesArray[i] = ksizes.get(i); } opBuilder.setAttr("ksizes", ksizesArray); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); opBuilder.setAttr("padding", padding); - return new ExtractVolumePatches(opBuilder.build()); + return new ExtractVolumePatches<>(opBuilder.build()); } - + /** - * 5-D Tensor with shape `[batch, out_planes, out_rows, out_cols, - * ksize_planes * ksize_rows * ksize_cols * depth]` containing patches - * with size `ksize_planes x ksize_rows x ksize_cols x depth` vectorized - * in the "depth" dimension. Note `out_planes`, `out_rows` and `out_cols` + * Gets patches. + * 5-D Tensor with shape {@code [batch, out_planes, out_rows, out_cols, ksize_planes * ksize_rows * ksize_cols * depth]} containing patches + * with size {@code ksize_planes x ksize_rows x ksize_cols x depth} vectorized + * in the "depth" dimension. Note {@code out_planes}, {@code out_rows} and {@code out_cols} * are the dimensions of the output patches. + * @return patches. */ public Output patches() { return patches; } - + @Override public Output asOutput() { return patches; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExtractVolumePatches"; - - private Output patches; - - private ExtractVolumePatches(Operation operation) { - super(operation); - int outputIdx = 0; - patches = operation.output(outputIdx++); + + @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 fac22b5f885..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,88 +17,133 @@ 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; /** * Creates a tensor filled with a scalar value. - *

- * This operation creates a tensor of shape `dims` and fills it with `value`. - *

- * For example: - *

{@code
+ * This operation creates a tensor of shape {@code dims} and fills it with {@code value}.
+ * 

For example: + *

  * # Output tensor has shape [2, 3].
- * fill([2, 3], 9) ==> [[9, 9, 9]
+ * fill([2, 3], 9) ==> [[9, 9, 9]
  *                      [9, 9, 9]]
- * }
- * `tf.fill` differs from `tf.constant` in a few ways: + *
+ *

{@code tf.fill} differs from {@code tf.constant} in a few ways: *

    - *
  • - * `tf.fill` only supports scalar contents, whereas `tf.constant` supports - * Tensor values. - *
  • - *
  • - * `tf.fill` creates an Op in the computation graph that constructs the actual - * Tensor value at runtime. This is in contrast to `tf.constant` which embeds - * the entire Tensor into the graph with a `Const` node. - *
  • - *
  • - * Because `tf.fill` evaluates at graph runtime, it supports dynamic shapes - * based on other runtime Tensors, unlike `tf.constant`. - * - * @param data type for {@code output()} output + *
  • {@code tf.fill} only supports scalar contents, whereas {@code tf.constant} supports + * Tensor values.
  • + *
  • {@code tf.fill} creates an Op in the computation graph that constructs the actual + * Tensor value at runtime. This is in contrast to {@code tf.constant} which embeds + * the entire Tensor into the graph with a {@code Const} node.
  • + *
  • Because {@code tf.fill} evaluates at graph runtime, it supports dynamic shapes + * based on other runtime Tensors, unlike {@code tf.constant}.
  • + *
*/ +@OpMetadata( + opType = Fill.OP_NAME, + inputsClass = Fill.Inputs.class +) @Operator public final class Fill extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Fill"; + + private Output output; + + public Fill(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Fill operation. - * + * * @param scope current scope * @param dims 1-D. Represents the shape of the output tensor. * @param value 0-D (scalar). Value to fill the returned tensor. - *

- * @compatibility(numpy) + *

{@literal @}compatibility(numpy)
* Equivalent to np.full - * @end_compatibility + *
{@literal @}end_compatibility + * @param data type for {@code Fill} output and operands * @return a new instance of Fill */ - @Endpoint(describeByClass = true) - public static Fill create(Scope scope, Operand dims, Operand value) { - OperationBuilder opBuilder = scope.env().opBuilder("Fill", scope.makeOpName("Fill")); + @Endpoint( + describeByClass = true + ) + public static Fill create(Scope scope, Operand dims, + Operand value) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Fill"); opBuilder.addInput(dims.asOutput()); opBuilder.addInput(value.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Fill(opBuilder.build()); + return new Fill<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Fill"; - - private Output output; - - private Fill(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 5911fa07e40..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,93 +17,131 @@ 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; /** * Generates fingerprint values. - *

- * Generates fingerprint values of `data`. - *

- * Fingerprint op considers the first dimension of `data` as the batch dimension, - * and `output[i]` contains the fingerprint value generated from contents in - * `data[i, ...]` for all `i`. - *

- * Fingerprint op writes fingerprint values as byte arrays. For example, the - * default method `farmhash64` generates a 64-bit fingerprint value at a time. - * This 8-byte value is written out as an `uint8` array of size 8, in little-endian + * Generates fingerprint values of {@code data}. + *

Fingerprint op considers the first dimension of {@code data} as the batch dimension, + * and {@code output[i]} contains the fingerprint value generated from contents in + * {@code data[i, ...]} for all {@code i}. + *

Fingerprint op writes fingerprint values as byte arrays. For example, the + * default method {@code farmhash64} generates a 64-bit fingerprint value at a time. + * This 8-byte value is written out as an {@code uint8} array of size 8, in little-endian * order. - *

- * For example, suppose that `data` has data type `DT_INT32` and shape (2, 3, 4), - * and that the fingerprint method is `farmhash64`. In this case, the output shape - * is (2, 8), where 2 is the batch dimension size of `data`, and 8 is the size of - * each fingerprint value in bytes. `output[0, :]` is generated from 12 integers in - * `data[0, :, :]` and similarly `output[1, :]` is generated from other 12 integers - * in `data[1, :, :]`. - *

- * Note that this op fingerprints the raw underlying buffer, and it does not + *

For example, suppose that {@code data} has data type {@code DT_INT32} and shape (2, 3, 4), + * and that the fingerprint method is {@code farmhash64}. In this case, the output shape + * is (2, 8), where 2 is the batch dimension size of {@code data}, and 8 is the size of + * each fingerprint value in bytes. {@code output[0, :]} is generated from 12 integers in + * {@code data[0, :, :]} and similarly {@code output[1, :]} is generated from other 12 integers + * in {@code data[1, :, :]}. + *

Note that this op fingerprints the raw underlying buffer, and it does not * fingerprint Tensor's metadata such as data type and/or shape. For example, the * fingerprint values are invariant under reshapes and bitcasts as long as the * batch dimension remain the same: - *

{@code
+ * 
  * Fingerprint(data) == Fingerprint(Reshape(data, ...))
  * Fingerprint(data) == Fingerprint(Bitcast(data, ...))
- * }
- * For string data, one should expect `Fingerprint(data) != - * Fingerprint(ReduceJoin(data))` in general. + *
+ *

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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Fingerprint"; + + private Output fingerprint; + + public Fingerprint(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + fingerprint = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Fingerprint operation. - * + * * @param scope current scope * @param data Must have rank 1 or higher. * @param method Fingerprint method used by this op. Currently available method is - * `farmhash::fingerprint64`. + * {@code farmhash::fingerprint64}. * @return a new instance of Fingerprint */ - @Endpoint(describeByClass = true) - public static Fingerprint create(Scope scope, Operand data, Operand method) { - OperationBuilder opBuilder = scope.env().opBuilder("Fingerprint", scope.makeOpName("Fingerprint")); + @Endpoint( + describeByClass = true + ) + public static Fingerprint create(Scope scope, Operand data, + Operand method) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Fingerprint"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(method.asOutput()); - opBuilder = scope.apply(opBuilder); return new Fingerprint(opBuilder.build()); } - + /** - * A two-dimensional `Tensor` of type `tf.uint8`. The first dimension equals to - * `data`'s first dimension, and the second dimension size depends on the + * Gets fingerprint. + * A two-dimensional {@code Tensor} of type {@code tf.uint8}. The first dimension equals to + * {@code data}'s first dimension, and the second dimension size depends on the * fingerprint algorithm. + * @return fingerprint. */ public Output fingerprint() { return fingerprint; } - + @Override public Output asOutput() { return fingerprint; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Fingerprint"; - - private Output fingerprint; - - private Fingerprint(Operation operation) { - super(operation); - int outputIdx = 0; - fingerprint = operation.output(outputIdx++); + + @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 new file mode 100644 index 00000000000..db91928c495 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/For.java @@ -0,0 +1,156 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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> { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "For"; + + private List> output; + + @SuppressWarnings("unchecked") + public For(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 For operation. + * + * @param scope current scope + * @param start The lower bound. An int32 + * @param limit The upper bound. An int32 + * @param delta The increment. An int32 + * @param input A list of input tensors whose types are T. + * @param body
+   * A function that takes a list of tensors (int32, T) and returns another
+   * list of tensors (T).
+   * 
+ * @return a new instance of For + */ + @Endpoint( + describeByClass = true, + name = "forOp" + ) + public static For create(Scope scope, Operand start, Operand limit, + Operand delta, Iterable> input, ConcreteFunction body) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "For"); + opBuilder.addInput(start.asOutput()); + opBuilder.addInput(limit.asOutput()); + opBuilder.addInput(delta.asOutput()); + opBuilder.addInputList(Operands.asOutputs(input)); + opBuilder.setAttr("body", body); + return new For(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(); + } + + @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 e4a366d96f3..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,89 +17,92 @@ 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; /** - * Gather slices from `params` axis `axis` according to `indices`. - *

- * `indices` must be an integer tensor of any dimension (usually 0-D or 1-D). - * Produces an output tensor with shape `params.shape[:axis] + - * indices.shape[batch_dims:] + params.shape[axis + 1:]` where: - *

{@code
+ * Gather slices from {@code params} axis {@code axis} according to {@code indices}.
+ * {@code indices} must be an integer tensor of any dimension (usually 0-D or 1-D).
+ * Produces an output tensor with shape {@code params.shape[:axis] + indices.shape[batch_dims:] + params.shape[axis + 1:]} where:
+ * 
  *     # Scalar indices (output is rank(params) - 1).
  *     output[a_0, ..., a_n, b_0, ..., b_n] =
  *       params[a_0, ..., a_n, indices, b_0, ..., b_n]
- * 
+ *
  *     # Vector indices (output is rank(params)).
  *     output[a_0, ..., a_n, i, b_0, ..., b_n] =
  *       params[a_0, ..., a_n, indices[i], b_0, ..., b_n]
- * 
+ *
  *     # Higher rank indices (output is rank(params) + rank(indices) - 1).
  *     output[a_0, ..., a_n, i, ..., j, b_0, ... b_n] =
  *       params[a_0, ..., a_n, indices[i, ..., j], b_0, ..., b_n]
- * }
+ *
*
* *
- *

- * Note that on CPU, if an out of bound index is found, an error is returned. + *

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

- * See also `tf.batch_gather` and `tf.gather_nd`. - * - * @param data type for {@code output()} output + *

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}. */ +@OpMetadata( + opType = Gather.OP_NAME, + inputsClass = Gather.Inputs.class +) @Operator public final class Gather extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Gather} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param batchDims - */ - public Options batchDims(Long batchDims) { - this.batchDims = batchDims; - return this; - } - - private Long batchDims; - - private Options() { - } + public static final String OP_NAME = "GatherV2"; + + private Output output; + + public Gather(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Gather operation. - * + * Factory method to create a class wrapping a new GatherV2 operation. + * * @param scope current scope * @param params The tensor from which to gather values. Must be at least rank - * `axis + 1`. - * @param indices Index tensor. Must be in range `[0, params.shape[axis])`. - * @param axis The axis in `params` to gather `indices` from. Defaults to the first + * {@code axis + 1}. + * @param indices Index tensor. Must be in range {@code [0, params.shape[axis])}. + * @param axis The axis in {@code params} to gather {@code indices} from. Defaults to the first * dimension. Supports negative indexes. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code GatherV2} output and operands * @return a new instance of Gather */ - @Endpoint(describeByClass = true) - public static Gather create(Scope scope, Operand params, Operand indices, Operand axis, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("GatherV2", scope.makeOpName("Gather")); + @Endpoint( + describeByClass = true + ) + public static Gather create(Scope scope, Operand params, + Operand indices, Operand axis, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Gather"); opBuilder.addInput(params.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.batchDims != null) { @@ -107,37 +110,106 @@ public static Gather create(Scope scope, Operand params, } } } - return new Gather(opBuilder.build()); + return new Gather<>(opBuilder.build()); } - + /** - * @param batchDims + * Sets the batchDims option. + * + * @param batchDims the batchDims option + * @return this Options instance. */ public static Options batchDims(Long batchDims) { return new Options().batchDims(batchDims); } - + /** - * Values from `params` gathered from indices given by `indices`, with - * shape `params.shape[:axis] + indices.shape + params.shape[axis + 1:]`. + * Gets output. + * Values from {@code params} gathered from indices given by {@code indices}, with + * shape {@code params.shape[:axis] + indices.shape + params.shape[axis + 1:]}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "GatherV2"; - - private Output output; - - private Gather(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Gather} + */ + 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; + } + } + + @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 d7a5fa04b7e..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,156 +17,253 @@ 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; /** - * Gather slices from `params` into a Tensor with shape specified by `indices`. - *

- * `indices` is a K-dimensional integer tensor, best thought of as a - * (K-1)-dimensional tensor of indices into `params`, where each element defines a - * slice of `params`: - *

- * output[\\(i_0, ..., i_{K-2}\\)] = params[indices[\\(i_0, ..., i_{K-2}\\)]] - *

- * Whereas in `tf.gather` `indices` defines slices into the `axis` - * dimension of `params`, in `tf.gather_nd`, `indices` defines slices into the - * first `N` dimensions of `params`, where `N = indices.shape[-1]`. - *

- * The last dimension of `indices` can be at most the rank of - * `params`: - *

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

- * The last dimension of `indices` corresponds to elements - * (if `indices.shape[-1] == params.rank`) or slices - * (if `indices.shape[-1] < params.rank`) along dimension `indices.shape[-1]` - * of `params`. The output tensor has shape - *

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

- * Some examples below. - *

- * Simple indexing into a matrix: - *

{@code
+ * Gather slices from {@code params} into a Tensor with shape specified by {@code indices}.
+ * {@code indices} is a K-dimensional integer tensor, best thought of as a
+ * (K-1)-dimensional tensor of indices into {@code params}, where each element defines a
+ * slice of {@code params}:
+ * 
+ * output[\\(i_0, ..., i_{K-2}\\)] = params[indices[\\(i_0, ..., i_{K-2}\\)]]
+ * 
+ *

Whereas in {@code tf.gather} {@code indices} defines slices into the {@code axis} + * dimension of {@code params}, in {@code tf.gather_nd}, {@code indices} defines slices into the + * first {@code N} dimensions of {@code params}, where {@code N = indices.shape[-1]}. + *

The last dimension of {@code indices} can be at most the rank of + * {@code params}: + *

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

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

+ * indices.shape[:-1] + params.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 error and set the corresponding output to 0; + * supported on both CPU and GPU.
  6. + *
+ *

Some examples below. + *

Simple indexing into a matrix: + *

  *     indices = [[0, 0], [1, 1]]
  *     params = [['a', 'b'], ['c', 'd']]
  *     output = ['a', 'd']
- * }
- * Slice indexing into a matrix: - *
{@code
+ * 
+ *

Slice indexing into a matrix: + *

  *     indices = [[1], [0]]
  *     params = [['a', 'b'], ['c', 'd']]
  *     output = [['c', 'd'], ['a', 'b']]
- * }
- * Indexing into a 3-tensor: - *
{@code
+ * 
+ *

Indexing into a 3-tensor: + *

  *     indices = [[1]]
  *     params = [[['a0', 'b0'], ['c0', 'd0']],
  *               [['a1', 'b1'], ['c1', 'd1']]]
  *     output = [[['a1', 'b1'], ['c1', 'd1']]]
- * 
- * 
+ *
+ *
  *     indices = [[0, 1], [1, 0]]
  *     params = [[['a0', 'b0'], ['c0', 'd0']],
  *               [['a1', 'b1'], ['c1', 'd1']]]
  *     output = [['c0', 'd0'], ['a1', 'b1']]
- * 
- * 
+ *
+ *
  *     indices = [[0, 0, 1], [1, 0, 1]]
  *     params = [[['a0', 'b0'], ['c0', 'd0']],
  *               [['a1', 'b1'], ['c1', 'd1']]]
  *     output = ['b0', 'b1']
- * }
- * Batched indexing into a matrix: - *
{@code
+ * 
+ *

Batched indexing into a matrix: + *

  *     indices = [[[0, 0]], [[0, 1]]]
  *     params = [['a', 'b'], ['c', 'd']]
  *     output = [['a'], ['b']]
- * }
- * Batched slice indexing into a matrix: - *
{@code
+ * 
+ *

Batched slice indexing into a matrix: + *

  *     indices = [[[1]], [[0]]]
  *     params = [['a', 'b'], ['c', 'd']]
  *     output = [[['c', 'd']], [['a', 'b']]]
- * }
- * Batched indexing into a 3-tensor: - *
{@code
+ * 
+ *

Batched indexing into a 3-tensor: + *

  *     indices = [[[1]], [[0]]]
  *     params = [[['a0', 'b0'], ['c0', 'd0']],
  *               [['a1', 'b1'], ['c1', 'd1']]]
  *     output = [[[['a1', 'b1'], ['c1', 'd1']]],
  *               [[['a0', 'b0'], ['c0', 'd0']]]]
- * 
+ *
  *     indices = [[[0, 1], [1, 0]], [[0, 0], [1, 1]]]
  *     params = [[['a0', 'b0'], ['c0', 'd0']],
  *               [['a1', 'b1'], ['c1', 'd1']]]
  *     output = [[['c0', 'd0'], ['a1', 'b1']],
  *               [['a0', 'b0'], ['c1', 'd1']]]
- * 
- * 
+ *
+ *
  *     indices = [[[0, 0, 1], [1, 0, 1]], [[0, 1, 1], [1, 1, 0]]]
  *     params = [[['a0', 'b0'], ['c0', 'd0']],
  *               [['a1', 'b1'], ['c1', 'd1']]]
  *     output = [['b0', 'b1'], ['d0', 'c1']]
- * }
- * See also `tf.gather` and `tf.batch_gather`. - * - * @param data type for {@code output()} output + *
+ *

See also {@code tf.gather} and {@code tf.batch_gather}. */ +@OpMetadata( + opType = GatherNd.OP_NAME, + inputsClass = GatherNd.Inputs.class +) @Operator public final class GatherNd extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GatherNd"; + + private Output output; + + public GatherNd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new GatherNd 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 */ - @Endpoint(describeByClass = true) - public static GatherNd create(Scope scope, Operand params, Operand indices) { - OperationBuilder opBuilder = scope.env().opBuilder("GatherNd", scope.makeOpName("GatherNd")); + @Endpoint( + describeByClass = true + ) + public static GatherNd create(Scope scope, Operand params, + Operand indices, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GatherNd"); opBuilder.addInput(params.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); - return new GatherNd(opBuilder.build()); + 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); } - + /** - * Values from `params` gathered from indices given by `indices`, with - * shape `indices.shape[:-1] + params.shape[indices.shape[-1]:]`. + * Gets output. + * Values from {@code params} gathered from indices given by {@code indices}, with + * shape {@code indices.shape[:-1] + params.shape[indices.shape[-1]:]}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "GatherNd"; - - private Output output; - - private GatherNd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * 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 e3a46804398..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,59 +17,96 @@ 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 { - /** - * Factory method to create a class wrapping a new GetSessionHandle operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GetSessionHandleV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + public GetSessionHandle(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new GetSessionHandleV2 operation. + * * @param scope current scope * @param value The tensor to be stored. * @return a new instance of GetSessionHandle */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static GetSessionHandle create(Scope scope, Operand value) { - OperationBuilder opBuilder = scope.env().opBuilder("GetSessionHandleV2", scope.makeOpName("GetSessionHandle")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GetSessionHandle"); opBuilder.addInput(value.asOutput()); - opBuilder = scope.apply(opBuilder); return new GetSessionHandle(opBuilder.build()); } - + /** + * Gets handle. * The handle for the tensor stored in the session state, represented * as a ResourceHandle object. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "GetSessionHandleV2"; - - private Output handle; - - private GetSessionHandle(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 8a04f173ef8..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,63 +17,99 @@ 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GetSessionTensor"; + + private Output value; + + public GetSessionTensor(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + value = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new GetSessionTensor operation. - * + * * @param scope current scope * @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 * @return a new instance of GetSessionTensor */ - @Endpoint(describeByClass = true) - public static GetSessionTensor create(Scope scope, Operand handle, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("GetSessionTensor", scope.makeOpName("GetSessionTensor")); + @Endpoint( + describeByClass = true + ) + public static GetSessionTensor create(Scope scope, Operand handle, + Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GetSessionTensor"); opBuilder.addInput(handle.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new GetSessionTensor(opBuilder.build()); + return new GetSessionTensor<>(opBuilder.build()); } - + /** + * Gets value. * The tensor for the given handle. + * @return value. */ public Output value() { return value; } - + @Override public Output asOutput() { return value; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "GetSessionTensor"; - - private Output value; - - private GetSessionTensor(Operation operation) { - super(operation); - int outputIdx = 0; - value = operation.output(outputIdx++); + + @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 aeab16c7c6c..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,65 +17,98 @@ 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; /** * Gives a guarantee to the TF runtime that the input tensor is a constant. - *

* The runtime is then free to make optimizations based on this. - *

- * Only accepts value typed tensors as inputs and rejects resource variable handles + *

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

Returns the input tensor without modification. */ +@OpMetadata( + opType = GuaranteeConst.OP_NAME, + inputsClass = GuaranteeConst.Inputs.class +) @Operator public final class GuaranteeConst extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GuaranteeConst"; + + private Output output; + + public GuaranteeConst(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new GuaranteeConst operation. - * + * * @param scope current scope - * @param input + * @param input The input value + * @param data type for {@code GuaranteeConst} output and operands * @return a new instance of GuaranteeConst */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static GuaranteeConst create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("GuaranteeConst", scope.makeOpName("GuaranteeConst")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GuaranteeConst"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new GuaranteeConst(opBuilder.build()); + return new GuaranteeConst<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "GuaranteeConst"; - - private Output output; - - private GuaranteeConst(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 75f53539f84..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,80 +17,66 @@ 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 non-initialized hash table. - *

* This op creates a hash table, specifying the type of its keys and values. * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.HashTable} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this table is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this table is shared under the given name across - * multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param useNodeNameSharing If true and shared_name is empty, the table is shared - * using the node name. - */ - public Options useNodeNameSharing(Boolean useNodeNameSharing) { - this.useNodeNameSharing = useNodeNameSharing; - return this; - } - - private String container; - private String sharedName; - private Boolean useNodeNameSharing; - - private Options() { - } + public static final String OP_NAME = "HashTableV2"; + + private Output tableHandle; + + @SuppressWarnings("unchecked") + public HashTable(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + tableHandle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new HashTable operation. - * + * Factory method to create a class wrapping a new HashTableV2 operation. + * * @param scope current scope * @param keyDtype Type of the table keys. * @param valueDtype Type of the table values. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code HashTableV2} output and operands + * @param data type for {@code HashTableV2} output and operands * @return a new instance of HashTable */ - @Endpoint(describeByClass = true) - public static HashTable create(Scope scope, Class keyDtype, Class valueDtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("HashTableV2", scope.makeOpName("HashTable")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static HashTable create(Scope scope, Class keyDtype, + Class valueDtype, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "HashTable"); opBuilder.setAttr("key_dtype", Operands.toDataType(keyDtype)); opBuilder.setAttr("value_dtype", Operands.toDataType(valueDtype)); if (options != null) { @@ -108,52 +94,145 @@ public static HashTable create(Scope scope, C } return new HashTable(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this table is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this table is shared under the given name across * multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Sets the useNodeNameSharing option. + * * @param useNodeNameSharing If true and shared_name is empty, the table is shared * using the node name. + * @return this Options instance. */ public static Options useNodeNameSharing(Boolean useNodeNameSharing) { return new Options().useNodeNameSharing(useNodeNameSharing); } - + /** + * Gets tableHandle. * Handle to a table. + * @return tableHandle. */ - public Output tableHandle() { + public Output tableHandle() { return tableHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) tableHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "HashTableV2"; - - private Output tableHandle; - - private HashTable(Operation operation) { - super(operation); - int outputIdx = 0; - tableHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.HashTable} + */ + public static class Options { + private String container; + + private String sharedName; + + private Boolean useNodeNameSharing; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this table is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this table is shared under the given name across + * multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the useNodeNameSharing option. + * + * @param useNodeNameSharing If true and shared_name is empty, the table is shared + * using the node name. + * @return this Options instance. + */ + public Options useNodeNameSharing(Boolean useNodeNameSharing) { + this.useNodeNameSharing = 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 86e6cce541a..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,101 +17,160 @@ 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; /** * Return histogram of values. - *

- * Given the tensor `values`, this operation returns a rank 1 histogram counting - * the number of entries in `values` that fall into every bin. The bins are - * equal width and determined by the arguments `value_range` and `nbins`. - *

{@code
+ * Given the tensor {@code values}, this operation returns a rank 1 histogram counting
+ * the number of entries in {@code values} that fall into every bin.  The bins are
+ * equal width and determined by the arguments {@code value_range} and {@code nbins}.
+ * 
  * # Bins will be:  (-inf, 1), [1, 2), [2, 3), [3, 4), [4, inf)
  * nbins = 5
  * value_range = [0.0, 5.0]
  * new_values = [-1.0, 0.0, 1.5, 2.0, 5.0, 15]
- * 
+ *
  * with tf.get_default_session() as sess:
  *   hist = tf.histogram_fixed_width(new_values, value_range, nbins=5)
  *   variables.global_variables_initializer().run()
- *   sess.run(hist) => [2, 1, 1, 0, 2]
- * }
- * - * - * @param data type for {@code out()} output + * sess.run(hist) => [2, 1, 1, 0, 2] + *
*/ +@OpMetadata( + opType = HistogramFixedWidth.OP_NAME, + inputsClass = HistogramFixedWidth.Inputs.class +) @Operator public final class HistogramFixedWidth extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "HistogramFixedWidth"; + + private Output out; + + public HistogramFixedWidth(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new HistogramFixedWidth operation. - * + * * @param scope current scope - * @param values Numeric `Tensor`. - * @param valueRange Shape [2] `Tensor` of same `dtype` as `values`. - * values <= value_range[0] will be mapped to hist[0], - * values >= value_range[1] will be mapped to hist[-1]. - * @param nbins Scalar `int32 Tensor`. Number of histogram bins. - * @param dtype + * @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 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 */ - @Endpoint(describeByClass = true) - public static HistogramFixedWidth create(Scope scope, Operand values, Operand valueRange, Operand nbins, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("HistogramFixedWidth", scope.makeOpName("HistogramFixedWidth")); + @Endpoint( + describeByClass = true + ) + public static HistogramFixedWidth create(Scope scope, + Operand values, Operand valueRange, Operand nbins, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "HistogramFixedWidth"); opBuilder.addInput(values.asOutput()); opBuilder.addInput(valueRange.asOutput()); opBuilder.addInput(nbins.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new HistogramFixedWidth(opBuilder.build()); + return new HistogramFixedWidth<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new HistogramFixedWidth operation using default output types. - * + * Factory method to create a class wrapping a new HistogramFixedWidth operation, with the default output types. + * * @param scope current scope - * @param values Numeric `Tensor`. - * @param valueRange Shape [2] `Tensor` of same `dtype` as `values`. - * values <= value_range[0] will be mapped to hist[0], - * values >= value_range[1] will be mapped to hist[-1]. - * @param nbins Scalar `int32 Tensor`. Number of histogram bins. - * @return a new instance of HistogramFixedWidth + * @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 data type for {@code HistogramFixedWidth} output and operands + * @return a new instance of HistogramFixedWidth, with default output types */ - @Endpoint(describeByClass = true) - public static HistogramFixedWidth create(Scope scope, Operand values, Operand valueRange, Operand nbins) { + @Endpoint( + describeByClass = true + ) + public static HistogramFixedWidth create(Scope scope, + Operand values, Operand valueRange, Operand nbins) { return create(scope, values, valueRange, nbins, TInt32.class); } - + /** - * A 1-D `Tensor` holding histogram of values. + * Gets out. + * A 1-D {@code Tensor} holding histogram of values. + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "HistogramFixedWidth"; - - private Output out; - - private HistogramFixedWidth(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + @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 51030fd8349..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,58 +17,94 @@ 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Identity"; + + private Output output; + + public Identity(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Identity operation. - * + * * @param scope current scope - * @param input + * @param input The input value + * @param data type for {@code Identity} output and operands * @return a new instance of Identity */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Identity create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("Identity", scope.makeOpName("Identity")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Identity"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Identity(opBuilder.build()); + return new Identity<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Identity"; - - private Output output; - - private Identity(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 02bf0f00422..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,76 +20,112 @@ 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; /** * Returns a list of tensors with the same shapes and contents as the input - *

* tensors. - *

- * This op can be used to override the gradient for complicated functions. For + *

This op can be used to override the gradient for complicated functions. For * example, suppose y = f(x) and we wish to apply a custom function g for backprop * such that dx = g(dy). In Python, - *

{@code
+ * 
  * with tf.get_default_graph().gradient_override_map(
  *     {'IdentityN': 'OverrideGradientWithG'}):
  *   y, _ = identity_n([f(x), x])
- * 
- * @tf.RegisterGradient('OverrideGradientWithG')
+ *
+ * {@literal @}tf.RegisterGradient('OverrideGradientWithG')
  * def ApplyG(op, dy, _):
  *   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> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IdentityN"; + + private List> output; + + @SuppressWarnings("unchecked") + public IdentityN(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 IdentityN operation. - * + * * @param scope current scope - * @param input + * @param input The input value * @return a new instance of IdentityN */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static IdentityN create(Scope scope, Iterable> input) { - OperationBuilder opBuilder = scope.env().opBuilder("IdentityN", scope.makeOpName("IdentityN")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IdentityN"); opBuilder.addInputList(Operands.asOutputs(input)); - opBuilder = scope.apply(opBuilder); return new IdentityN(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public List> output() { return output; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) output.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IdentityN"; - - private List> output; - - private IdentityN(Operation operation) { - super(operation); - int outputIdx = 0; - int outputLength = operation.outputListLength("output"); - output = Arrays.asList(operation.outputList(outputIdx, outputLength)); - outputIdx += outputLength; + + @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 new file mode 100644 index 00000000000..c1635ef8c06 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/If.java @@ -0,0 +1,147 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.Output; +import org.tensorflow.ndarray.Shape; +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(input) : else_branch(input) + * + *

Selects between {@link StatefulIf} and {@link StatelessIf} based on the statefulness of the function arguments. + */ +@Operator +public interface If extends Iterable> { + /** + * Factory method to create a class wrapping a new If operation. + * + * @param scope current scope + * @param cond

+   *   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.
+   * 
+ * @param input A list of input tensors. + * @param Tout A list of output types. + * @param thenBranch
+   *   A function that takes 'inputs' and returns a list of tensors, whose
+   *   types are the same as what else_branch returns.
+   * 
+ * @param elseBranch
+   * A function that takes 'inputs' and returns a list of tensors, whose
+   * types are the same as what then_branch returns.
+   * 
+ * @param options carries optional attribute values + * @return a new instance of If + */ + @Endpoint( + describeByClass = true, + name = "ifOp" + ) + static If create(Scope scope, Operand cond, Iterable> input, + List> Tout, ConcreteFunction thenBranch, ConcreteFunction elseBranch, + Options... options) { + boolean isStateful = false; + if (thenBranch.isStateful()) { + isStateful = true; + } + if (elseBranch.isStateful()) { + isStateful = true; + } + if (isStateful) { + return StatefulIf.create(scope, cond, input, Tout, thenBranch, elseBranch, options); + } else { + return StatelessIf.create(scope, cond, input, Tout, thenBranch, elseBranch, options); + } + } + + /** + * Sets the outputShapes option. + * + * @param outputShapes the outputShapes option + * @return this Options instance. + */ + static Options outputShapes(List outputShapes) { + return new Options().outputShapes(outputShapes); + } + + /** + * Sets the outputShapes option. + * + * @param outputShapes the outputShapes option + * @return this Options instance. + */ + static Options outputShapes(Shape... outputShapes) { + return new Options().outputShapes(outputShapes); + } + + /** + * Gets output. + * A list of return values. + * @return output. + */ + List> output(); + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + Iterator> iterator(); + + /** + * Optional attributes for {@link org.tensorflow.op.core.If} + */ + class Options { + List outputShapes; + + 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; + } + } +} 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 319304aff8b..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,60 +26,101 @@ 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ImmutableConst"; + + private Output tensor; + + public ImmutableConst(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + tensor = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ImmutableConst operation. - * + * * @param scope current scope * @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 * NewReadOnlyMemoryRegionFromFile in tensorflow::Env. + * @param data type for {@code ImmutableConst} output and operands * @return a new instance of ImmutableConst */ - @Endpoint(describeByClass = true) - public static ImmutableConst create(Scope scope, Class dtype, Shape shape, String memoryRegionName) { - OperationBuilder opBuilder = scope.env().opBuilder("ImmutableConst", scope.makeOpName("ImmutableConst")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static ImmutableConst create(Scope scope, Class dtype, Shape shape, + String memoryRegionName) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ImmutableConst"); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); opBuilder.setAttr("shape", shape); opBuilder.setAttr("memory_region_name", memoryRegionName); - return new ImmutableConst(opBuilder.build()); + return new ImmutableConst<>(opBuilder.build()); } - + /** + * Gets tensor. + * + * @return tensor. */ public Output tensor() { return tensor; } - + @Override public Output asOutput() { return tensor; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ImmutableConst"; - - private Output tensor; - - private ImmutableConst(Operation operation) { - super(operation); - int outputIdx = 0; - tensor = operation.output(outputIdx++); + + @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 d873004b378..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,44 +17,97 @@ 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 { - /** - * Factory method to create a class wrapping a new InitializeTable operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "InitializeTableV2"; + + public InitializeTable(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new InitializeTableV2 operation. + * * @param scope current scope * @param tableHandle Handle to a table which will be initialized. * @param keys Keys of type Tkey. * @param values Values of type Tval. * @return a new instance of InitializeTable */ - @Endpoint(describeByClass = true) - public static InitializeTable create(Scope scope, Operand tableHandle, Operand keys, Operand values) { - OperationBuilder opBuilder = scope.env().opBuilder("InitializeTableV2", scope.makeOpName("InitializeTable")); + @Endpoint( + describeByClass = true + ) + public static InitializeTable create(Scope scope, Operand tableHandle, + Operand keys, Operand values) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "InitializeTable"); opBuilder.addInput(tableHandle.asOutput()); opBuilder.addInput(keys.asOutput()); opBuilder.addInput(values.asOutput()); - opBuilder = scope.apply(opBuilder); return new InitializeTable(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InitializeTableV2"; - - private InitializeTable(Operation operation) { - super(operation); + + @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 43c72730eb2..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,78 +17,71 @@ 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; /** * Initializes a table from a text file. - *

* It inserts one key-value pair into the table for each line of the file. * The key and value is extracted from the whole line content, elements from the - * split line based on `delimiter` or the line number (starting from zero). - * Where to extract the key and value from a line is specified by `key_index` and - * `value_index`. - *

- * - A value of -1 means use the line number(starting from zero), expects `int64`. - * - A value of -2 means use the whole line content, expects `string`. - * - A value >= 0 means use the index (starting at zero) of the split line based - * on `delimiter`. + * split line based on {@code delimiter} or the line number (starting from zero). + * Where to extract the key and value from a line is specified by {@code key_index} and + * {@code value_index}. + *

    + *
  • A value of -1 means use the line number(starting from zero), expects {@code int64}.
  • + *
  • A value of -2 means use the whole line content, expects {@code string}.
  • + *
  • A value >= 0 means use the index (starting at zero) of the split line based + * on {@code delimiter}.
  • + *
*/ +@OpMetadata( + opType = InitializeTableFromTextFile.OP_NAME, + inputsClass = InitializeTableFromTextFile.Inputs.class +) @Operator public final class InitializeTableFromTextFile extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.InitializeTableFromTextFile} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param vocabSize Number of elements of the file, use -1 if unknown. - */ - public Options vocabSize(Long vocabSize) { - this.vocabSize = vocabSize; - return this; - } - - /** - * @param delimiter Delimiter to separate fields in a line. - */ - public Options delimiter(String delimiter) { - this.delimiter = delimiter; - return this; - } - - private Long vocabSize; - private String delimiter; - - private Options() { - } + public static final String OP_NAME = "InitializeTableFromTextFileV2"; + + public InitializeTableFromTextFile(Operation operation) { + super(operation, OP_NAME); } - + /** - * Factory method to create a class wrapping a new InitializeTableFromTextFile operation. - * + * Factory method to create a class wrapping a new InitializeTableFromTextFileV2 operation. + * * @param scope current scope * @param tableHandle Handle to a table which will be initialized. * @param filename Filename of a vocabulary text file. - * @param keyIndex Column index in a line to get the table `key` values from. + * @param keyIndex Column index in a line to get the table {@code key} values from. * @param valueIndex Column index that represents information of a line to get the table - * `value` values from. - * @param options carries optional attributes values + * {@code value} values from. + * @param options carries optional attribute values * @return a new instance of InitializeTableFromTextFile */ - @Endpoint(describeByClass = true) - public static InitializeTableFromTextFile create(Scope scope, Operand tableHandle, Operand filename, Long keyIndex, Long valueIndex, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("InitializeTableFromTextFileV2", scope.makeOpName("InitializeTableFromTextFile")); + @Endpoint( + describeByClass = true + ) + public static InitializeTableFromTextFile create(Scope scope, + Operand tableHandle, Operand filename, Long keyIndex, + Long valueIndex, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "InitializeTableFromTextFile"); opBuilder.addInput(tableHandle.asOutput()); opBuilder.addInput(filename.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("key_index", keyIndex); opBuilder.setAttr("value_index", valueIndex); if (options != null) { @@ -99,29 +92,141 @@ public static InitializeTableFromTextFile create(Scope scope, Operand tableHa if (opts.delimiter != null) { opBuilder.setAttr("delimiter", opts.delimiter); } + if (opts.offset != null) { + opBuilder.setAttr("offset", opts.offset); + } } } return new InitializeTableFromTextFile(opBuilder.build()); } - + /** + * Sets the vocabSize option. + * * @param vocabSize Number of elements of the file, use -1 if unknown. + * @return this Options instance. */ public static Options vocabSize(Long vocabSize) { return new Options().vocabSize(vocabSize); } - + /** + * Sets the delimiter option. + * * @param delimiter Delimiter to separate fields in a line. + * @return this Options instance. */ public static Options delimiter(String delimiter) { return new Options().delimiter(delimiter); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InitializeTableFromTextFileV2"; - - private InitializeTableFromTextFile(Operation operation) { - super(operation); + + /** + * Sets the offset option. + * + * @param offset the offset option + * @return this Options instance. + */ + public static Options offset(Long offset) { + return new Options().offset(offset); + } + + /** + * Optional attributes for {@link org.tensorflow.op.core.InitializeTableFromTextFile} + */ + public static class Options { + private Long vocabSize; + + private String delimiter; + + private Long offset; + + private Options() { + } + + /** + * Sets the vocabSize option. + * + * @param vocabSize Number of elements of the file, use -1 if unknown. + * @return this Options instance. + */ + public Options vocabSize(Long vocabSize) { + this.vocabSize = vocabSize; + return this; + } + + /** + * Sets the delimiter option. + * + * @param delimiter Delimiter to separate fields in a line. + * @return this Options instance. + */ + public Options delimiter(String delimiter) { + this.delimiter = delimiter; + return this; + } + + /** + * Sets the offset option. + * + * @param offset the offset option + * @return this Options instance. + */ + public Options offset(Long offset) { + this.offset = 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 c5a3e7516b5..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,66 +17,115 @@ 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; /** - * Adds v into specified rows of x. - *

- * Computes y = x; y[i, :] += v; return y. - * - * @param data type for {@code y()} output + * Adds v into specified rows of x. + *

+ * Computes y = x; y[i, :] += v; return y.
+ * 
*/ +@OpMetadata( + opType = InplaceAdd.OP_NAME, + inputsClass = InplaceAdd.Inputs.class +) @Operator public final class InplaceAdd extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "InplaceAdd"; + + private Output y; + + public InplaceAdd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new InplaceAdd operation. - * + * * @param scope current scope - * @param x A `Tensor` of type T. - * @param i A vector. Indices into the left-most dimension of `x`. - * @param v A `Tensor` of type T. Same dimension sizes as x except the first dimension, which must be the same as i's size. + * @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. + * @param data type for {@code InplaceAdd} output and operands * @return a new instance of InplaceAdd */ - @Endpoint(describeByClass = true) - public static InplaceAdd create(Scope scope, Operand x, Operand i, Operand v) { - OperationBuilder opBuilder = scope.env().opBuilder("InplaceAdd", scope.makeOpName("InplaceAdd")); + @Endpoint( + describeByClass = true + ) + public static InplaceAdd create(Scope scope, Operand x, Operand i, + Operand v) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "InplaceAdd"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(i.asOutput()); opBuilder.addInput(v.asOutput()); - opBuilder = scope.apply(opBuilder); - return new InplaceAdd(opBuilder.build()); + return new InplaceAdd<>(opBuilder.build()); } - + /** - * A `Tensor` of type T. An alias of `x`. The content of `y` is undefined if there are duplicates in `i`. + * Gets y. + * A {@code Tensor} of type T. An alias of {@code x}. The content of {@code y} is undefined if there are duplicates in {@code i}. + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InplaceAdd"; - - private Output y; - - private InplaceAdd(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 6e5f157cbe7..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,66 +17,116 @@ 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; /** - * Subtracts `v` into specified rows of `x`. - *

- * Computes y = x; y[i, :] -= v; return y. - * - * @param data type for {@code y()} output + *

+ * Subtracts `v` into specified rows of `x`.
+ *
+ * Computes y = x; y[i, :] -= v; return y.
+ * 
*/ +@OpMetadata( + opType = InplaceSub.OP_NAME, + inputsClass = InplaceSub.Inputs.class +) @Operator public final class InplaceSub extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "InplaceSub"; + + private Output y; + + public InplaceSub(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new InplaceSub operation. - * + * * @param scope current scope - * @param x A `Tensor` of type T. - * @param i A vector. Indices into the left-most dimension of `x`. - * @param v A `Tensor` of type T. Same dimension sizes as x except the first dimension, which must be the same as i's size. + * @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. + * @param data type for {@code InplaceSub} output and operands * @return a new instance of InplaceSub */ - @Endpoint(describeByClass = true) - public static InplaceSub create(Scope scope, Operand x, Operand i, Operand v) { - OperationBuilder opBuilder = scope.env().opBuilder("InplaceSub", scope.makeOpName("InplaceSub")); + @Endpoint( + describeByClass = true + ) + public static InplaceSub create(Scope scope, Operand x, Operand i, + Operand v) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "InplaceSub"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(i.asOutput()); opBuilder.addInput(v.asOutput()); - opBuilder = scope.apply(opBuilder); - return new InplaceSub(opBuilder.build()); + return new InplaceSub<>(opBuilder.build()); } - + /** - * A `Tensor` of type T. An alias of `x`. The content of `y` is undefined if there are duplicates in `i`. + * Gets y. + * A {@code Tensor} of type T. An alias of {@code x}. The content of {@code y} is undefined if there are duplicates in {@code i}. + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InplaceSub"; - - private Output y; - - private InplaceSub(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 4c05b4bff27..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,69 +17,115 @@ 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; /** * Updates specified rows 'i' with values 'v'. - *

- * Computes `x[i, :] = v; return x`. - *

- * Originally this function is mutative however for compilation we make this - * operation create / operate on a copy of `x`. - * - * @param data type for {@code y()} output + * 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}. */ +@OpMetadata( + opType = InplaceUpdate.OP_NAME, + inputsClass = InplaceUpdate.Inputs.class +) @Operator public final class InplaceUpdate extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "InplaceUpdate"; + + private Output y; + + public InplaceUpdate(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new InplaceUpdate operation. - * + * * @param scope current scope - * @param x A tensor of type `T`. - * @param i A vector. Indices into the left-most dimension of `x`. - * @param v A `Tensor` of type T. Same dimension sizes as x except the first dimension, which must be the same as i's size. + * @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. + * @param data type for {@code InplaceUpdate} output and operands * @return a new instance of InplaceUpdate */ - @Endpoint(describeByClass = true) - public static InplaceUpdate create(Scope scope, Operand x, Operand i, Operand v) { - OperationBuilder opBuilder = scope.env().opBuilder("InplaceUpdate", scope.makeOpName("InplaceUpdate")); + @Endpoint( + describeByClass = true + ) + public static InplaceUpdate create(Scope scope, Operand x, + Operand i, Operand v) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "InplaceUpdate"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(i.asOutput()); opBuilder.addInput(v.asOutput()); - opBuilder = scope.apply(opBuilder); - return new InplaceUpdate(opBuilder.build()); + return new InplaceUpdate<>(opBuilder.build()); } - + /** - * A `Tensor` of type T. An alias of `x`. The content of `y` is undefined if there are duplicates in `i`. + * Gets y. + * A {@code Tensor} of type T. An alias of {@code x}. The content of {@code y} is undefined if there are duplicates in {@code i}. + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InplaceUpdate"; - - private Output y; - - private InplaceUpdate(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 aea759600e0..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,59 +17,95 @@ 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; /** * 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IsVariableInitialized"; + + private Output isInitialized; + + public IsVariableInitialized(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + isInitialized = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new IsVariableInitialized operation. - * + * * @param scope current scope - * @param ref Should be from a `Variable` node. May be uninitialized. + * @param ref Should be from a {@code Variable} node. May be uninitialized. * @return a new instance of IsVariableInitialized */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static IsVariableInitialized create(Scope scope, Operand ref) { - OperationBuilder opBuilder = scope.env().opBuilder("IsVariableInitialized", scope.makeOpName("IsVariableInitialized")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IsVariableInitialized"); opBuilder.addInput(ref.asOutput()); - opBuilder = scope.apply(opBuilder); return new IsVariableInitialized(opBuilder.build()); } - + /** + * Gets isInitialized. + * + * @return isInitialized. */ public Output isInitialized() { return isInitialized; } - + @Override public Output asOutput() { return isInitialized; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IsVariableInitialized"; - - private Output isInitialized; - - private IsVariableInitialized(Operation operation) { - super(operation); - int outputIdx = 0; - isInitialized = operation.output(outputIdx++); + + @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 c52e07c05dd..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,19 +17,23 @@ 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; /** * Computes the Kth order statistic of a data set. The current - *

* implementation uses a binary search requiring exactly 32 passes over * the input data. The running time is linear with respect to input * size. The median-of-medians algorithm is probably faster, but is @@ -45,45 +49,76 @@ * 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "KthOrderStatistic"; + + private Output output; + + public KthOrderStatistic(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new KthOrderStatistic operation. - * + * * @param scope current scope - * @param input - * @param k + * @param input The input value + * @param k The value of the k attribute * @return a new instance of KthOrderStatistic */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static KthOrderStatistic create(Scope scope, Operand input, Long k) { - OperationBuilder opBuilder = scope.env().opBuilder("KthOrderStatistic", scope.makeOpName("KthOrderStatistic")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "KthOrderStatistic"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("k", k); return new KthOrderStatistic(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "KthOrderStatistic"; - - private Output output; - - private KthOrderStatistic(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 086bd32278d..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,72 +17,124 @@ 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 `num` evenly-spaced values are generated beginning at `start`. - * If `num > 1`, the values in the sequence increase by `stop - start / num - 1`, - * so that the last one is exactly `stop`. - *

- * For example: - *

{@code
- * tf.linspace(10.0, 12.0, 3, name="linspace") => [ 10.0  11.0  12.0]
- * }
- * - * - * @param data type for {@code output()} output + * 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]
+ * 
*/ +@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 + */ + public static final String OP_NAME = "LinSpace"; + + private Output output; + + public LinSpace(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LinSpace operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static LinSpace create(Scope scope, Operand start, Operand stop, Operand num) { - OperationBuilder opBuilder = scope.env().opBuilder("LinSpace", scope.makeOpName("LinSpace")); + @Endpoint( + describeByClass = true + ) + public static LinSpace create(Scope scope, Operand start, + Operand stop, Operand num) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LinSpace"); opBuilder.addInput(start.asOutput()); opBuilder.addInput(stop.asOutput()); opBuilder.addInput(num.asOutput()); - opBuilder = scope.apply(opBuilder); - return new LinSpace(opBuilder.build()); + return new LinSpace<>(opBuilder.build()); } - + /** + * Gets output. * 1-D. The generated values. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LinSpace"; - - private Output output; - - private LinSpace(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 7685fa5e7b4..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,69 +17,114 @@ 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 { - /** - * Factory method to create a class wrapping a new LookupTableExport operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LookupTableExportV2"; + + private Output keys; + + private Output values; + + public LookupTableExport(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + keys = operation.output(outputIdx++); + values = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new LookupTableExportV2 operation. + * * @param scope current scope * @param tableHandle Handle to the table. - * @param Tkeys - * @param Tvalues + * @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 */ - @Endpoint(describeByClass = true) - public static LookupTableExport create(Scope scope, Operand tableHandle, Class Tkeys, Class Tvalues) { - OperationBuilder opBuilder = scope.env().opBuilder("LookupTableExportV2", scope.makeOpName("LookupTableExport")); + @Endpoint( + describeByClass = true + ) + public static LookupTableExport create(Scope scope, + Operand tableHandle, Class Tkeys, Class Tvalues) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LookupTableExport"); opBuilder.addInput(tableHandle.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tkeys", Operands.toDataType(Tkeys)); opBuilder.setAttr("Tvalues", Operands.toDataType(Tvalues)); - return new LookupTableExport(opBuilder.build()); + return new LookupTableExport<>(opBuilder.build()); } - + /** + * Gets keys. * Vector of all keys present in the table. + * @return keys. */ public Output keys() { return keys; } - + /** - * Tensor of all values in the table. Indexed in parallel with `keys`. + * Gets values. + * Tensor of all values in the table. Indexed in parallel with {@code keys}. + * @return values. */ public Output values() { return values; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LookupTableExportV2"; - - private Output keys; - private Output values; - - private LookupTableExport(Operation operation) { - super(operation); - int outputIdx = 0; - keys = operation.output(outputIdx++); - values = operation.output(outputIdx++); + + @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 930f30b8ea7..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,70 +17,123 @@ 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; /** * Looks up keys in a table, outputs the corresponding values. - *

- * The tensor `keys` must of the same type as the keys of the table. - * The output `values` is of the type of the table values. - *

- * The scalar `default_value` is the value output for keys not present in the + * The tensor {@code keys} must of the same type as the keys of the table. + * 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 { - /** - * Factory method to create a class wrapping a new LookupTableFind operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LookupTableFindV2"; + + private Output values; + + public LookupTableFind(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + values = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new LookupTableFindV2 operation. + * * @param scope current scope * @param tableHandle Handle to the table. * @param keys Any shape. Keys to look up. - * @param defaultValue + * @param defaultValue The defaultValue value + * @param data type for {@code LookupTableFindV2} output and operands * @return a new instance of LookupTableFind */ - @Endpoint(describeByClass = true) - public static LookupTableFind create(Scope scope, Operand tableHandle, Operand keys, Operand defaultValue) { - OperationBuilder opBuilder = scope.env().opBuilder("LookupTableFindV2", scope.makeOpName("LookupTableFind")); + @Endpoint( + describeByClass = true + ) + public static LookupTableFind create(Scope scope, + Operand tableHandle, Operand keys, + Operand defaultValue) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LookupTableFind"); opBuilder.addInput(tableHandle.asOutput()); opBuilder.addInput(keys.asOutput()); opBuilder.addInput(defaultValue.asOutput()); - opBuilder = scope.apply(opBuilder); - return new LookupTableFind(opBuilder.build()); + return new LookupTableFind<>(opBuilder.build()); } - + /** - * Same shape as `keys`. Values found in the table, or `default_values` + * Gets values. + * Same shape as {@code keys}. Values found in the table, or {@code default_values} * for missing keys. + * @return values. */ public Output values() { return values; } - + @Override public Output asOutput() { return values; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LookupTableFindV2"; - - private Output values; - - private LookupTableFind(Operation operation) { - super(operation); - int outputIdx = 0; - values = operation.output(outputIdx++); + + @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 b7957c394ce..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,47 +17,99 @@ 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; /** * Replaces the contents of the table with the specified keys and values. - *

- * The tensor `keys` must be of the same type as the keys of the table. - * The tensor `values` must be of the type of the table values. + * 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 { - /** - * Factory method to create a class wrapping a new LookupTableImport operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LookupTableImportV2"; + + public LookupTableImport(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new LookupTableImportV2 operation. + * * @param scope current scope * @param tableHandle Handle to the table. * @param keys Any shape. Keys to look up. * @param values Values to associate with keys. * @return a new instance of LookupTableImport */ - @Endpoint(describeByClass = true) - public static LookupTableImport create(Scope scope, Operand tableHandle, Operand keys, Operand values) { - OperationBuilder opBuilder = scope.env().opBuilder("LookupTableImportV2", scope.makeOpName("LookupTableImport")); + @Endpoint( + describeByClass = true + ) + public static LookupTableImport create(Scope scope, Operand tableHandle, + Operand keys, Operand values) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LookupTableImport"); opBuilder.addInput(tableHandle.asOutput()); opBuilder.addInput(keys.asOutput()); opBuilder.addInput(values.asOutput()); - opBuilder = scope.apply(opBuilder); return new LookupTableImport(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LookupTableImportV2"; - - private LookupTableImport(Operation operation) { - super(operation); + + @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 c444db4fe52..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,47 +17,99 @@ 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; /** * Updates the table to associates keys with values. - *

- * The tensor `keys` must be of the same type as the keys of the table. - * The tensor `values` must be of the type of the table values. + * 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 { - /** - * Factory method to create a class wrapping a new LookupTableInsert operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LookupTableInsertV2"; + + public LookupTableInsert(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new LookupTableInsertV2 operation. + * * @param scope current scope * @param tableHandle Handle to the table. * @param keys Any shape. Keys to look up. * @param values Values to associate with keys. * @return a new instance of LookupTableInsert */ - @Endpoint(describeByClass = true) - public static LookupTableInsert create(Scope scope, Operand tableHandle, Operand keys, Operand values) { - OperationBuilder opBuilder = scope.env().opBuilder("LookupTableInsertV2", scope.makeOpName("LookupTableInsert")); + @Endpoint( + describeByClass = true + ) + public static LookupTableInsert create(Scope scope, Operand tableHandle, + Operand keys, Operand values) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LookupTableInsert"); opBuilder.addInput(tableHandle.asOutput()); opBuilder.addInput(keys.asOutput()); opBuilder.addInput(values.asOutput()); - opBuilder = scope.apply(opBuilder); return new LookupTableInsert(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LookupTableInsertV2"; - - private LookupTableInsert(Operation operation) { - super(operation); + + @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 2965fd839da..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,44 +17,85 @@ 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; /** * Removes keys and its associated values from a table. - *

- * The tensor `keys` must of the same type as the keys of the table. Keys not + * 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 { - /** - * Factory method to create a class wrapping a new LookupTableRemove operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LookupTableRemoveV2"; + + public LookupTableRemove(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new LookupTableRemoveV2 operation. + * * @param scope current scope * @param tableHandle Handle to the table. * @param keys Any shape. Keys of the elements to remove. * @return a new instance of LookupTableRemove */ - @Endpoint(describeByClass = true) - public static LookupTableRemove create(Scope scope, Operand tableHandle, Operand keys) { - OperationBuilder opBuilder = scope.env().opBuilder("LookupTableRemoveV2", scope.makeOpName("LookupTableRemove")); + @Endpoint( + describeByClass = true + ) + public static LookupTableRemove create(Scope scope, Operand tableHandle, + Operand keys) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LookupTableRemove"); opBuilder.addInput(tableHandle.asOutput()); opBuilder.addInput(keys.asOutput()); - opBuilder = scope.apply(opBuilder); return new LookupTableRemove(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LookupTableRemoveV2"; - - private LookupTableRemove(Operation operation) { - super(operation); + + @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 8960fb28f2a..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,57 +17,87 @@ 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; /** * 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 { - /** - * Factory method to create a class wrapping a new LookupTableSize operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LookupTableSizeV2"; + + private Output output; + + public LookupTableSize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new LookupTableSizeV2 operation. + * * @param scope current scope * @param tableHandle Handle to the table. * @return a new instance of LookupTableSize */ - @Endpoint(describeByClass = true) - public static LookupTableSize create(Scope scope, Operand tableHandle) { - OperationBuilder opBuilder = scope.env().opBuilder("LookupTableSizeV2", scope.makeOpName("LookupTableSize")); + @Endpoint( + describeByClass = true + ) + public static LookupTableSize create(Scope scope, Operand tableHandle) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LookupTableSize"); opBuilder.addInput(tableHandle.asOutput()); - opBuilder = scope.apply(opBuilder); return new LookupTableSize(opBuilder.build()); } - + /** + * Gets output. * Scalar that contains number of elements in the table. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LookupTableSizeV2"; - - private Output output; - - private LookupTableSize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 45744e7ce9f..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,60 +17,88 @@ 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; /** * Forwards the input to the output. - *

* This operator represents the loop termination condition used by the - * "pivot" switches of a loop. + * "pivot" switches of a loop. */ +@OpMetadata( + opType = LoopCond.OP_NAME, + inputsClass = LoopCond.Inputs.class +) @Operator public final class LoopCond extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LoopCond"; + + private Output output; + + public LoopCond(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LoopCond operation. - * + * * @param scope current scope * @param input A boolean scalar, representing the branch predicate of the Switch op. * @return a new instance of LoopCond */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static LoopCond create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("LoopCond", scope.makeOpName("LoopCond")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoopCond"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); return new LoopCond(opBuilder.build()); } - + /** - * The same tensor as `input`. + * Gets output. + * The same tensor as {@code input}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoopCond"; - - private Output output; - - private LoopCond(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 1aa8badb5a1..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,100 +17,150 @@ 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; /** * 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 - * `np.searchsorted(sorted_inputs, values, side='left')`. - *

- * The result is not a global index to the entire - * `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 data type for {@code output()} output + * {@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]] */ +@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 + */ + public static final String OP_NAME = "LowerBound"; + + private Output output; + + public LowerBound(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LowerBound operation. - * + * * @param scope current scope * @param sortedInputs 2-D Tensor where each row is ordered. - * @param values 2-D Tensor with the same numbers of rows as `sorted_search_values`. Contains - * the values that will be searched for in `sorted_search_values`. - * @param outType + * @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 */ - @Endpoint(describeByClass = true) - public static LowerBound create(Scope scope, Operand sortedInputs, Operand values, Class outType) { - OperationBuilder opBuilder = scope.env().opBuilder("LowerBound", scope.makeOpName("LowerBound")); + @Endpoint( + describeByClass = true + ) + public static LowerBound create(Scope scope, + Operand sortedInputs, Operand values, Class outType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LowerBound"); opBuilder.addInput(sortedInputs.asOutput()); opBuilder.addInput(values.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new LowerBound(opBuilder.build()); + return new LowerBound<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new LowerBound operation using default output types. - * + * Factory method to create a class wrapping a new LowerBound operation, with the default output types. + * * @param scope current scope * @param sortedInputs 2-D Tensor where each row is ordered. - * @param values 2-D Tensor with the same numbers of rows as `sorted_search_values`. Contains - * the values that will be searched for in `sorted_search_values`. - * @return a new instance of LowerBound + * @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 */ - @Endpoint(describeByClass = true) - public static LowerBound create(Scope scope, Operand sortedInputs, Operand values) { + @Endpoint( + describeByClass = true + ) + public static LowerBound create(Scope scope, Operand sortedInputs, + Operand values) { return create(scope, sortedInputs, values, TInt32.class); } - + /** - * A `Tensor` with the same shape as `values`. It contains the first scalar index + * Gets output. + * A {@code Tensor} with the same shape as {@code values}. It contains the first scalar index * into the last dimension where values can be inserted without changing the * ordered property. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LowerBound"; - - private Output output; - - private LowerBound(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 f4366722c28..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,61 +17,90 @@ 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; /** - * Make all elements in the non-Batch dimension unique, but \"close\" to - *

+ * Make all elements in the non-Batch dimension unique, but "close" to * their initial value. Never returns a sub-normal number. Never returns * zero. The sign of each input element is always identical to the sign * of the corresponding output element. Behavior for infinite elements is * undefined. Behavior for subnormal elements is undefined. */ +@OpMetadata( + opType = MakeUnique.OP_NAME, + inputsClass = MakeUnique.Inputs.class +) @Operator public final class MakeUnique extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MakeUnique"; + + private Output output; + + public MakeUnique(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MakeUnique operation. - * + * * @param scope current scope - * @param input + * @param input The input value * @return a new instance of MakeUnique */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static MakeUnique create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("MakeUnique", scope.makeOpName("MakeUnique")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MakeUnique"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); return new MakeUnique(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MakeUnique"; - - private Output output; - - private MakeUnique(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 e680e7db08a..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,80 +17,54 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.MapClear} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "MapClear"; + + 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 - * @param options carries optional attributes values + * @param dtypes The value of the dtypes attribute + * @param options carries optional attribute values * @return a new instance of MapClear */ - @Endpoint(describeByClass = true) - public static MapClear create(Scope scope, List> dtypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MapClear", scope.makeOpName("MapClear")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static MapClear create(Scope scope, List> dtypes, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MapClear"); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); if (options != null) { for (Options opts : options) { @@ -110,39 +84,144 @@ public static MapClear create(Scope scope, List> dtypes, } return new MapClear(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MapClear"; - - private MapClear(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.MapClear} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * 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; + } + } + + @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 new file mode 100644 index 00000000000..5c91ffea662 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapDefun.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.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.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; + +/** + * 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. + */ +@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 + */ + public static final String OP_NAME = "MapDefun"; + + private List> output; + + @SuppressWarnings("unchecked") + public MapDefun(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 MapDefun operation. + * + * @param scope current scope + * @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 + */ + @Endpoint( + describeByClass = true + ) + public static MapDefun create(Scope scope, Iterable> arguments, + Iterable> capturedInputs, List> outputTypes, + List outputShapes, ConcreteFunction f, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MapDefun"); + opBuilder.addInputList(Operands.asOutputs(arguments)); + opBuilder.addInputList(Operands.asOutputs(capturedInputs)); + 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("f", f); + if (options != null) { + for (Options opts : options) { + if (opts.maxIntraOpParallelism != null) { + opBuilder.setAttr("max_intra_op_parallelism", opts.maxIntraOpParallelism); + } + } + } + return new MapDefun(opBuilder.build()); + } + + /** + * Sets the maxIntraOpParallelism option. + * + * @param maxIntraOpParallelism the maxIntraOpParallelism option + * @return this Options instance. + */ + public static Options maxIntraOpParallelism(Long maxIntraOpParallelism) { + return new Options().maxIntraOpParallelism(maxIntraOpParallelism); + } + + /** + * Gets output. + *
+   * A list of output tensors whose types are `output_types` and whose dimensions
+   * 0 are the same as the dimensions 0 of the tensors in `arguments`, and whose
+   * remaining dimensions correspond to those in `output_shapes`.
+   * 
+ * @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.core.MapDefun} + */ + public static class Options { + private Long maxIntraOpParallelism; + + private Options() { + } + + /** + * Sets the maxIntraOpParallelism option. + * + * @param maxIntraOpParallelism the maxIntraOpParallelism option + * @return this Options instance. + */ + public Options maxIntraOpParallelism(Long maxIntraOpParallelism) { + this.maxIntraOpParallelism = 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 6fa921bb408..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,83 +17,61 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.MapIncompleteSize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "MapIncompleteSize"; + + private Output output; + + public MapIncompleteSize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new MapIncompleteSize operation. - * + * * @param scope current scope - * @param dtypes - * @param options carries optional attributes values + * @param dtypes The value of the dtypes attribute + * @param options carries optional attribute values * @return a new instance of MapIncompleteSize */ - @Endpoint(describeByClass = true) - public static MapIncompleteSize create(Scope scope, List> dtypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MapIncompleteSize", scope.makeOpName("MapIncompleteSize")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static MapIncompleteSize create(Scope scope, List> dtypes, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MapIncompleteSize"); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); if (options != null) { for (Options opts : options) { @@ -113,54 +91,158 @@ public static MapIncompleteSize create(Scope scope, List> } return new MapIncompleteSize(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * 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 output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MapIncompleteSize"; - - private Output output; - - private MapIncompleteSize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.MapIncompleteSize} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * 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; + } + } + + @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 316bc08c64c..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,90 +20,69 @@ 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; /** * Op peeks at the values at the specified key. If the - *

* 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> { - /** - * Optional attributes for {@link org.tensorflow.op.core.MapPeek} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "MapPeek"; + + private List> values; + + @SuppressWarnings("unchecked") + public MapPeek(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int valuesLength = operation.outputListLength("values"); + values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); + outputIdx += valuesLength; } - + /** * Factory method to create a class wrapping a new MapPeek operation. - * + * * @param scope current scope - * @param key - * @param indices - * @param dtypes - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static MapPeek create(Scope scope, Operand key, Operand indices, List> dtypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MapPeek", scope.makeOpName("MapPeek")); + @Endpoint( + describeByClass = true + ) + public static MapPeek create(Scope scope, Operand key, Operand indices, + List> dtypes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MapPeek"); opBuilder.addInput(key.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); if (options != null) { for (Options opts : options) { @@ -123,57 +102,171 @@ public static MapPeek create(Scope scope, Operand key, Operand i } return new MapPeek(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * 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 values. + * + * @return values. */ public List> values() { return values; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) values.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MapPeek"; - - private List> values; - - private MapPeek(Operation operation) { - super(operation); - int outputIdx = 0; - int valuesLength = operation.outputListLength("values"); - values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); - outputIdx += valuesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.core.MapPeek} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * 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; + } + } + + @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 0cd9510a8f7..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,83 +17,61 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.MapSize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "MapSize"; + + private Output output; + + public MapSize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new MapSize operation. - * + * * @param scope current scope - * @param dtypes - * @param options carries optional attributes values + * @param dtypes The value of the dtypes attribute + * @param options carries optional attribute values * @return a new instance of MapSize */ - @Endpoint(describeByClass = true) - public static MapSize create(Scope scope, List> dtypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MapSize", scope.makeOpName("MapSize")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static MapSize create(Scope scope, List> dtypes, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MapSize"); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); if (options != null) { for (Options opts : options) { @@ -113,54 +91,158 @@ public static MapSize create(Scope scope, List> dtypes, O } return new MapSize(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * 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 output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MapSize"; - - private Output output; - - private MapSize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.MapSize} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * 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; + } + } + + @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 76f9086f46e..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,76 +39,42 @@ /** * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.MapStage} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity Maximum number of elements in the Staging Area. If > 0, inserts - * on the container will block when the capacity is reached. - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container If non-empty, this queue is placed in the given container. Otherwise, - * a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName It is necessary to match this name to the matching Unstage Op. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "MapStage"; + + public MapStage(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new MapStage operation. - * + * * @param scope current scope * @param key int64 - * @param indices + * @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 - * @param options carries optional attributes values + * @param dtypes The value of the dtypes attribute + * @param options carries optional attribute values * @return a new instance of MapStage */ - @Endpoint(describeByClass = true) - public static MapStage create(Scope scope, Operand key, Operand indices, Iterable> values, List> dtypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MapStage", scope.makeOpName("MapStage")); + @Endpoint( + describeByClass = true + ) + public static MapStage create(Scope scope, Operand key, Operand indices, + Iterable> values, List> dtypes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MapStage"); opBuilder.addInput(key.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInputList(Operands.asOutputs(values)); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); if (options != null) { for (Options opts : options) { @@ -122,41 +94,177 @@ public static MapStage create(Scope scope, Operand key, Operand } return new MapStage(opBuilder.build()); } - + /** - * @param capacity Maximum number of elements in the Staging Area. If > 0, inserts + * Sets the capacity option. + * + * @param capacity Maximum number of elements in the Staging Area. If > 0, inserts * on the container will block when the capacity is reached. + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** + * Sets the container option. + * * @param container If non-empty, this queue is placed in the given container. Otherwise, * a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName It is necessary to match this name to the matching Unstage Op. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MapStage"; - - private MapStage(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.MapStage} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity Maximum number of elements in the Staging Area. If > 0, inserts + * on the container will block when the capacity is reached. + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * Sets the container option. + * + * @param container If non-empty, this queue is placed in the given container. Otherwise, + * a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName It is necessary to match this name to the matching Unstage Op. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = 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 6d189a50d7b..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,90 +20,69 @@ 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; /** * Op removes and returns the values associated with the key - *

* 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> { - /** - * Optional attributes for {@link org.tensorflow.op.core.MapUnstage} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "MapUnstage"; + + private List> values; + + @SuppressWarnings("unchecked") + public MapUnstage(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int valuesLength = operation.outputListLength("values"); + values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); + outputIdx += valuesLength; } - + /** * Factory method to create a class wrapping a new MapUnstage operation. - * + * * @param scope current scope - * @param key - * @param indices - * @param dtypes - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static MapUnstage create(Scope scope, Operand key, Operand indices, List> dtypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MapUnstage", scope.makeOpName("MapUnstage")); + @Endpoint( + describeByClass = true + ) + public static MapUnstage create(Scope scope, Operand key, Operand indices, + List> dtypes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MapUnstage"); opBuilder.addInput(key.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); if (options != null) { for (Options opts : options) { @@ -123,57 +102,171 @@ public static MapUnstage create(Scope scope, Operand key, Operand> values() { return values; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) values.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MapUnstage"; - - private List> values; - - private MapUnstage(Operation operation) { - super(operation); - int outputIdx = 0; - int valuesLength = operation.outputListLength("values"); - values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); - outputIdx += valuesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.core.MapUnstage} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * 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; + } + } + + @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 9848ab2d845..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,88 +19,70 @@ 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; /** * Op removes and returns a random (key, value) - *

* 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.MapUnstageNoKey} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "MapUnstageNoKey"; + + private Output key; + + private List> values; + + @SuppressWarnings("unchecked") + public MapUnstageNoKey(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + key = operation.output(outputIdx++); + int valuesLength = operation.outputListLength("values"); + values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); + outputIdx += valuesLength; } - + /** * Factory method to create a class wrapping a new MapUnstageNoKey operation. - * + * * @param scope current scope - * @param indices - * @param dtypes - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static MapUnstageNoKey create(Scope scope, Operand indices, List> dtypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MapUnstageNoKey", scope.makeOpName("MapUnstageNoKey")); + @Endpoint( + describeByClass = true + ) + public static MapUnstageNoKey create(Scope scope, Operand indices, + List> dtypes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MapUnstageNoKey"); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); if (options != null) { for (Options opts : options) { @@ -120,59 +102,168 @@ public static MapUnstageNoKey create(Scope scope, Operand indices, List< } return new MapUnstageNoKey(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * 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 key. + * + * @return key. */ public Output key() { return key; } - + /** + * Gets values. + * + * @return values. */ public List> values() { return values; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MapUnstageNoKey"; - - private Output key; - private List> values; - - private MapUnstageNoKey(Operation operation) { - super(operation); - int outputIdx = 0; - key = operation.output(outputIdx++); - int valuesLength = operation.outputListLength("values"); - values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); - outputIdx += valuesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.core.MapUnstageNoKey} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * 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; + } + } + + @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 690767e561a..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,65 +17,67 @@ 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 the maximum of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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 { - +public final class Max extends RawOp implements Operand { /** - * Optional attributes for {@link org.tensorflow.op.core.Max} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "Max"; + + private Output output; + + public Max(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Max operation. - * + * * @param scope current scope * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values + * @param data type for {@code Max} output and operands * @return a new instance of Max */ - @Endpoint(describeByClass = true) - public static Max create(Scope scope, Operand input, Operand axis, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Max", scope.makeOpName("Max")); + @Endpoint( + describeByClass = true + ) + public static Max create(Scope scope, Operand input, + Operand axis, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Max"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.keepDims != null) { @@ -83,36 +85,92 @@ public static Max create(Scope scope, Operand input, Ope } } } - return new Max(opBuilder.build()); + return new Max<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets output. * The reduced tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Max"; - - private Output output; - - private Max(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Max} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = 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 a4229d80ec3..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,71 +17,109 @@ 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 value of an available tensor from `inputs` to `output`. - *

- * `Merge` waits for at least one of the tensors in `inputs` to become available. - * It is usually combined with `Switch` to implement branching. - *

- * `Merge` forwards the first tensor to become available to `output`, and sets - * `value_index` to its index in `inputs`. - * - * @param data type for {@code output()} output + * 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 to become available to {@code output}, and sets + * {@code value_index} to its index in {@code inputs}. */ +@OpMetadata( + opType = Merge.OP_NAME, + inputsClass = Merge.Inputs.class +) @Operator public final class Merge extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Merge"; + + private Output output; + + private Output valueIndex; + + public Merge(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + valueIndex = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Merge operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Merge create(Scope scope, Iterable> inputs) { - OperationBuilder opBuilder = scope.env().opBuilder("Merge", scope.makeOpName("Merge")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Merge"); opBuilder.addInputList(Operands.asOutputs(inputs)); - opBuilder = scope.apply(opBuilder); - return new Merge(opBuilder.build()); + return new Merge<>(opBuilder.build()); } - + /** + * Gets output. * Will be set to the available input tensor. + * @return output. */ public Output output() { return output; } - + /** - * The index of the chosen input tensor in `inputs`. + * Gets valueIndex. + * The index of the chosen input tensor in {@code inputs}. + * @return valueIndex. */ public Output valueIndex() { return valueIndex; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Merge"; - - private Output output; - private Output valueIndex; - - private Merge(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - valueIndex = operation.output(outputIdx++); + + @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 bc06376c01f..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,65 +17,67 @@ 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 the minimum of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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 { - +public final class Min extends RawOp implements Operand { /** - * Optional attributes for {@link org.tensorflow.op.core.Min} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "Min"; + + private Output output; + + public Min(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Min operation. - * + * * @param scope current scope * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values + * @param data type for {@code Min} output and operands * @return a new instance of Min */ - @Endpoint(describeByClass = true) - public static Min create(Scope scope, Operand input, Operand axis, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Min", scope.makeOpName("Min")); + @Endpoint( + describeByClass = true + ) + public static Min create(Scope scope, Operand input, + Operand axis, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Min"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.keepDims != null) { @@ -83,36 +85,92 @@ public static Min create(Scope scope, Operand input, Ope } } } - return new Min(opBuilder.build()); + return new Min<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets output. * The reduced tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Min"; - - private Output output; - - private Min(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Min} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = 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 717a77c7a6a..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,95 +17,149 @@ 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; /** * Pads a tensor with mirrored values. - *

- * This operation pads a `input` with mirrored values according to the `paddings` - * you specify. `paddings` is an integer tensor with shape `[n, 2]`, where n is - * the rank of `input`. For each dimension D of `input`, `paddings[D, 0]` indicates - * how many values to add before the contents of `input` in that dimension, and - * `paddings[D, 1]` indicates how many values to add after the contents of `input` - * in that dimension. Both `paddings[D, 0]` and `paddings[D, 1]` must be no greater - * than `input.dim_size(D)` (or `input.dim_size(D) - 1`) if `copy_border` is true + * This operation pads a {@code input} with mirrored values according to the {@code paddings} + * you specify. {@code paddings} is an integer tensor with shape {@code [n, 2]}, where n is + * the rank of {@code input}. For each dimension D of {@code input}, {@code paddings[D, 0]} indicates + * how many values to add before the contents of {@code input} in that dimension, and + * {@code paddings[D, 1]} indicates how many values to add after the contents of {@code input} + * in that dimension. Both {@code paddings[D, 0]} and {@code paddings[D, 1]} must be no greater + * than {@code input.dim_size(D)} (or {@code input.dim_size(D) - 1}) if {@code copy_border} is true * (if false, respectively). - *

- * The padded size of each dimension D of the output is: - *

- * `paddings(D, 0) + input.dim_size(D) + paddings(D, 1)` - *

- * For example: - *

{@code
+ * 

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

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

For example: + *

  * # 't' is [[1, 2, 3], [4, 5, 6]].
  * # 'paddings' is [[1, 1]], [2, 2]].
  * # 'mode' is SYMMETRIC.
  * # rank of 't' is 2.
- * pad(t, paddings) ==> [[2, 1, 1, 2, 3, 3, 2]
+ * pad(t, paddings) ==> [[2, 1, 1, 2, 3, 3, 2]
  *                       [2, 1, 1, 2, 3, 3, 2]
  *                       [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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MirrorPad"; + + private Output output; + + public MirrorPad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MirrorPad operation. - * + * * @param scope current scope * @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 `input`. - * @param mode Either `REFLECT` or `SYMMETRIC`. In reflect mode the padded regions + * rows must be the same as the rank of {@code input}. + * @param mode 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 `input` is `[1, 2, 3]` and `paddings` - * is `[0, 2]`, then the output is `[1, 2, 3, 2, 1]` in reflect mode, and - * it is `[1, 2, 3, 3, 2]` in symmetric mode. + * 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. + * @param data type for {@code MirrorPad} output and operands * @return a new instance of MirrorPad */ - @Endpoint(describeByClass = true) - public static MirrorPad create(Scope scope, Operand input, Operand paddings, String mode) { - OperationBuilder opBuilder = scope.env().opBuilder("MirrorPad", scope.makeOpName("MirrorPad")); + @Endpoint( + describeByClass = true + ) + public static MirrorPad create(Scope scope, Operand input, + Operand paddings, String mode) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MirrorPad"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(paddings.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("mode", mode); - return new MirrorPad(opBuilder.build()); + return new MirrorPad<>(opBuilder.build()); } - + /** + * Gets output. * The padded tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MirrorPad"; - - private Output output; - - private MirrorPad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 901620aa27d..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,83 +17,134 @@ 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; /** - * Gradient op for `MirrorPad` op. This op folds a mirror-padded tensor. - *

- * This operation folds the padded areas of `input` by `MirrorPad` according to the - * `paddings` you specify. `paddings` must be the same as `paddings` argument - * given to the corresponding `MirrorPad` op. - *

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

- * `input.dim_size(D) - paddings(D, 0) - paddings(D, 1)` - *

- * For example: - *

{@code
+ * 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]
+ * 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 + */ + public static final String OP_NAME = "MirrorPadGrad"; + + private Output output; + + public MirrorPadGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MirrorPadGrad operation. - * + * * @param scope current scope * @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 `input`. - * @param mode The mode used in the `MirrorPad` op. + * 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 */ - @Endpoint(describeByClass = true) - public static MirrorPadGrad create(Scope scope, Operand input, Operand paddings, String mode) { - OperationBuilder opBuilder = scope.env().opBuilder("MirrorPadGrad", scope.makeOpName("MirrorPadGrad")); + @Endpoint( + describeByClass = true + ) + public static MirrorPadGrad create(Scope scope, Operand input, + Operand paddings, String mode) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MirrorPadGrad"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(paddings.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("mode", mode); - return new MirrorPadGrad(opBuilder.build()); + return new MirrorPadGrad<>(opBuilder.build()); } - + /** + * Gets output. * The folded tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MirrorPadGrad"; - - private Output output; - - private MirrorPadGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 e80af4ecee8..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,20 +20,24 @@ 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; /** * 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 * executed in a regular TensorFlow session. Instead it is intended to be used for * testing or for special case where a user intends to pass custom MLIR computation @@ -45,69 +49,115 @@ * main() function and the returned values of the main function mapped to the * outputs. * Example usage: - *

{@code
+ * 
  * import tensorflow as tf
  * from tensorflow.compiler.mlir.tensorflow.gen_mlir_passthrough_op import mlir_passthrough_op
- * 
+ *
  * mlir_module = '''python
- * func @main(%arg0 : tensor<10xf32>, %arg1 : tensor<10xf32>) -> tensor<10x10xf32> {
- *    %add = "magic.op"(%arg0, %arg1) : (tensor<10xf32>, tensor<10xf32>) -> tensor<10x10xf32>
- *    return %ret : tensor<10x10xf32>
+ * func {@literal @}main(%arg0 : tensor<10xf32>, %arg1 : tensor<10xf32>) -> tensor<10x10xf32> {
+ *    %add = "magic.op"(%arg0, %arg1) : (tensor<10xf32>, tensor<10xf32>) -> tensor<10x10xf32>
+ *    return %ret : tensor<10x10xf32>
  * }
  * '''
- * 
- * @tf.function
+ *
+ * {@literal @}tf.function
  * def foo(x, y):
  *   return mlir_passthrough_op([x, y], mlir_module, Toutputs=[tf.float32])
- * 
+ *
  * 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> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MlirPassthroughOp"; + + private List> outputs; + + @SuppressWarnings("unchecked") + public MlirPassthroughOp(Operation operation) { + super(operation, OP_NAME); + 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 MlirPassthroughOp operation. - * + * * @param scope current scope - * @param inputs - * @param mlirModule - * @param Toutputs + * @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(describeByClass = true) - public static MlirPassthroughOp create(Scope scope, Iterable> inputs, String mlirModule, List> Toutputs) { - OperationBuilder opBuilder = scope.env().opBuilder("MlirPassthroughOp", scope.makeOpName("MlirPassthroughOp")); + @Endpoint( + describeByClass = true + ) + public static MlirPassthroughOp create(Scope scope, Iterable> inputs, + String mlirModule, List> Toutputs) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MlirPassthroughOp"); opBuilder.addInputList(Operands.asOutputs(inputs)); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("mlir_module", mlirModule); opBuilder.setAttr("Toutputs", Operands.toDataTypes(Toutputs)); return new MlirPassthroughOp(opBuilder.build()); } - + /** + * Gets outputs. + * + * @return outputs. */ public List> outputs() { return outputs; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) outputs.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MlirPassthroughOp"; - - private List> outputs; - - private MlirPassthroughOp(Operation operation) { - super(operation); - int outputIdx = 0; - int outputsLength = operation.outputListLength("outputs"); - outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength)); - outputIdx += outputsLength; + + @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 28a85dc0082..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,109 +26,64 @@ 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 hash table that uses tensors as the backing store. - *

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

- * This op creates a mutable hash table, specifying the type of its keys and + *

This op creates a mutable hash table, specifying the type of its keys and * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.MutableDenseHashTable} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this table is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this table is shared under the given name across - * multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param useNodeNameSharing - */ - public Options useNodeNameSharing(Boolean useNodeNameSharing) { - this.useNodeNameSharing = useNodeNameSharing; - return this; - } - - /** - * @param valueShape The shape of each value. - */ - public Options valueShape(Shape valueShape) { - this.valueShape = valueShape; - return this; - } - - /** - * @param initialNumBuckets The initial number of hash table buckets. Must be a power - * to 2. - */ - public Options initialNumBuckets(Long initialNumBuckets) { - this.initialNumBuckets = initialNumBuckets; - return this; - } - - /** - * @param maxLoadFactor The maximum ratio between number of entries and number of - * buckets before growing the table. Must be between 0 and 1. - */ - public Options maxLoadFactor(Float maxLoadFactor) { - this.maxLoadFactor = maxLoadFactor; - return this; - } - - private String container; - private String sharedName; - private Boolean useNodeNameSharing; - private Shape valueShape; - private Long initialNumBuckets; - private Float maxLoadFactor; - - private Options() { - } + public static final String OP_NAME = "MutableDenseHashTableV2"; + + private Output tableHandle; + + @SuppressWarnings("unchecked") + public MutableDenseHashTable(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + tableHandle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new MutableDenseHashTable operation. - * + * Factory method to create a class wrapping a new MutableDenseHashTableV2 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 + * @param deletedKey The deletedKey value * @param valueDtype Type of the table values. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MutableDenseHashTableV2} output and operands + * @param data type for {@code MutableDenseHashTableV2} output and operands * @return a new instance of MutableDenseHashTable */ - @Endpoint(describeByClass = true) - public static MutableDenseHashTable create(Scope scope, Operand emptyKey, Operand deletedKey, Class valueDtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MutableDenseHashTableV2", scope.makeOpName("MutableDenseHashTable")); + @Endpoint( + describeByClass = true + ) + public static MutableDenseHashTable create(Scope scope, + Operand emptyKey, Operand deletedKey, Class valueDtype, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MutableDenseHashTable"); opBuilder.addInput(emptyKey.asOutput()); opBuilder.addInput(deletedKey.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("value_dtype", Operands.toDataType(valueDtype)); if (options != null) { for (Options opts : options) { @@ -152,74 +109,248 @@ public static MutableDenseHashTable create(Sc } return new MutableDenseHashTable(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this table is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this table is shared under the given name across * multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * @param useNodeNameSharing + * Sets the useNodeNameSharing option. + * + * @param useNodeNameSharing the useNodeNameSharing option + * @return this Options instance. */ public static Options useNodeNameSharing(Boolean useNodeNameSharing) { return new Options().useNodeNameSharing(useNodeNameSharing); } - + /** + * 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. * Handle to a table. + * @return tableHandle. */ - public Output tableHandle() { + public Output tableHandle() { return tableHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) tableHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MutableDenseHashTableV2"; - - private Output tableHandle; - - private MutableDenseHashTable(Operation operation) { - super(operation); - int outputIdx = 0; - tableHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.MutableDenseHashTable} + */ + public static class Options { + private String container; + + private String sharedName; + + private Boolean useNodeNameSharing; + + private Shape valueShape; + + private Long initialNumBuckets; + + private Float maxLoadFactor; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this table is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this table is shared under the given name across + * multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the useNodeNameSharing option. + * + * @param useNodeNameSharing the useNodeNameSharing option + * @return this Options instance. + */ + public Options useNodeNameSharing(Boolean useNodeNameSharing) { + this.useNodeNameSharing = useNodeNameSharing; + return this; + } + + /** + * 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 = 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 1a551a3d77f..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,80 +17,66 @@ 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 hash table. - *

* This op creates a mutable hash table, specifying the type of its keys and * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.MutableHashTable} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this table is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this table is shared under the given name across - * multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param useNodeNameSharing If true and shared_name is empty, the table is shared - * using the node name. - */ - public Options useNodeNameSharing(Boolean useNodeNameSharing) { - this.useNodeNameSharing = useNodeNameSharing; - return this; - } - - private String container; - private String sharedName; - private Boolean useNodeNameSharing; - - private Options() { - } + public static final String OP_NAME = "MutableHashTableV2"; + + private Output tableHandle; + + @SuppressWarnings("unchecked") + public MutableHashTable(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + tableHandle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new MutableHashTable operation. - * + * Factory method to create a class wrapping a new MutableHashTableV2 operation. + * * @param scope current scope * @param keyDtype Type of the table keys. * @param valueDtype Type of the table values. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MutableHashTableV2} output and operands + * @param data type for {@code MutableHashTableV2} output and operands * @return a new instance of MutableHashTable */ - @Endpoint(describeByClass = true) - public static MutableHashTable create(Scope scope, Class keyDtype, Class valueDtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MutableHashTableV2", scope.makeOpName("MutableHashTable")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static MutableHashTable create(Scope scope, + Class keyDtype, Class valueDtype, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MutableHashTable"); opBuilder.setAttr("key_dtype", Operands.toDataType(keyDtype)); opBuilder.setAttr("value_dtype", Operands.toDataType(valueDtype)); if (options != null) { @@ -108,52 +94,145 @@ public static MutableHashTable create(Scope s } return new MutableHashTable(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this table is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this table is shared under the given name across * multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Sets the useNodeNameSharing option. + * * @param useNodeNameSharing If true and shared_name is empty, the table is shared * using the node name. + * @return this Options instance. */ public static Options useNodeNameSharing(Boolean useNodeNameSharing) { return new Options().useNodeNameSharing(useNodeNameSharing); } - + /** + * Gets tableHandle. * Handle to a table. + * @return tableHandle. */ - public Output tableHandle() { + public Output tableHandle() { return tableHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) tableHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MutableHashTableV2"; - - private Output tableHandle; - - private MutableHashTable(Operation operation) { - super(operation); - int outputIdx = 0; - tableHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.MutableHashTable} + */ + public static class Options { + private String container; + + private String sharedName; + + private Boolean useNodeNameSharing; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this table is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this table is shared under the given name across + * multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the useNodeNameSharing option. + * + * @param useNodeNameSharing If true and shared_name is empty, the table is shared + * using the node name. + * @return this Options instance. + */ + public Options useNodeNameSharing(Boolean useNodeNameSharing) { + this.useNodeNameSharing = 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 c054b60ad0b..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,82 +26,58 @@ 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 hash table. - *

* This op creates a mutable hash table, specifying the type of its keys and * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.MutableHashTableOfTensors} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this table is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this table is shared under the given name across - * multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param useNodeNameSharing - */ - public Options useNodeNameSharing(Boolean useNodeNameSharing) { - this.useNodeNameSharing = useNodeNameSharing; - return this; - } - - /** - * @param valueShape - */ - public Options valueShape(Shape valueShape) { - this.valueShape = valueShape; - return this; - } - - private String container; - private String sharedName; - private Boolean useNodeNameSharing; - private Shape valueShape; - - private Options() { - } + public static final String OP_NAME = "MutableHashTableOfTensorsV2"; + + private Output tableHandle; + + @SuppressWarnings("unchecked") + public MutableHashTableOfTensors(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + tableHandle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new MutableHashTableOfTensors operation. - * + * Factory method to create a class wrapping a new MutableHashTableOfTensorsV2 operation. + * * @param scope current scope * @param keyDtype Type of the table keys. * @param valueDtype Type of the table values. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MutableHashTableOfTensorsV2} output and operands + * @param data type for {@code MutableHashTableOfTensorsV2} output and operands * @return a new instance of MutableHashTableOfTensors */ - @Endpoint(describeByClass = true) - public static MutableHashTableOfTensors create(Scope scope, Class keyDtype, Class valueDtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MutableHashTableOfTensorsV2", scope.makeOpName("MutableHashTableOfTensors")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static MutableHashTableOfTensors create(Scope scope, + Class keyDtype, Class valueDtype, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MutableHashTableOfTensors"); opBuilder.setAttr("key_dtype", Operands.toDataType(keyDtype)); opBuilder.setAttr("value_dtype", Operands.toDataType(valueDtype)); if (options != null) { @@ -120,58 +98,171 @@ public static MutableHashTableOfTensors creat } return new MutableHashTableOfTensors(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this table is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this table is shared under the given name across * multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * @param useNodeNameSharing + * Sets the useNodeNameSharing option. + * + * @param useNodeNameSharing the useNodeNameSharing option + * @return this Options instance. */ public static Options useNodeNameSharing(Boolean useNodeNameSharing) { return new Options().useNodeNameSharing(useNodeNameSharing); } - + /** - * @param valueShape + * 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. * Handle to a table. + * @return tableHandle. */ - public Output tableHandle() { + public Output tableHandle() { return tableHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) tableHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MutableHashTableOfTensorsV2"; - - private Output tableHandle; - - private MutableHashTableOfTensors(Operation operation) { - super(operation); - int outputIdx = 0; - tableHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.MutableHashTableOfTensors} + */ + public static class Options { + private String container; + + private String sharedName; + + private Boolean useNodeNameSharing; + + private Shape valueShape; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this table is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this table is shared under the given name across + * multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the useNodeNameSharing option. + * + * @param useNodeNameSharing the useNodeNameSharing option + * @return this Options instance. + */ + public Options useNodeNameSharing(Boolean useNodeNameSharing) { + this.useNodeNameSharing = useNodeNameSharing; + return this; + } + + /** + * 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 = 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 ae8f8894252..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,63 +17,56 @@ 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 `MutexLock`. + * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.Mutex} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this variable is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this variable is named in the given bucket - * with this shared_name. Otherwise, the node name is used instead. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "MutexV2"; + + private Output resource; + + @SuppressWarnings("unchecked") + public Mutex(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + resource = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Mutex operation. - * + * Factory method to create a class wrapping a new MutexV2 operation. + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Mutex */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Mutex create(Scope scope, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MutexV2", scope.makeOpName("Mutex")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Mutex"); if (options != null) { for (Options opts : options) { if (opts.container != null) { @@ -86,44 +79,101 @@ public static Mutex create(Scope scope, Options... options) { } return new Mutex(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this variable is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this variable is named in the given bucket * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets resource. * The mutex resource. + * @return resource. */ - public Output resource() { + public Output resource() { return resource; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) resource; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MutexV2"; - - private Output resource; - - private Mutex(Operation operation) { - super(operation); - int outputIdx = 0; - resource = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Mutex} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this variable is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this variable is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = 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 1506216c8d3..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,96 +17,123 @@ 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; /** * Locks a mutex resource. The output is the lock. So long as the lock tensor - *

- * is alive, any other request to use `MutexLock` with this mutex will wait. - *

- * This is particularly useful for creating a critical section when used in - * conjunction with `MutexLockIdentity`: - *

{@code
+ * is alive, any other request to use {@code MutexLock} with this mutex will wait.
+ * 

This is particularly useful for creating a critical section when used in + * conjunction with {@code MutexLockIdentity}: + *

+ *
  * mutex = mutex_v2(
  *   shared_name=handle_name, container=container, name=name)
- * 
+ *
  * def execute_in_critical_section(fn, *args, **kwargs):
  *   lock = gen_resource_variable_ops.mutex_lock(mutex)
- * 
+ *
  *   with ops.control_dependencies([lock]):
  *     r = fn(*args, **kwargs)
- * 
+ *
  *   with ops.control_dependencies(nest.flatten(r)):
  *     with ops.colocate_with(mutex):
  *       ensure_lock_exists = mutex_lock_identity(lock)
- * 
+ *
  *     # Make sure that if any element of r is accessed, all of
  *     # them are executed together.
  *     r = nest.map_structure(tf.identity, r)
- * 
+ *
  *   with ops.control_dependencies([ensure_lock_exists]):
  *     return nest.map_structure(tf.identity, r)
- * }
- * While `fn` is running in the critical section, no other functions which wish to + *
+ *

While {@code fn} is running in the critical section, no other functions which wish to * use this critical section may run. - *

- * Often the use case is that two executions of the same graph, in parallel, - * wish to run `fn`; and we wish to ensure that only one of them executes - * at a time. This is especially important if `fn` modifies one or more + *

Often the use case is that two executions of the same graph, in parallel, + * wish to run {@code fn}; and we wish to ensure that only one of them executes + * at a time. This is especially important if {@code fn} modifies one or more * variables at a time. - *

- * It is also useful if two separate functions must share a resource, but we + *

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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MutexLock"; + + private Output mutexLock; + + @SuppressWarnings("unchecked") + public MutexLock(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + mutexLock = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MutexLock operation. - * + * * @param scope current scope * @param mutex The mutex resource to lock. * @return a new instance of MutexLock */ - @Endpoint(describeByClass = true) - public static MutexLock create(Scope scope, Operand mutex) { - OperationBuilder opBuilder = scope.env().opBuilder("MutexLock", scope.makeOpName("MutexLock")); + @Endpoint( + describeByClass = true + ) + public static MutexLock create(Scope scope, Operand mutex) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MutexLock"); opBuilder.addInput(mutex.asOutput()); - opBuilder = scope.apply(opBuilder); return new MutexLock(opBuilder.build()); } - + /** + * Gets mutexLock. * A tensor that keeps a shared pointer to a lock on the mutex; * when the Tensor is destroyed, the use count on the shared pointer is decreased * by 1. When it reaches 0, the lock is released. + * @return mutexLock. */ - public Output mutexLock() { + public Output mutexLock() { return mutexLock; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) mutexLock; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MutexLock"; - - private Output mutexLock; - - private MutexLock(Operation operation) { - super(operation); - int outputIdx = 0; - mutexLock = operation.output(outputIdx++); + + @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 3621d772dd2..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,76 +17,132 @@ 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 a tensor containing the reduction across all input tensors. - *

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

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

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 `num_devices` 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. * 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 + */ + public static final String OP_NAME = "NcclAllReduce"; + + private Output data; + + public NcclAllReduce(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + data = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NcclAllReduce operation. - * + * * @param scope current scope - * @param input - * @param reduction - * @param numDevices - * @param sharedName + * @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 */ - @Endpoint(describeByClass = true) - public static NcclAllReduce create(Scope scope, Operand input, String reduction, Long numDevices, String sharedName) { - OperationBuilder opBuilder = scope.env().opBuilder("NcclAllReduce", scope.makeOpName("NcclAllReduce")); + @Endpoint( + describeByClass = true + ) + public static NcclAllReduce create(Scope scope, Operand input, + String reduction, Long numDevices, String sharedName) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "NcclAllReduce"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("reduction", reduction); opBuilder.setAttr("num_devices", numDevices); opBuilder.setAttr("shared_name", sharedName); - return new NcclAllReduce(opBuilder.build()); + return new NcclAllReduce<>(opBuilder.build()); } - + /** + * Gets data. + * + * @return data. */ public Output data() { return data; } - + @Override public Output asOutput() { return data; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NcclAllReduce"; - - private Output data; - - private NcclAllReduce(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); + + @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 8febd22137b..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,70 +17,113 @@ 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; /** - * Sends `input` to all devices that are connected to the output. - *

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

- * The graph should be constructed so that all ops connected to the output have a + * 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. + *

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 + * + * @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 + */ + public static final String OP_NAME = "NcclBroadcast"; + + private Output output; + + public NcclBroadcast(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NcclBroadcast operation. - * + * * @param scope current scope - * @param input - * @param shape + * @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 */ - @Endpoint(describeByClass = true) - public static NcclBroadcast create(Scope scope, Operand input, Shape shape) { - OperationBuilder opBuilder = scope.env().opBuilder("NcclBroadcast", scope.makeOpName("NcclBroadcast")); + @Endpoint( + describeByClass = true + ) + public static NcclBroadcast create(Scope scope, Operand input, + Shape shape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "NcclBroadcast"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("shape", shape); - return new NcclBroadcast(opBuilder.build()); + return new NcclBroadcast<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NcclBroadcast"; - - private Output output; - - private NcclBroadcast(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 eba12c24818..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,69 +17,115 @@ 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; /** - * Reduces `input` from `num_devices` using `reduction` to a single device. - *

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

- * The graph should be constructed so that all inputs have a valid device + * 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 `num_devices` 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 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 + */ + public static final String OP_NAME = "NcclReduce"; + + private Output data; + + public NcclReduce(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + data = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NcclReduce operation. - * + * * @param scope current scope - * @param input - * @param reduction + * @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 */ - @Endpoint(describeByClass = true) - public static NcclReduce create(Scope scope, Iterable> input, String reduction) { - OperationBuilder opBuilder = scope.env().opBuilder("NcclReduce", scope.makeOpName("NcclReduce")); + @Endpoint( + describeByClass = true + ) + public static NcclReduce create(Scope scope, Iterable> input, + String reduction) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "NcclReduce"); opBuilder.addInputList(Operands.asOutputs(input)); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("reduction", reduction); - return new NcclReduce(opBuilder.build()); + return new NcclReduce<>(opBuilder.build()); } - + /** + * Gets data. + * + * @return data. */ public Output data() { return data; } - + @Override public Output asOutput() { return data; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NcclReduce"; - - private Output data; - - private NcclReduce(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); + + @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 e5b558b23ff..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,59 +17,94 @@ 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "NextIteration"; + + private Output output; + + public NextIteration(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NextIteration operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static NextIteration create(Scope scope, Operand data) { - OperationBuilder opBuilder = scope.env().opBuilder("NextIteration", scope.makeOpName("NextIteration")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "NextIteration"); opBuilder.addInput(data.asOutput()); - opBuilder = scope.apply(opBuilder); - return new NextIteration(opBuilder.build()); + return new NextIteration<>(opBuilder.build()); } - + /** - * The same tensor as `data`. + * Gets output. + * The same tensor as {@code data}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NextIteration"; - - private Output output; - - private NextIteration(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 b8aa6227ce7..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,36 +17,57 @@ 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "NoOp"; + + public NoOp(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new NoOp operation. - * + * * @param scope current scope * @return a new instance of NoOp */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static NoOp create(Scope scope) { - OperationBuilder opBuilder = scope.env().opBuilder("NoOp", scope.makeOpName("NoOp")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "NoOp"); return new NoOp(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NoOp"; - - private NoOp(Operation operation) { - super(operation); + + @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 46e82fd3b41..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,71 +17,71 @@ 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; /** * Returns a one-hot tensor. - *

- * The locations represented by indices in `indices` take value `on_value`, - * while all other locations take value `off_value`. - *

- * If the input `indices` is rank `N`, the output will have rank `N+1`, - * The new axis is created at dimension `axis` (default: the new axis is + * The locations represented by indices in {@code indices} take value {@code on_value}, + * while all other locations take value {@code off_value}. + *

If the input {@code indices} is rank {@code N}, the output will have rank {@code N+1}, + * The new axis is created at dimension {@code axis} (default: the new axis is * appended at the end). - *

- * If `indices` is a scalar the output shape will be a vector of length `depth`. - *

- * If `indices` is a vector of length `features`, the output shape will be: - *

{@code
+ * 

If {@code indices} is a scalar the output shape will be a vector of length {@code depth}. + *

If {@code indices} is a vector of length {@code features}, the output shape will be: + *

  *   features x depth if axis == -1
  *   depth x features if axis == 0
- * }
- * If `indices` is a matrix (batch) with shape `[batch, features]`, + *
+ *

If {@code indices} is a matrix (batch) with shape {@code [batch, features]}, * the output shape will be: - *

{@code
+ * 
  *   batch x features x depth if axis == -1
  *   batch x depth x features if axis == 1
  *   depth x batch x features if axis == 0
- * }
- * Examples - * ========= - *

- * Suppose that - *

{@code
+ * 
+ * Examples
+ *

Suppose that + *

  *   indices = [0, 2, -1, 1]
  *   depth = 3
  *   on_value = 5.0
  *   off_value = 0.0
  *   axis = -1
- * }
- * Then output is `[4 x 3]`: - *
{@code
+ * 
+ *

Then output is {@code [4 x 3]}: + *

  * output =
  *   [5.0 0.0 0.0]  // one_hot(0)
  *   [0.0 0.0 5.0]  // one_hot(2)
  *   [0.0 0.0 0.0]  // one_hot(-1)
  *   [0.0 5.0 0.0]  // one_hot(1)
- * }
- * Suppose that - *
{@code
+ * 
+ *

Suppose that + *

  *   indices = [0, 2, -1, 1]
  *   depth = 3
  *   on_value = 0.0
  *   off_value = 3.0
  *   axis = 0
- * }
- * Then output is `[3 x 4]`: - *
{@code
+ * 
+ *

Then output is {@code [3 x 4]}: + *

  * output =
  *   [0.0 3.0 3.0 3.0]
  *   [3.0 3.0 3.0 0.0]
@@ -91,17 +91,17 @@
  * //      ^            one_hot(2)
  * //          ^        one_hot(-1)
  * //              ^    one_hot(1)
- * }
- * Suppose that - *
{@code
+ * 
+ *

Suppose that + *

  *   indices = [[0, 2], [1, -1]]
  *   depth = 3
  *   on_value = 1.0
  *   off_value = 0.0
  *   axis = -1
- * }
- * Then output is `[2 x 2 x 3]`: - *
{@code
+ * 
+ *

Then output is {@code [2 x 2 x 3]}: + *

  * output =
  *   [
  *     [1.0, 0.0, 0.0]  // one_hot(0)
@@ -110,52 +110,49 @@
  *     [0.0, 1.0, 0.0]  // one_hot(1)
  *     [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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.OneHot} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param axis The axis to fill (default: -1, a new inner-most axis). - */ - public Options axis(Long axis) { - this.axis = axis; - return this; - } - - private Long axis; - - private Options() { - } + public static final String OP_NAME = "OneHot"; + + private Output output; + + public OneHot(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new OneHot operation. - * + * * @param scope current scope * @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 `indices[j] = i`. - * @param offValue A scalar defining the value to fill in output when `indices[j] != i`. - * @param options carries optional attributes values + * @param onValue A scalar defining the value to fill in output when {@code indices[j] = i}. + * @param offValue A scalar defining the value to fill in output when {@code indices[j] != i}. + * @param options carries optional attribute values + * @param data type for {@code OneHot} output and operands * @return a new instance of OneHot */ - @Endpoint(describeByClass = true) - public static OneHot create(Scope scope, Operand indices, Operand depth, Operand onValue, Operand offValue, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("OneHot", scope.makeOpName("OneHot")); + @Endpoint( + describeByClass = true + ) + public static OneHot create(Scope scope, Operand indices, + Operand depth, Operand onValue, Operand offValue, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OneHot"); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(depth.asOutput()); opBuilder.addInput(onValue.asOutput()); opBuilder.addInput(offValue.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.axis != null) { @@ -163,36 +160,103 @@ public static OneHot create(Scope scope, Operand(opBuilder.build()); + return new OneHot<>(opBuilder.build()); } - + /** + * Sets the axis option. + * * @param axis The axis to fill (default: -1, a new inner-most axis). + * @return this Options instance. */ public static Options axis(Long axis) { return new Options().axis(axis); } - + /** + * Gets output. * The one-hot tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OneHot"; - - private Output output; - - private OneHot(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.OneHot} + */ + public static class Options { + private Long axis; + + private Options() { + } + + /** + * Sets the axis option. + * + * @param axis The axis to fill (default: -1, a new inner-most axis). + * @return this Options instance. + */ + public Options axis(Long axis) { + this.axis = 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 d314879054f..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,59 +17,94 @@ 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "OnesLike"; + + private Output y; + + public OnesLike(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new OnesLike operation. - * + * * @param scope current scope * @param x a tensor of type T. + * @param data type for {@code OnesLike} output and operands * @return a new instance of OnesLike */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static OnesLike create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("OnesLike", scope.makeOpName("OnesLike")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OnesLike"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new OnesLike(opBuilder.build()); + return new OnesLike<>(opBuilder.build()); } - + /** + * Gets y. * a tensor of the same shape and type as x but filled with ones. + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OnesLike"; - - private Output y; - - private OnesLike(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 dd789bcec82..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,80 +17,54 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.OrderedMapClear} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "OrderedMapClear"; + + 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 - * @param options carries optional attributes values + * @param dtypes The value of the dtypes attribute + * @param options carries optional attribute values * @return a new instance of OrderedMapClear */ - @Endpoint(describeByClass = true) - public static OrderedMapClear create(Scope scope, List> dtypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("OrderedMapClear", scope.makeOpName("OrderedMapClear")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static OrderedMapClear create(Scope scope, List> dtypes, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OrderedMapClear"); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); if (options != null) { for (Options opts : options) { @@ -110,39 +84,144 @@ public static OrderedMapClear create(Scope scope, List> d } return new OrderedMapClear(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OrderedMapClear"; - - private OrderedMapClear(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.OrderedMapClear} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * 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; + } + } + + @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 56d520b02ff..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,83 +17,61 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.OrderedMapIncompleteSize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "OrderedMapIncompleteSize"; + + private Output output; + + public OrderedMapIncompleteSize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new OrderedMapIncompleteSize operation. - * + * * @param scope current scope - * @param dtypes - * @param options carries optional attributes values + * @param dtypes The value of the dtypes attribute + * @param options carries optional attribute values * @return a new instance of OrderedMapIncompleteSize */ - @Endpoint(describeByClass = true) - public static OrderedMapIncompleteSize create(Scope scope, List> dtypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("OrderedMapIncompleteSize", scope.makeOpName("OrderedMapIncompleteSize")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static OrderedMapIncompleteSize create(Scope scope, List> dtypes, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OrderedMapIncompleteSize"); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); if (options != null) { for (Options opts : options) { @@ -113,54 +91,158 @@ public static OrderedMapIncompleteSize create(Scope scope, List output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OrderedMapIncompleteSize"; - - private Output output; - - private OrderedMapIncompleteSize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.OrderedMapIncompleteSize} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * 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; + } + } + + @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 893be796c79..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,91 +20,70 @@ 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; /** * Op peeks at the values at the specified key. If the - *

* underlying container does not contain this key * 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> { - /** - * Optional attributes for {@link org.tensorflow.op.core.OrderedMapPeek} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "OrderedMapPeek"; + + private List> values; + + @SuppressWarnings("unchecked") + public OrderedMapPeek(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int valuesLength = operation.outputListLength("values"); + values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); + outputIdx += valuesLength; } - + /** * Factory method to create a class wrapping a new OrderedMapPeek operation. - * + * * @param scope current scope - * @param key - * @param indices - * @param dtypes - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static OrderedMapPeek create(Scope scope, Operand key, Operand indices, List> dtypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("OrderedMapPeek", scope.makeOpName("OrderedMapPeek")); + @Endpoint( + describeByClass = true + ) + public static OrderedMapPeek create(Scope scope, Operand key, Operand indices, + List> dtypes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OrderedMapPeek"); opBuilder.addInput(key.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); if (options != null) { for (Options opts : options) { @@ -124,57 +103,171 @@ public static OrderedMapPeek create(Scope scope, Operand key, Operand> values() { return values; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) values.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OrderedMapPeek"; - - private List> values; - - private OrderedMapPeek(Operation operation) { - super(operation); - int outputIdx = 0; - int valuesLength = operation.outputListLength("values"); - values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); - outputIdx += valuesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.core.OrderedMapPeek} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * 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; + } + } + + @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 3c561660900..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,83 +17,61 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.OrderedMapSize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "OrderedMapSize"; + + private Output output; + + public OrderedMapSize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new OrderedMapSize operation. - * + * * @param scope current scope - * @param dtypes - * @param options carries optional attributes values + * @param dtypes The value of the dtypes attribute + * @param options carries optional attribute values * @return a new instance of OrderedMapSize */ - @Endpoint(describeByClass = true) - public static OrderedMapSize create(Scope scope, List> dtypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("OrderedMapSize", scope.makeOpName("OrderedMapSize")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static OrderedMapSize create(Scope scope, List> dtypes, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OrderedMapSize"); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); if (options != null) { for (Options opts : options) { @@ -113,54 +91,158 @@ public static OrderedMapSize create(Scope scope, List> dt } return new OrderedMapSize(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * 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 output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OrderedMapSize"; - - private Output output; - - private OrderedMapSize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.OrderedMapSize} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * 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; + } + } + + @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 a78c20a9623..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,94 +17,65 @@ 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; /** * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.OrderedMapStage} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity Maximum number of elements in the Staging Area. If > 0, inserts - * on the container will block when the capacity is reached. - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container If non-empty, this queue is placed in the given container. Otherwise, - * a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName It is necessary to match this name to the matching Unstage Op. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "OrderedMapStage"; + + public OrderedMapStage(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new OrderedMapStage operation. - * + * * @param scope current scope * @param key int64 - * @param indices + * @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 - * @param options carries optional attributes values + * @param dtypes The value of the dtypes attribute + * @param options carries optional attribute values * @return a new instance of OrderedMapStage */ - @Endpoint(describeByClass = true) - public static OrderedMapStage create(Scope scope, Operand key, Operand indices, Iterable> values, List> dtypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("OrderedMapStage", scope.makeOpName("OrderedMapStage")); + @Endpoint( + describeByClass = true + ) + public static OrderedMapStage create(Scope scope, Operand key, Operand indices, + Iterable> values, List> dtypes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OrderedMapStage"); opBuilder.addInput(key.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInputList(Operands.asOutputs(values)); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); if (options != null) { for (Options opts : options) { @@ -124,41 +95,177 @@ public static OrderedMapStage create(Scope scope, Operand key, Operand 0, inserts + * Sets the capacity option. + * + * @param capacity Maximum number of elements in the Staging Area. If > 0, inserts * on the container will block when the capacity is reached. + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** + * Sets the container option. + * * @param container If non-empty, this queue is placed in the given container. Otherwise, * a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName It is necessary to match this name to the matching Unstage Op. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OrderedMapStage"; - - private OrderedMapStage(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.OrderedMapStage} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity Maximum number of elements in the Staging Area. If > 0, inserts + * on the container will block when the capacity is reached. + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * Sets the container option. + * + * @param container If non-empty, this queue is placed in the given container. Otherwise, + * a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName It is necessary to match this name to the matching Unstage Op. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = 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 667f0f198fb..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,90 +20,69 @@ 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; /** * Op removes and returns the values associated with the key - *

* 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> { - /** - * Optional attributes for {@link org.tensorflow.op.core.OrderedMapUnstage} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "OrderedMapUnstage"; + + private List> values; + + @SuppressWarnings("unchecked") + public OrderedMapUnstage(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int valuesLength = operation.outputListLength("values"); + values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); + outputIdx += valuesLength; } - + /** * Factory method to create a class wrapping a new OrderedMapUnstage operation. - * + * * @param scope current scope - * @param key - * @param indices - * @param dtypes - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static OrderedMapUnstage create(Scope scope, Operand key, Operand indices, List> dtypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("OrderedMapUnstage", scope.makeOpName("OrderedMapUnstage")); + @Endpoint( + describeByClass = true + ) + public static OrderedMapUnstage create(Scope scope, Operand key, Operand indices, + List> dtypes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OrderedMapUnstage"); opBuilder.addInput(key.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); if (options != null) { for (Options opts : options) { @@ -123,57 +102,171 @@ public static OrderedMapUnstage create(Scope scope, Operand key, Operand } return new OrderedMapUnstage(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * 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 values. + * + * @return values. */ public List> values() { return values; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) values.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OrderedMapUnstage"; - - private List> values; - - private OrderedMapUnstage(Operation operation) { - super(operation); - int outputIdx = 0; - int valuesLength = operation.outputListLength("values"); - values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); - outputIdx += valuesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.core.OrderedMapUnstage} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * 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; + } + } + + @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 fb0d239d6a2..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,88 +19,70 @@ 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; /** * Op removes and returns the (key, value) element with the smallest - *

* 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.OrderedMapUnstageNoKey} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "OrderedMapUnstageNoKey"; + + private Output key; + + private List> values; + + @SuppressWarnings("unchecked") + public OrderedMapUnstageNoKey(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + key = operation.output(outputIdx++); + int valuesLength = operation.outputListLength("values"); + values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); + outputIdx += valuesLength; } - + /** * Factory method to create a class wrapping a new OrderedMapUnstageNoKey operation. - * + * * @param scope current scope - * @param indices - * @param dtypes - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static OrderedMapUnstageNoKey create(Scope scope, Operand indices, List> dtypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("OrderedMapUnstageNoKey", scope.makeOpName("OrderedMapUnstageNoKey")); + @Endpoint( + describeByClass = true + ) + public static OrderedMapUnstageNoKey create(Scope scope, Operand indices, + List> dtypes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OrderedMapUnstageNoKey"); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); if (options != null) { for (Options opts : options) { @@ -120,59 +102,168 @@ public static OrderedMapUnstageNoKey create(Scope scope, Operand indices } return new OrderedMapUnstageNoKey(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * 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 key. + * + * @return key. */ public Output key() { return key; } - + /** + * Gets values. + * + * @return values. */ public List> values() { return values; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OrderedMapUnstageNoKey"; - - private Output key; - private List> values; - - private OrderedMapUnstageNoKey(Operation operation) { - super(operation); - int outputIdx = 0; - key = operation.output(outputIdx++); - int valuesLength = operation.outputListLength("values"); - values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); - outputIdx += valuesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.core.OrderedMapUnstageNoKey} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * 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; + } + } + + @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 f455f0fc98c..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,88 +17,138 @@ 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; /** * Pads a tensor. - *

- * This operation pads `input` according to the `paddings` and `constant_values` - * you specify. `paddings` is an integer tensor with shape `[Dn, 2]`, where n is - * the rank of `input`. For each dimension D of `input`, `paddings[D, 0]` indicates - * how many padding values to add before the contents of `input` in that dimension, - * and `paddings[D, 1]` indicates how many padding values to add after the contents - * of `input` in that dimension. `constant_values` is a scalar tensor of the same - * type as `input` that indicates the value to use for padding `input`. - *

- * The padded size of each dimension D of the output is: - *

- * `paddings(D, 0) + input.dim_size(D) + paddings(D, 1)` - *

- * For example: - *

{@code
+ * This operation pads {@code input} according to the {@code paddings} and {@code constant_values}
+ * you specify. {@code paddings} is an integer tensor with shape {@code [Dn, 2]}, where n is
+ * the rank of {@code input}. For each dimension D of {@code input}, {@code paddings[D, 0]} indicates
+ * how many padding values to add before the contents of {@code input} in that dimension,
+ * and {@code paddings[D, 1]} indicates how many padding values to add after the contents
+ * of {@code input} in that dimension. {@code constant_values} is a scalar tensor of the same
+ * type as {@code input} that indicates the value to use for padding {@code input}.
+ * 

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

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

For example: + *

  * # 't' is [[1, 1], [2, 2]]
  * # 'paddings' is [[1, 1], [2, 2]]
  * # 'constant_values' is 0
  * # rank of 't' is 2
- * pad(t, paddings) ==> [[0, 0, 0, 0, 0, 0]
+ * pad(t, paddings) ==> [[0, 0, 0, 0, 0, 0]
  *                       [0, 0, 1, 1, 0, 0]
  *                       [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 { - /** - * Factory method to create a class wrapping a new Pad operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "PadV2"; + + private Output output; + + public Pad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new PadV2 operation. + * * @param scope current scope - * @param input - * @param paddings - * @param constantValues + * @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 */ - @Endpoint(describeByClass = true) - public static Pad create(Scope scope, Operand input, Operand paddings, Operand constantValues) { - OperationBuilder opBuilder = scope.env().opBuilder("PadV2", scope.makeOpName("Pad")); + @Endpoint( + describeByClass = true + ) + public static Pad create(Scope scope, Operand input, + Operand paddings, Operand constantValues) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Pad"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(paddings.asOutput()); opBuilder.addInput(constantValues.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Pad(opBuilder.build()); + return new Pad<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "PadV2"; - - private Output output; - - private Pad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 a0f8c3d7d0b..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,73 +26,115 @@ 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; /** - * Concatenates a list of `N` tensors along the first dimension. - *

+ * Concatenates a list of {@code N} tensors along the first dimension. * The input tensors are all required to have size 1 in the first dimension. - *

- * For example: - *

{@code
+ * 

For example: + *

  * # 'x' is [[1, 4]]
  * # 'y' is [[2, 5]]
  * # 'z' is [[3, 6]]
- * parallel_concat([x, y, z]) => [[1, 4], [2, 5], [3, 6]]  # Pack along first dim.
- * }
- * The difference between concat and parallel_concat is that concat requires all + * parallel_concat([x, y, z]) => [[1, 4], [2, 5], [3, 6]] # Pack along first dim. + *
+ *

The difference between concat and parallel_concat is that concat requires all * of the inputs be computed before the operation will begin but doesn't require * 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ParallelConcat"; + + private Output output; + + public ParallelConcat(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ParallelConcat operation. - * + * * @param scope current scope * @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 * but with the number of input values in the first dimension. + * @param data type for {@code ParallelConcat} output and operands * @return a new instance of ParallelConcat */ - @Endpoint(describeByClass = true) - public static ParallelConcat create(Scope scope, Iterable> values, Shape shape) { - OperationBuilder opBuilder = scope.env().opBuilder("ParallelConcat", scope.makeOpName("ParallelConcat")); + @Endpoint( + describeByClass = true + ) + public static ParallelConcat create(Scope scope, Iterable> values, + Shape shape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ParallelConcat"); opBuilder.addInputList(Operands.asOutputs(values)); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("shape", shape); - return new ParallelConcat(opBuilder.build()); + return new ParallelConcat<>(opBuilder.build()); } - + /** + * Gets output. * The concatenated tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ParallelConcat"; - - private Output output; - - private ParallelConcat(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 ddadd14a859..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,46 +17,50 @@ 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; /** - * Interleave the values from the `data` tensors into a single tensor. - *

+ * Interleave the values from the {@code data} tensors into a single tensor. * Builds a merged tensor such that - *

{@code
+ * 
  *     merged[indices[m][i, ..., j], ...] = data[m][i, ..., j, ...]
- * }
- * For example, if each `indices[m]` is scalar or vector, we have - *
{@code
+ * 
+ *

For example, if each {@code indices[m]} is scalar or vector, we have + *

  *     # Scalar indices:
  *     merged[indices[m], ...] = data[m][...]
- * 
+ *
  *     # Vector indices:
  *     merged[indices[m][i], ...] = data[m][i, ...]
- * }
- * Each `data[i].shape` must start with the corresponding `indices[i].shape`, - * and the rest of `data[i].shape` must be constant w.r.t. `i`. That is, we - * must have `data[i].shape = indices[i].shape + constant`. In terms of this - * `constant`, the output shape is - *

- * merged.shape = [max(indices)] + constant - *

- * Values may be merged in parallel, so if an index appears in both `indices[m][i]` - * and `indices[n][j]`, the result may be invalid. This differs from the normal + *

+ *

Each {@code data[i].shape} must start with the corresponding {@code indices[i].shape}, + * and the rest of {@code data[i].shape} must be constant w.r.t. {@code i}. That is, we + * 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
+ * 
+ *

Values may be merged in parallel, so if an index appears in both {@code indices[m][i]} + * and {@code indices[n][j]}, the result may be invalid. This differs from the normal * DynamicStitch operator that defines the behavior in that case. - *

- * For example: - *

{@code
+ * 

For example: + *

  *     indices[0] = 6
  *     indices[1] = [4, 1]
  *     indices[2] = [[5, 2], [0, 3]]
@@ -65,10 +69,10 @@
  *     data[2] = [[[51, 52], [21, 22]], [[1, 2], [31, 32]]]
  *     merged = [[1, 2], [11, 12], [21, 22], [31, 32], [41, 42],
  *               [51, 52], [61, 62]]
- * }
- * This method can be used to merge partitions created by `dynamic_partition` + *
+ *

This method can be used to merge partitions created by {@code dynamic_partition} * as illustrated on the following example: - *

{@code
+ * 
  *     # Apply function (increments x_i) on elements for which a certain condition
  *     # apply (x_i != -1 in this example).
  *     x=tf.constant([0.1, -1., 5.2, 4.3, -1., 7.4])
@@ -81,52 +85,93 @@
  *     x = tf.dynamic_stitch(condition_indices, partitioned_data)
  *     # Here x=[1.1, -1., 6.2, 5.3, -1, 8.4], the -1. values remain
  *     # unchanged.
- * }
+ *
*
* *
- * - * @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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ParallelDynamicStitch"; + + private Output merged; + + public ParallelDynamicStitch(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + merged = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ParallelDynamicStitch operation. - * + * * @param scope current scope - * @param indices - * @param data + * @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 */ - @Endpoint(describeByClass = true) - public static ParallelDynamicStitch create(Scope scope, Iterable> indices, Iterable> data) { - OperationBuilder opBuilder = scope.env().opBuilder("ParallelDynamicStitch", scope.makeOpName("ParallelDynamicStitch")); + @Endpoint( + describeByClass = true + ) + public static ParallelDynamicStitch create(Scope scope, + Iterable> indices, Iterable> data) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ParallelDynamicStitch"); opBuilder.addInputList(Operands.asOutputs(indices)); opBuilder.addInputList(Operands.asOutputs(data)); - opBuilder = scope.apply(opBuilder); - return new ParallelDynamicStitch(opBuilder.build()); + return new ParallelDynamicStitch<>(opBuilder.build()); } - + /** + * Gets merged. + * + * @return merged. */ public Output merged() { return merged; } - + @Override public Output asOutput() { return merged; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ParallelDynamicStitch"; - - private Output merged; - - private ParallelDynamicStitch(Operation operation) { - super(operation); - int outputIdx = 0; - merged = operation.output(outputIdx++); + + @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 new file mode 100644 index 00000000000..08b8952e099 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/PartitionedCall.java @@ -0,0 +1,247 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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. + * 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 final class PartitionedCall extends RawOp implements Iterable> { + /** + * 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. + * @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 PartitionedCall + */ + @Endpoint( + describeByClass = true + ) + public static PartitionedCall create(Scope scope, Iterable> args, + List> Tout, ConcreteFunction f, Options... 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()); + } + + /** + * 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. + */ + public List> output() { + return output; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + public Iterator> iterator() { + return (Iterator) output.iterator(); + } + + /** + * Optional attributes for {@link org.tensorflow.op.core.PartitionedCall} + */ + 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 = 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 a510d2d5cb7..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,55 +26,55 @@ 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. - *

* 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.Placeholder} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param shape (Optional) The shape of the tensor. If the shape has 0 dimensions, the - * shape is unconstrained. - */ - public Options shape(Shape shape) { - this.shape = shape; - return this; - } - - private Shape shape; - - private Options() { - } + public static final String OP_NAME = "Placeholder"; + + private Output output; + + public Placeholder(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Placeholder operation. - * + * * @param scope current scope * @param dtype The type of elements in the tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Placeholder} output and operands * @return a new instance of Placeholder */ - @Endpoint(describeByClass = true) - public static Placeholder create(Scope scope, Class dtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Placeholder", scope.makeOpName("Placeholder")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static Placeholder create(Scope scope, Class dtype, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Placeholder"); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); if (options != null) { for (Options opts : options) { @@ -81,37 +83,76 @@ public static Placeholder create(Scope scope, Class dtyp } } } - return new Placeholder(opBuilder.build()); + return new Placeholder<>(opBuilder.build()); } - + /** + * Sets the shape option. + * * @param shape (Optional) The shape of the tensor. If the shape has 0 dimensions, the * shape is unconstrained. + * @return this Options instance. */ public static Options shape(Shape shape) { return new Options().shape(shape); } - + /** + * Gets output. * A placeholder tensor that must be replaced using the feed mechanism. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Placeholder"; - - private Output output; - - private Placeholder(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Placeholder} + */ + public static class Options { + private Shape shape; + + private Options() { + } + + /** + * Sets the shape option. + * + * @param shape (Optional) The shape of the tensor. If the shape has 0 dimensions, the + * shape is unconstrained. + * @return this Options instance. + */ + public Options shape(Shape shape) { + this.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 afcf8f3b631..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,62 +17,104 @@ 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 `input` when its output is not fed. - * - * @param data type for {@code output()} output + * A placeholder op that passes through {@code input} when its output is not fed. */ +@OpMetadata( + opType = PlaceholderWithDefault.OP_NAME, + inputsClass = PlaceholderWithDefault.Inputs.class +) @Operator public final class PlaceholderWithDefault extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "PlaceholderWithDefault"; + + private Output output; + + public PlaceholderWithDefault(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new PlaceholderWithDefault operation. - * + * * @param scope current scope - * @param input The default value to produce when `output` is not fed. + * @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 * @return a new instance of PlaceholderWithDefault */ - @Endpoint(describeByClass = true) - public static PlaceholderWithDefault create(Scope scope, Operand input, Shape shape) { - OperationBuilder opBuilder = scope.env().opBuilder("PlaceholderWithDefault", scope.makeOpName("PlaceholderWithDefault")); + @Endpoint( + describeByClass = true + ) + public static PlaceholderWithDefault create(Scope scope, Operand input, + Shape shape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "PlaceholderWithDefault"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("shape", shape); - return new PlaceholderWithDefault(opBuilder.build()); + return new PlaceholderWithDefault<>(opBuilder.build()); } - + /** - * A placeholder tensor that defaults to `input` if it is not fed. + * Gets output. + * A placeholder tensor that defaults to {@code input} if it is not fed. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "PlaceholderWithDefault"; - - private Output output; - - private PlaceholderWithDefault(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 e5c1b17d5c2..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,64 +17,53 @@ 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; /** * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.Print} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param outputStream A string specifying the output stream or logging level to print to. - */ - public Options outputStream(String outputStream) { - this.outputStream = outputStream; - return this; - } - - /** - * @param end - */ - public Options end(String end) { - this.end = end; - return this; - } - - private String outputStream; - private String end; - - private Options() { - } + public static final String OP_NAME = "PrintV2"; + + public Print(Operation operation) { + super(operation, OP_NAME); } - + /** - * Factory method to create a class wrapping a new Print operation. - * + * Factory method to create a class wrapping a new PrintV2 operation. + * * @param scope current scope * @param input The string scalar to print. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Print */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Print create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("PrintV2", scope.makeOpName("Print")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Print"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.outputStream != null) { @@ -87,25 +76,86 @@ public static Print create(Scope scope, Operand input, Options... optio } return new Print(opBuilder.build()); } - + /** + * Sets the outputStream option. + * * @param outputStream A string specifying the output stream or logging level to print to. + * @return this Options instance. */ public static Options outputStream(String outputStream) { return new Options().outputStream(outputStream); } - + /** - * @param end + * Sets the end option. + * + * @param end the end option + * @return this Options instance. */ public static Options end(String end) { return new Options().end(end); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "PrintV2"; - - private Print(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Print} + */ + public static class Options { + private String outputStream; + + private String end; + + private Options() { + } + + /** + * Sets the outputStream option. + * + * @param outputStream A string specifying the output stream or logging level to print to. + * @return this Options instance. + */ + public Options outputStream(String outputStream) { + this.outputStream = outputStream; + return this; + } + + /** + * Sets the end option. + * + * @param end the end option + * @return this Options instance. + */ + public Options end(String end) { + this.end = 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 3d48cb2a4d3..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,65 +17,68 @@ 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 the product of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.Prod} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "Prod"; + + private Output output; + + public Prod(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Prod operation. - * + * * @param scope current scope * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values + * @param data type for {@code Prod} output and operands * @return a new instance of Prod */ - @Endpoint(describeByClass = true) - public static Prod create(Scope scope, Operand input, Operand axis, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Prod", scope.makeOpName("Prod")); + @Endpoint( + describeByClass = true + ) + public static Prod create(Scope scope, Operand input, + Operand axis, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Prod"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.keepDims != null) { @@ -83,36 +86,92 @@ public static Prod create(Scope scope, Operand input, Op } } } - return new Prod(opBuilder.build()); + return new Prod<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets output. * The reduced tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Prod"; - - private Output output; - - private Prod(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Prod} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = 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 13a8a62b000..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,81 +17,146 @@ 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizedReshape"; + + private Output output; + + private Output outputMin; + + private Output outputMax; + + public QuantizedReshape(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + outputMin = operation.output(outputIdx++); + outputMax = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizedReshape operation. - * + * * @param scope current scope - * @param tensor + * @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. + * @param data type for {@code QuantizedReshape} output and operands * @return a new instance of QuantizedReshape */ - @Endpoint(describeByClass = true) - public static QuantizedReshape create(Scope scope, Operand tensor, Operand shape, Operand inputMin, Operand inputMax) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedReshape", scope.makeOpName("QuantizedReshape")); + @Endpoint( + describeByClass = true + ) + public static QuantizedReshape create(Scope scope, Operand tensor, + Operand shape, Operand inputMin, Operand inputMax) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedReshape"); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(inputMin.asOutput()); opBuilder.addInput(inputMax.asOutput()); - opBuilder = scope.apply(opBuilder); - return new QuantizedReshape(opBuilder.build()); + return new QuantizedReshape<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets outputMin. * This value is copied from input_min. + * @return outputMin. */ public Output outputMin() { return outputMin; } - + /** + * Gets outputMax. * This value is copied from input_max. + * @return outputMax. */ public Output outputMax() { return outputMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedReshape"; - - private Output output; - private Output outputMin; - private Output outputMax; - - private QuantizedReshape(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - outputMin = operation.output(outputIdx++); - outputMax = operation.output(outputIdx++); + + @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 7f30e607c86..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,75 +17,120 @@ 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; /** * Creates a sequence of numbers. - *

- * This operation creates a sequence of numbers that begins at `start` and - * extends by increments of `delta` up to but not including `limit`. - *

- * For example: - *

{@code
+ * This operation creates a sequence of numbers that begins at {@code start} and
+ * extends by increments of {@code delta} up to but not including {@code limit}.
+ * 

For example: + *

  * # 'start' is 3
  * # 'limit' is 18
  * # 'delta' is 3
- * tf.range(start, limit, delta) ==> [3, 6, 9, 12, 15]
- * }
- * - * - * @param data type for {@code output()} output + * tf.range(start, limit, delta) ==> [3, 6, 9, 12, 15] + *
*/ +@OpMetadata( + opType = Range.OP_NAME, + inputsClass = Range.Inputs.class +) @Operator public final class Range extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Range"; + + private Output output; + + public Range(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Range operation. - * + * * @param scope current scope * @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 `start`. + * @param delta 0-D (scalar). Optional. Default is 1. Number that increments {@code start}. + * @param data type for {@code Range} output and operands * @return a new instance of Range */ - @Endpoint(describeByClass = true) - public static Range create(Scope scope, Operand start, Operand limit, Operand delta) { - OperationBuilder opBuilder = scope.env().opBuilder("Range", scope.makeOpName("Range")); + @Endpoint( + describeByClass = true + ) + public static Range create(Scope scope, Operand start, Operand limit, + Operand delta) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Range"); opBuilder.addInput(start.asOutput()); opBuilder.addInput(limit.asOutput()); opBuilder.addInput(delta.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Range(opBuilder.build()); + return new Range<>(opBuilder.build()); } - + /** + * Gets output. * 1-D. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Range"; - - private Output output; - - private Range(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 cff0df03467..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,69 +17,104 @@ 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; /** * Returns the rank of a tensor. - *

- * This operation returns an integer representing the rank of `input`. - *

- * For example: - *

{@code
+ * This operation returns an integer representing the rank of {@code input}.
+ * 

For example: + *

  * # 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]
  * # shape of tensor 't' is [2, 2, 3]
- * rank(t) ==> 3
- * }
- * Note: The rank of a tensor is not the same as the rank of a matrix. The rank + * rank(t) ==> 3 + *
+ *

Note: The rank of a tensor is not the same as the rank of a matrix. The rank * 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." + * 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Rank"; + + private Output output; + + public Rank(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Rank operation. - * + * * @param scope current scope - * @param input + * @param input The input value * @return a new instance of Rank */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Rank create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("Rank", scope.makeOpName("Rank")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Rank"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); return new Rank(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Rank"; - - private Output output; - - private Rank(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 1e73225cc89..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,68 +17,103 @@ 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; /** * Reads the value of a variable. - *

* The tensor returned by this operation is immutable. - *

- * The value returned by this operation is guaranteed to be influenced by all the + *

The value returned by this operation is guaranteed to be influenced by all the * 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReadVariableOp"; + + private Output value; + + public ReadVariableOp(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + value = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ReadVariableOp operation. - * + * * @param scope current scope * @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 * @return a new instance of ReadVariableOp */ - @Endpoint(describeByClass = true) - public static ReadVariableOp create(Scope scope, Operand resource, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("ReadVariableOp", scope.makeOpName("ReadVariableOp")); + @Endpoint( + describeByClass = true + ) + public static ReadVariableOp create(Scope scope, + Operand resource, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReadVariableOp"); opBuilder.addInput(resource.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new ReadVariableOp(opBuilder.build()); + return new ReadVariableOp<>(opBuilder.build()); } - + /** + * Gets value. + * + * @return value. */ public Output value() { return value; } - + @Override public Output asOutput() { return value; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReadVariableOp"; - - private Output value; - - private ReadVariableOp(Operation operation) { - super(operation); - int outputIdx = 0; - value = operation.output(outputIdx++); + + @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 ccae187f1ec..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,62 +17,65 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.Recv} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param clientTerminated 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 Options clientTerminated(Boolean clientTerminated) { - this.clientTerminated = clientTerminated; - return this; - } - - private Boolean clientTerminated; - - private Options() { - } + public static final String OP_NAME = "Recv"; + + private Output tensor; + + public Recv(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + tensor = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Recv operation. - * + * * @param scope current scope - * @param tensorType + * @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. * @param recvDevice The name of the device receiving the tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Recv} output and operands * @return a new instance of Recv */ - @Endpoint(describeByClass = true) - public static Recv create(Scope scope, Class tensorType, String tensorName, String sendDevice, Long sendDeviceIncarnation, String recvDevice, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Recv", scope.makeOpName("Recv")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static Recv create(Scope scope, Class tensorType, + String tensorName, String sendDevice, Long sendDeviceIncarnation, String recvDevice, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Recv"); opBuilder.setAttr("tensor_type", Operands.toDataType(tensorType)); opBuilder.setAttr("tensor_name", tensorName); opBuilder.setAttr("send_device", sendDevice); @@ -85,39 +88,106 @@ public static Recv create(Scope scope, Class tensorType, } } } - return new Recv(opBuilder.build()); + return new Recv<>(opBuilder.build()); } - + /** + * Sets the clientTerminated option. + * * @param clientTerminated 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. + * @return this Options instance. */ public static Options clientTerminated(Boolean clientTerminated) { return new Options().clientTerminated(clientTerminated); } - + /** + * Gets tensor. * The tensor to receive. + * @return tensor. */ public Output tensor() { return tensor; } - + @Override public Output asOutput() { return tensor; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Recv"; - - private Output tensor; - - private Recv(Operation operation) { - super(operation); - int outputIdx = 0; - tensor = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Recv} + */ + public static class Options { + private Boolean clientTerminated; + + private Options() { + } + + /** + * Sets the clientTerminated option. + * + * @param clientTerminated 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. + * @return this Options instance. + */ + public Options clientTerminated(Boolean clientTerminated) { + this.clientTerminated = 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 fee74f3b81f..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,63 +17,67 @@ 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; /** - * Computes the "logical and" of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Computes the "logical and" of elements across dimensions of a tensor. + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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. */ +@OpMetadata( + opType = ReduceAll.OP_NAME, + inputsClass = ReduceAll.Inputs.class +) @Operator public final class ReduceAll extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ReduceAll} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "All"; + + private Output output; + + public ReduceAll(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ReduceAll operation. - * + * Factory method to create a class wrapping a new All operation. + * * @param scope current scope * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values * @return a new instance of ReduceAll */ - @Endpoint(describeByClass = true) - public static ReduceAll create(Scope scope, Operand input, Operand axis, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("All", scope.makeOpName("ReduceAll")); + @Endpoint( + describeByClass = true + ) + public static ReduceAll create(Scope scope, Operand input, Operand axis, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReduceAll"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.keepDims != null) { @@ -83,34 +87,84 @@ public static ReduceAll create(Scope scope, Operand input, Operand output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "All"; - - private Output output; - - private ReduceAll(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ReduceAll} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = 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 ff0b97078f9..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,63 +17,67 @@ 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; /** - * Computes the "logical or" of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Computes the "logical or" of elements across dimensions of a tensor. + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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. */ +@OpMetadata( + opType = ReduceAny.OP_NAME, + inputsClass = ReduceAny.Inputs.class +) @Operator public final class ReduceAny extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ReduceAny} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "Any"; + + private Output output; + + public ReduceAny(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ReduceAny operation. - * + * Factory method to create a class wrapping a new Any operation. + * * @param scope current scope * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values * @return a new instance of ReduceAny */ - @Endpoint(describeByClass = true) - public static ReduceAny create(Scope scope, Operand input, Operand axis, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Any", scope.makeOpName("ReduceAny")); + @Endpoint( + describeByClass = true + ) + public static ReduceAny create(Scope scope, Operand input, Operand axis, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReduceAny"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.keepDims != null) { @@ -83,34 +87,84 @@ public static ReduceAny create(Scope scope, Operand input, Operand output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Any"; - - private Output output; - - private ReduceAny(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ReduceAny} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = 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 44418b844d9..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,65 +17,67 @@ 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 the maximum of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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 { - +public final class ReduceMax extends RawOp implements Operand { /** - * Optional attributes for {@link org.tensorflow.op.core.ReduceMax} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "Max"; + + private Output output; + + public ReduceMax(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ReduceMax operation. - * + * Factory method to create a class wrapping a new Max operation. + * * @param scope current scope * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values + * @param data type for {@code Max} output and operands * @return a new instance of ReduceMax */ - @Endpoint(describeByClass = true) - public static ReduceMax create(Scope scope, Operand input, Operand axis, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Max", scope.makeOpName("ReduceMax")); + @Endpoint( + describeByClass = true + ) + public static ReduceMax create(Scope scope, Operand input, + Operand axis, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReduceMax"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.keepDims != null) { @@ -83,36 +85,92 @@ public static ReduceMax create(Scope scope, Operand inpu } } } - return new ReduceMax(opBuilder.build()); + return new ReduceMax<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets output. * The reduced tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Max"; - - private Output output; - - private ReduceMax(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ReduceMax} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = 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 6a7f4361324..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,65 +17,67 @@ 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 the minimum of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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 { - +public final class ReduceMin extends RawOp implements Operand { /** - * Optional attributes for {@link org.tensorflow.op.core.ReduceMin} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "Min"; + + private Output output; + + public ReduceMin(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ReduceMin operation. - * + * Factory method to create a class wrapping a new Min operation. + * * @param scope current scope * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values + * @param data type for {@code Min} output and operands * @return a new instance of ReduceMin */ - @Endpoint(describeByClass = true) - public static ReduceMin create(Scope scope, Operand input, Operand axis, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Min", scope.makeOpName("ReduceMin")); + @Endpoint( + describeByClass = true + ) + public static ReduceMin create(Scope scope, Operand input, + Operand axis, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReduceMin"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.keepDims != null) { @@ -83,36 +85,92 @@ public static ReduceMin create(Scope scope, Operand inpu } } } - return new ReduceMin(opBuilder.build()); + return new ReduceMin<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets output. * The reduced tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Min"; - - private Output output; - - private ReduceMin(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ReduceMin} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = 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 da78a30db62..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,65 +17,68 @@ 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 the product of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.ReduceProd} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "Prod"; + + private Output output; + + public ReduceProd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ReduceProd operation. - * + * Factory method to create a class wrapping a new Prod operation. + * * @param scope current scope * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values + * @param data type for {@code Prod} output and operands * @return a new instance of ReduceProd */ - @Endpoint(describeByClass = true) - public static ReduceProd create(Scope scope, Operand input, Operand axis, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Prod", scope.makeOpName("ReduceProd")); + @Endpoint( + describeByClass = true + ) + public static ReduceProd create(Scope scope, Operand input, + Operand axis, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReduceProd"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.keepDims != null) { @@ -83,36 +86,92 @@ public static ReduceProd create(Scope scope, Operand inp } } } - return new ReduceProd(opBuilder.build()); + return new ReduceProd<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets output. * The reduced tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Prod"; - - private Output output; - - private ReduceProd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ReduceProd} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = 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 c06b2998a67..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,65 +17,68 @@ 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 the sum of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.ReduceSum} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "Sum"; + + private Output output; + + public ReduceSum(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ReduceSum operation. - * + * Factory method to create a class wrapping a new Sum operation. + * * @param scope current scope * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values + * @param data type for {@code Sum} output and operands * @return a new instance of ReduceSum */ - @Endpoint(describeByClass = true) - public static ReduceSum create(Scope scope, Operand input, Operand axis, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Sum", scope.makeOpName("ReduceSum")); + @Endpoint( + describeByClass = true + ) + public static ReduceSum create(Scope scope, Operand input, + Operand axis, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReduceSum"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.keepDims != null) { @@ -83,36 +86,92 @@ public static ReduceSum create(Scope scope, Operand inpu } } } - return new ReduceSum(opBuilder.build()); + return new ReduceSum<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets output. * The reduced tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Sum"; - - private Output output; - - private ReduceSum(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ReduceSum} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = 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 a31b538e594..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,70 +17,65 @@ 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; /** - * Creates or finds a child frame, and makes `data` available to the child frame. - *

- * The unique `frame_name` is used by the `Executor` to identify frames. If - * `is_constant` is true, `output` is a constant in the child frame; otherwise - * it may be changed in the child frame. At most `parallel_iterations` iterations + * Creates or finds a child frame, and makes {@code data} available to the child frame. + * 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 type for {@code output()} output */ +@OpMetadata( + opType = RefEnter.OP_NAME, + inputsClass = RefEnter.Inputs.class +) +@Operator public final class RefEnter extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.RefEnter} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param isConstant If true, the output is constant within the child frame. - */ - public Options isConstant(Boolean isConstant) { - this.isConstant = isConstant; - return this; - } - - /** - * @param parallelIterations The number of iterations allowed to run in parallel. - */ - public Options parallelIterations(Long parallelIterations) { - this.parallelIterations = parallelIterations; - return this; - } - - private Boolean isConstant; - private Long parallelIterations; - - private Options() { - } + public static final String OP_NAME = "RefEnter"; + + private Output output; + + public RefEnter(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RefEnter operation. - * + * * @param scope current scope * @param data The tensor to be made available to the child frame. * @param frameName The name of the child frame. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code RefEnter} output and operands * @return a new instance of RefEnter */ - @Endpoint(describeByClass = true) - public static RefEnter create(Scope scope, Operand data, String frameName, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RefEnter", scope.makeOpName("RefEnter")); + @Endpoint( + describeByClass = true + ) + public static RefEnter create(Scope scope, Operand data, String frameName, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RefEnter"); opBuilder.addInput(data.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("frame_name", frameName); if (options != null) { for (Options opts : options) { @@ -92,43 +87,114 @@ public static RefEnter create(Scope scope, Operand data, } } } - return new RefEnter(opBuilder.build()); + return new RefEnter<>(opBuilder.build()); } - + /** + * Sets the isConstant option. + * * @param isConstant If true, the output is constant within the child frame. + * @return this Options instance. */ public static Options isConstant(Boolean isConstant) { return new Options().isConstant(isConstant); } - + /** + * Sets the parallelIterations option. + * * @param parallelIterations The number of iterations allowed to run in parallel. + * @return this Options instance. */ public static Options parallelIterations(Long parallelIterations) { return new Options().parallelIterations(parallelIterations); } - + /** - * The same tensor as `data`. + * Gets output. + * The same tensor as {@code data}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RefEnter"; - - private Output output; - - private RefEnter(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.RefEnter} + */ + public static class Options { + private Boolean isConstant; + + private Long parallelIterations; + + private Options() { + } + + /** + * Sets the isConstant option. + * + * @param isConstant If true, the output is constant within the child frame. + * @return this Options instance. + */ + public Options isConstant(Boolean isConstant) { + this.isConstant = isConstant; + return this; + } + + /** + * Sets the parallelIterations option. + * + * @param parallelIterations The number of iterations allowed to run in parallel. + * @return this Options instance. + */ + public Options parallelIterations(Long parallelIterations) { + this.parallelIterations = 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 ce2ac9a8264..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,60 +17,95 @@ 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 `data` available to the parent frame. - * - * @param data type for {@code output()} output + * Exit makes its input {@code data} available to the parent frame. */ +@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 + */ + public static final String OP_NAME = "RefExit"; + + private Output output; + + public RefExit(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RefExit operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static RefExit create(Scope scope, Operand data) { - OperationBuilder opBuilder = scope.env().opBuilder("RefExit", scope.makeOpName("RefExit")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RefExit"); opBuilder.addInput(data.asOutput()); - opBuilder = scope.apply(opBuilder); - return new RefExit(opBuilder.build()); + return new RefExit<>(opBuilder.build()); } - + /** - * The same tensor as `data`. + * Gets output. + * The same tensor as {@code data}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RefExit"; - - private Output output; - - private RefExit(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 12e896fdfb5..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,57 +17,94 @@ 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 + */ + public static final String OP_NAME = "RefIdentity"; + + private Output output; + + public RefIdentity(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RefIdentity operation. - * + * * @param scope current scope - * @param input + * @param input The input value + * @param data type for {@code RefIdentity} output and operands * @return a new instance of RefIdentity */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static RefIdentity create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("RefIdentity", scope.makeOpName("RefIdentity")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RefIdentity"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new RefIdentity(opBuilder.build()); + return new RefIdentity<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RefIdentity"; - - private Output output; - - private RefIdentity(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 c19e662b607..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,70 +17,109 @@ 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 value of an available tensor from `inputs` to `output`. - *

- * `Merge` waits for at least one of the tensors in `inputs` to become available. - * It is usually combined with `Switch` to implement branching. - *

- * `Merge` forwards the first tensor for become available to `output`, and sets - * `value_index` to its index in `inputs`. - * - * @param data type for {@code output()} output + * 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}. */ +@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 + */ + public static final String OP_NAME = "RefMerge"; + + private Output output; + + private Output valueIndex; + + public RefMerge(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + valueIndex = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RefMerge operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static RefMerge create(Scope scope, Iterable> inputs) { - OperationBuilder opBuilder = scope.env().opBuilder("RefMerge", scope.makeOpName("RefMerge")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RefMerge"); opBuilder.addInputList(Operands.asOutputs(inputs)); - opBuilder = scope.apply(opBuilder); - return new RefMerge(opBuilder.build()); + return new RefMerge<>(opBuilder.build()); } - + /** + * Gets output. * Will be set to the available input tensor. + * @return output. */ public Output output() { return output; } - + /** - * The index of the chosen input tensor in `inputs`. + * Gets valueIndex. + * The index of the chosen input tensor in {@code inputs}. + * @return valueIndex. */ public Output valueIndex() { return valueIndex; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RefMerge"; - - private Output output; - private Output valueIndex; - - private RefMerge(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - valueIndex = operation.output(outputIdx++); + + @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 f3f6e374590..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,59 +17,94 @@ 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RefNextIteration"; + + private Output output; + + public RefNextIteration(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RefNextIteration operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static RefNextIteration create(Scope scope, Operand data) { - OperationBuilder opBuilder = scope.env().opBuilder("RefNextIteration", scope.makeOpName("RefNextIteration")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RefNextIteration"); opBuilder.addInput(data.asOutput()); - opBuilder = scope.apply(opBuilder); - return new RefNextIteration(opBuilder.build()); + return new RefNextIteration<>(opBuilder.build()); } - + /** - * The same tensor as `data`. + * Gets output. + * The same tensor as {@code data}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RefNextIteration"; - - private Output output; - - private RefNextIteration(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 e334412a13a..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,63 +17,107 @@ 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 `index`th element of `inputs` to `output`. - * - * @param data type for {@code output()} output + * Forwards the {@code index}th element of {@code inputs} to {@code output}. */ +@OpMetadata( + opType = RefSelect.OP_NAME, + inputsClass = RefSelect.Inputs.class +) @Operator public final class RefSelect extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RefSelect"; + + private Output output; + + public RefSelect(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RefSelect operation. - * + * * @param scope current scope * @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 `output`. + * @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 * @return a new instance of RefSelect */ - @Endpoint(describeByClass = true) - public static RefSelect create(Scope scope, Operand index, Iterable> inputs) { - OperationBuilder opBuilder = scope.env().opBuilder("RefSelect", scope.makeOpName("RefSelect")); + @Endpoint( + describeByClass = true + ) + public static RefSelect create(Scope scope, Operand index, + Iterable> inputs) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RefSelect"); opBuilder.addInput(index.asOutput()); opBuilder.addInputList(Operands.asOutputs(inputs)); - opBuilder = scope.apply(opBuilder); - return new RefSelect(opBuilder.build()); + return new RefSelect<>(opBuilder.build()); } - + /** + * Gets output. * The forwarded tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RefSelect"; - - private Output output; - - private RefSelect(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 08a8f1ee53c..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,71 +17,114 @@ 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; /** - * Forwards the ref tensor `data` to the output port determined by `pred`. - *

- * If `pred` is true, the `data` input is forwarded to `output_true`. Otherwise, - * the data goes to `output_false`. - *

- * See also `Switch` and `Merge`. - * - * @param data type for {@code outputFalse()} output + * Forwards the ref tensor {@code data} to the output port determined by {@code pred}. + * 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}. */ +@OpMetadata( + opType = RefSwitch.OP_NAME, + inputsClass = RefSwitch.Inputs.class +) @Operator public final class RefSwitch extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RefSwitch"; + + private Output outputFalse; + + private Output outputTrue; + + public RefSwitch(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputFalse = operation.output(outputIdx++); + outputTrue = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RefSwitch operation. - * + * * @param scope current scope * @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 * @return a new instance of RefSwitch */ - @Endpoint(describeByClass = true) - public static RefSwitch create(Scope scope, Operand data, Operand pred) { - OperationBuilder opBuilder = scope.env().opBuilder("RefSwitch", scope.makeOpName("RefSwitch")); + @Endpoint( + describeByClass = true + ) + public static RefSwitch create(Scope scope, Operand data, + Operand pred) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RefSwitch"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(pred.asOutput()); - opBuilder = scope.apply(opBuilder); - return new RefSwitch(opBuilder.build()); + return new RefSwitch<>(opBuilder.build()); } - + /** - * If `pred` is false, data will be forwarded to this output. + * Gets outputFalse. + * If {@code pred} is false, data will be forwarded to this output. + * @return outputFalse. */ public Output outputFalse() { return outputFalse; } - + /** - * If `pred` is true, data will be forwarded to this output. + * Gets outputTrue. + * If {@code pred} is true, data will be forwarded to this output. + * @return outputTrue. */ public Output outputTrue() { return outputTrue; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RefSwitch"; - - private Output outputFalse; - private Output outputTrue; - - private RefSwitch(Operation operation) { - super(operation); - int outputIdx = 0; - outputFalse = operation.output(outputIdx++); - outputTrue = operation.output(outputIdx++); + + @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 new file mode 100644 index 00000000000..7613a302dbe --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RemoteCall.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.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.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> { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RemoteCall"; + + private List> output; + + @SuppressWarnings("unchecked") + public RemoteCall(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 RemoteCall operation. + * + * @param scope current scope + * @param target A fully specified device name where we want to run the function. + * @param args A list of arguments for the function. + * @param Tout The type list for the return values. + * @param f The function to run remotely. + * @return a new instance of RemoteCall + */ + @Endpoint( + describeByClass = true + ) + public static RemoteCall create(Scope scope, Operand target, Iterable> args, + List> Tout, ConcreteFunction f) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RemoteCall"); + opBuilder.addInput(target.asOutput()); + opBuilder.addInputList(Operands.asOutputs(args)); + opBuilder.setAttr("Tout", Operands.toDataTypes(Tout)); + opBuilder.setAttr("f", f); + return new RemoteCall(opBuilder.build()); + } + + /** + * Gets output. + * A list of return values. + * @return output. + */ + public List> output() { + return output; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + 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/RemoteFusedGraphExecute.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RemoteFusedGraphExecute.java deleted file mode 100644 index b0dcdfc5398..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RemoteFusedGraphExecute.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.core; - -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import org.tensorflow.Operand; -import org.tensorflow.Operation; -import org.tensorflow.OperationBuilder; -import org.tensorflow.Output; -import org.tensorflow.op.Operands; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.family.TType; - -/** - * Execute a sub graph on a remote processor. - *

- * The graph specifications(such as graph itself, input tensors and output names) - * are stored as a serialized protocol buffer of RemoteFusedGraphExecuteInfo - * as serialized_remote_fused_graph_execute_info. - * The specifications will be passed to a dedicated registered - * remote fused graph executor. The executor will send the graph specifications - * to a remote processor and execute that graph. The execution results - * will be passed to consumer nodes as outputs of this node. - */ -@Operator -public final class RemoteFusedGraphExecute extends RawOp implements Iterable> { - - /** - * Factory method to create a class wrapping a new RemoteFusedGraphExecute operation. - * - * @param scope current scope - * @param inputs Arbitrary number of tensors with arbitrary data types - * @param Toutputs - * @param serializedRemoteFusedGraphExecuteInfo Serialized protocol buffer - * of RemoteFusedGraphExecuteInfo which contains graph specifications. - * @return a new instance of RemoteFusedGraphExecute - */ - @Endpoint(describeByClass = true) - public static RemoteFusedGraphExecute create(Scope scope, Iterable> inputs, List> Toutputs, String serializedRemoteFusedGraphExecuteInfo) { - OperationBuilder opBuilder = scope.env().opBuilder("RemoteFusedGraphExecute", scope.makeOpName("RemoteFusedGraphExecute")); - opBuilder.addInputList(Operands.asOutputs(inputs)); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("Toutputs", Operands.toDataTypes(Toutputs)); - opBuilder.setAttr("serialized_remote_fused_graph_execute_info", serializedRemoteFusedGraphExecuteInfo); - return new RemoteFusedGraphExecute(opBuilder.build()); - } - - /** - * Arbitrary number of tensors with arbitrary data types - */ - public List> outputs() { - return outputs; - } - - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { - return (Iterator) outputs.iterator(); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RemoteFusedGraphExecute"; - - private List> outputs; - - private RemoteFusedGraphExecute(Operation operation) { - super(operation); - int outputIdx = 0; - int outputsLength = operation.outputListLength("outputs"); - outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength)); - outputIdx += outputsLength; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Reshape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Reshape.java index 1da37dd550d..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,48 +17,49 @@ 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; /** * Reshapes a tensor. - *

- * Given `tensor`, this operation returns a tensor that has the same values - * as `tensor` with shape `shape`. - *

- * If one component of 1-D tensor `shape` is the special value -1, the size of that + * Given {@code tensor}, this operation returns a tensor that has the same values + * as {@code tensor} with shape {@code shape}. + *

If one component of 1-D tensor {@code shape} is the special value -1, the size of that * dimension is computed so that the total size remains constant. In particular, a - * `shape` of `[-1]` flattens into 1-D. At most one component of `shape` may be + * {@code shape} of {@code [-1]} flattens into 1-D. At most one component of {@code shape} may be * unknown. - *

- * The `shape` must be 1-D and the operation returns a tensor with shape - * `shape` filled with the values of `tensor`. In this case, the number of elements - * implied by `shape` must be the same as the number of elements in `tensor`. - *

- * It is an error if `shape` is not 1-D. - *

- * For example: - *

{@code
+ * 

The {@code shape} must be 1-D and the operation returns a tensor with shape + * {@code shape} filled with the values of {@code tensor}. In this case, the number of elements + * implied by {@code shape} must be the same as the number of elements in {@code tensor}. + *

It is an error if {@code shape} is not 1-D. + *

For example: + *

  * # tensor 't' is [1, 2, 3, 4, 5, 6, 7, 8, 9]
  * # tensor 't' has shape [9]
- * reshape(t, [3, 3]) ==> [[1, 2, 3],
+ * reshape(t, [3, 3]) ==> [[1, 2, 3],
  *                         [4, 5, 6],
  *                         [7, 8, 9]]
- * 
+ *
  * # tensor 't' is [[[1, 1], [2, 2]],
  * #                [[3, 3], [4, 4]]]
  * # tensor 't' has shape [2, 2, 2]
- * reshape(t, [2, 4]) ==> [[1, 1, 2, 2],
+ * reshape(t, [2, 4]) ==> [[1, 1, 2, 2],
  *                         [3, 3, 4, 4]]
- * 
+ *
  * # tensor 't' is [[[1, 1, 1],
  * #                 [2, 2, 2]],
  * #                [[3, 3, 3],
@@ -67,71 +68,113 @@
  * #                 [6, 6, 6]]]
  * # tensor 't' has shape [3, 2, 3]
  * # pass '[-1]' to flatten 't'
- * reshape(t, [-1]) ==> [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6]
- * 
+ * reshape(t, [-1]) ==> [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6]
+ *
  * # -1 can also be used to infer the shape
- * 
+ *
  * # -1 is inferred to be 9:
- * reshape(t, [2, -1]) ==> [[1, 1, 1, 2, 2, 2, 3, 3, 3],
+ * reshape(t, [2, -1]) ==> [[1, 1, 1, 2, 2, 2, 3, 3, 3],
  *                          [4, 4, 4, 5, 5, 5, 6, 6, 6]]
  * # -1 is inferred to be 2:
- * reshape(t, [-1, 9]) ==> [[1, 1, 1, 2, 2, 2, 3, 3, 3],
+ * reshape(t, [-1, 9]) ==> [[1, 1, 1, 2, 2, 2, 3, 3, 3],
  *                          [4, 4, 4, 5, 5, 5, 6, 6, 6]]
  * # -1 is inferred to be 3:
- * reshape(t, [ 2, -1, 3]) ==> [[[1, 1, 1],
+ * reshape(t, [ 2, -1, 3]) ==> [[[1, 1, 1],
  *                               [2, 2, 2],
  *                               [3, 3, 3]],
  *                              [[4, 4, 4],
  *                               [5, 5, 5],
  *                               [6, 6, 6]]]
- * 
+ *
  * # tensor 't' is [7]
  * # shape `[]` reshapes to a scalar
- * reshape(t, []) ==> 7
- * }
- * - * - * @param data type for {@code output()} output + * reshape(t, []) ==> 7 + *
*/ +@OpMetadata( + opType = Reshape.OP_NAME, + inputsClass = Reshape.Inputs.class +) @Operator public final class Reshape extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Reshape"; + + private Output output; + + public Reshape(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Reshape operation. - * + * * @param scope current scope - * @param tensor + * @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 */ - @Endpoint(describeByClass = true) - public static Reshape create(Scope scope, Operand tensor, Operand shape) { - OperationBuilder opBuilder = scope.env().opBuilder("Reshape", scope.makeOpName("Reshape")); + @Endpoint( + describeByClass = true + ) + public static Reshape create(Scope scope, Operand tensor, + Operand shape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Reshape"); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(shape.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Reshape(opBuilder.build()); + return new Reshape<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Reshape"; - - private Output output; - - private Reshape(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 cbfb7ea15d2..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,66 +17,110 @@ 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ResourceCountUpTo"; + + private Output output; + + public ResourceCountUpTo(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ResourceCountUpTo operation. - * + * * @param scope current scope - * @param resource Should be from a scalar `Variable` node. + * @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 + * @param T The value of the T attribute + * @param data type for {@code ResourceCountUpTo} output and operands * @return a new instance of ResourceCountUpTo */ - @Endpoint(describeByClass = true) - public static ResourceCountUpTo create(Scope scope, Operand resource, Long limit, Class T) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceCountUpTo", scope.makeOpName("ResourceCountUpTo")); + @Endpoint( + describeByClass = true + ) + public static ResourceCountUpTo create(Scope scope, + Operand resource, Long limit, Class T) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceCountUpTo"); opBuilder.addInput(resource.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("limit", limit); opBuilder.setAttr("T", Operands.toDataType(T)); - return new ResourceCountUpTo(opBuilder.build()); + return new ResourceCountUpTo<>(opBuilder.build()); } - + /** + * Gets output. * A copy of the input before increment. If nothing else modifies the * input, the values produced will all be distinct. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceCountUpTo"; - - private Output output; - - private ResourceCountUpTo(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 c8906164dd7..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,84 +17,78 @@ 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; /** - * Gather slices from the variable pointed to by `resource` according to `indices`. - *

- * `indices` must be an integer tensor of any dimension (usually 0-D or 1-D). - * Produces an output tensor with shape `indices.shape + params.shape[1:]` where: - *

{@code
+ * Gather slices from the variable pointed to by {@code resource} according to {@code indices}.
+ * {@code indices} must be an integer tensor of any dimension (usually 0-D or 1-D).
+ * Produces an output tensor with shape {@code indices.shape + params.shape[1:]} where:
+ * 
  *     # Scalar indices
  *     output[:, ..., :] = params[indices, :, ... :]
- * 
+ *
  *     # Vector indices
  *     output[i, :, ..., :] = params[indices[i], :, ... :]
- * 
+ *
  *     # 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.ResourceGather} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param batchDims - */ - public Options batchDims(Long batchDims) { - this.batchDims = batchDims; - return this; - } - - /** - * @param validateIndices - */ - public Options validateIndices(Boolean validateIndices) { - this.validateIndices = validateIndices; - return this; - } - - private Long batchDims; - private Boolean validateIndices; - - private Options() { - } + public static final String OP_NAME = "ResourceGather"; + + private Output output; + + public ResourceGather(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ResourceGather operation. - * + * * @param scope current scope - * @param resource - * @param indices - * @param dtype - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static ResourceGather create(Scope scope, Operand resource, Operand indices, Class dtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceGather", scope.makeOpName("ResourceGather")); + @Endpoint( + describeByClass = true + ) + public static ResourceGather create(Scope scope, + Operand resource, Operand indices, Class dtype, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceGather"); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); if (options != null) { for (Options opts : options) { @@ -106,42 +100,120 @@ public static ResourceGather create(Scope scope, Operand } } } - return new ResourceGather(opBuilder.build()); + return new ResourceGather<>(opBuilder.build()); } - + /** - * @param batchDims + * Sets the batchDims option. + * + * @param batchDims the batchDims option + * @return this Options instance. */ public static Options batchDims(Long batchDims) { return new Options().batchDims(batchDims); } - + /** - * @param validateIndices + * Sets the validateIndices option. + * + * @param validateIndices the validateIndices option + * @return this Options instance. */ public static Options validateIndices(Boolean validateIndices) { return new Options().validateIndices(validateIndices); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceGather"; - - private Output output; - - private ResourceGather(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ResourceGather} + */ + public static class Options { + private Long batchDims; + + private Boolean validateIndices; + + 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; + } + + /** + * Sets the validateIndices option. + * + * @param validateIndices the validateIndices option + * @return this Options instance. + */ + public Options validateIndices(Boolean validateIndices) { + this.validateIndices = 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 5cadc84d016..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,62 +17,113 @@ 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; /** - * @param data type for {@code output()} output + * The ResourceGatherNd operation */ +@OpMetadata( + opType = ResourceGatherNd.OP_NAME, + inputsClass = ResourceGatherNd.Inputs.class +) @Operator public final class ResourceGatherNd extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ResourceGatherNd"; + + private Output output; + + public ResourceGatherNd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ResourceGatherNd operation. - * + * * @param scope current scope - * @param resource - * @param indices - * @param dtype + * @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 */ - @Endpoint(describeByClass = true) - public static ResourceGatherNd create(Scope scope, Operand resource, Operand indices, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceGatherNd", scope.makeOpName("ResourceGatherNd")); + @Endpoint( + describeByClass = true + ) + public static ResourceGatherNd create(Scope scope, + Operand resource, Operand indices, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceGatherNd"); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new ResourceGatherNd(opBuilder.build()); + return new ResourceGatherNd<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceGatherNd"; - - private Output output; - - private ResourceGatherNd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 935000e7ec6..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,65 +17,115 @@ 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; /** - * Adds sparse updates to the variable referenced by `resource`. - *

+ * Adds sparse updates to the variable referenced by {@code resource}. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] += updates[...] - *

- * # Vector indices (for each i) - * ref[indices[i], ...] += updates[i, ...] - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] += updates[i, ..., j, ...] - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

+ * # Scalar indices
+ * ref[indices, ...] += updates[...]
+ *
+ * # Vector indices (for each i)
+ * ref[indices[i], ...] += updates[i, ...]
+ *
+ * # High rank indices (for each i, ..., j)
+ * ref[indices[i, ..., j], ...] += updates[i, ..., j, ...]
+ * 
+ *

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

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
*/ +@OpMetadata( + opType = ResourceScatterAdd.OP_NAME, + inputsClass = ResourceScatterAdd.Inputs.class +) @Operator public final class ResourceScatterAdd extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ResourceScatterAdd"; + + public ResourceScatterAdd(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new ResourceScatterAdd operation. - * + * * @param scope current scope - * @param resource Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. + * @param resource 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}. * @return a new instance of ResourceScatterAdd */ - @Endpoint(describeByClass = true) - public static ResourceScatterAdd create(Scope scope, Operand resource, Operand indices, Operand updates) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterAdd", scope.makeOpName("ResourceScatterAdd")); + @Endpoint( + describeByClass = true + ) + public static ResourceScatterAdd create(Scope scope, Operand resource, + Operand indices, Operand updates) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceScatterAdd"); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); return new ResourceScatterAdd(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceScatterAdd"; - - private ResourceScatterAdd(Operation operation) { - super(operation); + + @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 8a21a2706a3..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,65 +17,115 @@ 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; /** - * Divides sparse updates into the variable referenced by `resource`. - *

+ * Divides sparse updates into the variable referenced by {@code resource}. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] /= updates[...] - *

- * # Vector indices (for each i) - * ref[indices[i], ...] /= updates[i, ...] - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] /= updates[i, ..., j, ...] - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

+ * # Scalar indices
+ * ref[indices, ...] /= updates[...]
+ *
+ * # Vector indices (for each i)
+ * ref[indices[i], ...] /= updates[i, ...]
+ *
+ * # High rank indices (for each i, ..., j)
+ * ref[indices[i, ..., j], ...] /= updates[i, ..., j, ...]
+ * 
+ *

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

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
*/ +@OpMetadata( + opType = ResourceScatterDiv.OP_NAME, + inputsClass = ResourceScatterDiv.Inputs.class +) @Operator public final class ResourceScatterDiv extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ResourceScatterDiv"; + + public ResourceScatterDiv(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new ResourceScatterDiv operation. - * + * * @param scope current scope - * @param resource Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. + * @param resource 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}. * @return a new instance of ResourceScatterDiv */ - @Endpoint(describeByClass = true) - public static ResourceScatterDiv create(Scope scope, Operand resource, Operand indices, Operand updates) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterDiv", scope.makeOpName("ResourceScatterDiv")); + @Endpoint( + describeByClass = true + ) + public static ResourceScatterDiv create(Scope scope, Operand resource, + Operand indices, Operand updates) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceScatterDiv"); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); return new ResourceScatterDiv(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceScatterDiv"; - - private ResourceScatterDiv(Operation operation) { - super(operation); + + @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 7e6ca9e3302..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,65 +17,115 @@ 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; /** - * Reduces sparse updates into the variable referenced by `resource` using the `max` operation. - *

+ * Reduces sparse updates into the variable referenced by {@code resource} using the {@code max} operation. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] = max(ref[indices, ...], updates[...]) - *

- * # Vector indices (for each i) - * ref[indices[i], ...] = max(ref[indices[i], ...], updates[i, ...]) - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] = max(ref[indices[i, ..., j], ...], updates[i, ..., j, ...]) - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

+ * # Scalar indices
+ * ref[indices, ...] = max(ref[indices, ...], updates[...])
+ *
+ * # Vector indices (for each i)
+ * ref[indices[i], ...] = max(ref[indices[i], ...], updates[i, ...])
+ *
+ * # High rank indices (for each i, ..., j)
+ * ref[indices[i, ..., j], ...] = max(ref[indices[i, ..., j], ...], updates[i, ..., j, ...])
+ * 
+ *

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

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
*/ +@OpMetadata( + opType = ResourceScatterMax.OP_NAME, + inputsClass = ResourceScatterMax.Inputs.class +) @Operator public final class ResourceScatterMax extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ResourceScatterMax"; + + public ResourceScatterMax(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new ResourceScatterMax operation. - * + * * @param scope current scope - * @param resource Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. + * @param resource 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}. * @return a new instance of ResourceScatterMax */ - @Endpoint(describeByClass = true) - public static ResourceScatterMax create(Scope scope, Operand resource, Operand indices, Operand updates) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterMax", scope.makeOpName("ResourceScatterMax")); + @Endpoint( + describeByClass = true + ) + public static ResourceScatterMax create(Scope scope, Operand resource, + Operand indices, Operand updates) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceScatterMax"); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); return new ResourceScatterMax(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceScatterMax"; - - private ResourceScatterMax(Operation operation) { - super(operation); + + @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 9fa3cf76ca8..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,65 +17,115 @@ 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; /** - * Reduces sparse updates into the variable referenced by `resource` using the `min` operation. - *

+ * Reduces sparse updates into the variable referenced by {@code resource} using the {@code min} operation. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] = min(ref[indices, ...], updates[...]) - *

- * # Vector indices (for each i) - * ref[indices[i], ...] = min(ref[indices[i], ...], updates[i, ...]) - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] = min(ref[indices[i, ..., j], ...], updates[i, ..., j, ...]) - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

+ * # Scalar indices
+ * ref[indices, ...] = min(ref[indices, ...], updates[...])
+ *
+ * # Vector indices (for each i)
+ * ref[indices[i], ...] = min(ref[indices[i], ...], updates[i, ...])
+ *
+ * # High rank indices (for each i, ..., j)
+ * ref[indices[i, ..., j], ...] = min(ref[indices[i, ..., j], ...], updates[i, ..., j, ...])
+ * 
+ *

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

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
*/ +@OpMetadata( + opType = ResourceScatterMin.OP_NAME, + inputsClass = ResourceScatterMin.Inputs.class +) @Operator public final class ResourceScatterMin extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ResourceScatterMin"; + + public ResourceScatterMin(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new ResourceScatterMin operation. - * + * * @param scope current scope - * @param resource Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. + * @param resource 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}. * @return a new instance of ResourceScatterMin */ - @Endpoint(describeByClass = true) - public static ResourceScatterMin create(Scope scope, Operand resource, Operand indices, Operand updates) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterMin", scope.makeOpName("ResourceScatterMin")); + @Endpoint( + describeByClass = true + ) + public static ResourceScatterMin create(Scope scope, Operand resource, + Operand indices, Operand updates) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceScatterMin"); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); return new ResourceScatterMin(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceScatterMin"; - - private ResourceScatterMin(Operation operation) { - super(operation); + + @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 1133e6f2f82..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,65 +17,115 @@ 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; /** - * Multiplies sparse updates into the variable referenced by `resource`. - *

+ * Multiplies sparse updates into the variable referenced by {@code resource}. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] *= updates[...] - *

- * # Vector indices (for each i) - * ref[indices[i], ...] *= updates[i, ...] - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] *= updates[i, ..., j, ...] - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

+ * # Scalar indices
+ * ref[indices, ...] *= updates[...]
+ *
+ * # Vector indices (for each i)
+ * ref[indices[i], ...] *= updates[i, ...]
+ *
+ * # High rank indices (for each i, ..., j)
+ * ref[indices[i, ..., j], ...] *= updates[i, ..., j, ...]
+ * 
+ *

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

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
*/ +@OpMetadata( + opType = ResourceScatterMul.OP_NAME, + inputsClass = ResourceScatterMul.Inputs.class +) @Operator public final class ResourceScatterMul extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ResourceScatterMul"; + + public ResourceScatterMul(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new ResourceScatterMul operation. - * + * * @param scope current scope - * @param resource Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. + * @param resource 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}. * @return a new instance of ResourceScatterMul */ - @Endpoint(describeByClass = true) - public static ResourceScatterMul create(Scope scope, Operand resource, Operand indices, Operand updates) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterMul", scope.makeOpName("ResourceScatterMul")); + @Endpoint( + describeByClass = true + ) + public static ResourceScatterMul create(Scope scope, Operand resource, + Operand indices, Operand updates) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceScatterMul"); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); return new ResourceScatterMul(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceScatterMul"; - - private ResourceScatterMul(Operation operation) { - super(operation); + + @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 5a020f072df..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,115 +17,211 @@ 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; /** * Applies sparse addition to individual values or slices in a Variable. - *

- * `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. - *

- * `indices` must be integer tensor, containing indices into `ref`. - * It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. - *

- * The innermost dimension of `indices` (with length `K`) corresponds to - * indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th - * dimension of `ref`. - *

- * `updates` is `Tensor` of rank `Q-1+P-K` with shape: - *

{@code
+ * {@code ref} is a {@code Tensor} with rank {@code P} and {@code indices} is a {@code Tensor} of rank {@code Q}.
+ * 

{@code indices} must be integer tensor, containing indices into {@code ref}. + * It must be shape {@code [d_0, ..., d_{Q-2}, K]} where {@code 0 < K <= P}. + *

The innermost dimension of {@code indices} (with length {@code K}) corresponds to + * indices into elements (if {@code K = P}) or slices (if {@code K < P}) along the {@code K}th + * dimension of {@code ref}. + *

{@code updates} is {@code Tensor} of rank {@code Q-1+P-K} with shape: + *

  * [d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]
- * }
- * For example, say we want to add 4 scattered elements to a rank-1 tensor to + *
+ *

For example, say we want to add 4 scattered elements to a rank-1 tensor to * 8 elements. In Python, that addition would look like this: - *

{@code
+ * 
  * ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8], use_resource=True)
  * indices = tf.constant([[4], [3], [1], [7]])
  * updates = tf.constant([9, 10, 11, 12])
  * add = tf.scatter_nd_add(ref, indices, updates)
  * with tf.Session() as sess:
  *   print sess.run(add)
- * }
- * The resulting update to ref would look like this: - *

- * [1, 13, 3, 14, 14, 6, 7, 20] - *

- * See `tf.scatter_nd` for more details about how to make updates to + *

+ *

The resulting update to ref would look like this: + *

+ * [1, 13, 3, 14, 14, 6, 7, 20]
+ * 
+ *

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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.ResourceScatterNdAdd} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceScatterNdAdd"; + + public ResourceScatterNdAdd(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new ResourceScatterNdAdd operation. - * + * * @param scope current scope * @param ref A resource handle. Must be from a VarHandleOp. * @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 * values to add to ref. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ResourceScatterNdAdd */ - @Endpoint(describeByClass = true) - public static ResourceScatterNdAdd create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterNdAdd", scope.makeOpName("ResourceScatterNdAdd")); + @Endpoint( + describeByClass = true + ) + public static ResourceScatterNdAdd create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceScatterNdAdd"); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { 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()); } - + /** + * Sets the useLocking option. + * * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceScatterNdAdd"; - - private ResourceScatterNdAdd(Operation operation) { - super(operation); + + /** + * 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() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + 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 156af50c380..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,84 +17,185 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.ResourceScatterNdMax} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceScatterNdMax"; + + public ResourceScatterNdMax(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new ResourceScatterNdMax operation. - * + * * @param scope current scope * @param ref A resource handle. Must be from a VarHandleOp. * @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 * values whose element wise max is taken with ref - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ResourceScatterNdMax */ - @Endpoint(describeByClass = true) - public static ResourceScatterNdMax create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterNdMax", scope.makeOpName("ResourceScatterNdMax")); + @Endpoint( + describeByClass = true + ) + public static ResourceScatterNdMax create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceScatterNdMax"); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { 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()); } - + /** + * Sets the useLocking option. + * * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceScatterNdMax"; - - private ResourceScatterNdMax(Operation operation) { - super(operation); + + /** + * 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() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + 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 45909f9cbab..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,84 +17,185 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.ResourceScatterNdMin} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceScatterNdMin"; + + public ResourceScatterNdMin(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new ResourceScatterNdMin operation. - * + * * @param scope current scope * @param ref A resource handle. Must be from a VarHandleOp. * @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 * values whose element wise min is taken with ref. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ResourceScatterNdMin */ - @Endpoint(describeByClass = true) - public static ResourceScatterNdMin create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterNdMin", scope.makeOpName("ResourceScatterNdMin")); + @Endpoint( + describeByClass = true + ) + public static ResourceScatterNdMin create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceScatterNdMin"); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { 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()); } - + /** + * Sets the useLocking option. + * * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceScatterNdMin"; - - private ResourceScatterNdMin(Operation operation) { - super(operation); + + /** + * 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() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + 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 4e166746f7b..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,115 +17,211 @@ 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; /** * Applies sparse subtraction to individual values or slices in a Variable. - *

- * `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. - *

- * `indices` must be integer tensor, containing indices into `ref`. - * It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. - *

- * The innermost dimension of `indices` (with length `K`) corresponds to - * indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th - * dimension of `ref`. - *

- * `updates` is `Tensor` of rank `Q-1+P-K` with shape: - *

{@code
+ * {@code ref} is a {@code Tensor} with rank {@code P} and {@code indices} is a {@code Tensor} of rank {@code Q}.
+ * 

{@code indices} must be integer tensor, containing indices into {@code ref}. + * It must be shape {@code [d_0, ..., d_{Q-2}, K]} where {@code 0 < K <= P}. + *

The innermost dimension of {@code indices} (with length {@code K}) corresponds to + * indices into elements (if {@code K = P}) or slices (if {@code K < P}) along the {@code K}th + * dimension of {@code ref}. + *

{@code updates} is {@code Tensor} of rank {@code Q-1+P-K} with shape: + *

  * [d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]
- * }
- * For example, say we want to subtract 4 scattered elements from a rank-1 tensor + *
+ *

For example, say we want to subtract 4 scattered elements from a rank-1 tensor * with 8 elements. In Python, that subtraction would look like this: - *

{@code
+ * 
  * ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8], use_resource=True)
  * indices = tf.constant([[4], [3], [1], [7]])
  * updates = tf.constant([9, 10, 11, 12])
  * sub = tf.scatter_nd_sub(ref, indices, updates)
  * with tf.Session() as sess:
  *   print sess.run(sub)
- * }
- * The resulting update to ref would look like this: - *

- * [1, -9, 3, -6, -4, 6, 7, -4] - *

- * See `tf.scatter_nd` for more details about how to make updates to + *

+ *

The resulting update to ref would look like this: + *

+ * [1, -9, 3, -6, -4, 6, 7, -4]
+ * 
+ *

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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.ResourceScatterNdSub} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceScatterNdSub"; + + public ResourceScatterNdSub(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new ResourceScatterNdSub operation. - * + * * @param scope current scope * @param ref A resource handle. Must be from a VarHandleOp. * @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 * values to add to ref. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ResourceScatterNdSub */ - @Endpoint(describeByClass = true) - public static ResourceScatterNdSub create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterNdSub", scope.makeOpName("ResourceScatterNdSub")); + @Endpoint( + describeByClass = true + ) + public static ResourceScatterNdSub create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceScatterNdSub"); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { 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()); } - + /** + * Sets the useLocking option. + * * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceScatterNdSub"; - - private ResourceScatterNdSub(Operation operation) { - super(operation); + + /** + * 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() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + 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 ae9539388d7..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,117 +17,212 @@ 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; /** - * Applies sparse `updates` to individual values or slices within a given - *

- * variable according to `indices`. - *

- * `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. - *

- * `indices` must be integer tensor, containing indices into `ref`. - * It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. - *

- * The innermost dimension of `indices` (with length `K`) corresponds to - * indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th - * dimension of `ref`. - *

- * `updates` is `Tensor` of rank `Q-1+P-K` with shape: - *

{@code
+ * Applies sparse {@code updates} to individual values or slices within a given
+ * variable according to {@code indices}.
+ * 

{@code ref} is a {@code Tensor} with rank {@code P} and {@code indices} is a {@code Tensor} of rank {@code Q}. + *

{@code indices} must be integer tensor, containing indices into {@code ref}. + * It must be shape {@code [d_0, ..., d_{Q-2}, K]} where {@code 0 < K <= P}. + *

The innermost dimension of {@code indices} (with length {@code K}) corresponds to + * indices into elements (if {@code K = P}) or slices (if {@code K < P}) along the {@code K}th + * dimension of {@code ref}. + *

{@code updates} is {@code Tensor} of rank {@code Q-1+P-K} with shape: + *

  * [d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]].
- * }
- * For example, say we want to update 4 scattered elements to a rank-1 tensor to + *
+ *

For example, say we want to update 4 scattered elements to a rank-1 tensor to * 8 elements. In Python, that update would look like this: - *

{@code
+ * 
  *     ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8])
  *     indices = tf.constant([[4], [3], [1] ,[7]])
  *     updates = tf.constant([9, 10, 11, 12])
  *     update = tf.scatter_nd_update(ref, indices, updates)
  *     with tf.Session() as sess:
  *       print sess.run(update)
- * }
- * The resulting update to ref would look like this: - *

- * [1, 11, 3, 10, 9, 6, 7, 12] - *

- * See `tf.scatter_nd` for more details about how to make updates to + *

+ *

The resulting update to ref would look like this: + *

+ * [1, 11, 3, 10, 9, 6, 7, 12]
+ * 
+ *

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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.ResourceScatterNdUpdate} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceScatterNdUpdate"; + + public ResourceScatterNdUpdate(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new ResourceScatterNdUpdate operation. - * + * * @param scope current scope * @param ref A resource handle. Must be from a VarHandleOp. * @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 attributes values + * @param options carries optional attribute values * @return a new instance of ResourceScatterNdUpdate */ - @Endpoint(describeByClass = true) - public static ResourceScatterNdUpdate create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterNdUpdate", scope.makeOpName("ResourceScatterNdUpdate")); + @Endpoint( + describeByClass = true + ) + public static ResourceScatterNdUpdate create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceScatterNdUpdate"); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { opBuilder.setAttr("use_locking", opts.useLocking); } + if (opts.badIndicesPolicy != null) { + opBuilder.setAttr("bad_indices_policy", opts.badIndicesPolicy); + } } } return new ResourceScatterNdUpdate(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceScatterNdUpdate"; - - private ResourceScatterNdUpdate(Operation operation) { - super(operation); + + /** + * 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.ResourceScatterNdUpdate} + */ + public static class Options { + private Boolean useLocking; + + private String badIndicesPolicy; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + 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 = ResourceScatterNdUpdate.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 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 35d94ad5a52..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,65 +17,115 @@ 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; /** - * Subtracts sparse updates from the variable referenced by `resource`. - *

+ * Subtracts sparse updates from the variable referenced by {@code resource}. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] -= updates[...] - *

- * # Vector indices (for each i) - * ref[indices[i], ...] -= updates[i, ...] - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] -= updates[i, ..., j, ...] - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

+ * # Scalar indices
+ * ref[indices, ...] -= updates[...]
+ *
+ * # Vector indices (for each i)
+ * ref[indices[i], ...] -= updates[i, ...]
+ *
+ * # High rank indices (for each i, ..., j)
+ * ref[indices[i, ..., j], ...] -= updates[i, ..., j, ...]
+ * 
+ *

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

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
*/ +@OpMetadata( + opType = ResourceScatterSub.OP_NAME, + inputsClass = ResourceScatterSub.Inputs.class +) @Operator public final class ResourceScatterSub extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ResourceScatterSub"; + + public ResourceScatterSub(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new ResourceScatterSub operation. - * + * * @param scope current scope - * @param resource Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. + * @param resource 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}. * @return a new instance of ResourceScatterSub */ - @Endpoint(describeByClass = true) - public static ResourceScatterSub create(Scope scope, Operand resource, Operand indices, Operand updates) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterSub", scope.makeOpName("ResourceScatterSub")); + @Endpoint( + describeByClass = true + ) + public static ResourceScatterSub create(Scope scope, Operand resource, + Operand indices, Operand updates) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceScatterSub"); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); return new ResourceScatterSub(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceScatterSub"; - - private ResourceScatterSub(Operation operation) { - super(operation); + + @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 df04dff7608..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,56 +17,109 @@ 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; /** - * Assigns sparse updates to the variable referenced by `resource`. - *

+ * Assigns sparse updates to the variable referenced by {@code resource}. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] = updates[...] - *

- * # Vector indices (for each i) - * ref[indices[i], ...] = updates[i, ...] - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] = updates[i, ..., j, ...] + *

+ * # Scalar indices
+ * ref[indices, ...] = updates[...]
+ *
+ * # Vector indices (for each i)
+ * ref[indices[i], ...] = updates[i, ...]
+ *
+ * # High rank indices (for each i, ..., j)
+ * ref[indices[i, ..., j], ...] = updates[i, ..., j, ...]
+ * 
*/ +@OpMetadata( + opType = ResourceScatterUpdate.OP_NAME, + inputsClass = ResourceScatterUpdate.Inputs.class +) @Operator public final class ResourceScatterUpdate extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ResourceScatterUpdate"; + + public ResourceScatterUpdate(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new ResourceScatterUpdate operation. - * + * * @param scope current scope - * @param resource Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. + * @param resource 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}. * @return a new instance of ResourceScatterUpdate */ - @Endpoint(describeByClass = true) - public static ResourceScatterUpdate create(Scope scope, Operand resource, Operand indices, Operand updates) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterUpdate", scope.makeOpName("ResourceScatterUpdate")); + @Endpoint( + describeByClass = true + ) + public static ResourceScatterUpdate create(Scope scope, Operand resource, + Operand indices, Operand updates) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceScatterUpdate"); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); return new ResourceScatterUpdate(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceScatterUpdate"; - - private ResourceScatterUpdate(Operation operation) { - super(operation); + + @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 d0e6fc06b2f..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,105 +17,70 @@ 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; /** - * 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`. + * Assign {@code value} to the sliced l-value reference of {@code ref}. + * The values of {@code value} are assigned to the positions in the variable + * {@code ref} that are selected by the slice parameters. The slice parameters + * {@code begin, }end{@code , }strides{@code , etc. work exactly as in }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}. */ +@OpMetadata( + opType = ResourceStridedSliceAssign.OP_NAME, + inputsClass = ResourceStridedSliceAssign.Inputs.class +) @Operator public final class ResourceStridedSliceAssign extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.ResourceStridedSliceAssign} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param beginMask - */ - public Options beginMask(Long beginMask) { - this.beginMask = beginMask; - return this; - } - - /** - * @param endMask - */ - public Options endMask(Long endMask) { - this.endMask = endMask; - return this; - } - - /** - * @param ellipsisMask - */ - public Options ellipsisMask(Long ellipsisMask) { - this.ellipsisMask = ellipsisMask; - return this; - } - - /** - * @param newAxisMask - */ - public Options newAxisMask(Long newAxisMask) { - this.newAxisMask = newAxisMask; - return this; - } - - /** - * @param shrinkAxisMask - */ - public Options shrinkAxisMask(Long shrinkAxisMask) { - this.shrinkAxisMask = shrinkAxisMask; - return this; - } - - private Long beginMask; - private Long endMask; - private Long ellipsisMask; - private Long newAxisMask; - private Long shrinkAxisMask; - - private Options() { - } + public static final String OP_NAME = "ResourceStridedSliceAssign"; + + 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 - * @param begin - * @param end - * @param strides - * @param value - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static ResourceStridedSliceAssign create(Scope scope, Operand ref, Operand begin, Operand end, Operand strides, Operand value, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceStridedSliceAssign", scope.makeOpName("ResourceStridedSliceAssign")); + @Endpoint( + describeByClass = true + ) + public static ResourceStridedSliceAssign create(Scope scope, + Operand ref, Operand begin, Operand end, Operand strides, + Operand value, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceStridedSliceAssign"); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(begin.asOutput()); opBuilder.addInput(end.asOutput()); opBuilder.addInput(strides.asOutput()); opBuilder.addInput(value.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.beginMask != null) { @@ -137,46 +102,209 @@ public static ResourceStridedSliceAssign create(Scope scope, } return new ResourceStridedSliceAssign(opBuilder.build()); } - + /** - * @param beginMask + * Sets the beginMask option. + * + * @param beginMask the beginMask option + * @return this Options instance. */ public static Options beginMask(Long beginMask) { return new Options().beginMask(beginMask); } - + /** - * @param endMask + * Sets the endMask option. + * + * @param endMask the endMask option + * @return this Options instance. */ public static Options endMask(Long endMask) { return new Options().endMask(endMask); } - + /** - * @param ellipsisMask + * Sets the ellipsisMask option. + * + * @param ellipsisMask the ellipsisMask option + * @return this Options instance. */ public static Options ellipsisMask(Long ellipsisMask) { return new Options().ellipsisMask(ellipsisMask); } - + /** - * @param newAxisMask + * Sets the newAxisMask option. + * + * @param newAxisMask the newAxisMask option + * @return this Options instance. */ public static Options newAxisMask(Long newAxisMask) { return new Options().newAxisMask(newAxisMask); } - + /** - * @param shrinkAxisMask + * Sets the shrinkAxisMask option. + * + * @param shrinkAxisMask the shrinkAxisMask option + * @return this Options instance. */ public static Options shrinkAxisMask(Long shrinkAxisMask) { return new Options().shrinkAxisMask(shrinkAxisMask); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceStridedSliceAssign"; - - private ResourceStridedSliceAssign(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ResourceStridedSliceAssign} + */ + public static class Options { + private Long beginMask; + + private Long endMask; + + private Long ellipsisMask; + + private Long newAxisMask; + + private Long shrinkAxisMask; + + private Options() { + } + + /** + * Sets the beginMask option. + * + * @param beginMask the beginMask option + * @return this Options instance. + */ + public Options beginMask(Long beginMask) { + this.beginMask = beginMask; + return this; + } + + /** + * Sets the endMask option. + * + * @param endMask the endMask option + * @return this Options instance. + */ + public Options endMask(Long endMask) { + this.endMask = endMask; + return this; + } + + /** + * Sets the ellipsisMask option. + * + * @param ellipsisMask the ellipsisMask option + * @return this Options instance. + */ + public Options ellipsisMask(Long ellipsisMask) { + this.ellipsisMask = ellipsisMask; + return this; + } + + /** + * Sets the newAxisMask option. + * + * @param newAxisMask the newAxisMask option + * @return this Options instance. + */ + public Options newAxisMask(Long newAxisMask) { + this.newAxisMask = newAxisMask; + return this; + } + + /** + * Sets the shrinkAxisMask option. + * + * @param shrinkAxisMask the shrinkAxisMask option + * @return this Options instance. + */ + public Options shrinkAxisMask(Long shrinkAxisMask) { + this.shrinkAxisMask = 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 95cc701bae3..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,33 +17,33 @@ 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 `tf.reverse` has now changed behavior in preparation for 1.0. - * `tf.reverse_v2` is currently an alias that will be deprecated before TF 1.0. - *

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

- * `tensor` can have up to 8 dimensions. The number of dimensions specified - * in `axis` may be 0 or more entries. If an index is specified more than + * 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 + * in {@code axis} may be 0 or more entries. If an index is specified more than * once, a InvalidArgument error is raised. - *

- * For example: - *

{@code
+ * 

For example: + *

  * # tensor 't' is [[[[ 0,  1,  2,  3],
  * #                  [ 4,  5,  6,  7],
  * #                  [ 8,  9, 10, 11]],
@@ -51,76 +51,118 @@
  * #                  [16, 17, 18, 19],
  * #                  [20, 21, 22, 23]]]]
  * # tensor 't' shape is [1, 2, 3, 4]
- * 
+ *
  * # 'dims' is [3] or 'dims' is [-1]
- * reverse(t, dims) ==> [[[[ 3,  2,  1,  0],
+ * reverse(t, dims) ==> [[[[ 3,  2,  1,  0],
  *                         [ 7,  6,  5,  4],
  *                         [ 11, 10, 9, 8]],
  *                        [[15, 14, 13, 12],
  *                         [19, 18, 17, 16],
  *                         [23, 22, 21, 20]]]]
- * 
+ *
  * # 'dims' is '[1]' (or 'dims' is '[-3]')
- * reverse(t, dims) ==> [[[[12, 13, 14, 15],
+ * reverse(t, dims) ==> [[[[12, 13, 14, 15],
  *                         [16, 17, 18, 19],
  *                         [20, 21, 22, 23]
  *                        [[ 0,  1,  2,  3],
  *                         [ 4,  5,  6,  7],
  *                         [ 8,  9, 10, 11]]]]
- * 
+ *
  * # 'dims' is '[2]' (or 'dims' is '[-2]')
- * reverse(t, dims) ==> [[[[8, 9, 10, 11],
+ * reverse(t, dims) ==> [[[[8, 9, 10, 11],
  *                         [4, 5, 6, 7],
  *                         [0, 1, 2, 3]]
  *                        [[20, 21, 22, 23],
  *                         [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 { - /** - * Factory method to create a class wrapping a new Reverse operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReverseV2"; + + private Output output; + + public Reverse(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ReverseV2 operation. + * * @param scope current scope * @param tensor Up to 8-D. * @param axis 1-D. The indices of the dimensions to reverse. Must be in the range - * `[-rank(tensor), rank(tensor))`. + * {@code [-rank(tensor), rank(tensor))}. + * @param data type for {@code ReverseV2} output and operands * @return a new instance of Reverse */ - @Endpoint(describeByClass = true) - public static Reverse create(Scope scope, Operand tensor, Operand axis) { - OperationBuilder opBuilder = scope.env().opBuilder("ReverseV2", scope.makeOpName("Reverse")); + @Endpoint( + describeByClass = true + ) + public static Reverse create(Scope scope, Operand tensor, + Operand axis) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Reverse"); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Reverse(opBuilder.build()); + return new Reverse<>(opBuilder.build()); } - + /** - * The same shape as `tensor`. + * Gets output. + * The same shape as {@code tensor}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReverseV2"; - - private Output output; - - private Reverse(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 6793713f659..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,114 +17,113 @@ 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 variable length slices. - *

- * This op first slices `input` along the dimension `batch_dim`, and for each - * slice `i`, reverses the first `seq_lengths[i]` elements along - * the dimension `seq_dim`. - *

- * The elements of `seq_lengths` must obey `seq_lengths[i] <= input.dims[seq_dim]`, - * and `seq_lengths` must be a vector of length `input.dims[batch_dim]`. - *

- * The output slice `i` along dimension `batch_dim` is then given by input - * slice `i`, with the first `seq_lengths[i]` slices along dimension - * `seq_dim` reversed. - *

- * For example: - *

{@code
+ * This op first slices {@code input} along the dimension {@code batch_dim}, and for each
+ * slice {@code i}, reverses the first {@code seq_lengths[i]} elements along
+ * the dimension {@code seq_dim}.
+ * 

The elements of {@code seq_lengths} must obey {@code seq_lengths[i] <= input.dims[seq_dim]}, + * and {@code seq_lengths} must be a vector of length {@code input.dims[batch_dim]}. + *

The output slice {@code i} along dimension {@code batch_dim} is then given by input + * slice {@code i}, with the first {@code seq_lengths[i]} slices along dimension + * {@code seq_dim} reversed. + *

For example: + *

  * # Given this:
  * batch_dim = 0
  * seq_dim = 1
  * input.dims = (4, 8, ...)
  * seq_lengths = [7, 2, 3, 5]
- * 
+ *
  * # then slices of input are reversed on seq_dim, but only up to seq_lengths:
  * output[0, 0:7, :, ...] = input[0, 7:0:-1, :, ...]
  * output[1, 0:2, :, ...] = input[1, 2:0:-1, :, ...]
  * output[2, 0:3, :, ...] = input[2, 3:0:-1, :, ...]
  * output[3, 0:5, :, ...] = input[3, 5:0:-1, :, ...]
- * 
+ *
  * # while entries past seq_lens are copied through:
  * output[0, 7:, :, ...] = input[0, 7:, :, ...]
  * output[1, 2:, :, ...] = input[1, 2:, :, ...]
  * output[2, 3:, :, ...] = input[2, 3:, :, ...]
  * output[3, 2:, :, ...] = input[3, 2:, :, ...]
- * }
- * In contrast, if: - *
{@code
+ * 
+ *

In contrast, if: + *

  * # Given this:
  * batch_dim = 2
  * seq_dim = 0
  * input.dims = (8, ?, 4, ...)
  * seq_lengths = [7, 2, 3, 5]
- * 
+ *
  * # then slices of input are reversed on seq_dim, but only up to seq_lengths:
  * output[0:7, :, 0, :, ...] = input[7:0:-1, :, 0, :, ...]
  * output[0:2, :, 1, :, ...] = input[2:0:-1, :, 1, :, ...]
  * output[0:3, :, 2, :, ...] = input[3:0:-1, :, 2, :, ...]
  * output[0:5, :, 3, :, ...] = input[5:0:-1, :, 3, :, ...]
- * 
+ *
  * # while entries past seq_lens are copied through:
  * output[7:, :, 0, :, ...] = input[7:, :, 0, :, ...]
  * output[2:, :, 1, :, ...] = input[2:, :, 1, :, ...]
  * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.ReverseSequence} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param batchDim The dimension along which reversal is performed. - */ - public Options batchDim(Long batchDim) { - this.batchDim = batchDim; - return this; - } - - private Long batchDim; - - private Options() { - } + public static final String OP_NAME = "ReverseSequence"; + + private Output output; + + public ReverseSequence(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ReverseSequence operation. - * + * * @param scope current scope * @param input The input to reverse. - * @param seqLengths 1-D with length `input.dims(batch_dim)` and - * `max(seq_lengths) <= input.dims(seq_dim)` + * @param seqLengths 1-D with length {@code input.dims(batch_dim)} and + * {@code max(seq_lengths) <= input.dims(seq_dim)} * @param seqDim The dimension which is partially reversed. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ReverseSequence} output and operands * @return a new instance of ReverseSequence */ - @Endpoint(describeByClass = true) - public static ReverseSequence create(Scope scope, Operand input, Operand seqLengths, Long seqDim, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ReverseSequence", scope.makeOpName("ReverseSequence")); + @Endpoint( + describeByClass = true + ) + public static ReverseSequence create(Scope scope, Operand input, + Operand seqLengths, Long seqDim, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReverseSequence"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(seqLengths.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("seq_dim", seqDim); if (options != null) { for (Options opts : options) { @@ -133,36 +132,98 @@ public static ReverseSequence create(Scope scope, Operand(opBuilder.build()); + return new ReverseSequence<>(opBuilder.build()); } - + /** + * Sets the batchDim option. + * * @param batchDim The dimension along which reversal is performed. + * @return this Options instance. */ public static Options batchDim(Long batchDim) { return new Options().batchDim(batchDim); } - + /** - * The partially reversed input. It has the same shape as `input`. + * Gets output. + * The partially reversed input. It has the same shape as {@code input}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReverseSequence"; - - private Output output; - - private ReverseSequence(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ReverseSequence} + */ + public static class Options { + private Long batchDim; + + private Options() { + } + + /** + * Sets the batchDim option. + * + * @param batchDim The dimension along which reversal is performed. + * @return this Options instance. + */ + public Options batchDim(Long batchDim) { + this.batchDim = 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 4151cb41a3e..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,93 +17,156 @@ 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; /** * Rolls the elements of a tensor along an axis. - *

* The elements are shifted positively (towards larger indices) by the offset of - * `shift` along the dimension of `axis`. Negative `shift` values will shift + * {@code shift} along the dimension of {@code axis}. Negative {@code shift} values will shift * elements in the opposite direction. Elements that roll passed the last position * will wrap around to the first and vice versa. Multiple shifts along multiple * axes may be specified. - *

- * For example: - *

{@code
+ * 

For example: + *

  * # 't' is [0, 1, 2, 3, 4]
- * roll(t, shift=2, axis=0) ==> [3, 4, 0, 1, 2]
- * 
+ * roll(t, shift=2, axis=0) ==> [3, 4, 0, 1, 2]
+ *
  * # shifting along multiple dimensions
  * # 't' is [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]
- * roll(t, shift=[1, -2], axis=[0, 1]) ==> [[7, 8, 9, 5, 6], [2, 3, 4, 0, 1]]
- * 
+ * roll(t, shift=[1, -2], axis=[0, 1]) ==> [[7, 8, 9, 5, 6], [2, 3, 4, 0, 1]]
+ *
  * # shifting along the same axis multiple times
  * # '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 + * roll(t, shift=[2, -3], axis=[1, 1]) ==> [[1, 2, 3, 4, 0], [6, 7, 8, 9, 5]] + *
*/ +@OpMetadata( + opType = Roll.OP_NAME, + inputsClass = Roll.Inputs.class +) @Operator public final class Roll extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Roll"; + + private Output output; + + public Roll(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Roll operation. - * + * * @param scope current scope - * @param input - * @param shift Dimension must be 0-D or 1-D. `shift[i]` specifies the number of places by which + * @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 `axis[i]`. Negative shifts will roll the elements in the opposite + * specified by {@code axis[i]}. Negative shifts will roll the elements in the opposite * direction. - * @param axis Dimension must be 0-D or 1-D. `axis[i]` specifies the dimension that the shift - * `shift[i]` should occur. If the same axis is referenced more than once, the + * @param axis 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. + * @param data type for {@code Roll} output and operands * @return a new instance of Roll */ - @Endpoint(describeByClass = true) - public static Roll create(Scope scope, Operand input, Operand shift, Operand axis) { - OperationBuilder opBuilder = scope.env().opBuilder("Roll", scope.makeOpName("Roll")); + @Endpoint( + describeByClass = true + ) + public static Roll create(Scope scope, Operand input, + Operand shift, Operand axis) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Roll"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(shift.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Roll(opBuilder.build()); + return new Roll<>(opBuilder.build()); } - + /** + * Gets output. * Has the same shape and size as the input. The elements are shifted - * positively (towards larger indices) by the offsets of `shift` along the - * dimensions of `axis`. + * positively (towards larger indices) by the offsets of {@code shift} along the + * dimensions of {@code axis}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Roll"; - - private Output output; - - private Roll(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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/Rpc.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Rpc.java deleted file mode 100644 index e11643041c7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Rpc.java +++ /dev/null @@ -1,209 +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.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.TString; - -/** - * Perform batches of RPC requests. - *

- * This op asynchronously performs either a single RPC request, or a batch - * of requests. RPC requests are defined by three main parameters: - *

- * - `address` (the host+port or BNS address of the request) - * - `method` (the RPC method name for the request) - * - `request` (the serialized proto string, or vector of strings, - * of the RPC request argument). - *

- * For example, if you have an RPC service running on port localhost:2345, - * and its interface is configured with the following proto declaration: - *

{@code
- * service MyService {
- *   rpc MyMethod(MyRequestProto) returns (MyResponseProto) {
- *   }
- * };
- * }
- * then call this op with arguments: - *
{@code
- * address = "localhost:2345"
- * method = "MyService/MyMethod"
- * }
- * The `request` tensor is a string tensor representing serialized `MyRequestProto` - * strings; and the output string tensor `response` will have the same shape - * and contain (upon successful completion) corresponding serialized - * `MyResponseProto` strings. - *

- * For example, to send a single, empty, `MyRequestProto`, call - * this op with `request = ""`. To send 5 parallel empty requests, - * call this op with `request = ["", "", "", "", ""]`. - *

- * More generally, one can create a batch of `MyRequestProto` serialized protos - * from regular batched tensors using the `encode_proto` op, and convert - * the response `MyResponseProto` serialized protos to batched tensors - * using the `decode_proto` op. - *

- * NOTE Working with serialized proto strings is faster than instantiating - * actual proto objects in memory, so no performance degradation is expected - * compared to writing custom kernels for this workflow. - *

- * If the connection fails or the remote worker returns an error - * status, the op reraises this exception locally. - *

- * See the `TryRpc` op if you prefer to handle RPC failures manually in the graph. - */ -@Operator -public final class Rpc extends RawOp implements Operand { - - /** - * Optional attributes for {@link org.tensorflow.op.core.Rpc} - */ - public static class Options { - - /** - * @param protocol RPC protocol to use. Empty string means use the default protocol. - * Options include 'grpc'. - */ - public Options protocol(String protocol) { - this.protocol = protocol; - return this; - } - - /** - * @param failFast `boolean`. If `true` (default), then failures to connect - * (i.e., the server does not immediately respond) cause an RPC failure. - */ - public Options failFast(Boolean failFast) { - this.failFast = failFast; - return this; - } - - /** - * @param timeoutInMs `int`. If `0` (default), then the kernel will run the RPC - * request and only time out if the RPC deadline passes or the session times out. - * If this value is greater than `0`, then the op will raise an exception if - * the RPC takes longer than `timeout_in_ms`. - */ - public Options timeoutInMs(Long timeoutInMs) { - this.timeoutInMs = timeoutInMs; - return this; - } - - private String protocol; - private Boolean failFast; - private Long timeoutInMs; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new Rpc operation. - * - * @param scope current scope - * @param address `0-D` or `1-D`. The address (i.e. host_name:port) of the RPC server. - * If this tensor has more than 1 element, then multiple parallel rpc requests - * are sent. This argument broadcasts with `method` and `request`. - * @param method `0-D` or `1-D`. The method address on the RPC server. - * If this tensor has more than 1 element, then multiple parallel rpc requests - * are sent. This argument broadcasts with `address` and `request`. - * @param request `0-D` or `1-D`. Serialized proto strings: the rpc request argument. - * If this tensor has more than 1 element, then multiple parallel rpc requests - * are sent. This argument broadcasts with `address` and `method`. - * @param options carries optional attributes values - * @return a new instance of Rpc - */ - @Endpoint(describeByClass = true) - public static Rpc create(Scope scope, Operand address, Operand method, Operand request, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Rpc", scope.makeOpName("Rpc")); - opBuilder.addInput(address.asOutput()); - opBuilder.addInput(method.asOutput()); - opBuilder.addInput(request.asOutput()); - opBuilder = scope.apply(opBuilder); - if (options != null) { - for (Options opts : options) { - if (opts.protocol != null) { - opBuilder.setAttr("protocol", opts.protocol); - } - if (opts.failFast != null) { - opBuilder.setAttr("fail_fast", opts.failFast); - } - if (opts.timeoutInMs != null) { - opBuilder.setAttr("timeout_in_ms", opts.timeoutInMs); - } - } - } - return new Rpc(opBuilder.build()); - } - - /** - * @param protocol RPC protocol to use. Empty string means use the default protocol. - * Options include 'grpc'. - */ - public static Options protocol(String protocol) { - return new Options().protocol(protocol); - } - - /** - * @param failFast `boolean`. If `true` (default), then failures to connect - * (i.e., the server does not immediately respond) cause an RPC failure. - */ - public static Options failFast(Boolean failFast) { - return new Options().failFast(failFast); - } - - /** - * @param timeoutInMs `int`. If `0` (default), then the kernel will run the RPC - * request and only time out if the RPC deadline passes or the session times out. - * If this value is greater than `0`, then the op will raise an exception if - * the RPC takes longer than `timeout_in_ms`. - */ - public static Options timeoutInMs(Long timeoutInMs) { - return new Options().timeoutInMs(timeoutInMs); - } - - /** - * Same shape as `request`. Serialized proto strings: the rpc responses. - */ - public Output response() { - return response; - } - - @Override - public Output asOutput() { - return response; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Rpc"; - - private Output response; - - private Rpc(Operation operation) { - super(operation); - int outputIdx = 0; - response = operation.output(outputIdx++); - } -} 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 61b7f0e29c6..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,85 +17,84 @@ 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; /** * Adds sparse updates to a variable reference. - *

* This operation computes - *

- * # Scalar indices - * ref[indices, ...] += updates[...] - *

- * # Vector indices (for each i) - * ref[indices[i], ...] += updates[i, ...] - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] += updates[i, ..., j, ...] - *

- * This operation outputs `ref` after the update is done. + *

+ * # Scalar indices
+ * ref[indices, ...] += updates[...]
+ *
+ * # Vector indices (for each i)
+ * ref[indices[i], ...] += updates[i, ...]
+ *
+ * # High rank indices (for each i, ..., j)
+ * ref[indices[i, ..., j], ...] += updates[i, ..., j, ...]
+ * 
+ *

This operation outputs {@code ref} after the update is done. * This makes it easier to chain operations that need to use the reset value. - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

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

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
- * - * @param data type for {@code outputRef()} output */ +@OpMetadata( + opType = ScatterAdd.OP_NAME, + inputsClass = ScatterAdd.Inputs.class +) @Operator public final class ScatterAdd extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterAdd} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the addition will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterAdd"; + + private Output outputRef; + + public ScatterAdd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterAdd operation. - * + * * @param scope current scope - * @param ref Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. - * @param options carries optional attributes values + * @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}. + * @param options carries optional attribute values + * @param data type for {@code ScatterAdd} output and operands * @return a new instance of ScatterAdd */ - @Endpoint(describeByClass = true) - public static ScatterAdd create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ScatterAdd", scope.makeOpName("ScatterAdd")); + @Endpoint( + describeByClass = true + ) + public static ScatterAdd create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ScatterAdd"); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -103,38 +102,101 @@ public static ScatterAdd create(Scope scope, Operand ref } } } - return new ScatterAdd(opBuilder.build()); + return new ScatterAdd<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the addition will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * = Same as `ref`. Returned as a convenience for operations that want + * Gets outputRef. + * = Same as {@code ref}. Returned as a convenience for operations that want * to use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterAdd"; - - private Output outputRef; - - private ScatterAdd(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterAdd} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the addition will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 d7de6fb959d..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,81 +17,81 @@ 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; /** * Divides a variable reference by sparse updates. - *

* This operation computes - *

{@code
+ * 
  *     # Scalar indices
  *     ref[indices, ...] /= updates[...]
- * 
+ *
  *     # Vector indices (for each i)
  *     ref[indices[i], ...] /= updates[i, ...]
- * 
+ *
  *     # High rank indices (for each i, ..., j)
  *     ref[indices[i, ..., j], ...] /= updates[i, ..., j, ...]
- * }
- * This operation outputs `ref` after the update is done. + *
+ *

This operation outputs {@code ref} after the update is done. * This makes it easier to chain operations that need to use the reset value. - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

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

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - * - * @param data type for {@code outputRef()} output + *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. */ +@OpMetadata( + opType = ScatterDiv.OP_NAME, + inputsClass = ScatterDiv.Inputs.class +) @Operator public final class ScatterDiv extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterDiv} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the operation will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterDiv"; + + private Output outputRef; + + public ScatterDiv(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterDiv operation. - * + * * @param scope current scope - * @param ref Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of values that `ref` is divided by. - * @param options carries optional attributes values + * @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. + * @param options carries optional attribute values + * @param data type for {@code ScatterDiv} output and operands * @return a new instance of ScatterDiv */ - @Endpoint(describeByClass = true) - public static ScatterDiv create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ScatterDiv", scope.makeOpName("ScatterDiv")); + @Endpoint( + describeByClass = true + ) + public static ScatterDiv create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ScatterDiv"); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -99,38 +99,101 @@ public static ScatterDiv create(Scope scope, Operand ref } } } - return new ScatterDiv(opBuilder.build()); + return new ScatterDiv<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the operation will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * = Same as `ref`. Returned as a convenience for operations that want + * Gets outputRef. + * = Same as {@code ref}. Returned as a convenience for operations that want * to use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterDiv"; - - private Output outputRef; - - private ScatterDiv(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterDiv} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the operation will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 b76c71f3aad..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,84 +17,83 @@ 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; /** - * Reduces sparse updates into a variable reference using the `max` operation. - *

+ * Reduces sparse updates into a variable reference using the {@code max} operation. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] = max(ref[indices, ...], updates[...]) - *

- * # Vector indices (for each i) - * ref[indices[i], ...] = max(ref[indices[i], ...], updates[i, ...]) - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] = max(ref[indices[i, ..., j], ...], updates[i, ..., j, ...]) - *

- * This operation outputs `ref` after the update is done. + *

+ * # Scalar indices
+ * ref[indices, ...] = max(ref[indices, ...], updates[...])
+ *
+ * # Vector indices (for each i)
+ * ref[indices[i], ...] = max(ref[indices[i], ...], updates[i, ...])
+ *
+ * # High rank indices (for each i, ..., j)
+ * ref[indices[i, ..., j], ...] = max(ref[indices[i, ..., j], ...], updates[i, ..., j, ...])
+ * 
+ *

This operation outputs {@code ref} after the update is done. * This makes it easier to chain operations that need to use the reset value. - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

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

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
- * - * @param data type for {@code outputRef()} output */ +@OpMetadata( + opType = ScatterMax.OP_NAME, + inputsClass = ScatterMax.Inputs.class +) @Operator public final class ScatterMax extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterMax} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the update will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterMax"; + + private Output outputRef; + + public ScatterMax(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterMax operation. - * + * * @param scope current scope - * @param ref Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to reduce into `ref`. - * @param options carries optional attributes values + * @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}. + * @param options carries optional attribute values + * @param data type for {@code ScatterMax} output and operands * @return a new instance of ScatterMax */ - @Endpoint(describeByClass = true) - public static ScatterMax create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ScatterMax", scope.makeOpName("ScatterMax")); + @Endpoint( + describeByClass = true + ) + public static ScatterMax create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ScatterMax"); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -102,38 +101,101 @@ public static ScatterMax create(Scope scope, Operand r } } } - return new ScatterMax(opBuilder.build()); + return new ScatterMax<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the update will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * = Same as `ref`. Returned as a convenience for operations that want + * Gets outputRef. + * = Same as {@code ref}. Returned as a convenience for operations that want * to use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterMax"; - - private Output outputRef; - - private ScatterMax(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterMax} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the update will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 20c4393ce79..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,84 +17,83 @@ 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; /** - * Reduces sparse updates into a variable reference using the `min` operation. - *

+ * Reduces sparse updates into a variable reference using the {@code min} operation. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] = min(ref[indices, ...], updates[...]) - *

- * # Vector indices (for each i) - * ref[indices[i], ...] = min(ref[indices[i], ...], updates[i, ...]) - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] = min(ref[indices[i, ..., j], ...], updates[i, ..., j, ...]) - *

- * This operation outputs `ref` after the update is done. + *

+ * # Scalar indices
+ * ref[indices, ...] = min(ref[indices, ...], updates[...])
+ *
+ * # Vector indices (for each i)
+ * ref[indices[i], ...] = min(ref[indices[i], ...], updates[i, ...])
+ *
+ * # High rank indices (for each i, ..., j)
+ * ref[indices[i, ..., j], ...] = min(ref[indices[i, ..., j], ...], updates[i, ..., j, ...])
+ * 
+ *

This operation outputs {@code ref} after the update is done. * This makes it easier to chain operations that need to use the reset value. - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

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

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
- * - * @param data type for {@code outputRef()} output */ +@OpMetadata( + opType = ScatterMin.OP_NAME, + inputsClass = ScatterMin.Inputs.class +) @Operator public final class ScatterMin extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterMin} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the update will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterMin"; + + private Output outputRef; + + public ScatterMin(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterMin operation. - * + * * @param scope current scope - * @param ref Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to reduce into `ref`. - * @param options carries optional attributes values + * @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}. + * @param options carries optional attribute values + * @param data type for {@code ScatterMin} output and operands * @return a new instance of ScatterMin */ - @Endpoint(describeByClass = true) - public static ScatterMin create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ScatterMin", scope.makeOpName("ScatterMin")); + @Endpoint( + describeByClass = true + ) + public static ScatterMin create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ScatterMin"); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -102,38 +101,101 @@ public static ScatterMin create(Scope scope, Operand r } } } - return new ScatterMin(opBuilder.build()); + return new ScatterMin<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the update will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * = Same as `ref`. Returned as a convenience for operations that want + * Gets outputRef. + * = Same as {@code ref}. Returned as a convenience for operations that want * to use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterMin"; - - private Output outputRef; - - private ScatterMin(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterMin} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the update will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 7b155dd8fd5..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,81 +17,81 @@ 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; /** * Multiplies sparse updates into a variable reference. - *

* This operation computes - *

{@code
+ * 
  *     # Scalar indices
  *     ref[indices, ...] *= updates[...]
- * 
+ *
  *     # Vector indices (for each i)
  *     ref[indices[i], ...] *= updates[i, ...]
- * 
+ *
  *     # High rank indices (for each i, ..., j)
  *     ref[indices[i, ..., j], ...] *= updates[i, ..., j, ...]
- * }
- * This operation outputs `ref` after the update is done. + *
+ *

This operation outputs {@code ref} after the update is done. * This makes it easier to chain operations that need to use the reset value. - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

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

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - * - * @param data type for {@code outputRef()} output + *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. */ +@OpMetadata( + opType = ScatterMul.OP_NAME, + inputsClass = ScatterMul.Inputs.class +) @Operator public final class ScatterMul extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterMul} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the operation will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterMul"; + + private Output outputRef; + + public ScatterMul(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterMul operation. - * + * * @param scope current scope - * @param ref Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to multiply to `ref`. - * @param options carries optional attributes values + * @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}. + * @param options carries optional attribute values + * @param data type for {@code ScatterMul} output and operands * @return a new instance of ScatterMul */ - @Endpoint(describeByClass = true) - public static ScatterMul create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ScatterMul", scope.makeOpName("ScatterMul")); + @Endpoint( + describeByClass = true + ) + public static ScatterMul create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ScatterMul"); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -99,38 +99,101 @@ public static ScatterMul create(Scope scope, Operand ref } } } - return new ScatterMul(opBuilder.build()); + return new ScatterMul<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the operation will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * = Same as `ref`. Returned as a convenience for operations that want + * Gets outputRef. + * = Same as {@code ref}. Returned as a convenience for operations that want * to use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterMul"; - - private Output outputRef; - - private ScatterMul(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterMul} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the operation will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 63dd5fa5cef..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,79 +17,81 @@ 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 `updates` into a new tensor according to `indices`. - *

- * Creates a new tensor by applying sparse `updates` to individual values or - * slices within a tensor (initially zero for numeric, empty for string) of - * the given `shape` according to indices. This operator is the inverse of the - * `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 `tf.scatter_nd(indices, values, shape)` is identical - * to `tensor_scatter_add(tf.zeros(shape, values.dtype), indices, values)` - *

- * If `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 `indices` contains duplicates -- because - * of some numerical approximation issues, numbers summed in different order - * may yield different results. - *

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

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

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

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

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

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

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

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

* *
- *

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

{@code
+ * 

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

  *     indices = tf.constant([[4], [3], [1], [7]])
  *     updates = tf.constant([9, 10, 11, 12])
  *     shape = tf.constant([8])
  *     scatter = tf.scatter_nd(indices, updates, shape)
  *     print(scatter)
- * }
- * The resulting tensor would look like this: - *

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

+ *

+ *

The resulting tensor would look like this: + *

+ * [0, 11, 0, 10, 9, 0, 0, 12]
+ * 
+ *

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: - *

{@code
- *     indices = tf.constant([[0], [2]])
+ * 

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

+ *     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],
@@ -97,62 +99,164 @@
  *     shape = tf.constant([4, 4, 4])
  *     scatter = tf.scatter_nd(indices, updates, shape)
  *     print(scatter)
- * }
- * 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]], - * [[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]]] - *

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

+ *

The resulting tensor would look like this: + *

+ * [[[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]],
+ *  [[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]]]
+ * 
+ *

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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ScatterNd"; + + private Output output; + + public ScatterNd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * 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 */ - @Endpoint(describeByClass = true) - public static ScatterNd create(Scope scope, Operand indices, Operand updates, Operand shape) { - OperationBuilder opBuilder = scope.env().opBuilder("ScatterNd", scope.makeOpName("ScatterNd")); + @Endpoint( + describeByClass = true + ) + public static ScatterNd create(Scope scope, + 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()); - opBuilder = scope.apply(opBuilder); - return new ScatterNd(opBuilder.build()); + 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 * to the indices. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterNd"; - - private Output output; - - private ScatterNd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * 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 3ccd389abcb..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,135 +17,232 @@ 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; /** * Applies sparse addition to individual values or slices in a Variable. - *

- * `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. - *

- * `indices` must be integer tensor, containing indices into `ref`. - * It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. - *

- * The innermost dimension of `indices` (with length `K`) corresponds to - * indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th - * dimension of `ref`. - *

- * `updates` is `Tensor` of rank `Q-1+P-K` with shape: - *

{@code
+ * {@code ref} is a {@code Tensor} with rank {@code P} and {@code indices} is a {@code Tensor} of rank {@code Q}.
+ * 

{@code indices} must be integer tensor, containing indices into {@code ref}. + * It must be shape {@code [d_0, ..., d_{Q-2}, K]} where {@code 0 < K <= P}. + *

The innermost dimension of {@code indices} (with length {@code K}) corresponds to + * indices into elements (if {@code K = P}) or slices (if {@code K < P}) along the {@code K}th + * dimension of {@code ref}. + *

{@code updates} is {@code Tensor} of rank {@code Q-1+P-K} with shape: + *

  * [d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]
- * }
- * For example, say we want to add 4 scattered elements to a rank-1 tensor to + *
+ *

For example, say we want to add 4 scattered elements to a rank-1 tensor to * 8 elements. In Python, that addition would look like this: - *

{@code
+ * 
  * ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8])
  * indices = tf.constant([[4], [3], [1], [7]])
  * updates = tf.constant([9, 10, 11, 12])
  * add = tf.scatter_nd_add(ref, indices, updates)
  * with tf.Session() as sess:
  *   print sess.run(add)
- * }
- * The resulting update to ref would look like this: - *

- * [1, 13, 3, 14, 14, 6, 7, 20] - *

- * See `tf.scatter_nd` for more details about how to make updates to + *

+ *

The resulting update to ref would look like this: + *

+ * [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 outputRef()} output */ +@OpMetadata( + opType = ScatterNdAdd.OP_NAME, + inputsClass = ScatterNdAdd.Inputs.class +) @Operator public final class ScatterNdAdd extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterNdAdd} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterNdAdd"; + + private Output outputRef; + + public ScatterNdAdd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterNdAdd operation. - * + * * @param scope current scope * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code ScatterNdAdd} output and operands * @return a new instance of ScatterNdAdd */ - @Endpoint(describeByClass = true) - public static ScatterNdAdd create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ScatterNdAdd", scope.makeOpName("ScatterNdAdd")); + @Endpoint( + describeByClass = true + ) + public static ScatterNdAdd create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ScatterNdAdd"); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { 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()); + return new ScatterNdAdd<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking 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. + * @return this Options instance. */ 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 use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterNdAdd"; - - private Output outputRef; - - private ScatterNdAdd(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterNdAdd} + */ + public static class Options { + private Boolean useLocking; + + private String badIndicesPolicy; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + 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 8c77ecad143..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,104 +17,206 @@ 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 outputRef()} output */ +@OpMetadata( + opType = ScatterNdMax.OP_NAME, + inputsClass = ScatterNdMax.Inputs.class +) +@Operator public final class ScatterNdMax extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterNdMax} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterNdMax"; + + private Output outputRef; + + public ScatterNdMax(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterNdMax operation. - * + * * @param scope current scope * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code ScatterNdMax} output and operands * @return a new instance of ScatterNdMax */ - @Endpoint(describeByClass = true) - public static ScatterNdMax create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ScatterNdMax", scope.makeOpName("ScatterNdMax")); + @Endpoint( + describeByClass = true + ) + public static ScatterNdMax create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ScatterNdMax"); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { 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()); + return new ScatterNdMax<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking 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. + * @return this Options instance. */ 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 use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterNdMax"; - - private Output outputRef; - - private ScatterNdMax(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterNdMax} + */ + public static class Options { + private Boolean useLocking; + + private String badIndicesPolicy; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + 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 19fbd9eac1e..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,104 +17,206 @@ 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 outputRef()} output */ +@OpMetadata( + opType = ScatterNdMin.OP_NAME, + inputsClass = ScatterNdMin.Inputs.class +) +@Operator public final class ScatterNdMin extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterNdMin} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterNdMin"; + + private Output outputRef; + + public ScatterNdMin(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterNdMin operation. - * + * * @param scope current scope * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code ScatterNdMin} output and operands * @return a new instance of ScatterNdMin */ - @Endpoint(describeByClass = true) - public static ScatterNdMin create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ScatterNdMin", scope.makeOpName("ScatterNdMin")); + @Endpoint( + describeByClass = true + ) + public static ScatterNdMin create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ScatterNdMin"); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { 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()); + return new ScatterNdMin<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking 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. + * @return this Options instance. */ 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 use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterNdMin"; - - private Output outputRef; - - private ScatterNdMin(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterNdMin} + */ + public static class Options { + private Boolean useLocking; + + private String badIndicesPolicy; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + 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 09396a80e86..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,101 +17,195 @@ 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; /** - * Applies sparse addition to `input` using individual values or slices - *

- * from `updates` according to indices `indices`. The updates are non-aliasing: - * `input` is only modified in-place if no other operations will use it. - * Otherwise, a copy of `input` is made. This operation has a gradient with - * respect to both `input` and `updates`. - *

- * `input` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. - *

- * `indices` must be integer tensor, containing indices into `input`. - * It must be shape \\([d_0, ..., d_{Q-2}, K]\\) where `0 < K <= P`. - *

- * The innermost dimension of `indices` (with length `K`) corresponds to - * indices into elements (if `K = P`) or `(P-K)`-dimensional slices - * (if `K < P`) along the `K`th dimension of `input`. - *

- * `updates` is `Tensor` of rank `Q-1+P-K` with shape: - *

- * $$[d_0, ..., d_{Q-2}, input.shape[K], ..., input.shape[P-1]].$$ - *

- * For example, say we want to add 4 scattered elements to a rank-1 tensor to 8 + * Applies sparse addition to {@code input} using individual values or slices + * from {@code updates} according to indices {@code indices}. The updates are non-aliasing: + * {@code input} is only modified in-place if no other operations will use it. + * Otherwise, a copy of {@code input} is made. This operation has a gradient with + * respect to both {@code input} and {@code updates}. + *

{@code input} is a {@code Tensor} with rank {@code P} and {@code indices} is a {@code Tensor} of rank {@code Q}. + *

{@code indices} must be integer tensor, containing indices into {@code input}. + * It must be shape \([d_0, ..., d_{Q-2}, K]\) where {@code 0 < K <= P}. + *

The innermost dimension of {@code indices} (with length {@code K}) corresponds to + * indices into elements (if {@code K = P}) or {@code (P-K)}-dimensional slices + * (if {@code K < P}) along the {@code K}th dimension of {@code input}. + *

{@code updates} is {@code Tensor} of rank {@code Q-1+P-K} with shape: + *

$$[d_0, ..., d_{Q-2}, input.shape[K], ..., input.shape[P-1]].$$ + *

For example, say we want to add 4 scattered elements to a rank-1 tensor to 8 * elements. In Python, that addition would look like this: - *

- * input = tf.constant([1, 2, 3, 4, 5, 6, 7, 8]) - * indices = tf.constant([[4], [3], [1], [7]]) - * updates = tf.constant([9, 10, 11, 12]) - * output = tf.scatter_nd_non_aliasing_add(input, indices, updates) - * with tf.Session() as sess: - * print(sess.run(output)) - *

- * The resulting value `output` would look like this: - *

- * [1, 13, 3, 14, 14, 6, 7, 20] - *

- * See `tf.scatter_nd` for more details about how to make updates to slices. - * - * @param data type for {@code output()} output + *

+ * input = tf.constant([1, 2, 3, 4, 5, 6, 7, 8])
+ * indices = tf.constant([[4], [3], [1], [7]])
+ * updates = tf.constant([9, 10, 11, 12])
+ * output = tf.scatter_nd_non_aliasing_add(input, indices, updates)
+ * with tf.Session() as sess:
+ *   print(sess.run(output))
+ * 
+ *

The resulting value {@code output} would look like this: + *

+ * [1, 13, 3, 14, 14, 6, 7, 20]
+ * 
+ *

See {@code tf.scatter_nd} for more details about how to make updates to slices. */ +@OpMetadata( + opType = ScatterNdNonAliasingAdd.OP_NAME, + inputsClass = ScatterNdNonAliasingAdd.Inputs.class +) @Operator public final class ScatterNdNonAliasingAdd extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ScatterNdNonAliasingAdd"; + + private Output output; + + public ScatterNdNonAliasingAdd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ScatterNdNonAliasingAdd operation. - * + * * @param scope current scope * @param input A Tensor. - * @param indices A Tensor. Must be one of the following types: `int32`, `int64`. - * A tensor of indices into `input`. + * @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 `input`. + * 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 */ - @Endpoint(describeByClass = true) - public static ScatterNdNonAliasingAdd create(Scope scope, Operand input, Operand indices, Operand updates) { - OperationBuilder opBuilder = scope.env().opBuilder("ScatterNdNonAliasingAdd", scope.makeOpName("ScatterNdNonAliasingAdd")); + @Endpoint( + describeByClass = true + ) + public static ScatterNdNonAliasingAdd create(Scope scope, Operand input, + 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()); - opBuilder = scope.apply(opBuilder); - return new ScatterNdNonAliasingAdd(opBuilder.build()); + 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); } - + /** - * A `Tensor` with the same shape as `input`, containing values of `input` - * updated with `updates`. + * Gets output. + * A {@code Tensor} with the same shape as {@code input}, containing values of {@code input} + * updated with {@code updates}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterNdNonAliasingAdd"; - - private Output output; - - private ScatterNdNonAliasingAdd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * 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 e391a05ff82..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,137 +17,233 @@ 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; /** * Applies sparse subtraction to individual values or slices in a Variable. - *

- * within a given variable according to `indices`. - *

- * `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. - *

- * `indices` must be integer tensor, containing indices into `ref`. - * It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. - *

- * The innermost dimension of `indices` (with length `K`) corresponds to - * indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th - * dimension of `ref`. - *

- * `updates` is `Tensor` of rank `Q-1+P-K` with shape: - *

{@code
+ * within a given variable according to {@code indices}.
+ * 

{@code ref} is a {@code Tensor} with rank {@code P} and {@code indices} is a {@code Tensor} of rank {@code Q}. + *

{@code indices} must be integer tensor, containing indices into {@code ref}. + * It must be shape {@code [d_0, ..., d_{Q-2}, K]} where {@code 0 < K <= P}. + *

The innermost dimension of {@code indices} (with length {@code K}) corresponds to + * indices into elements (if {@code K = P}) or slices (if {@code K < P}) along the {@code K}th + * dimension of {@code ref}. + *

{@code updates} is {@code Tensor} of rank {@code Q-1+P-K} with shape: + *

  * [d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]
- * }
- * For example, say we want to subtract 4 scattered elements from a rank-1 tensor + *
+ *

For example, say we want to subtract 4 scattered elements from a rank-1 tensor * with 8 elements. In Python, that subtraction would look like this: - *

{@code
+ * 
  * ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8])
  * indices = tf.constant([[4], [3], [1], [7]])
  * updates = tf.constant([9, 10, 11, 12])
  * sub = tf.scatter_nd_sub(ref, indices, updates)
  * with tf.Session() as sess:
  *   print sess.run(sub)
- * }
- * The resulting update to ref would look like this: - *

- * [1, -9, 3, -6, -4, 6, 7, -4] - *

- * See `tf.scatter_nd` for more details about how to make updates to + *

+ *

The resulting update to ref would look like this: + *

+ * [1, -9, 3, -6, -4, 6, 7, -4]
+ * 
+ *

See {@code tf.scatter_nd} for more details about how to make updates to * slices. - * - * @param data type for {@code outputRef()} output */ +@OpMetadata( + opType = ScatterNdSub.OP_NAME, + inputsClass = ScatterNdSub.Inputs.class +) @Operator public final class ScatterNdSub extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterNdSub} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterNdSub"; + + private Output outputRef; + + public ScatterNdSub(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterNdSub operation. - * + * * @param scope current scope * @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 subtract from ref. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ScatterNdSub} output and operands * @return a new instance of ScatterNdSub */ - @Endpoint(describeByClass = true) - public static ScatterNdSub create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ScatterNdSub", scope.makeOpName("ScatterNdSub")); + @Endpoint( + describeByClass = true + ) + public static ScatterNdSub create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ScatterNdSub"); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { 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()); + return new ScatterNdSub<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking 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. + * @return this Options instance. */ 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 use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterNdSub"; - - private Output outputRef; - - private ScatterNdSub(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterNdSub} + */ + public static class Options { + private Boolean useLocking; + + private String badIndicesPolicy; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + 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 13eb21a735c..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,139 +17,232 @@ 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; /** - * Applies sparse `updates` to individual values or slices within a given - *

- * variable according to `indices`. - *

- * `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. - *

- * `indices` must be integer tensor, containing indices into `ref`. - * It must be shape \\([d_0, ..., d_{Q-2}, K]\\) where `0 < K <= P`. - *

- * The innermost dimension of `indices` (with length `K`) corresponds to - * indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th - * dimension of `ref`. - *

- * `updates` is `Tensor` of rank `Q-1+P-K` with shape: - *

- * $$[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]].$$ - *

- * For example, say we want to update 4 scattered elements to a rank-1 tensor to + * Applies sparse {@code updates} to individual values or slices within a given + * variable according to {@code indices}. + *

{@code ref} is a {@code Tensor} with rank {@code P} and {@code indices} is a {@code Tensor} of rank {@code Q}. + *

{@code indices} must be integer tensor, containing indices into {@code ref}. + * It must be shape \([d_0, ..., d_{Q-2}, K]\) where {@code 0 < K <= P}. + *

The innermost dimension of {@code indices} (with length {@code K}) corresponds to + * indices into elements (if {@code K = P}) or slices (if {@code K < P}) along the {@code K}th + * dimension of {@code ref}. + *

{@code updates} is {@code Tensor} of rank {@code Q-1+P-K} with shape: + *

$$[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]].$$ + *

For example, say we want to update 4 scattered elements to a rank-1 tensor to * 8 elements. In Python, that update would look like this: - *

{@code
+ * 
  *     ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8])
  *     indices = tf.constant([[4], [3], [1] ,[7]])
  *     updates = tf.constant([9, 10, 11, 12])
  *     update = tf.scatter_nd_update(ref, indices, updates)
  *     with tf.Session() as sess:
  *       print sess.run(update)
- * }
- * The resulting update to ref would look like this: - *

- * [1, 11, 3, 10, 9, 6, 7, 12] - *

- * See `tf.scatter_nd` for more details about how to make updates to + *

+ *

The resulting update to ref would look like this: + *

+ * [1, 11, 3, 10, 9, 6, 7, 12]
+ * 
+ *

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

- * See also `tf.scatter_update` and `tf.batch_scatter_update`. - * - * @param data type for {@code outputRef()} output + *

See also {@code tf.scatter_update} and {@code tf.batch_scatter_update}. */ +@OpMetadata( + opType = ScatterNdUpdate.OP_NAME, + inputsClass = ScatterNdUpdate.Inputs.class +) @Operator public final class ScatterNdUpdate extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterNdUpdate} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterNdUpdate"; + + private Output outputRef; + + public ScatterNdUpdate(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterNdUpdate operation. - * + * * @param scope current scope * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code ScatterNdUpdate} output and operands * @return a new instance of ScatterNdUpdate */ - @Endpoint(describeByClass = true) - public static ScatterNdUpdate create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ScatterNdUpdate", scope.makeOpName("ScatterNdUpdate")); + @Endpoint( + describeByClass = true + ) + public static ScatterNdUpdate create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ScatterNdUpdate"); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { opBuilder.setAttr("use_locking", opts.useLocking); } + if (opts.badIndicesPolicy != null) { + opBuilder.setAttr("bad_indices_policy", opts.badIndicesPolicy); + } } } - return new ScatterNdUpdate(opBuilder.build()); + return new ScatterNdUpdate<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking 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. + * @return this Options instance. */ 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 * use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterNdUpdate"; - - private Output outputRef; - - private ScatterNdUpdate(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterNdUpdate} + */ + public static class Options { + private Boolean useLocking; + + private String badIndicesPolicy; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + 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 0d53ef622fe..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,84 +17,83 @@ 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; /** * Subtracts sparse updates to a variable reference. - *

- *

{@code
+ * 
  *     # Scalar indices
  *     ref[indices, ...] -= updates[...]
- * 
+ *
  *     # Vector indices (for each i)
  *     ref[indices[i], ...] -= updates[i, ...]
- * 
+ *
  *     # High rank indices (for each i, ..., j)
  *     ref[indices[i, ..., j], ...] -= updates[i, ..., j, ...]
- * }
- * This operation outputs `ref` after the update is done. + *
+ * This operation outputs {@code ref} after the update is done. * This makes it easier to chain operations that need to use the reset value. - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

Duplicate entries are handled correctly: if multiple {@code indices} reference * the same location, their (negated) contributions add. - *

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
- * - * @param data type for {@code outputRef()} output */ +@OpMetadata( + opType = ScatterSub.OP_NAME, + inputsClass = ScatterSub.Inputs.class +) @Operator public final class ScatterSub extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterSub} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the subtraction will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterSub"; + + private Output outputRef; + + public ScatterSub(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterSub operation. - * + * * @param scope current scope - * @param ref Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to subtract from `ref`. - * @param options carries optional attributes values + * @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}. + * @param options carries optional attribute values + * @param data type for {@code ScatterSub} output and operands * @return a new instance of ScatterSub */ - @Endpoint(describeByClass = true) - public static ScatterSub create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ScatterSub", scope.makeOpName("ScatterSub")); + @Endpoint( + describeByClass = true + ) + public static ScatterSub create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ScatterSub"); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -102,38 +101,101 @@ public static ScatterSub create(Scope scope, Operand ref } } } - return new ScatterSub(opBuilder.build()); + return new ScatterSub<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the subtraction will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * = Same as `ref`. Returned as a convenience for operations that want + * Gets outputRef. + * = Same as {@code ref}. Returned as a convenience for operations that want * to use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterSub"; - - private Output outputRef; - - private ScatterSub(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterSub} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 37efa7194e8..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,88 +17,86 @@ 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; /** * Applies sparse updates to a variable reference. - *

* This operation computes - *

{@code
+ * 
  *     # Scalar indices
  *     ref[indices, ...] = updates[...]
- * 
+ *
  *     # Vector indices (for each i)
  *     ref[indices[i], ...] = updates[i, ...]
- * 
+ *
  *     # High rank indices (for each i, ..., j)
  *     ref[indices[i, ..., j], ...] = updates[i, ..., j, ...]
- * }
- * This operation outputs `ref` after the update is done. + *
+ *

This operation outputs {@code ref} after the update is done. * This makes it easier to chain operations that need to use the reset value. - *

- * If values in `ref` is to be updated more than once, because there are - * duplicate entries in `indices`, the order at which the updates happen + *

If values in {@code ref} is to be updated more than once, because there are + * duplicate entries in {@code indices}, the order at which the updates happen * for each value is undefined. - *

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
- *

- * See also `tf.batch_scatter_update` and `tf.scatter_nd_update`. - * - * @param data type for {@code outputRef()} output + *

See also {@code tf.batch_scatter_update} and {@code tf.scatter_nd_update}. */ +@OpMetadata( + opType = ScatterUpdate.OP_NAME, + inputsClass = ScatterUpdate.Inputs.class +) @Operator public final class ScatterUpdate extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterUpdate} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the assignment will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterUpdate"; + + private Output outputRef; + + public ScatterUpdate(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterUpdate operation. - * + * * @param scope current scope - * @param ref Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to store in `ref`. - * @param options carries optional attributes values + * @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}. + * @param options carries optional attribute values + * @param data type for {@code ScatterUpdate} output and operands * @return a new instance of ScatterUpdate */ - @Endpoint(describeByClass = true) - public static ScatterUpdate create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ScatterUpdate", scope.makeOpName("ScatterUpdate")); + @Endpoint( + describeByClass = true + ) + public static ScatterUpdate create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ScatterUpdate"); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -106,38 +104,101 @@ public static ScatterUpdate create(Scope scope, Operand } } } - return new ScatterUpdate(opBuilder.build()); + return new ScatterUpdate<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the assignment will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * = Same as `ref`. Returned as a convenience for operations that want + * Gets outputRef. + * = Same as {@code ref}. Returned as a convenience for operations that want * to use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterUpdate"; - - private Output outputRef; - - private ScatterUpdate(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterUpdate} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the assignment will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 4bea1d6de91..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,61 +17,112 @@ 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; /** - * @param data type for {@code output()} output + * The SelectV2 operation */ +@OpMetadata( + opType = Select.OP_NAME, + inputsClass = Select.Inputs.class +) @Operator public final class Select extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Select operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SelectV2"; + + private Output output; + + public Select(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new SelectV2 operation. + * * @param scope current scope - * @param condition - * @param t - * @param e + * @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 */ - @Endpoint(describeByClass = true) - public static Select create(Scope scope, Operand condition, Operand t, Operand e) { - OperationBuilder opBuilder = scope.env().opBuilder("SelectV2", scope.makeOpName("Select")); + @Endpoint( + describeByClass = true + ) + public static Select create(Scope scope, Operand condition, + Operand t, Operand e) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Select"); opBuilder.addInput(condition.asOutput()); opBuilder.addInput(t.asOutput()); opBuilder.addInput(e.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Select(opBuilder.build()); + return new Select<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SelectV2"; - - private Output output; - - private Select(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 480cd265f1a..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,59 +17,58 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.Send} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param clientTerminated 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 Options clientTerminated(Boolean clientTerminated) { - this.clientTerminated = clientTerminated; - return this; - } - - private Boolean clientTerminated; - - private Options() { - } + public static final String OP_NAME = "Send"; + + public Send(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new Send operation. - * + * * @param scope current scope * @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 attributes values + * @param options carries optional attribute values * @return a new instance of Send */ - @Endpoint(describeByClass = true) - public static Send create(Scope scope, Operand tensor, String tensorName, String sendDevice, Long sendDeviceIncarnation, String recvDevice, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Send", scope.makeOpName("Send")); + @Endpoint( + describeByClass = true + ) + public static Send create(Scope scope, Operand tensor, String tensorName, + String sendDevice, Long sendDeviceIncarnation, String recvDevice, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Send"); opBuilder.addInput(tensor.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("tensor_name", tensorName); opBuilder.setAttr("send_device", sendDevice); opBuilder.setAttr("send_device_incarnation", sendDeviceIncarnation); @@ -83,21 +82,96 @@ public static Send create(Scope scope, Operand tensor, String t } return new Send(opBuilder.build()); } - + /** + * Sets the clientTerminated option. + * * @param clientTerminated 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. + * @return this Options instance. */ public static Options clientTerminated(Boolean clientTerminated) { return new Options().clientTerminated(clientTerminated); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Send"; - - private Send(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Send} + */ + public static class Options { + private Boolean clientTerminated; + + private Options() { + } + + /** + * Sets the clientTerminated option. + * + * @param clientTerminated 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. + * @return this Options instance. + */ + public Options clientTerminated(Boolean clientTerminated) { + this.clientTerminated = 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 515f413fca9..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,104 +17,155 @@ 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; /** * Computes the difference between two lists of numbers or strings. - *

- * Given a list `x` and a list `y`, this operation returns a list `out` that - * represents all values that are in `x` but not in `y`. The returned list `out` - * is sorted in the same order that the numbers appear in `x` (duplicates are - * preserved). This operation also returns a list `idx` that represents the - * position of each `out` element in `x`. In other words: - *

- * `out[i] = x[idx[i]] for i in [0, 1, ..., len(out) - 1]` - *

- * For example, given this input: - *

{@code
+ * Given a list {@code x} and a list {@code y}, this operation returns a list {@code out} that
+ * represents all values that are in {@code x} but not in {@code y}. The returned list {@code out}
+ * is sorted in the same order that the numbers appear in {@code x} (duplicates are
+ * preserved). This operation also returns a list {@code idx} that represents the
+ * position of each {@code out} element in {@code x}. In other words:
+ * 

{@code out[i] = x[idx[i]] for i in [0, 1, ..., len(out) - 1]} + *

For example, given this input: + *

  * x = [1, 2, 3, 4, 5, 6]
  * y = [1, 3, 5]
- * }
- * This operation would return: - *
{@code
- * out ==> [2, 4, 6]
- * idx ==> [1, 3, 5]
- * }
- * - * - * @param data type for {@code out()} output - * @param data type for {@code idx()} output + *
+ *

This operation would return: + *

+ * out ==> [2, 4, 6]
+ * idx ==> [1, 3, 5]
+ * 
*/ +@OpMetadata( + opType = SetDiff1d.OP_NAME, + inputsClass = SetDiff1d.Inputs.class +) @Operator public final class SetDiff1d extends RawOp { - /** - * Factory method to create a class wrapping a new SetDiff1d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ListDiff"; + + private Output out; + + private Output idx; + + public SetDiff1d(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); + idx = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ListDiff operation. + * * @param scope current scope * @param x 1-D. Values to keep. * @param y 1-D. Values to remove. - * @param outIdx + * @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 */ - @Endpoint(describeByClass = true) - public static SetDiff1d create(Scope scope, Operand x, Operand y, Class outIdx) { - OperationBuilder opBuilder = scope.env().opBuilder("ListDiff", scope.makeOpName("SetDiff1d")); + @Endpoint( + describeByClass = true + ) + public static SetDiff1d create(Scope scope, + Operand x, Operand y, Class outIdx) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SetDiff1d"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_idx", Operands.toDataType(outIdx)); - return new SetDiff1d(opBuilder.build()); + return new SetDiff1d<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new SetDiff1d operation using default output types. - * + * Factory method to create a class wrapping a new ListDiff operation, with the default output types. + * * @param scope current scope * @param x 1-D. Values to keep. * @param y 1-D. Values to remove. - * @return a new instance of SetDiff1d + * @param data type for {@code ListDiff} output and operands + * @return a new instance of SetDiff1d, with default output types */ - @Endpoint(describeByClass = true) - public static SetDiff1d create(Scope scope, Operand x, Operand y) { + @Endpoint( + describeByClass = true + ) + public static SetDiff1d create(Scope scope, Operand x, + Operand y) { return create(scope, x, y, TInt32.class); } - + /** - * 1-D. Values present in `x` but not in `y`. + * Gets out. + * 1-D. Values present in {@code x} but not in {@code y}. + * @return out. */ public Output out() { return out; } - + /** - * 1-D. Positions of `x` values preserved in `out`. + * Gets idx. + * 1-D. Positions of {@code x} values preserved in {@code out}. + * @return idx. */ public Output idx() { return idx; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ListDiff"; - - private Output out; - private Output idx; - - private SetDiff1d(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); - idx = operation.output(outputIdx++); + + @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 bfa86868a72..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,67 +17,71 @@ 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; /** - * Number of unique elements along last dimension of input `set`. - *

- * Input `set` is a `SparseTensor` represented by `set_indices`, `set_values`, - * and `set_shape`. The last dimension contains values in a set, duplicates are + * Number of unique elements along last dimension of input {@code set}. + * Input {@code set} is a {@code SparseTensor} represented by {@code set_indices}, {@code set_values}, + * and {@code set_shape}. The last dimension contains values in a set, duplicates are * allowed but ignored. - *

- * If `validate_indices` is `True`, this op validates the order and range of `set` - * indices. + *

If {@code validate_indices} is {@code True}, this op validates the order and range of {@code set} + * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.SetSize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param validateIndices - */ - public Options validateIndices(Boolean validateIndices) { - this.validateIndices = validateIndices; - return this; - } - - private Boolean validateIndices; - - private Options() { - } + public static final String OP_NAME = "SetSize"; + + private Output output; + + public SetSize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SetSize operation. - * + * * @param scope current scope - * @param setIndices 2D `Tensor`, indices of a `SparseTensor`. - * @param setValues 1D `Tensor`, values of a `SparseTensor`. - * @param setShape 1D `Tensor`, shape of a `SparseTensor`. - * @param options carries optional attributes values + * @param setIndices 2D {@code Tensor}, indices of a {@code SparseTensor}. + * @param setValues 1D {@code Tensor}, values of a {@code SparseTensor}. + * @param setShape 1D {@code Tensor}, shape of a {@code SparseTensor}. + * @param options carries optional attribute values * @return a new instance of SetSize */ - @Endpoint(describeByClass = true) - public static SetSize create(Scope scope, Operand setIndices, Operand setValues, Operand setShape, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SetSize", scope.makeOpName("SetSize")); + @Endpoint( + describeByClass = true + ) + public static SetSize create(Scope scope, Operand setIndices, + Operand setValues, Operand setShape, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SetSize"); opBuilder.addInput(setIndices.asOutput()); opBuilder.addInput(setValues.asOutput()); opBuilder.addInput(setShape.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.validateIndices != null) { @@ -87,36 +91,91 @@ public static SetSize create(Scope scope, Operand setIndices, Operand output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SetSize"; - - private Output output; - - private SetSize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.SetSize} + */ + public static class Options { + private Boolean validateIndices; + + private Options() { + } + + /** + * Sets the validateIndices option. + * + * @param validateIndices the validateIndices option + * @return this Options instance. + */ + public Options validateIndices(Boolean validateIndices) { + this.validateIndices = 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 dbb34980213..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,84 +17,126 @@ 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; /** * Returns the shape of a tensor. - *

- * This operation returns a 1-D integer tensor representing the shape of `input`. - *

- * For example: - *

{@code
+ * This operation returns a 1-D integer tensor representing the shape of {@code input}.
+ * 

For example: + *

  * # '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 + * shape(t) ==> [2, 2, 3] + *
*/ +@OpMetadata( + opType = Shape.OP_NAME, + inputsClass = Shape.Inputs.class +) @Operator public final class Shape extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Shape"; + + private Output output; + + public Shape(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Shape operation. - * + * * @param scope current scope - * @param input - * @param outType + * @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 */ - @Endpoint(describeByClass = true) - public static Shape create(Scope scope, Operand input, Class outType) { - OperationBuilder opBuilder = scope.env().opBuilder("Shape", scope.makeOpName("Shape")); + @Endpoint( + describeByClass = true + ) + public static Shape create(Scope scope, Operand input, + Class outType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Shape"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new Shape(opBuilder.build()); + return new Shape<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Shape operation using default output types. - * + * Factory method to create a class wrapping a new Shape operation, with the default output types. + * * @param scope current scope - * @param input - * @return a new instance of Shape + * @param input The input value + * @return a new instance of Shape, with default output types */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Shape 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Shape"; - - private Output output; - - private Shape(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 b196e321962..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,81 +20,126 @@ 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; /** * Returns shape of tensors. - *

- * This operation returns N 1-D integer tensors representing shape of `input[i]s`. - * - * @param data type for {@code output()} output + * This operation returns N 1-D integer tensors representing shape of {@code input[i]s}. */ +@OpMetadata( + opType = ShapeN.OP_NAME, + inputsClass = ShapeN.Inputs.class +) @Operator public final class ShapeN extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ShapeN"; + + private List> output; + + @SuppressWarnings("unchecked") + public ShapeN(Operation operation) { + super(operation, OP_NAME); + 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 ShapeN operation. - * + * * @param scope current scope - * @param input - * @param outType + * @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 */ - @Endpoint(describeByClass = true) - public static ShapeN create(Scope scope, Iterable> input, Class outType) { - OperationBuilder opBuilder = scope.env().opBuilder("ShapeN", scope.makeOpName("ShapeN")); + @Endpoint( + describeByClass = true + ) + public static ShapeN create(Scope scope, + Iterable> input, Class outType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ShapeN"); opBuilder.addInputList(Operands.asOutputs(input)); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new ShapeN(opBuilder.build()); + return new ShapeN<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new ShapeN operation using default output types. - * + * Factory method to create a class wrapping a new ShapeN operation, with the default output types. + * * @param scope current scope - * @param input - * @return a new instance of ShapeN + * @param input The input value + * @return a new instance of ShapeN, with default output types */ - @Endpoint(describeByClass = true) - public static ShapeN create(Scope scope, Iterable> input) { + @Endpoint( + describeByClass = true + ) + public static ShapeN create(Scope scope, Iterable> input) { return create(scope, input, TInt32.class); } - + /** + * Gets output. + * + * @return output. */ public List> output() { return output; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) output.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ShapeN"; - - private List> output; - - @SuppressWarnings("unchecked") - private ShapeN(Operation operation) { - super(operation); - int outputIdx = 0; - int outputLength = operation.outputListLength("output"); - output = Arrays.asList((Output[])operation.outputList(outputIdx, outputLength)); - outputIdx += outputLength; + + @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 07ab596ea23..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,85 +17,127 @@ 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; /** * Returns the size of a tensor. - *

* This operation returns an integer representing the number of elements in - * `input`. - *

- * For example: - *

{@code
+ * {@code input}.
+ * 

For example: + *

  * # 't' is [[[1, 1,, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]]
- * size(t) ==> 12
- * }
- * - * - * @param data type for {@code output()} output + * size(t) ==> 12 + *
*/ +@OpMetadata( + opType = Size.OP_NAME, + inputsClass = Size.Inputs.class +) @Operator public final class Size extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Size"; + + private Output output; + + public Size(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Size operation. - * + * * @param scope current scope - * @param input - * @param outType + * @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 */ - @Endpoint(describeByClass = true) - public static Size create(Scope scope, Operand input, Class outType) { - OperationBuilder opBuilder = scope.env().opBuilder("Size", scope.makeOpName("Size")); + @Endpoint( + describeByClass = true + ) + public static Size create(Scope scope, Operand input, + Class outType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Size"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new Size(opBuilder.build()); + return new Size<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Size operation using default output types. - * + * Factory method to create a class wrapping a new Size operation, with the default output types. + * * @param scope current scope - * @param input - * @return a new instance of Size + * @param input The input value + * @return a new instance of Size, with default output types */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Size 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Size"; - - private Output output; - - private Size(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 d55a47e4c48..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,61 +36,57 @@ /** * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.Skipgram} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param windowSize The number of words to predict to the left and right of the target. - */ - public Options windowSize(Long windowSize) { - this.windowSize = windowSize; - return this; - } - - /** - * @param minCount The minimum number of word occurrences for it to be included in the - * vocabulary. - */ - public Options minCount(Long minCount) { - this.minCount = minCount; - return this; - } - - /** - * @param subsample Threshold for word occurrence. Words that appear with higher - * frequency will be randomly down-sampled. Set to 0 to disable. - */ - public Options subsample(Float subsample) { - this.subsample = subsample; - return this; - } - - private Long windowSize; - private Long minCount; - private Float subsample; - - private Options() { - } + public static final String OP_NAME = "Skipgram"; + + private Output vocabWord; + + private Output vocabFreq; + + private Output wordsPerEpoch; + + private Output currentEpoch; + + private Output totalWordsProcessed; + + private Output examples; + + private Output labels; + + public Skipgram(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + vocabWord = operation.output(outputIdx++); + vocabFreq = operation.output(outputIdx++); + wordsPerEpoch = operation.output(outputIdx++); + currentEpoch = operation.output(outputIdx++); + totalWordsProcessed = operation.output(outputIdx++); + examples = operation.output(outputIdx++); + labels = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Skipgram operation. - * + * * @param scope current scope * @param filename The corpus's text file name. * @param batchSize The size of produced batch. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Skipgram */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Skipgram create(Scope scope, String filename, Long batchSize, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Skipgram", scope.makeOpName("Skipgram")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Skipgram"); opBuilder.setAttr("filename", filename); opBuilder.setAttr("batch_size", batchSize); if (options != null) { @@ -103,99 +104,190 @@ public static Skipgram create(Scope scope, String filename, Long batchSize, Opti } return new Skipgram(opBuilder.build()); } - + /** + * Sets the windowSize option. + * * @param windowSize The number of words to predict to the left and right of the target. + * @return this Options instance. */ public static Options windowSize(Long windowSize) { return new Options().windowSize(windowSize); } - + /** + * Sets the minCount option. + * * @param minCount The minimum number of word occurrences for it to be included in the * vocabulary. + * @return this Options instance. */ public static Options minCount(Long minCount) { return new Options().minCount(minCount); } - + /** + * Sets the subsample option. + * * @param subsample Threshold for word occurrence. Words that appear with higher * frequency will be randomly down-sampled. Set to 0 to disable. + * @return this Options instance. */ public static Options subsample(Float subsample) { return new Options().subsample(subsample); } - + /** + * Gets vocabWord. * A vector of words in the corpus. + * @return vocabWord. */ public Output vocabWord() { return vocabWord; } - + /** + * Gets vocabFreq. * Frequencies of words. Sorted in the non-ascending order. + * @return vocabFreq. */ public Output vocabFreq() { return vocabFreq; } - + /** + * Gets wordsPerEpoch. * Number of words per epoch in the data file. + * @return wordsPerEpoch. */ public Output wordsPerEpoch() { return wordsPerEpoch; } - + /** + * Gets currentEpoch. * The current epoch number. + * @return currentEpoch. */ public Output currentEpoch() { return currentEpoch; } - + /** + * Gets totalWordsProcessed. * The total number of words processed so far. + * @return totalWordsProcessed. */ public Output totalWordsProcessed() { return totalWordsProcessed; } - + /** + * Gets examples. * A vector of word ids. + * @return examples. */ public Output examples() { return examples; } - + /** + * Gets labels. * A vector of word ids. + * @return labels. */ public Output labels() { return labels; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Skipgram"; - - private Output vocabWord; - private Output vocabFreq; - private Output wordsPerEpoch; - private Output currentEpoch; - private Output totalWordsProcessed; - private Output examples; - private Output labels; - - private Skipgram(Operation operation) { - super(operation); - int outputIdx = 0; - vocabWord = operation.output(outputIdx++); - vocabFreq = operation.output(outputIdx++); - wordsPerEpoch = operation.output(outputIdx++); - currentEpoch = operation.output(outputIdx++); - totalWordsProcessed = operation.output(outputIdx++); - examples = operation.output(outputIdx++); - labels = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Skipgram} + */ + public static class Options { + private Long windowSize; + + private Long minCount; + + private Float subsample; + + private Options() { + } + + /** + * Sets the windowSize option. + * + * @param windowSize The number of words to predict to the left and right of the target. + * @return this Options instance. + */ + public Options windowSize(Long windowSize) { + this.windowSize = windowSize; + return this; + } + + /** + * Sets the minCount option. + * + * @param minCount The minimum number of word occurrences for it to be included in the + * vocabulary. + * @return this Options instance. + */ + public Options minCount(Long minCount) { + this.minCount = minCount; + return this; + } + + /** + * Sets the subsample option. + * + * @param subsample Threshold for word occurrence. Words that appear with higher + * frequency will be randomly down-sampled. Set to 0 to disable. + * @return this Options instance. + */ + public Options subsample(Float subsample) { + this.subsample = 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 22447d96bcd..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,74 +17,132 @@ 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; /** * Return a slice from 'input'. - *

* The output tensor is a tensor with dimensions described by 'size' * whose values are extracted from 'input' starting at the offsets in * 'begin'. - *

- * Requirements: - * 0 <= begin[i] <= begin[i] + size[i] <= Di for i in [0, n) - * - * @param data type for {@code output()} output + *

Requirements: + * 0 <= begin[i] <= begin[i] + size[i] <= Di for i in [0, n) */ +@OpMetadata( + opType = Slice.OP_NAME, + inputsClass = Slice.Inputs.class +) @Operator public final class Slice extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Slice"; + + private Output output; + + public Slice(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Slice operation. - * + * * @param scope current scope - * @param input + * @param input The input value * @param begin begin[i] specifies the offset into the 'i'th dimension of * 'input' to slice from. - * @param size size[i] specifies the number of elements of the 'i'th dimension + * @param sizeOutput 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]). + * @param data type for {@code Slice} output and operands + * @param data type for {@code Slice} output and operands * @return a new instance of Slice */ - @Endpoint(describeByClass = true) - public static Slice create(Scope scope, Operand input, Operand begin, Operand size) { - OperationBuilder opBuilder = scope.env().opBuilder("Slice", scope.makeOpName("Slice")); + @Endpoint( + describeByClass = true + ) + public static Slice create(Scope scope, Operand input, + Operand begin, Operand sizeOutput) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Slice"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(begin.asOutput()); - opBuilder.addInput(size.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Slice(opBuilder.build()); + opBuilder.addInput(sizeOutput.asOutput()); + return new Slice<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Slice"; - - private Output output; - - private Slice(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 eb782cf90d8..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,58 +17,94 @@ 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Snapshot"; + + private Output output; + + public Snapshot(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Snapshot operation. - * + * * @param scope current scope - * @param input + * @param input The input value + * @param data type for {@code Snapshot} output and operands * @return a new instance of Snapshot */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Snapshot create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("Snapshot", scope.makeOpName("Snapshot")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Snapshot"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Snapshot(opBuilder.build()); + return new Snapshot<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Snapshot"; - - private Output output; - - private Snapshot(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 df34fd91afd..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,164 +17,228 @@ 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; /** * SpaceToBatch for N-D tensors of type T. - *

- * This operation divides "spatial" dimensions `[1, ..., M]` of the input into a - * grid of blocks of shape `block_shape`, and interleaves these blocks with the - * "batch" dimension (0) such that in the output, the spatial dimensions - * `[1, ..., M]` correspond to the position within the grid, and the batch + * This operation divides "spatial" dimensions {@code [1, ..., M]} of the input into a + * grid of blocks of shape {@code block_shape}, and interleaves these blocks with the + * "batch" dimension (0) such that in the output, the spatial dimensions + * {@code [1, ..., M]} correspond to the position within the grid, and the batch * dimension combines both the position within a spatial block and the original * batch position. Prior to division into blocks, the spatial dimensions of the - * input are optionally zero padded according to `paddings`. See below for a + * input are optionally zero padded according to {@code paddings}. See below for a * precise description. - * - * @param data type for {@code output()} output + *

This operation is equivalent to the following steps: + *

    + *
  1. + *

    Zero-pad the start and end of dimensions {@code [1, ..., M]} of the + * input according to {@code paddings} to produce {@code padded} of shape {@code padded_shape}. + *

  2. + *
  3. + *

    Reshape {@code padded} to {@code reshaped_padded} of shape: + *

    [batch] + + * [padded_shape[1] / block_shape[0], + * block_shape[0], + * ..., + * padded_shape[M] / block_shape[M-1], + * block_shape[M-1]] + + * remaining_shape + *

  4. + *
  5. + *

    Permute dimensions of {@code reshaped_padded} to produce + * {@code permuted_reshaped_padded} of shape: + *

    block_shape + + * [batch] + + * [padded_shape[1] / block_shape[0], + * ..., + * padded_shape[M] / block_shape[M-1]] + + * remaining_shape + *

  6. + *
  7. + *

    Reshape {@code permuted_reshaped_padded} to flatten {@code block_shape} into the batch + * dimension, producing an output tensor of shape: + *

    [batch * prod(block_shape)] + + * [padded_shape[1] / block_shape[0], + * ..., + * padded_shape[M] / block_shape[M-1]] + + * remaining_shape + *

  8. + *
+ *

Some examples: + *

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Among others, this operation is useful for reducing atrous convolution into + * regular convolution. */ +@OpMetadata( + opType = SpaceToBatchNd.OP_NAME, + inputsClass = SpaceToBatchNd.Inputs.class +) @Operator public final class SpaceToBatchNd extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new SpaceToBatchNd operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SpaceToBatchND"; + + private Output output; + + public SpaceToBatchNd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new SpaceToBatchND operation. + * * @param scope current scope - * @param input N-D with shape `input_shape = [batch] + spatial_shape + remaining_shape`, - * where spatial_shape has `M` dimensions. - * @param blockShape 1-D with shape `[M]`, all values must be >= 1. - * @param paddings 2-D with shape `[M, 2]`, all values must be >= 0. - * `paddings[i] = [pad_start, pad_end]` specifies the padding for input dimension - * `i + 1`, which corresponds to spatial dimension `i`. It is required that - * `block_shape[i]` divides `input_shape[i + 1] + pad_start + pad_end`. - *

- * This operation is equivalent to the following steps: - *

- * 1. Zero-pad the start and end of dimensions `[1, ..., M]` of the - * input according to `paddings` to produce `padded` of shape `padded_shape`. - *

- * 2. Reshape `padded` to `reshaped_padded` of shape: - *

- * [batch] + - * [padded_shape[1] / block_shape[0], - * block_shape[0], - * ..., - * padded_shape[M] / block_shape[M-1], - * block_shape[M-1]] + - * remaining_shape - *

- * 3. Permute dimensions of `reshaped_padded` to produce - * `permuted_reshaped_padded` of shape: - *

- * block_shape + - * [batch] + - * [padded_shape[1] / block_shape[0], - * ..., - * padded_shape[M] / block_shape[M-1]] + - * remaining_shape - *

- * 4. Reshape `permuted_reshaped_padded` to flatten `block_shape` into the batch - * dimension, producing an output tensor of shape: - *

- * [batch * prod(block_shape)] + - * [padded_shape[1] / block_shape[0], - * ..., - * padded_shape[M] / block_shape[M-1]] + - * remaining_shape - *

- * Some examples: - *

- * (1) For the following input of shape `[1, 2, 2, 1]`, `block_shape = [2, 2]`, and - * `paddings = [[0, 0], [0, 0]]`: - *

{@code
-   * x = [[[[1], [2]], [[3], [4]]]]
-   * }
- * The output tensor has shape `[4, 1, 1, 1]` and value: - *
{@code
-   * [[[[1]]], [[[2]]], [[[3]]], [[[4]]]]
-   * }
- * (2) For the following input of shape `[1, 2, 2, 3]`, `block_shape = [2, 2]`, and - * `paddings = [[0, 0], [0, 0]]`: - *
{@code
-   * x = [[[[1, 2, 3], [4, 5, 6]],
-   *       [[7, 8, 9], [10, 11, 12]]]]
-   * }
- * The output tensor has shape `[4, 1, 1, 3]` and value: - *
{@code
-   * [[[[1, 2, 3]]], [[[4, 5, 6]]], [[[7, 8, 9]]], [[[10, 11, 12]]]]
-   * }
- * (3) For the following input of shape `[1, 4, 4, 1]`, `block_shape = [2, 2]`, and - * `paddings = [[0, 0], [0, 0]]`: - *
{@code
-   * x = [[[[1],   [2],  [3],  [4]],
-   *       [[5],   [6],  [7],  [8]],
-   *       [[9],  [10], [11],  [12]],
-   *       [[13], [14], [15],  [16]]]]
-   * }
- * The output tensor has shape `[4, 2, 2, 1]` and value: - *
{@code
-   * x = [[[[1], [3]], [[9], [11]]],
-   *      [[[2], [4]], [[10], [12]]],
-   *      [[[5], [7]], [[13], [15]]],
-   *      [[[6], [8]], [[14], [16]]]]
-   * }
- * (4) For the following input of shape `[2, 2, 4, 1]`, block_shape = `[2, 2]`, and - * paddings = `[[0, 0], [2, 0]]`: - *
{@code
-   * x = [[[[1],   [2],  [3],  [4]],
-   *       [[5],   [6],  [7],  [8]]],
-   *      [[[9],  [10], [11],  [12]],
-   *       [[13], [14], [15],  [16]]]]
-   * }
- * The output tensor has shape `[8, 1, 3, 1]` and value: - *
{@code
-   * 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]]]]
-   * }
- * Among others, this operation is useful for reducing atrous convolution into - * regular convolution. + * @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. + * @param paddings 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}. + * @param data type for {@code SpaceToBatchND} output and operands * @return a new instance of SpaceToBatchNd */ - @Endpoint(describeByClass = true) - public static SpaceToBatchNd create(Scope scope, Operand input, Operand blockShape, Operand paddings) { - OperationBuilder opBuilder = scope.env().opBuilder("SpaceToBatchND", scope.makeOpName("SpaceToBatchNd")); + @Endpoint( + describeByClass = true + ) + public static SpaceToBatchNd create(Scope scope, Operand input, + Operand blockShape, Operand paddings) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SpaceToBatchNd"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(blockShape.asOutput()); opBuilder.addInput(paddings.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SpaceToBatchNd(opBuilder.build()); + return new SpaceToBatchNd<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SpaceToBatchND"; - - private Output output; - - private SpaceToBatchNd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 d56a31b93e4..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,72 +20,114 @@ 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 `num_split` tensors along one dimension. - * - * @param data type for {@code output()} output + * Splits a tensor into {@code num_split} tensors along one dimension. */ +@OpMetadata( + opType = Split.OP_NAME, + inputsClass = Split.Inputs.class +) @Operator public final class Split extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Split"; + + private List> output; + + @SuppressWarnings("unchecked") + public Split(Operation operation) { + super(operation, OP_NAME); + 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 Split operation. - * + * * @param scope current scope * @param axis 0-D. The dimension along which to split. Must be in the range - * `[-rank(value), rank(value))`. + * {@code [-rank(value), rank(value))}. * @param value The tensor to split. * @param numSplit The number of ways to split. Must evenly divide - * `value.shape[split_dim]`. + * {@code value.shape[split_dim]}. + * @param data type for {@code Split} output and operands * @return a new instance of Split */ - @Endpoint(describeByClass = true) - public static Split create(Scope scope, Operand axis, Operand value, Long numSplit) { - OperationBuilder opBuilder = scope.env().opBuilder("Split", scope.makeOpName("Split")); + @Endpoint( + describeByClass = true + ) + public static Split create(Scope scope, Operand axis, + Operand value, Long numSplit) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Split"); opBuilder.addInput(axis.asOutput()); opBuilder.addInput(value.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_split", numSplit); - return new Split(opBuilder.build()); + return new Split<>(opBuilder.build()); } - + /** - * They are identically shaped tensors, whose shape matches that of `value` - * except along `axis`, where their sizes are - * `values.shape[split_dim] / num_split`. + * Gets output. + * They are identically shaped tensors, whose shape matches that of {@code value} + * except along {@code axis}, where their sizes are + * {@code values.shape[split_dim] / num_split}. + * @return output. */ public List> output() { return output; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) output.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Split"; - - private List> output; - - @SuppressWarnings("unchecked") - private Split(Operation operation) { - super(operation); - int outputIdx = 0; - int outputLength = operation.outputListLength("output"); - output = Arrays.asList((Output[])operation.outputList(outputIdx, outputLength)); - outputIdx += outputLength; + + @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 ee7dced8ee8..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,76 +20,132 @@ 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 `num_split` tensors along one dimension. - * - * @param data type for {@code output()} output + * Splits a tensor into {@code num_split} tensors along one dimension. */ +@OpMetadata( + opType = SplitV.OP_NAME, + inputsClass = SplitV.Inputs.class +) @Operator public final class SplitV extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SplitV"; + + private List> output; + + @SuppressWarnings("unchecked") + public SplitV(Operation operation) { + super(operation, OP_NAME); + 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 SplitV operation. - * + * * @param scope current scope * @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 - * `[-rank(value), rank(value))`. - * @param numSplit + * {@code [-rank(value), rank(value))}. + * @param numSplit The value of the numSplit attribute + * @param data type for {@code SplitV} output and operands * @return a new instance of SplitV */ - @Endpoint(describeByClass = true) - public static SplitV create(Scope scope, Operand value, Operand sizeSplits, Operand axis, Long numSplit) { - OperationBuilder opBuilder = scope.env().opBuilder("SplitV", scope.makeOpName("SplitV")); + @Endpoint( + describeByClass = true + ) + public static SplitV create(Scope scope, Operand value, + Operand sizeSplits, Operand axis, Long numSplit) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SplitV"); opBuilder.addInput(value.asOutput()); opBuilder.addInput(sizeSplits.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_split", numSplit); - return new SplitV(opBuilder.build()); + return new SplitV<>(opBuilder.build()); } - + /** - * Tensors whose shape matches that of `value` - * except along `axis`, where their sizes are - * `size_splits[i]`. + * Gets output. + * Tensors whose shape matches that of {@code value} + * except along {@code axis}, where their sizes are + * {@code size_splits[i]}. + * @return output. */ public List> output() { return output; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) output.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SplitV"; - - private List> output; - - @SuppressWarnings("unchecked") - private SplitV(Operation operation) { - super(operation); - int outputIdx = 0; - int outputLength = operation.outputListLength("output"); - output = Arrays.asList((Output[])operation.outputList(outputIdx, outputLength)); - outputIdx += outputLength; + + @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 bce8dad363e..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. @@ -17,120 +17,191 @@ 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.TType; /** * Removes dimensions of size 1 from the shape of a tensor. - *

- * Given a tensor `input`, this operation returns a tensor of the same type with + * Given a tensor {@code input}, this operation returns a tensor of the same type with * all dimensions of size 1 removed. If you don't want to remove all size 1 * dimensions, you can remove specific size 1 dimensions by specifying - * `axis`. - *

- * For example: - *

{@code
+ * {@code axis}.
+ * 

For example: + *

  * # 't' is a tensor of shape [1, 2, 1, 3, 1, 1]
- * shape(squeeze(t)) ==> [2, 3]
- * }
- * Or, to remove specific size 1 dimensions: - *
{@code
+ * shape(squeeze(t)) ==> [2, 3]
+ * 
+ *

Or, to remove specific size 1 dimensions: + *

  * # '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 + * shape(squeeze(t, [2, 4])) ==> [1, 2, 3, 1] + *
*/ +@OpMetadata( + opType = Squeeze.OP_NAME, + inputsClass = Squeeze.Inputs.class +) @Operator public final class Squeeze extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Squeeze} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param axis 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 `[-rank(input), rank(input))`. - */ - public Options axis(List axis) { - this.axis = axis; - return this; - } - - private List axis; - - private Options() { - } + public static final String OP_NAME = "Squeeze"; + + private Output output; + + public Squeeze(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Squeeze operation. - * + * * @param scope current scope - * @param input The `input` to squeeze. - * @param options carries optional attributes values + * @param input The {@code input} to squeeze. + * @param options carries optional attribute values + * @param data type for {@code Squeeze} output and operands * @return a new instance of Squeeze */ - @Endpoint(describeByClass = true) - public static Squeeze create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Squeeze", scope.makeOpName("Squeeze")); + @Endpoint( + describeByClass = true + ) + public static Squeeze create(Scope scope, Operand input, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Squeeze"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.axis != null) { - long[] axisArray = new long[opts.axis.size()]; - for (int i = 0; i < axisArray.length; ++i) { - axisArray[i] = opts.axis.get(i); + long[] squeezeDimsArray = new long[opts.axis.size()]; + for (int i = 0 ; i < squeezeDimsArray.length ; i++) { + squeezeDimsArray[i] = opts.axis.get(i); } - opBuilder.setAttr("squeeze_dims", axisArray); + opBuilder.setAttr("squeeze_dims", squeezeDimsArray); } } } - return new Squeeze(opBuilder.build()); + return new Squeeze<>(opBuilder.build()); } - + /** + * Sets the axis option. + * * @param axis 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 `[-rank(input), rank(input))`. + * be in the range {@code [-rank(input), rank(input))}. + * @return this Options instance. */ public static Options axis(List axis) { return new Options().axis(axis); } - + + /** + * Sets the axis option. + * + * @param axis 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))}. + * @return this Options instance. + */ + public static Options axis(Long... axis) { + return new Options().axis(axis); + } + /** - * Contains the same data as `input`, but has one or more dimensions of + * Gets output. + * Contains the same data as {@code input}, but has one or more dimensions of * size 1 removed. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Squeeze"; - - private Output output; - - private Squeeze(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Squeeze} + */ + public static class Options { + private List axis; + + private Options() { + } + + /** + * Sets the axis option. + * + * @param axis 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))}. + * @return this Options instance. + */ + public Options axis(List axis) { + this.axis = axis; + return this; + } + + /** + * Sets the axis option. + * + * @param axis 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))}. + * @return this Options instance. + */ + public Options axis(Long... axis) { + this.axis = Arrays.asList(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 3586ca71251..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,76 +17,76 @@ 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; /** - * Packs a list of `N` rank-`R` tensors into one rank-`(R+1)` tensor. - *

- * Packs the `N` tensors in `values` into a tensor with rank one higher than each - * tensor in `values`, by packing them along the `axis` dimension. - * Given a list of tensors of shape `(A, B, C)`; - *

- * if `axis == 0` then the `output` tensor will have the shape `(N, A, B, C)`. - * if `axis == 1` then the `output` tensor will have the shape `(A, N, B, C)`. + * Packs a list of {@code N} rank-{@code R} tensors into one rank-{@code (R+1)} tensor. + * Packs the {@code N} tensors in {@code values} into a tensor with rank one higher than each + * tensor in {@code values}, by packing them along the {@code axis} dimension. + * Given a list of tensors of shape {@code (A, B, C)}; + *

if {@code axis == 0} then the {@code output} tensor will have the shape {@code (N, A, B, C)}. + * if {@code axis == 1} then the {@code output} tensor will have the shape {@code (A, N, B, C)}. * Etc. - *

- * For example: - *

{@code
+ * 

For example: + *

  * # 'x' is [1, 4]
  * # 'y' is [2, 5]
  * # 'z' is [3, 6]
- * pack([x, y, z]) => [[1, 4], [2, 5], [3, 6]]  # Pack along first dim.
- * pack([x, y, z], axis=1) => [[1, 2, 3], [4, 5, 6]]
- * }
- * This is the opposite of `unpack`. - * - * @param data type for {@code output()} output + * pack([x, y, z]) => [[1, 4], [2, 5], [3, 6]] # Pack along first dim. + * pack([x, y, z], axis=1) => [[1, 2, 3], [4, 5, 6]] + *
+ *

This is the opposite of {@code unpack}. */ +@OpMetadata( + opType = Stack.OP_NAME, + inputsClass = Stack.Inputs.class +) @Operator public final class Stack extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Stack} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param axis Dimension along which to pack. Negative values wrap around, so the - * valid range is `[-(R+1), R+1)`. - */ - public Options axis(Long axis) { - this.axis = axis; - return this; - } - - private Long axis; - - private Options() { - } + public static final String OP_NAME = "Pack"; + + private Output output; + + public Stack(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Stack operation. - * + * Factory method to create a class wrapping a new Pack operation. + * * @param scope current scope * @param values Must be of same shape and type. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Pack} output and operands * @return a new instance of Stack */ - @Endpoint(describeByClass = true) - public static Stack create(Scope scope, Iterable> values, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Pack", scope.makeOpName("Stack")); + @Endpoint( + describeByClass = true + ) + public static Stack create(Scope scope, Iterable> values, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Stack"); opBuilder.addInputList(Operands.asOutputs(values)); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.axis != null) { @@ -94,37 +94,84 @@ public static Stack create(Scope scope, Iterable } } } - return new Stack(opBuilder.build()); + return new Stack<>(opBuilder.build()); } - + /** + * Sets the axis option. + * * @param axis Dimension along which to pack. Negative values wrap around, so the - * valid range is `[-(R+1), R+1)`. + * valid range is {@code [-(R+1), R+1)}. + * @return this Options instance. */ public static Options axis(Long axis) { return new Options().axis(axis); } - + /** + * Gets output. * The packed tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Pack"; - - private Output output; - - private Stack(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Stack} + */ + public static class Options { + private Long axis; + + private Options() { + } + + /** + * Sets the axis option. + * + * @param axis Dimension along which to pack. Negative values wrap around, so the + * valid range is {@code [-(R+1), R+1)}. + * @return this Options instance. + */ + public Options axis(Long axis) { + this.axis = 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 3925ec6313b..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,87 +17,56 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.Stage} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity Maximum number of elements in the Staging Area. If > 0, inserts - * on the container will block when the capacity is reached. - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit The maximum number of bytes allowed for Tensors in the Staging Area. - * If > 0, inserts will block until sufficient space is available. - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container If non-empty, this queue is placed in the given container. Otherwise, - * a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName It is necessary to match this name to the matching Unstage Op. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "Stage"; + + public Stage(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new Stage operation. - * + * * @param scope current scope * @param values a list of tensors * dtypes A list of data types that inserted values should adhere to. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Stage */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Stage create(Scope scope, Iterable> values, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Stage", scope.makeOpName("Stage")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Stage"); opBuilder.addInputList(Operands.asOutputs(values)); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.capacity != null) { @@ -116,42 +85,162 @@ public static Stage create(Scope scope, Iterable> values, Options... } return new Stage(opBuilder.build()); } - + /** - * @param capacity Maximum number of elements in the Staging Area. If > 0, inserts + * Sets the capacity option. + * + * @param capacity Maximum number of elements in the Staging Area. If > 0, inserts * on the container will block when the capacity is reached. + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** + * Sets the memoryLimit option. + * * @param memoryLimit The maximum number of bytes allowed for Tensors in the Staging Area. - * If > 0, inserts will block until sufficient space is available. + * If > 0, inserts will block until sufficient space is available. + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** + * Sets the container option. + * * @param container If non-empty, this queue is placed in the given container. Otherwise, * a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName It is necessary to match this name to the matching Unstage Op. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Stage"; - - private Stage(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Stage} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity Maximum number of elements in the Staging Area. If > 0, inserts + * on the container will block when the capacity is reached. + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit The maximum number of bytes allowed for Tensors in the Staging Area. + * If > 0, inserts will block until sufficient space is available. + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * Sets the container option. + * + * @param container If non-empty, this queue is placed in the given container. Otherwise, + * a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName It is necessary to match this name to the matching Unstage Op. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = 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 7be90432f6b..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,80 +17,54 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.StageClear} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "StageClear"; + + 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 - * @param options carries optional attributes values + * @param dtypes The value of the dtypes attribute + * @param options carries optional attribute values * @return a new instance of StageClear */ - @Endpoint(describeByClass = true) - public static StageClear create(Scope scope, List> dtypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("StageClear", scope.makeOpName("StageClear")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static StageClear create(Scope scope, List> dtypes, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StageClear"); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); if (options != null) { for (Options opts : options) { @@ -110,39 +84,144 @@ public static StageClear create(Scope scope, List> dtypes } return new StageClear(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StageClear"; - - private StageClear(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.StageClear} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * 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; + } + } + + @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 eb6e6dde91c..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,88 +20,67 @@ 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 peeks at the values at the specified index. If the - *

* underlying container does not contain sufficient elements * 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> { - /** - * Optional attributes for {@link org.tensorflow.op.core.StagePeek} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "StagePeek"; + + private List> values; + + @SuppressWarnings("unchecked") + public StagePeek(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int valuesLength = operation.outputListLength("values"); + values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); + outputIdx += valuesLength; } - + /** * Factory method to create a class wrapping a new StagePeek operation. - * + * * @param scope current scope - * @param index - * @param dtypes - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static StagePeek create(Scope scope, Operand index, List> dtypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("StagePeek", scope.makeOpName("StagePeek")); + @Endpoint( + describeByClass = true + ) + public static StagePeek create(Scope scope, Operand index, + List> dtypes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StagePeek"); opBuilder.addInput(index.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); if (options != null) { for (Options opts : options) { @@ -121,57 +100,165 @@ public static StagePeek create(Scope scope, Operand index, List> values() { return values; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) values.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StagePeek"; - - private List> values; - - private StagePeek(Operation operation) { - super(operation); - int outputIdx = 0; - int valuesLength = operation.outputListLength("values"); - values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); - outputIdx += valuesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.core.StagePeek} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * 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; + } + } + + @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 c70660c2071..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,83 +17,61 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.StageSize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "StageSize"; + + private Output output; + + public StageSize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new StageSize operation. - * + * * @param scope current scope - * @param dtypes - * @param options carries optional attributes values + * @param dtypes The value of the dtypes attribute + * @param options carries optional attribute values * @return a new instance of StageSize */ - @Endpoint(describeByClass = true) - public static StageSize create(Scope scope, List> dtypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("StageSize", scope.makeOpName("StageSize")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static StageSize create(Scope scope, List> dtypes, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StageSize"); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); if (options != null) { for (Options opts : options) { @@ -113,54 +91,158 @@ public static StageSize create(Scope scope, List> dtypes, } return new StageSize(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * 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 output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StageSize"; - - private Output output; - - private StageSize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.StageSize} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * 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; + } + } + + @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 new file mode 100644 index 00000000000..97e4aa05449 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulCase.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.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.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; + +/** + * 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;
+ * }
+ * ```
+ * 
+ */ +@OpMetadata( + opType = StatefulCase.OP_NAME, + inputsClass = StatefulCase.Inputs.class +) +@Operator +public final class StatefulCase extends RawOp implements Case { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Case"; + + private List> output; + + @SuppressWarnings("unchecked") + public StatefulCase(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 Case operation. + * + * @param scope current scope + * @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 StatefulCase + */ + @Endpoint( + describeByClass = true + ) + public static StatefulCase create(Scope scope, Operand branchIndex, + Iterable> input, List> Tout, + List branches, Case.Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatefulCase"); + opBuilder.addInput(branchIndex.asOutput()); + opBuilder.addInputList(Operands.asOutputs(input)); + opBuilder.setAttr("Tout", Operands.toDataTypes(Tout)); + ConcreteFunction[] branchesArray = new ConcreteFunction[branches.size()]; + for (int i = 0 ; i < branchesArray.length ; i++) { + branchesArray[i] = branches.get(i); + } + opBuilder.setAttr("branches", branchesArray); + if (options != null) { + for (Case.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); + } + } + } + return new StatefulCase(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(); + } + + @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 new file mode 100644 index 00000000000..b920fe2da46 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulIf.java @@ -0,0 +1,187 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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; + +/** + * 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 { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "If"; + + private List> output; + + @SuppressWarnings("unchecked") + public StatefulIf(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 If operation. + * + * @param scope current scope + * @param cond
+   *   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.
+   * 
+ * @param input A list of input tensors. + * @param Tout A list of output types. + * @param thenBranch
+   *   A function that takes 'inputs' and returns a list of tensors, whose
+   *   types are the same as what else_branch returns.
+   * 
+ * @param elseBranch
+   * A function that takes 'inputs' and returns a list of tensors, whose
+   * types are the same as what then_branch returns.
+   * 
+ * @param options carries optional attribute values + * @return a new instance of StatefulIf + */ + @Endpoint( + describeByClass = true + ) + public static StatefulIf create(Scope scope, Operand cond, + Iterable> input, List> Tout, ConcreteFunction thenBranch, + ConcreteFunction elseBranch, If.Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatefulIf"); + opBuilder.addInput(cond.asOutput()); + opBuilder.addInputList(Operands.asOutputs(input)); + opBuilder.setAttr("Tout", Operands.toDataTypes(Tout)); + opBuilder.setAttr("then_branch", thenBranch); + opBuilder.setAttr("else_branch", elseBranch); + if (options != null) { + for (If.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); + } + } + } + return new StatefulIf(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(); + } + + @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 new file mode 100644 index 00000000000..ca19af055db --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulPartitionedCall.java @@ -0,0 +1,245 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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 Iterable> { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatefulPartitionedCall"; + + private List> output; + + @SuppressWarnings("unchecked") + public StatefulPartitionedCall(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 StatefulPartitionedCall 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. This op is
+   *   stateful.
+   * 
+ * @param options carries optional attribute values + * @return a new instance of StatefulPartitionedCall + */ + @Endpoint( + describeByClass = true + ) + public static StatefulPartitionedCall create(Scope scope, Iterable> args, + 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 (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 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. + */ + public List> output() { + return output; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + 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 new file mode 100644 index 00000000000..afc78346a40 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulWhile.java @@ -0,0 +1,165 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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; + +/** + * 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 { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "While"; + + private List> output; + + @SuppressWarnings("unchecked") + public StatefulWhile(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 While 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.
+   * 
+ * @param options carries optional attribute values + * @return a new instance of StatefulWhile + */ + @Endpoint( + describeByClass = true + ) + public static StatefulWhile create(Scope scope, Iterable> input, ConcreteFunction cond, + ConcreteFunction body, While.Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatefulWhile"); + opBuilder.addInputList(Operands.asOutputs(input)); + opBuilder.setAttr("cond", cond); + opBuilder.setAttr("body", body); + if (options != null) { + for (While.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 StatefulWhile(opBuilder.build()); + } + + /** + * Gets output. + * A list of output tensors whose types are T. + * @return output. + */ + @Override + public List> output() { + return output; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + 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 new file mode 100644 index 00000000000..915d6908936 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatelessCase.java @@ -0,0 +1,187 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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.TInt32; +import org.tensorflow.types.family.TType; + +/** + * 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.
+ * 
+ */ +@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 + */ + public static final String OP_NAME = "StatelessCase"; + + private List> output; + + @SuppressWarnings("unchecked") + public StatelessCase(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 StatelessCase operation. + * + * @param scope current scope + * @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 + */ + @Endpoint( + describeByClass = true + ) + public static StatelessCase create(Scope scope, Operand branchIndex, + Iterable> input, List> Tout, + List branches, Case.Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessCase"); + opBuilder.addInput(branchIndex.asOutput()); + opBuilder.addInputList(Operands.asOutputs(input)); + opBuilder.setAttr("Tout", Operands.toDataTypes(Tout)); + ConcreteFunction[] branchesArray = new ConcreteFunction[branches.size()]; + for (int i = 0 ; i < branchesArray.length ; i++) { + branchesArray[i] = branches.get(i); + } + opBuilder.setAttr("branches", branchesArray); + if (options != null) { + for (Case.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); + } + } + } + return new StatelessCase(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(); + } + + @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 new file mode 100644 index 00000000000..898516ff813 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatelessIf.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.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.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 { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessIf"; + + private List> output; + + @SuppressWarnings("unchecked") + public StatelessIf(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 StatelessIf operation. + * + * @param scope current scope + * @param cond
+   *   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.
+   * 
+ * @param input A list of input tensors. + * @param Tout A list of output types. + * @param thenBranch
+   *   A function that takes 'inputs' and returns a list of tensors, whose
+   *   types are the same as what else_branch returns.
+   * 
+ * @param elseBranch
+   * A function that takes 'inputs' and returns a list of tensors, whose
+   * types are the same as what then_branch returns.
+   * 
+ * @param options carries optional attribute values + * @return a new instance of StatelessIf + */ + @Endpoint( + describeByClass = true + ) + public static StatelessIf create(Scope scope, Operand cond, + Iterable> input, List> Tout, ConcreteFunction thenBranch, + ConcreteFunction elseBranch, If.Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessIf"); + opBuilder.addInput(cond.asOutput()); + opBuilder.addInputList(Operands.asOutputs(input)); + opBuilder.setAttr("Tout", Operands.toDataTypes(Tout)); + opBuilder.setAttr("then_branch", thenBranch); + opBuilder.setAttr("else_branch", elseBranch); + if (options != null) { + for (If.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); + } + } + } + return new StatelessIf(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(); + } + + @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/StatelessWhile.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatelessWhile.java new file mode 100644 index 00000000000..cad5b32e302 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatelessWhile.java @@ -0,0 +1,168 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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; + +/** + * 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 { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessWhile"; + + private List> output; + + @SuppressWarnings("unchecked") + public StatelessWhile(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 StatelessWhile 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.
+   *
+   *   This should only be used when the while condition and body functions
+   *   do not have stateful ops.
+   * 
+ * @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.
+   * 
+ * @param options carries optional attribute values + * @return a new instance of StatelessWhile + */ + @Endpoint( + describeByClass = true + ) + public static StatelessWhile create(Scope scope, Iterable> input, + ConcreteFunction cond, ConcreteFunction body, While.Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessWhile"); + opBuilder.addInputList(Operands.asOutputs(input)); + opBuilder.setAttr("cond", cond); + opBuilder.setAttr("body", body); + if (options != null) { + for (While.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 StatelessWhile(opBuilder.build()); + } + + /** + * Gets output. + * A list of output tensors whose types are T. + * @return output. + */ + @Override + public List> output() { + return output; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + 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 e4e8ac9bd46..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,83 +17,144 @@ 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; /** * Stops gradient computation. - *

* When executed in a graph, this op outputs its input tensor as-is. - *

- * When building ops to compute gradients, this op prevents the contribution of + *

When building ops to compute gradients, this op prevents the contribution of * its inputs to be taken into account. Normally, the gradient generator adds ops * to a graph to compute the derivatives of a specified 'loss' by recursively * finding out inputs that contributed to its computation. If you insert this op * in the graph it inputs are masked from the gradient generator. They are not * taken into account for computing gradients. - *

- * This is useful any time you want to compute a value with TensorFlow but need - * to pretend that the value was a constant. Some examples include: + *

This is useful any time you want to compute a value with TensorFlow but need + * to pretend that the value was a constant. For example, the softmax function + * for a vector x can be written as + *

+ *
+ *   def softmax(x):
+ *     numerator = tf.exp(x)
+ *     denominator = tf.reduce_sum(numerator)
+ *     return numerator / denominator
+ * 
+ *

This however is susceptible to overflow if the values in x are large. An + * alternative more stable way is to subtract the maximum of x from each of the + * values. + *

+ *
+ *   def stable_softmax(x):
+ *     z = x - tf.reduce_max(x)
+ *     numerator = tf.exp(z)
+ *     denominator = tf.reduce_sum(numerator)
+ *     return numerator / denominator
+ * 
+ *

However, when we backprop through the softmax to x, we dont want to backprop + * through the {@code tf.reduce_max(x)} (if the max values are not unique then the + * gradient could flow to the wrong input) calculation and treat that as a + * constant. Therefore, we should write this out as + *

+ *
+ *   def stable_softmax(x):
+ *     z = x - tf.stop_gradient(tf.reduce_max(x))
+ *     numerator = tf.exp(z)
+ *     denominator = tf.reduce_sum(numerator)
+ *     return numerator / denominator
+ * 
+ *

Some other examples include: *

    - *
  • - * The EM algorithm where the M-step should not involve backpropagation - * through the output of the E-step. - *
  • - *
  • - * Contrastive divergence training of Boltzmann machines where, when - * differentiating the energy function, the training must not backpropagate - * through the graph that generated the samples from the model. - *
  • - *
  • - * Adversarial training, where no backprop should happen through the adversarial - * example generation process. - * - * @param data type for {@code output()} output + *
  • The EM algorithm where the M-step should not involve backpropagation + * through the output of the E-step.
  • + *
  • Contrastive divergence training of Boltzmann machines where, when + * differentiating the energy function, the training must not backpropagate + * through the graph that generated the samples from the model.
  • + *
  • Adversarial training, where no backprop should happen through the adversarial + * example generation process.
  • + *
*/ +@OpMetadata( + opType = StopGradient.OP_NAME, + inputsClass = StopGradient.Inputs.class +) @Operator public final class StopGradient extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StopGradient"; + + private Output output; + + public StopGradient(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StopGradient operation. - * + * * @param scope current scope - * @param input + * @param input The input value + * @param data type for {@code StopGradient} output and operands * @return a new instance of StopGradient */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static StopGradient create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("StopGradient", scope.makeOpName("StopGradient")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StopGradient"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new StopGradient(opBuilder.build()); + return new StopGradient<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StopGradient"; - - private Output output; - - private StopGradient(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 2e1cc56828b..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,210 +17,174 @@ 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; /** - * Return a strided slice from `input`. - *

- * Note, most python users will want to use the Python `Tensor.__getitem__` - * or `Variable.__getitem__` rather than this op directly. - *

- * 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 + * Return a strided slice from {@code input}. + * Note, most python users will want to use the Python {@code Tensor.__getitem__} + * or {@code Variable.__getitem__} rather than this op directly. + *

The goal of this op is to produce a new tensor with a subset of + * the elements from the {@code n} dimensional {@code input} tensor. The subset is chosen using + * a sequence of {@code 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 + * {@code m} could be equal to {@code n}, but this need not be the case. Each * range specification entry can be one of the following: - *

- * - An ellipsis (...). Ellipses are used to imply zero or more - * dimensions of full-dimension selection and are produced using - * `ellipsis_mask`. For example, `foo[...]` is the identity slice. - *

- * - A new axis. This is used to insert a new shape=1 dimension and is - * produced using `new_axis_mask`. For example, `foo[:, ...]` where - * `foo` is shape `(3, 4)` produces a `(1, 3, 4)` tensor. - *

- * - A range `begin:end:stride`. This is used to specify how much to choose from - * a given dimension. `stride` can be any integer but 0. `begin` is an integer - * which represents the index of the first value to select while `end` represents - * the index of the last value to select. The number of values selected in each - * dimension is `end - begin` if `stride > 0` and `begin - end` if `stride < 0`. - * `begin` and `end` can be negative where `-1` is the last element, `-2` is - * the second to last. `begin_mask` controls whether to replace the explicitly - * given `begin` with an implicit effective value of `0` if `stride > 0` and - * `-1` if `stride < 0`. `end_mask` is analogous but produces the number - * required to create the largest open interval. For example, given a shape - * `(3,)` tensor `foo[:]`, the effective `begin` and `end` are `0` and `3`. Do - * not assume this is equivalent to `foo[0:-1]` which has an effective `begin` - * and `end` of `0` and `2`. Another example is `foo[-2::-1]` which reverses the - * first dimension of a tensor while dropping the last two (in the original - * order elements). For example `foo = [1,2,3,4]; foo[-2::-1]` is `[4,3]`. - *

- * - A single index. This is used to keep only elements that have a given - * index. For example (`foo[2, :]` on a shape `(5,6)` tensor produces a - * shape `(6,)` tensor. This is encoded in `begin` and `end` and - * `shrink_axis_mask`. - *

- * Each conceptual range specification is encoded in the op's argument. This + *

    + *
  • + *

    An ellipsis (...). Ellipses are used to imply zero or more + * dimensions of full-dimension selection and are produced using + * {@code ellipsis_mask}. For example, {@code foo[...]} is the identity slice. + *

  • + *
  • + *

    A new axis. This is used to insert a new shape=1 dimension and is + * produced using {@code new_axis_mask}. For example, {@code foo[:, ...]} where + * {@code foo} is shape {@code (3, 4)} produces a {@code (1, 3, 4)} tensor. + *

  • + *
  • + *

    A range {@code begin:end:stride}. 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. 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. {@code begin_mask} controls whether to replace the explicitly + * given {@code begin} with an implicit effective value of {@code 0} if {@code stride > 0} and + * {@code -1} if {@code stride < 0}. {@code end_mask} is analogous but produces the number + * required to create the largest open interval. For example, given a shape + * {@code (3,)} tensor {@code foo[:]}, the effective {@code begin} and {@code end} are {@code 0} and {@code 3}. Do + * not assume this is equivalent to {@code foo[0:-1]} which has an effective {@code begin} + * and {@code end} of {@code 0} and {@code 2}. Another example is {@code foo[-2::-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]; foo[-2::-1]} is {@code [4,3]}. + *

  • + *
  • + *

    A single index. This is used to keep only elements that have a given + * index. For example ({@code foo[2, :]} on a shape {@code (5,6)} tensor produces a + * shape {@code (6,)} tensor. This is encoded in {@code begin} and {@code end} and + * {@code shrink_axis_mask}. + *

  • + *
+ *

Each conceptual range specification is encoded in the op's argument. This * encoding is best understand by considering a non-trivial example. In * particular, - * `foo[1, 2:4, None, ..., :-3:-1, :]` will be encoded as - *

{@code
+ * {@code foo[1, 2:4, None, ..., :-3:-1, :]} will be encoded as
+ * 
  * begin = [1, 2, x, x, 0, x] # x denotes don't care (usually 0)
  * end = [2, 4, x, x, -3, x]
  * strides = [1, 1, x, x, -1, 1]
- * begin_mask = 1<<4 | 1<<5 = 48
- * end_mask = 1<<5 = 32
- * ellipsis_mask = 1<<3 = 8
- * new_axis_mask = 1<<2 = 4
- * shrink_axis_mask = 1<<0 = 1
- * }
- * In this case if `foo.shape` is (5, 5, 5, 5, 5, 5) the final shape of + * begin_mask = 1<<4 | 1<<5 = 48 + * end_mask = 1<<5 = 32 + * ellipsis_mask = 1<<3 = 8 + * new_axis_mask = 1<<2 = 4 + * shrink_axis_mask = 1<<0 = 1 + *
+ *

In this case if {@code foo.shape} is (5, 5, 5, 5, 5, 5) the final shape of * the slice becomes (2, 1, 5, 5, 2, 5). * Let us walk step by step through each argument specification. - *

- * 1. The first argument in the example slice is turned into `begin = 1` and - * `end = begin + 1 = 2`. To disambiguate from the original spec `2:4` we - * also set the appropriate bit in `shrink_axis_mask`. - *

- * 2. `2:4` is contributes 2, 4, 1 to begin, end, and stride. All masks have + *

    + *
  1. + *

    The first argument in the example slice is turned into {@code begin = 1} and + * {@code end = begin + 1 = 2}. To disambiguate from the original spec {@code 2:4} we + * also set the appropriate bit in {@code shrink_axis_mask}. + *

  2. + *
  3. + *

    {@code 2:4} is contributes 2, 4, 1 to begin, end, and stride. All masks have * zero bits contributed. - *

    - * 3. None is a synonym for `tf.newaxis`. This means insert a dimension of size 1 + *

  4. + *
  5. + *

    None is a synonym for {@code tf.newaxis}. This means insert a dimension of size 1 * dimension in the final shape. Dummy values are contributed to begin, * end and stride, while the new_axis_mask bit is set. - *

    - * 4. `...` grab the full ranges from as many dimensions as needed to + *

  6. + *
  7. + *

    {@code ...} grab the full ranges from as many dimensions as needed to * fully specify a slice for every dimension of the input shape. - *

    - * 5. `:-3:-1` shows the use of negative indices. A negative index `i` associated - * with a dimension that has shape `s` is converted to a positive index - * `s + i`. So `-1` becomes `s-1` (i.e. the last element). This conversion + *

  8. + *
  9. + *

    {@code :-3:-1} shows the use of negative indices. A negative index {@code i} associated + * with a dimension that has shape {@code s} is converted to a positive index + * {@code s + i}. So {@code -1} becomes {@code s-1} (i.e. the last element). This conversion * is done internally so begin, end and strides receive x, -3, and -1. * The appropriate begin_mask bit is set to indicate the start range is the * full range (ignoring the x). - *

    - * 6. `:` indicates that the entire contents of the corresponding dimension - * is selected. This is equivalent to `::` or `0::1`. begin, end, and strides - * receive 0, 0, and 1, respectively. The appropriate bits in `begin_mask` and - * `end_mask` are also set. - *

    - * Requirements: - * `0 != strides[i] for i in [0, m)` - * `ellipsis_mask must be a power of two (only one ellipsis)` - * - * @param data type for {@code output()} output + *

  10. + *
  11. + *

    {@code :} indicates that the entire contents of the corresponding dimension + * is selected. This is equivalent to {@code ::} or {@code 0::1}. begin, end, and strides + * receive 0, 0, and 1, respectively. The appropriate bits in {@code begin_mask} and + * {@code end_mask} are also set. + *

  12. + *
+ *

Requirements: + * {@code 0 != strides[i] for i in [0, m)} + * {@code ellipsis_mask must be a power of two (only one ellipsis)} */ +@OpMetadata( + opType = StridedSlice.OP_NAME, + inputsClass = StridedSlice.Inputs.class +) @Operator public final class StridedSlice extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.StridedSlice} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param beginMask 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 `[0, n-1)` if `stride[i] > 0` or - * `[-1, n-1]` if `stride[i] < 0` - */ - public Options beginMask(Long beginMask) { - this.beginMask = beginMask; - return this; - } - - /** - * @param endMask analogous to `begin_mask` - */ - public Options endMask(Long endMask) { - this.endMask = endMask; - return this; - } - - /** - * @param ellipsisMask a bitmask where bit `i` being 1 means the `i`th - * position is actually an ellipsis. One bit at most can be 1. - * If `ellipsis_mask == 0`, then an implicit ellipsis mask of `1 << (m+1)` - * is provided. This means that `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 `foo` the slice `foo[2, ..., 5:8]` implies `foo[2, :, :, 5:8]`. - */ - public Options ellipsisMask(Long ellipsisMask) { - this.ellipsisMask = ellipsisMask; - return this; - } - - /** - * @param newAxisMask a bitmask where bit `i` being 1 means the `i`th - * specification creates a new shape 1 dimension. For example - * `foo[:4, tf.newaxis, :2]` would produce a shape `(4, 1, 2)` tensor. - */ - public Options newAxisMask(Long newAxisMask) { - this.newAxisMask = newAxisMask; - return this; - } - - /** - * @param shrinkAxisMask a bitmask where bit `i` implies that the `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 `foo[:, 3, :]` which would result in - * `shrink_axis_mask` being 2. - */ - public Options shrinkAxisMask(Long shrinkAxisMask) { - this.shrinkAxisMask = shrinkAxisMask; - return this; - } - - private Long beginMask; - private Long endMask; - private Long ellipsisMask; - private Long newAxisMask; - private Long shrinkAxisMask; - - private Options() { - } + public static final String OP_NAME = "StridedSlice"; + + private Output output; + + public StridedSlice(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new StridedSlice operation. - * + * * @param scope current scope - * @param input - * @param begin `begin[k]` specifies the offset into the `k`th range specification. + * @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 `k`th bit of - * `begin_mask` then `begin[k]` is ignored and the full range of the + * 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 `foo==[1,2,3]` then `foo[-1]==3`. - * @param end `end[i]` is like `begin` with the exception that `end_mask` is + * to start from the highest element e.g. If {@code foo==[1,2,3]} then {@code foo[-1]==3}. + * @param end {@code end[i]} is like {@code begin} with the exception that {@code end_mask} is * used to determine full ranges. - * @param strides `strides[i]` specifies the increment in the `i`th specification + * @param strides {@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 `[0,dim[i]) if slice[i]>0` or `[-1,dim[i]-1] if slice[i] < 0` - * @param options carries optional attributes values + * clamped to {@code [0,dim[i]) if slice[i]>0} or {@code [-1,dim[i]-1] if slice[i] < 0} + * @param options carries optional attribute values + * @param data type for {@code StridedSlice} output and operands + * @param data type for {@code StridedSlice} output and operands * @return a new instance of StridedSlice */ - @Endpoint(describeByClass = true) - public static StridedSlice create(Scope scope, Operand input, Operand begin, Operand end, Operand strides, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("StridedSlice", scope.makeOpName("StridedSlice")); + @Endpoint( + describeByClass = true + ) + public static StridedSlice create(Scope scope, + Operand input, Operand begin, Operand end, Operand strides, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StridedSlice"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(begin.asOutput()); opBuilder.addInput(end.asOutput()); opBuilder.addInput(strides.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.beginMask != null) { @@ -240,78 +204,273 @@ public static StridedSlice create(Scope } } } - return new StridedSlice(opBuilder.build()); + return new StridedSlice<>(opBuilder.build()); } - + /** + * Sets the beginMask option. + * * @param beginMask 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 `[0, n-1)` if `stride[i] > 0` or - * `[-1, n-1]` if `stride[i] < 0` + * 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} + * @return this Options instance. */ public static Options beginMask(Long beginMask) { return new Options().beginMask(beginMask); } - + /** - * @param endMask analogous to `begin_mask` + * Sets the endMask option. + * + * @param endMask analogous to {@code begin_mask} + * @return this Options instance. */ public static Options endMask(Long endMask) { return new Options().endMask(endMask); } - + /** - * @param ellipsisMask a bitmask where bit `i` being 1 means the `i`th + * Sets the ellipsisMask option. + * + * @param ellipsisMask 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 `ellipsis_mask == 0`, then an implicit ellipsis mask of `1 << (m+1)` - * is provided. This means that `foo[3:5] == foo[3:5, ...]`. An ellipsis + * 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 `foo` the slice `foo[2, ..., 5:8]` implies `foo[2, :, :, 5:8]`. + * tensor {@code foo} the slice {@code foo[2, ..., 5:8]} implies {@code foo[2, :, :, 5:8]}. + * @return this Options instance. */ public static Options ellipsisMask(Long ellipsisMask) { return new Options().ellipsisMask(ellipsisMask); } - + /** - * @param newAxisMask a bitmask where bit `i` being 1 means the `i`th + * Sets the newAxisMask option. + * + * @param newAxisMask a bitmask where bit {@code i} being 1 means the {@code i}th * specification creates a new shape 1 dimension. For example - * `foo[:4, tf.newaxis, :2]` would produce a shape `(4, 1, 2)` tensor. + * {@code foo[:4, tf.newaxis, :2]} would produce a shape {@code (4, 1, 2)} tensor. + * @return this Options instance. */ public static Options newAxisMask(Long newAxisMask) { return new Options().newAxisMask(newAxisMask); } - + /** - * @param shrinkAxisMask a bitmask where bit `i` implies that the `i`th + * Sets the shrinkAxisMask option. + * + * @param shrinkAxisMask 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 `foo[:, 3, :]` which would result in - * `shrink_axis_mask` being 2. + * python one might do {@code foo[:, 3, :]} which would result in + * {@code shrink_axis_mask} being 2. + * @return this Options instance. */ public static Options shrinkAxisMask(Long shrinkAxisMask) { return new Options().shrinkAxisMask(shrinkAxisMask); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StridedSlice"; - - private Output output; - - private StridedSlice(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.StridedSlice} + */ + public static class Options { + private Long beginMask; + + private Long endMask; + + private Long ellipsisMask; + + private Long newAxisMask; + + private Long shrinkAxisMask; + + private Options() { + } + + /** + * Sets the beginMask option. + * + * @param beginMask 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} + * @return this Options instance. + */ + public Options beginMask(Long beginMask) { + this.beginMask = beginMask; + return this; + } + + /** + * Sets the endMask option. + * + * @param endMask analogous to {@code begin_mask} + * @return this Options instance. + */ + public Options endMask(Long endMask) { + this.endMask = endMask; + return this; + } + + /** + * Sets the ellipsisMask option. + * + * @param ellipsisMask 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]}. + * @return this Options instance. + */ + public Options ellipsisMask(Long ellipsisMask) { + this.ellipsisMask = ellipsisMask; + return this; + } + + /** + * Sets the newAxisMask option. + * + * @param newAxisMask 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. + * @return this Options instance. + */ + public Options newAxisMask(Long newAxisMask) { + this.newAxisMask = newAxisMask; + return this; + } + + /** + * Sets the shrinkAxisMask option. + * + * @param shrinkAxisMask 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. + * @return this Options instance. + */ + public Options shrinkAxisMask(Long shrinkAxisMask) { + this.shrinkAxisMask = 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 f3662beb353..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,108 +17,76 @@ 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; /** - * 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`. - * - * @param data type for {@code outputRef()} output + * Assign {@code value} to the sliced l-value reference of {@code ref}. + * The values of {@code value} are assigned to the positions in the variable + * {@code ref} that are selected by the slice parameters. The slice parameters + * {@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}. */ +@OpMetadata( + opType = StridedSliceAssign.OP_NAME, + inputsClass = StridedSliceAssign.Inputs.class +) @Operator public final class StridedSliceAssign extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.StridedSliceAssign} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param beginMask - */ - public Options beginMask(Long beginMask) { - this.beginMask = beginMask; - return this; - } - - /** - * @param endMask - */ - public Options endMask(Long endMask) { - this.endMask = endMask; - return this; - } - - /** - * @param ellipsisMask - */ - public Options ellipsisMask(Long ellipsisMask) { - this.ellipsisMask = ellipsisMask; - return this; - } - - /** - * @param newAxisMask - */ - public Options newAxisMask(Long newAxisMask) { - this.newAxisMask = newAxisMask; - return this; - } - - /** - * @param shrinkAxisMask - */ - public Options shrinkAxisMask(Long shrinkAxisMask) { - this.shrinkAxisMask = shrinkAxisMask; - return this; - } - - private Long beginMask; - private Long endMask; - private Long ellipsisMask; - private Long newAxisMask; - private Long shrinkAxisMask; - - private Options() { - } + public static final String OP_NAME = "StridedSliceAssign"; + + private Output outputRef; + + public StridedSliceAssign(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new StridedSliceAssign operation. - * + * * @param scope current scope - * @param ref - * @param begin - * @param end - * @param strides - * @param value - * @param options carries optional attributes values + * @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 * @return a new instance of StridedSliceAssign */ - @Endpoint(describeByClass = true) - public static StridedSliceAssign create(Scope scope, Operand ref, Operand begin, Operand end, Operand strides, Operand value, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("StridedSliceAssign", scope.makeOpName("StridedSliceAssign")); + @Endpoint( + describeByClass = true + ) + public static StridedSliceAssign create(Scope scope, + Operand ref, Operand begin, Operand end, Operand strides, Operand value, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StridedSliceAssign"); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(begin.asOutput()); opBuilder.addInput(end.asOutput()); opBuilder.addInput(strides.asOutput()); opBuilder.addInput(value.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.beginMask != null) { @@ -138,63 +106,225 @@ public static StridedSliceAssign create( } } } - return new StridedSliceAssign(opBuilder.build()); + return new StridedSliceAssign<>(opBuilder.build()); } - + /** - * @param beginMask + * Sets the beginMask option. + * + * @param beginMask the beginMask option + * @return this Options instance. */ public static Options beginMask(Long beginMask) { return new Options().beginMask(beginMask); } - + /** - * @param endMask + * Sets the endMask option. + * + * @param endMask the endMask option + * @return this Options instance. */ public static Options endMask(Long endMask) { return new Options().endMask(endMask); } - + /** - * @param ellipsisMask + * Sets the ellipsisMask option. + * + * @param ellipsisMask the ellipsisMask option + * @return this Options instance. */ public static Options ellipsisMask(Long ellipsisMask) { return new Options().ellipsisMask(ellipsisMask); } - + /** - * @param newAxisMask + * Sets the newAxisMask option. + * + * @param newAxisMask the newAxisMask option + * @return this Options instance. */ public static Options newAxisMask(Long newAxisMask) { return new Options().newAxisMask(newAxisMask); } - + /** - * @param shrinkAxisMask + * Sets the shrinkAxisMask option. + * + * @param shrinkAxisMask the shrinkAxisMask option + * @return this Options instance. */ public static Options shrinkAxisMask(Long shrinkAxisMask) { return new Options().shrinkAxisMask(shrinkAxisMask); } - + /** + * Gets outputRef. + * + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StridedSliceAssign"; - - private Output outputRef; - - private StridedSliceAssign(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.StridedSliceAssign} + */ + public static class Options { + private Long beginMask; + + private Long endMask; + + private Long ellipsisMask; + + private Long newAxisMask; + + private Long shrinkAxisMask; + + private Options() { + } + + /** + * Sets the beginMask option. + * + * @param beginMask the beginMask option + * @return this Options instance. + */ + public Options beginMask(Long beginMask) { + this.beginMask = beginMask; + return this; + } + + /** + * Sets the endMask option. + * + * @param endMask the endMask option + * @return this Options instance. + */ + public Options endMask(Long endMask) { + this.endMask = endMask; + return this; + } + + /** + * Sets the ellipsisMask option. + * + * @param ellipsisMask the ellipsisMask option + * @return this Options instance. + */ + public Options ellipsisMask(Long ellipsisMask) { + this.ellipsisMask = ellipsisMask; + return this; + } + + /** + * Sets the newAxisMask option. + * + * @param newAxisMask the newAxisMask option + * @return this Options instance. + */ + public Options newAxisMask(Long newAxisMask) { + this.newAxisMask = newAxisMask; + return this; + } + + /** + * Sets the shrinkAxisMask option. + * + * @param shrinkAxisMask the shrinkAxisMask option + * @return this Options instance. + */ + public Options shrinkAxisMask(Long shrinkAxisMask) { + this.shrinkAxisMask = 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 d9559f48eb1..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,110 +17,78 @@ 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; /** - * Returns the gradient of `StridedSlice`. - *

- * Since `StridedSlice` cuts out pieces of its `input` which is size - * `shape`, its gradient will have the same shape (which is passed here - * as `shape`). The gradient will be zero in any element that the slice + * Returns the gradient of {@code StridedSlice}. + * Since {@code StridedSlice} cuts out pieces of its {@code input} which is size + * {@code shape}, its gradient will have the same shape (which is passed here + * as {@code shape}). The gradient will be zero in any element that the slice * does not select. - *

- * Arguments are the same as StridedSliceGrad with the exception that - * `dy` is the input gradient to be propagated and `shape` is the - * shape of `StridedSlice`'s `input`. - * - * @param data type for {@code output()} output + *

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}. */ +@OpMetadata( + opType = StridedSliceGrad.OP_NAME, + inputsClass = StridedSliceGrad.Inputs.class +) @Operator public final class StridedSliceGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.StridedSliceGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param beginMask - */ - public Options beginMask(Long beginMask) { - this.beginMask = beginMask; - return this; - } - - /** - * @param endMask - */ - public Options endMask(Long endMask) { - this.endMask = endMask; - return this; - } - - /** - * @param ellipsisMask - */ - public Options ellipsisMask(Long ellipsisMask) { - this.ellipsisMask = ellipsisMask; - return this; - } - - /** - * @param newAxisMask - */ - public Options newAxisMask(Long newAxisMask) { - this.newAxisMask = newAxisMask; - return this; - } - - /** - * @param shrinkAxisMask - */ - public Options shrinkAxisMask(Long shrinkAxisMask) { - this.shrinkAxisMask = shrinkAxisMask; - return this; - } - - private Long beginMask; - private Long endMask; - private Long ellipsisMask; - private Long newAxisMask; - private Long shrinkAxisMask; - - private Options() { - } + public static final String OP_NAME = "StridedSliceGrad"; + + private Output output; + + public StridedSliceGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new StridedSliceGrad operation. - * + * * @param scope current scope - * @param shape - * @param begin - * @param end - * @param strides - * @param dy - * @param options carries optional attributes values + * @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 * @return a new instance of StridedSliceGrad */ - @Endpoint(describeByClass = true) - public static StridedSliceGrad create(Scope scope, Operand shape, Operand begin, Operand end, Operand strides, Operand dy, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("StridedSliceGrad", scope.makeOpName("StridedSliceGrad")); + @Endpoint( + describeByClass = true + ) + public static StridedSliceGrad create(Scope scope, + Operand shape, Operand begin, Operand end, Operand strides, Operand dy, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StridedSliceGrad"); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(begin.asOutput()); opBuilder.addInput(end.asOutput()); opBuilder.addInput(strides.asOutput()); opBuilder.addInput(dy.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.beginMask != null) { @@ -140,63 +108,225 @@ public static StridedSliceGrad create(Sc } } } - return new StridedSliceGrad(opBuilder.build()); + return new StridedSliceGrad<>(opBuilder.build()); } - + /** - * @param beginMask + * Sets the beginMask option. + * + * @param beginMask the beginMask option + * @return this Options instance. */ public static Options beginMask(Long beginMask) { return new Options().beginMask(beginMask); } - + /** - * @param endMask + * Sets the endMask option. + * + * @param endMask the endMask option + * @return this Options instance. */ public static Options endMask(Long endMask) { return new Options().endMask(endMask); } - + /** - * @param ellipsisMask + * Sets the ellipsisMask option. + * + * @param ellipsisMask the ellipsisMask option + * @return this Options instance. */ public static Options ellipsisMask(Long ellipsisMask) { return new Options().ellipsisMask(ellipsisMask); } - + /** - * @param newAxisMask + * Sets the newAxisMask option. + * + * @param newAxisMask the newAxisMask option + * @return this Options instance. */ public static Options newAxisMask(Long newAxisMask) { return new Options().newAxisMask(newAxisMask); } - + /** - * @param shrinkAxisMask + * Sets the shrinkAxisMask option. + * + * @param shrinkAxisMask the shrinkAxisMask option + * @return this Options instance. */ public static Options shrinkAxisMask(Long shrinkAxisMask) { return new Options().shrinkAxisMask(shrinkAxisMask); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StridedSliceGrad"; - - private Output output; - - private StridedSliceGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.StridedSliceGrad} + */ + public static class Options { + private Long beginMask; + + private Long endMask; + + private Long ellipsisMask; + + private Long newAxisMask; + + private Long shrinkAxisMask; + + private Options() { + } + + /** + * Sets the beginMask option. + * + * @param beginMask the beginMask option + * @return this Options instance. + */ + public Options beginMask(Long beginMask) { + this.beginMask = beginMask; + return this; + } + + /** + * Sets the endMask option. + * + * @param endMask the endMask option + * @return this Options instance. + */ + public Options endMask(Long endMask) { + this.endMask = endMask; + return this; + } + + /** + * Sets the ellipsisMask option. + * + * @param ellipsisMask the ellipsisMask option + * @return this Options instance. + */ + public Options ellipsisMask(Long ellipsisMask) { + this.ellipsisMask = ellipsisMask; + return this; + } + + /** + * Sets the newAxisMask option. + * + * @param newAxisMask the newAxisMask option + * @return this Options instance. + */ + public Options newAxisMask(Long newAxisMask) { + this.newAxisMask = newAxisMask; + return this; + } + + /** + * Sets the shrinkAxisMask option. + * + * @param shrinkAxisMask the shrinkAxisMask option + * @return this Options instance. + */ + public Options shrinkAxisMask(Long shrinkAxisMask) { + this.shrinkAxisMask = 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 0eedfb90a82..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,65 +17,68 @@ 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 the sum of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.Sum} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "Sum"; + + private Output output; + + public Sum(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Sum operation. - * + * * @param scope current scope * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values + * @param data type for {@code Sum} output and operands * @return a new instance of Sum */ - @Endpoint(describeByClass = true) - public static Sum create(Scope scope, Operand input, Operand axis, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Sum", scope.makeOpName("Sum")); + @Endpoint( + describeByClass = true + ) + public static Sum create(Scope scope, Operand input, + Operand axis, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Sum"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.keepDims != null) { @@ -83,36 +86,92 @@ public static Sum create(Scope scope, Operand input, Ope } } } - return new Sum(opBuilder.build()); + return new Sum<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets output. * The reduced tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Sum"; - - private Output output; - - private Sum(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Sum} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = 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 5662f5b9509..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,71 +17,114 @@ 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; /** - * Forwards `data` to the output port determined by `pred`. - *

- * If `pred` is true, the `data` input is forwarded to `output_true`. Otherwise, - * the data goes to `output_false`. - *

- * See also `RefSwitch` and `Merge`. - * - * @param data type for {@code outputFalse()} output + * Forwards {@code data} to the output port determined by {@code pred}. + * 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}. */ +@OpMetadata( + opType = SwitchCond.OP_NAME, + inputsClass = SwitchCond.Inputs.class +) @Operator public final class SwitchCond extends RawOp { - /** - * Factory method to create a class wrapping a new SwitchCond operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Switch"; + + private Output outputFalse; + + private Output outputTrue; + + public SwitchCond(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputFalse = operation.output(outputIdx++); + outputTrue = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new Switch operation. + * * @param scope current scope * @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 * @return a new instance of SwitchCond */ - @Endpoint(describeByClass = true) - public static SwitchCond create(Scope scope, Operand data, Operand pred) { - OperationBuilder opBuilder = scope.env().opBuilder("Switch", scope.makeOpName("SwitchCond")); + @Endpoint( + describeByClass = true + ) + public static SwitchCond create(Scope scope, Operand data, + Operand pred) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SwitchCond"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(pred.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SwitchCond(opBuilder.build()); + return new SwitchCond<>(opBuilder.build()); } - + /** - * If `pred` is false, data will be forwarded to this output. + * Gets outputFalse. + * If {@code pred} is false, data will be forwarded to this output. + * @return outputFalse. */ public Output outputFalse() { return outputFalse; } - + /** - * If `pred` is true, data will be forwarded to this output. + * Gets outputTrue. + * If {@code pred} is true, data will be forwarded to this output. + * @return outputTrue. */ public Output outputTrue() { return outputTrue; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Switch"; - - private Output outputFalse; - private Output outputTrue; - - private SwitchCond(Operation operation) { - super(operation); - int outputIdx = 0; - outputFalse = operation.output(outputIdx++); - outputTrue = operation.output(outputIdx++); + + @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 15f54863824..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,67 +26,64 @@ 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 a tensor that may be mutated, but only persists within a single step. - *

* This is an experimental op for internal use only and it is possible to use this * op in unsafe ways. DO NOT USE unless you fully understand the risks. - *

- * It is the caller's responsibility to ensure that 'ref' is eventually passed to a + *

It is the caller's responsibility to ensure that 'ref' is eventually passed to a * matching 'DestroyTemporaryVariable' op after all other uses have completed. - *

- * Outputs a ref to the tensor state so it may be read or modified. - *

- * E.g. - * var = state_ops._temporary_variable([1, 2], types.float_) - * var_name = var.op.name - * 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 + *

Outputs a ref to the tensor state so it may be read or modified. + *

E.g. + * var = state_ops.temporary_variable([1, 2], types.float) + * var_name = var.op.name + * 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) */ +@OpMetadata( + opType = TemporaryVariable.OP_NAME, + inputsClass = TemporaryVariable.Inputs.class +) @Operator public final class TemporaryVariable extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.TemporaryVariable} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param varName Overrides the name used for the temporary variable resource. Default - * value is the name of the 'TemporaryVariable' op (which is guaranteed unique). - */ - public Options varName(String varName) { - this.varName = varName; - return this; - } - - private String varName; - - private Options() { - } + public static final String OP_NAME = "TemporaryVariable"; + + private Output ref; + + public TemporaryVariable(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + ref = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new TemporaryVariable operation. - * + * * @param scope current scope * @param shape The shape of the variable tensor. * @param dtype The type of elements in the variable tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code TemporaryVariable} output and operands * @return a new instance of TemporaryVariable */ - @Endpoint(describeByClass = true) - public static TemporaryVariable create(Scope scope, Shape shape, Class dtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("TemporaryVariable", scope.makeOpName("TemporaryVariable")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static TemporaryVariable create(Scope scope, Shape shape, + Class dtype, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TemporaryVariable"); opBuilder.setAttr("shape", shape); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); if (options != null) { @@ -94,37 +93,82 @@ public static TemporaryVariable create(Scope scope, Shape s } } } - return new TemporaryVariable(opBuilder.build()); + return new TemporaryVariable<>(opBuilder.build()); } - + /** + * Sets the varName option. + * * @param varName Overrides the name used for the temporary variable resource. Default * value is the name of the 'TemporaryVariable' op (which is guaranteed unique). + * @return this Options instance. */ public static Options varName(String varName) { return new Options().varName(varName); } - + /** + * Gets ref. * A reference to the variable tensor. + * @return ref. */ public Output ref() { return ref; } - + @Override public Output asOutput() { return ref; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TemporaryVariable"; - - private Output ref; - - private TemporaryVariable(Operation operation) { - super(operation); - int outputIdx = 0; - ref = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.TemporaryVariable} + */ + public static class Options { + private String varName; + + private Options() { + } + + /** + * Sets the varName option. + * + * @param varName Overrides the name used for the temporary variable resource. Default + * value is the name of the 'TemporaryVariable' op (which is guaranteed unique). + * @return this Options instance. + */ + public Options varName(String varName) { + this.varName = 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 c162f3110f6..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,102 +26,61 @@ 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; /** * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.TensorArray} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param elementShape 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 Options elementShape(Shape elementShape) { - this.elementShape = elementShape; - return this; - } - - /** - * @param dynamicSize A boolean that determines whether writes to the TensorArray - * are allowed to grow the size. By default, this is not allowed. - */ - public Options dynamicSize(Boolean dynamicSize) { - this.dynamicSize = dynamicSize; - return this; - } - - /** - * @param clearAfterRead If true (default), Tensors in the TensorArray are cleared - * after being read. This disables multiple read semantics but allows early - * release of memory. - */ - public Options clearAfterRead(Boolean clearAfterRead) { - this.clearAfterRead = clearAfterRead; - return this; - } - - /** - * @param identicalElementShapes If true (default is false), then all - * elements in the TensorArray will be expected to have 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 Options identicalElementShapes(Boolean identicalElementShapes) { - this.identicalElementShapes = identicalElementShapes; - return this; - } - - /** - * @param tensorArrayName Overrides the name used for the temporary tensor_array - * resource. Default value is the name of the 'TensorArray' op (which - * is guaranteed unique). - */ - public Options tensorArrayName(String tensorArrayName) { - this.tensorArrayName = tensorArrayName; - return this; - } - - private Shape elementShape; - private Boolean dynamicSize; - private Boolean clearAfterRead; - private Boolean identicalElementShapes; - private String tensorArrayName; - - private Options() { - } + public static final String OP_NAME = "TensorArrayV3"; + + private Output handle; + + private Output flow; + + @SuppressWarnings("unchecked") + public TensorArray(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + flow = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new TensorArray operation. - * + * Factory method to create a class wrapping a new TensorArrayV3 operation. + * * @param scope current scope - * @param size The size of the array. + * @param sizeOutput The size of the array. * @param dtype The type of the elements on the tensor_array. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code TensorArrayV3} output and operands * @return a new instance of TensorArray */ - @Endpoint(describeByClass = true) - public static TensorArray create(Scope scope, Operand size, Class dtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayV3", scope.makeOpName("TensorArray")); - opBuilder.addInput(size.asOutput()); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static TensorArray create(Scope scope, Operand sizeOutput, + Class dtype, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorArray"); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); if (options != null) { for (Options opts : options) { @@ -142,78 +103,233 @@ public static TensorArray create(Scope scope, Operand } return new TensorArray(opBuilder.build()); } - + /** + * Sets the elementShape option. + * * @param elementShape 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. + * @return this Options instance. */ public static Options elementShape(Shape elementShape) { return new Options().elementShape(elementShape); } - + /** + * Sets the dynamicSize option. + * * @param dynamicSize A boolean that determines whether writes to the TensorArray * are allowed to grow the size. By default, this is not allowed. + * @return this Options instance. */ public static Options dynamicSize(Boolean dynamicSize) { return new Options().dynamicSize(dynamicSize); } - + /** + * Sets the clearAfterRead option. + * * @param clearAfterRead If true (default), Tensors in the TensorArray are cleared * after being read. This disables multiple read semantics but allows early * release of memory. + * @return this Options instance. */ public static Options clearAfterRead(Boolean clearAfterRead) { return new Options().clearAfterRead(clearAfterRead); } - + /** + * Sets the identicalElementShapes option. + * * @param identicalElementShapes If true (default is false), then all - * elements in the TensorArray will be expected to have have identical shapes. + * 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. + * @return this Options instance. */ public static Options identicalElementShapes(Boolean identicalElementShapes) { return new Options().identicalElementShapes(identicalElementShapes); } - + /** + * Sets the tensorArrayName option. + * * @param tensorArrayName Overrides the name used for the temporary tensor_array * resource. Default value is the name of the 'TensorArray' op (which * is guaranteed unique). + * @return this Options instance. */ public static Options tensorArrayName(String tensorArrayName) { return new Options().tensorArrayName(tensorArrayName); } - + /** + * Gets handle. * The handle to the TensorArray. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + /** + * Gets flow. * A scalar used to control gradient flow. + * @return flow. */ public Output flow() { return flow; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArrayV3"; - - private Output handle; - private Output flow; - - private TensorArray(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - flow = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.TensorArray} + */ + public static class Options { + private Shape elementShape; + + private Boolean dynamicSize; + + private Boolean clearAfterRead; + + private Boolean identicalElementShapes; + + private String tensorArrayName; + + private Options() { + } + + /** + * Sets the elementShape option. + * + * @param elementShape 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. + * @return this Options instance. + */ + public Options elementShape(Shape elementShape) { + this.elementShape = elementShape; + return this; + } + + /** + * Sets the dynamicSize option. + * + * @param dynamicSize A boolean that determines whether writes to the TensorArray + * are allowed to grow the size. By default, this is not allowed. + * @return this Options instance. + */ + public Options dynamicSize(Boolean dynamicSize) { + this.dynamicSize = dynamicSize; + return this; + } + + /** + * Sets the clearAfterRead option. + * + * @param clearAfterRead If true (default), Tensors in the TensorArray are cleared + * after being read. This disables multiple read semantics but allows early + * release of memory. + * @return this Options instance. + */ + public Options clearAfterRead(Boolean clearAfterRead) { + this.clearAfterRead = clearAfterRead; + return this; + } + + /** + * Sets the identicalElementShapes option. + * + * @param identicalElementShapes 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. + * @return this Options instance. + */ + public Options identicalElementShapes(Boolean identicalElementShapes) { + this.identicalElementShapes = identicalElementShapes; + return this; + } + + /** + * Sets the tensorArrayName option. + * + * @param tensorArrayName Overrides the name used for the temporary tensor_array + * resource. Default value is the name of the 'TensorArray' op (which + * is guaranteed unique). + * @return this Options instance. + */ + public Options tensorArrayName(String tensorArrayName) { + this.tensorArrayName = 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 7a195cd579e..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,42 +17,69 @@ 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 TensorArray from its resource container. - *

* 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 { - /** - * Factory method to create a class wrapping a new TensorArrayClose operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorArrayCloseV3"; + + public TensorArrayClose(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new TensorArrayCloseV3 operation. + * * @param scope current scope * @param handle The handle to a TensorArray (output of TensorArray or TensorArrayGrad). * @return a new instance of TensorArrayClose */ - @Endpoint(describeByClass = true) - public static TensorArrayClose create(Scope scope, Operand handle) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayCloseV3", scope.makeOpName("TensorArrayClose")); + @Endpoint( + describeByClass = true + ) + public static TensorArrayClose create(Scope scope, Operand handle) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorArrayClose"); opBuilder.addInput(handle.asOutput()); - opBuilder = scope.apply(opBuilder); return new TensorArrayClose(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArrayCloseV3"; - - private TensorArrayClose(Operation operation) { - super(operation); + + @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 a861b19400e..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,70 +26,71 @@ 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; /** - * Concat the elements from the TensorArray into value `value`. - *

- * Takes `T` elements of shapes - *

- *

{@code
- *   (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 ...)}
- * All elements must have the same shape (excepting the first dimension). - * - * @param data type for {@code value()} output + * Concat the elements from the TensorArray into value {@code value}. + * Takes {@code T} elements of shapes + *
+ * (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: + *

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

All elements must have the same shape (excepting the first dimension). */ +@OpMetadata( + opType = TensorArrayConcat.OP_NAME, + inputsClass = TensorArrayConcat.Inputs.class +) @Operator public final class TensorArrayConcat extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.TensorArrayConcat} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param elementShapeExcept0 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 Options elementShapeExcept0(Shape elementShapeExcept0) { - this.elementShapeExcept0 = elementShapeExcept0; - return this; - } - - private Shape elementShapeExcept0; - - private Options() { - } + public static final String OP_NAME = "TensorArrayConcatV3"; + + private Output value; + + private Output lengths; + + public TensorArrayConcat(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + value = operation.output(outputIdx++); + lengths = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new TensorArrayConcat operation. - * + * Factory method to create a class wrapping a new TensorArrayConcatV3 operation. + * * @param scope current scope * @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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code TensorArrayConcatV3} output and operands * @return a new instance of TensorArrayConcat */ - @Endpoint(describeByClass = true) - public static TensorArrayConcat create(Scope scope, Operand handle, Operand flowIn, Class dtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayConcatV3", scope.makeOpName("TensorArrayConcat")); + @Endpoint( + describeByClass = true + ) + public static TensorArrayConcat create(Scope scope, + Operand handle, Operand flowIn, Class dtype, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorArrayConcat"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(flowIn.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); if (options != null) { for (Options opts : options) { @@ -96,46 +99,101 @@ public static TensorArrayConcat create(Scope scope, Operand } } } - return new TensorArrayConcat(opBuilder.build()); + return new TensorArrayConcat<>(opBuilder.build()); } - + /** + * Sets the elementShapeExcept0 option. + * * @param elementShapeExcept0 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. + * @return this Options instance. */ public static Options elementShapeExcept0(Shape elementShapeExcept0) { return new Options().elementShapeExcept0(elementShapeExcept0); } - + /** + * Gets value. * All of the elements in the TensorArray, concatenated along the first * axis. + * @return value. */ public Output value() { return value; } - + /** + * Gets lengths. * A vector of the row sizes of the original T elements in the * value output. In the example above, this would be the values: - * `(n1, n2, ..., n(T-1))`. + * {@code (n1, n2, ..., n(T-1))}. + * @return lengths. */ public Output lengths() { return lengths; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArrayConcatV3"; - - private Output value; - private Output lengths; - - private TensorArrayConcat(Operation operation) { - super(operation); - int outputIdx = 0; - value = operation.output(outputIdx++); - lengths = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.TensorArrayConcat} + */ + public static class Options { + private Shape elementShapeExcept0; + + private Options() { + } + + /** + * Sets the elementShapeExcept0 option. + * + * @param elementShapeExcept0 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. + * @return this Options instance. + */ + public Options elementShapeExcept0(Shape elementShapeExcept0) { + this.elementShapeExcept0 = 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 8f4bcea319e..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,62 +26,62 @@ 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; /** - * Gather specific elements from the TensorArray into output `value`. - *

- * All elements selected by `indices` must have the same shape. - * - * @param data type for {@code value()} output + * Gather specific elements from the TensorArray into output {@code value}. + * All elements selected by {@code indices} must have the same shape. */ +@OpMetadata( + opType = TensorArrayGather.OP_NAME, + inputsClass = TensorArrayGather.Inputs.class +) @Operator public final class TensorArrayGather extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.TensorArrayGather} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param elementShape 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 Options elementShape(Shape elementShape) { - this.elementShape = elementShape; - return this; - } - - private Shape elementShape; - - private Options() { - } + public static final String OP_NAME = "TensorArrayGatherV3"; + + private Output value; + + public TensorArrayGather(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + value = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new TensorArrayGather operation. - * + * Factory method to create a class wrapping a new TensorArrayGatherV3 operation. + * * @param scope current scope * @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. * @param dtype The type of the elem that is returned. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code TensorArrayGatherV3} output and operands * @return a new instance of TensorArrayGather */ - @Endpoint(describeByClass = true) - public static TensorArrayGather create(Scope scope, Operand handle, Operand indices, Operand flowIn, Class dtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayGatherV3", scope.makeOpName("TensorArrayGather")); + @Endpoint( + describeByClass = true + ) + public static TensorArrayGather create(Scope scope, + Operand handle, Operand indices, Operand flowIn, + Class dtype, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorArrayGather"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(flowIn.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); if (options != null) { for (Options opts : options) { @@ -88,39 +90,98 @@ public static TensorArrayGather create(Scope scope, Operand } } } - return new TensorArrayGather(opBuilder.build()); + return new TensorArrayGather<>(opBuilder.build()); } - + /** + * Sets the elementShape option. + * * @param elementShape 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. + * @return this Options instance. */ public static Options elementShape(Shape elementShape) { return new Options().elementShape(elementShape); } - + /** + * Gets value. * All of the elements in the TensorArray, concatenated along a new * axis (the new dimension 0). + * @return value. */ public Output value() { return value; } - + @Override public Output asOutput() { return value; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArrayGatherV3"; - - private Output value; - - private TensorArrayGather(Operation operation) { - super(operation); - int outputIdx = 0; - value = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.TensorArrayGather} + */ + public static class Options { + private Shape elementShape; + + private Options() { + } + + /** + * Sets the elementShape option. + * + * @param elementShape 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. + * @return this Options instance. + */ + public Options elementShape(Shape elementShape) { + this.elementShape = 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 2c9c73e8b90..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,26 +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.TFloat32; +import org.tensorflow.types.family.TType; /** * Creates a TensorArray for storing the gradients of values in the given handle. - *

* If the given TensorArray gradient already exists, returns a reference to it. - *

- * Locks the size of the original TensorArray by disabling its dynamic size flag. - *

- * **A note about the input flow_in:** - *

- * The handle flow_in forces the execution of the gradient lookup to occur + *

Locks the size of the original TensorArray by disabling its dynamic size flag. + *

A note about the input flow_in: + *

The handle flow_in forces the execution of the gradient lookup to occur * only after certain other operations have occurred. For example, when * the forward TensorArray is dynamically sized, writes to this TensorArray * may resize the object. The gradient TensorArray is statically sized based @@ -44,35 +46,50 @@ * Furthermore, the size of the forward TensorArray is frozen by this call. * As a result, the flow is used to ensure that the call to generate the gradient * TensorArray only happens after all writes are executed. - *

- * In the case of dynamically sized TensorArrays, gradient computation should + *

In the case of dynamically sized TensorArrays, gradient computation should * only be performed on read operations that have themselves been chained via * flow to occur only after all writes have executed. That way the final size * of the forward TensorArray is known when this operation is called. - *

- * **A note about the source attribute:** - *

- * TensorArray gradient calls use an accumulator TensorArray object. If + *

A note about the source attribute: + *

TensorArray gradient calls use an accumulator TensorArray object. If * multiple gradients are calculated and run in the same session, the multiple * gradient nodes may accidentally flow through the same accumulator TensorArray. * This double counts and generally breaks the TensorArray gradient flow. - *

- * The solution is to identify which gradient call this particular + *

The solution is to identify which gradient call this particular * TensorArray gradient is being called in. This is performed by identifying - * a unique string (e.g. "gradients", "gradients_1", ...) from the input + * a unique string (e.g. "gradients", "gradients_1", ...) from the input * gradient Tensor's name. This string is used as a suffix when creating - * the TensorArray gradient object here (the attribute `source`). - *

- * The attribute `source` is added as a suffix to the forward TensorArray's + * the TensorArray gradient object here (the attribute {@code source}). + *

The attribute {@code source} is added as a suffix to the forward TensorArray's * 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 { - /** - * Factory method to create a class wrapping a new TensorArrayGrad operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorArrayGradV3"; + + private Output gradHandle; + + private Output flowOut; + + @SuppressWarnings("unchecked") + public TensorArrayGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + gradHandle = operation.output(outputIdx++); + flowOut = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorArrayGradV3 operation. + * * @param scope current scope * @param handle The handle to the forward TensorArray. * @param flowIn A float scalar that enforces proper chaining of operations. @@ -80,38 +97,62 @@ public final class TensorArrayGrad extends RawOp { * to return. * @return a new instance of TensorArrayGrad */ - @Endpoint(describeByClass = true) - public static TensorArrayGrad create(Scope scope, Operand handle, Operand flowIn, String source) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayGradV3", scope.makeOpName("TensorArrayGrad")); + @Endpoint( + describeByClass = true + ) + public static TensorArrayGrad create(Scope scope, Operand handle, + Operand flowIn, String source) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorArrayGrad"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(flowIn.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("source", source); return new TensorArrayGrad(opBuilder.build()); } - + /** + * Gets gradHandle. + * + * @return gradHandle. */ - public Output gradHandle() { + public Output gradHandle() { return gradHandle; } - + /** + * Gets flowOut. + * + * @return flowOut. */ public Output flowOut() { return flowOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArrayGradV3"; - - private Output gradHandle; - private Output flowOut; - - private TensorArrayGrad(Operation operation) { - super(operation); - int outputIdx = 0; - gradHandle = operation.output(outputIdx++); - flowOut = operation.output(outputIdx++); + + @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 76479b938cd..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,31 +17,56 @@ 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; +import org.tensorflow.types.family.TType; /** * Creates a TensorArray for storing multiple gradients of values in the given handle. - *

* Similar to TensorArrayGradV3. However it creates an accumulator with an * expanded shape compared to the input TensorArray whose gradient is being * 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorArrayGradWithShape"; + + private Output gradHandle; + + private Output flowOut; + + @SuppressWarnings("unchecked") + public TensorArrayGradWithShape(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + gradHandle = operation.output(outputIdx++); + flowOut = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorArrayGradWithShape operation. - * + * * @param scope current scope * @param handle The handle to the forward TensorArray. * @param flowIn A float scalar that enforces proper chaining of operations. @@ -52,39 +77,71 @@ public final class TensorArrayGradWithShape extends RawOp { * to return. * @return a new instance of TensorArrayGradWithShape */ - @Endpoint(describeByClass = true) - public static TensorArrayGradWithShape create(Scope scope, Operand handle, Operand flowIn, Operand shapeToPrepend, String source) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayGradWithShape", scope.makeOpName("TensorArrayGradWithShape")); + @Endpoint( + describeByClass = true + ) + public static TensorArrayGradWithShape create(Scope scope, Operand handle, + Operand flowIn, Operand shapeToPrepend, String source) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorArrayGradWithShape"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(flowIn.asOutput()); opBuilder.addInput(shapeToPrepend.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("source", source); return new TensorArrayGradWithShape(opBuilder.build()); } - + /** + * Gets gradHandle. + * + * @return gradHandle. */ - public Output gradHandle() { + public Output gradHandle() { return gradHandle; } - + /** + * Gets flowOut. + * + * @return flowOut. */ public Output flowOut() { return flowOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArrayGradWithShape"; - - private Output gradHandle; - private Output flowOut; - - private TensorArrayGradWithShape(Operation operation) { - super(operation); - int outputIdx = 0; - gradHandle = operation.output(outputIdx++); - flowOut = operation.output(outputIdx++); + + @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 aa45df4b937..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,54 +26,58 @@ 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; /** - * @param data type for {@code value()} output + * The TensorArrayPack operation */ +@OpMetadata( + opType = TensorArrayPack.OP_NAME, + inputsClass = TensorArrayPack.Inputs.class +) @Operator public final class TensorArrayPack extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.TensorArrayPack} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param elementShape - */ - public Options elementShape(Shape elementShape) { - this.elementShape = elementShape; - return this; - } - - private Shape elementShape; - - private Options() { - } + public static final String OP_NAME = "TensorArrayPack"; + + private Output value; + + public TensorArrayPack(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + value = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new TensorArrayPack operation. - * + * * @param scope current scope - * @param handle - * @param flowIn - * @param dtype - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static TensorArrayPack create(Scope scope, Operand handle, Operand flowIn, Class dtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayPack", scope.makeOpName("TensorArrayPack")); + @Endpoint( + describeByClass = true + ) + public static TensorArrayPack create(Scope scope, Operand handle, + Operand flowIn, Class dtype, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorArrayPack"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(flowIn.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); if (options != null) { for (Options opts : options) { @@ -80,35 +86,85 @@ public static TensorArrayPack create(Scope scope, Operand(opBuilder.build()); + return new TensorArrayPack<>(opBuilder.build()); } - + /** - * @param elementShape + * Sets the elementShape option. + * + * @param elementShape the elementShape option + * @return this Options instance. */ public static Options elementShape(Shape elementShape) { return new Options().elementShape(elementShape); } - + /** + * Gets value. + * + * @return value. */ public Output value() { return value; } - + @Override public Output asOutput() { return value; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArrayPack"; - - private Output value; - - private TensorArrayPack(Operation operation) { - super(operation); - int outputIdx = 0; - value = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.TensorArrayPack} + */ + public static class Options { + private Shape elementShape; + + private Options() { + } + + /** + * Sets the elementShape option. + * + * @param elementShape the elementShape option + * @return this Options instance. + */ + public Options elementShape(Shape elementShape) { + this.elementShape = 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 c076510e393..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,68 +17,117 @@ 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 `value`. - * - * @param data type for {@code value()} output + * Read an element from the TensorArray into output {@code value}. */ +@OpMetadata( + opType = TensorArrayRead.OP_NAME, + inputsClass = TensorArrayRead.Inputs.class +) @Operator public final class TensorArrayRead extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TensorArrayRead operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorArrayReadV3"; + + private Output value; + + public TensorArrayRead(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + value = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorArrayReadV3 operation. + * * @param scope current scope * @param handle The handle to a TensorArray. - * @param index + * @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 * @return a new instance of TensorArrayRead */ - @Endpoint(describeByClass = true) - public static TensorArrayRead create(Scope scope, Operand handle, Operand index, Operand flowIn, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayReadV3", scope.makeOpName("TensorArrayRead")); + @Endpoint( + describeByClass = true + ) + public static TensorArrayRead create(Scope scope, + Operand handle, Operand index, Operand flowIn, + Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorArrayRead"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(index.asOutput()); opBuilder.addInput(flowIn.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new TensorArrayRead(opBuilder.build()); + return new TensorArrayRead<>(opBuilder.build()); } - + /** + * Gets value. * The tensor that is read from the TensorArray. + * @return value. */ public Output value() { return value; } - + @Override public Output asOutput() { return value; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArrayReadV3"; - - private Output value; - - private TensorArrayRead(Operation operation) { - super(operation); - int outputIdx = 0; - value = operation.output(outputIdx++); + + @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 f00c1477b05..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,29 +17,50 @@ 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; /** * Scatter the data from the input value into specific TensorArray elements. - *

- * `indices` must be a vector, its length must match the first dim of `value`. + * {@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 { - /** - * Factory method to create a class wrapping a new TensorArrayScatter operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorArrayScatterV3"; + + private Output flowOut; + + public TensorArrayScatter(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + flowOut = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorArrayScatterV3 operation. + * * @param scope current scope * @param handle The handle to a TensorArray. * @param indices The locations at which to write the tensor elements. @@ -47,37 +68,70 @@ public final class TensorArrayScatter extends RawOp implements Operand * @param flowIn A float scalar that enforces proper chaining of operations. * @return a new instance of TensorArrayScatter */ - @Endpoint(describeByClass = true) - public static TensorArrayScatter create(Scope scope, Operand handle, Operand indices, Operand value, Operand flowIn) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayScatterV3", scope.makeOpName("TensorArrayScatter")); + @Endpoint( + describeByClass = true + ) + public static TensorArrayScatter create(Scope scope, Operand handle, + Operand indices, Operand value, Operand flowIn) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorArrayScatter"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(value.asOutput()); opBuilder.addInput(flowIn.asOutput()); - opBuilder = scope.apply(opBuilder); return new TensorArrayScatter(opBuilder.build()); } - + /** + * Gets flowOut. * A float scalar that enforces proper chaining of operations. + * @return flowOut. */ public Output flowOut() { return flowOut; } - + @Override public Output asOutput() { return flowOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArrayScatterV3"; - - private Output flowOut; - - private TensorArrayScatter(Operation operation) { - super(operation); - int outputIdx = 0; - flowOut = operation.output(outputIdx++); + + @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 7a7e0ce8867..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,60 +17,97 @@ 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; +import org.tensorflow.types.family.TType; /** * 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 { - /** - * Factory method to create a class wrapping a new TensorArraySize operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorArraySizeV3"; + + private Output output; + + public TensorArraySize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorArraySizeV3 operation. + * * @param scope current scope * @param handle The handle to a TensorArray (output of TensorArray or TensorArrayGrad). * @param flowIn A float scalar that enforces proper chaining of operations. * @return a new instance of TensorArraySize */ - @Endpoint(describeByClass = true) - public static TensorArraySize create(Scope scope, Operand handle, Operand flowIn) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorArraySizeV3", scope.makeOpName("TensorArraySize")); + @Endpoint( + describeByClass = true + ) + public static TensorArraySize create(Scope scope, Operand handle, + Operand flowIn) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorArraySize"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(flowIn.asOutput()); - opBuilder = scope.apply(opBuilder); return new TensorArraySize(opBuilder.build()); } - + /** + * Gets output. * The current size of the TensorArray. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArraySizeV3"; - - private Output output; - - private TensorArraySize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 eaab6d412fd..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,49 +17,66 @@ 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; /** * Split the data from the input value into TensorArray elements. - *

- * Assuming that `lengths` takes on values - *

- *

{@code
- * (n0, n1, ..., n(T-1))}
- * and that `value` has shape - *

- *

{@code
- * (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, ...)}
- * and having size - *

- *

{@code
- * nt x d0 x d1 x ...}
- * + * Assuming that {@code lengths} takes on values + *
+ * (n0, n1, ..., n(T-1))
+ * 
+ *

and that {@code value} has shape + *

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

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

and having size + *

+ * nt x d0 x d1 x ...
+ * 
*/ +@OpMetadata( + opType = TensorArraySplit.OP_NAME, + inputsClass = TensorArraySplit.Inputs.class +) @Operator public final class TensorArraySplit extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TensorArraySplit operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorArraySplitV3"; + + private Output flowOut; + + public TensorArraySplit(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + flowOut = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorArraySplitV3 operation. + * * @param scope current scope * @param handle The handle to a TensorArray. * @param value The concatenated tensor to write to the TensorArray. @@ -68,37 +85,71 @@ public final class TensorArraySplit extends RawOp implements Operand { * @param flowIn A float scalar that enforces proper chaining of operations. * @return a new instance of TensorArraySplit */ - @Endpoint(describeByClass = true) - public static TensorArraySplit create(Scope scope, Operand handle, Operand value, Operand lengths, Operand flowIn) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorArraySplitV3", scope.makeOpName("TensorArraySplit")); + @Endpoint( + describeByClass = true + ) + public static TensorArraySplit create(Scope scope, Operand handle, + Operand value, Operand lengths, Operand flowIn) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorArraySplit"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(value.asOutput()); opBuilder.addInput(lengths.asOutput()); opBuilder.addInput(flowIn.asOutput()); - opBuilder = scope.apply(opBuilder); return new TensorArraySplit(opBuilder.build()); } - + /** + * Gets flowOut. * A float scalar that enforces proper chaining of operations. + * @return flowOut. */ public Output flowOut() { return flowOut; } - + @Override public Output asOutput() { return flowOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArraySplitV3"; - - private Output flowOut; - - private TensorArraySplit(Operation operation) { - super(operation); - int outputIdx = 0; - flowOut = operation.output(outputIdx++); + + @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 82f62c98658..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,61 +17,112 @@ 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; /** + * The TensorArrayUnpack operation */ +@OpMetadata( + opType = TensorArrayUnpack.OP_NAME, + inputsClass = TensorArrayUnpack.Inputs.class +) @Operator public final class TensorArrayUnpack extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorArrayUnpack"; + + private Output flowOut; + + public TensorArrayUnpack(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + flowOut = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorArrayUnpack operation. - * + * * @param scope current scope - * @param handle - * @param value - * @param flowIn + * @param handle The handle value + * @param value The value value + * @param flowIn The flowIn value * @return a new instance of TensorArrayUnpack */ - @Endpoint(describeByClass = true) - public static TensorArrayUnpack create(Scope scope, Operand handle, Operand value, Operand flowIn) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayUnpack", scope.makeOpName("TensorArrayUnpack")); + @Endpoint( + describeByClass = true + ) + public static TensorArrayUnpack create(Scope scope, Operand handle, + Operand value, Operand flowIn) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorArrayUnpack"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(value.asOutput()); opBuilder.addInput(flowIn.asOutput()); - opBuilder = scope.apply(opBuilder); return new TensorArrayUnpack(opBuilder.build()); } - + /** + * Gets flowOut. + * + * @return flowOut. */ public Output flowOut() { return flowOut; } - + @Override public Output asOutput() { return flowOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArrayUnpack"; - - private Output flowOut; - - private TensorArrayUnpack(Operation operation) { - super(operation); - int outputIdx = 0; - flowOut = operation.output(outputIdx++); + + @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 0d2fde02369..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,12 +38,28 @@ /** * 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 { - /** - * Factory method to create a class wrapping a new TensorArrayWrite operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorArrayWriteV3"; + + private Output flowOut; + + public TensorArrayWrite(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + flowOut = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorArrayWriteV3 operation. + * * @param scope current scope * @param handle The handle to a TensorArray. * @param index The position to write to inside the TensorArray. @@ -45,37 +67,70 @@ public final class TensorArrayWrite extends RawOp implements Operand { * @param flowIn A float scalar that enforces proper chaining of operations. * @return a new instance of TensorArrayWrite */ - @Endpoint(describeByClass = true) - public static TensorArrayWrite create(Scope scope, Operand handle, Operand index, Operand value, Operand flowIn) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayWriteV3", scope.makeOpName("TensorArrayWrite")); + @Endpoint( + describeByClass = true + ) + public static TensorArrayWrite create(Scope scope, Operand handle, + Operand index, Operand value, Operand flowIn) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorArrayWrite"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(index.asOutput()); opBuilder.addInput(value.asOutput()); opBuilder.addInput(flowIn.asOutput()); - opBuilder = scope.apply(opBuilder); return new TensorArrayWrite(opBuilder.build()); } - + /** + * Gets flowOut. * A float scalar that enforces proper chaining of operations. + * @return flowOut. */ public Output flowOut() { return flowOut; } - + @Override public Output asOutput() { return flowOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArrayWriteV3"; - - private Output flowOut; - - private TensorArrayWrite(Operation operation) { - super(operation); - int outputIdx = 0; - flowOut = operation.output(outputIdx++); + + @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/TensorForestCreateTreeVariable.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestCreateTreeVariable.java deleted file mode 100644 index e494af78e5b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestCreateTreeVariable.java +++ /dev/null @@ -1,57 +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.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.TString; - -/** - * Creates a tree resource and returns a handle to it. - */ -public final class TensorForestCreateTreeVariable extends RawOp { - - /** - * Factory method to create a class wrapping a new TensorForestCreateTreeVariable operation. - * - * @param scope current scope - * @param treeHandle Handle to the tree resource to be created. - * @param treeConfig Serialized proto string of the boosted_trees.Tree. - * @return a new instance of TensorForestCreateTreeVariable - */ - @Endpoint(describeByClass = true) - public static TensorForestCreateTreeVariable create(Scope scope, Operand treeHandle, Operand treeConfig) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorForestCreateTreeVariable", scope.makeOpName("TensorForestCreateTreeVariable")); - opBuilder.addInput(treeHandle.asOutput()); - opBuilder.addInput(treeConfig.asOutput()); - opBuilder = scope.apply(opBuilder); - return new TensorForestCreateTreeVariable(opBuilder.build()); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorForestCreateTreeVariable"; - - private TensorForestCreateTreeVariable(Operation operation) { - super(operation); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeDeserialize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeDeserialize.java deleted file mode 100644 index 74794de4ecb..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeDeserialize.java +++ /dev/null @@ -1,57 +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.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.TString; - -/** - * Deserializes a proto into the tree handle - */ -public final class TensorForestTreeDeserialize extends RawOp { - - /** - * Factory method to create a class wrapping a new TensorForestTreeDeserialize operation. - * - * @param scope current scope - * @param treeHandle Handle to the tree resource to be restored. - * @param treeConfig Serialied proto string of the boosted_trees.Tree proto. - * @return a new instance of TensorForestTreeDeserialize - */ - @Endpoint(describeByClass = true) - public static TensorForestTreeDeserialize create(Scope scope, Operand treeHandle, Operand treeConfig) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorForestTreeDeserialize", scope.makeOpName("TensorForestTreeDeserialize")); - opBuilder.addInput(treeHandle.asOutput()); - opBuilder.addInput(treeConfig.asOutput()); - opBuilder = scope.apply(opBuilder); - return new TensorForestTreeDeserialize(opBuilder.build()); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorForestTreeDeserialize"; - - private TensorForestTreeDeserialize(Operation operation) { - super(operation); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeIsInitializedOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeIsInitializedOp.java deleted file mode 100644 index 55cd0bc8cf1..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeIsInitializedOp.java +++ /dev/null @@ -1,72 +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.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.TBool; - -/** - * Checks whether a tree has been initialized. - */ -public final class TensorForestTreeIsInitializedOp extends RawOp implements Operand { - - /** - * Factory method to create a class wrapping a new TensorForestTreeIsInitializedOp operation. - * - * @param scope current scope - * @param treeHandle Handle to the tree. - * @return a new instance of TensorForestTreeIsInitializedOp - */ - @Endpoint(describeByClass = true) - public static TensorForestTreeIsInitializedOp create(Scope scope, Operand treeHandle) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorForestTreeIsInitializedOp", scope.makeOpName("TensorForestTreeIsInitializedOp")); - opBuilder.addInput(treeHandle.asOutput()); - opBuilder = scope.apply(opBuilder); - return new TensorForestTreeIsInitializedOp(opBuilder.build()); - } - - /** - * Whether the tree is initialized. - */ - public Output isInitialized() { - return isInitialized; - } - - @Override - public Output asOutput() { - return isInitialized; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorForestTreeIsInitializedOp"; - - private Output isInitialized; - - private TensorForestTreeIsInitializedOp(Operation operation) { - super(operation); - int outputIdx = 0; - isInitialized = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreePredict.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreePredict.java deleted file mode 100644 index 2f0988d0e88..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreePredict.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.core; - -import org.tensorflow.Operand; -import org.tensorflow.Operation; -import org.tensorflow.OperationBuilder; -import org.tensorflow.Output; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.TFloat32; - -/** - * Output the logits for the given input data - */ -public final class TensorForestTreePredict extends RawOp implements Operand { - - /** - * Factory method to create a class wrapping a new TensorForestTreePredict operation. - * - * @param scope current scope - * @param treeHandle Handle to the tree resource. - * @param denseFeatures Rank 2 dense features tensor. - * @param logitsDimension Scalar, dimension of the logits. - * @return a new instance of TensorForestTreePredict - */ - @Endpoint(describeByClass = true) - public static TensorForestTreePredict create(Scope scope, Operand treeHandle, Operand denseFeatures, Long logitsDimension) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorForestTreePredict", scope.makeOpName("TensorForestTreePredict")); - opBuilder.addInput(treeHandle.asOutput()); - opBuilder.addInput(denseFeatures.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("logits_dimension", logitsDimension); - return new TensorForestTreePredict(opBuilder.build()); - } - - /** - * The logits predictions from the tree for each instance in the batch. - */ - public Output logits() { - return logits; - } - - @Override - public Output asOutput() { - return logits; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorForestTreePredict"; - - private Output logits; - - private TensorForestTreePredict(Operation operation) { - super(operation); - int outputIdx = 0; - logits = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeResourceHandleOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeResourceHandleOp.java deleted file mode 100644 index dd6d50ccaf7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeResourceHandleOp.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.core; - -import org.tensorflow.Operand; -import org.tensorflow.Operation; -import org.tensorflow.OperationBuilder; -import org.tensorflow.Output; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.family.TType; - -/** - * Creates a handle to a TensorForestTreeResource - */ -public final class TensorForestTreeResourceHandleOp extends RawOp implements Operand { - - /** - * Optional attributes for {@link org.tensorflow.op.core.TensorForestTreeResourceHandleOp} - */ - public static class Options { - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new TensorForestTreeResourceHandleOp operation. - * - * @param scope current scope - * @param options carries optional attributes values - * @return a new instance of TensorForestTreeResourceHandleOp - */ - @Endpoint(describeByClass = true) - public static TensorForestTreeResourceHandleOp create(Scope scope, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorForestTreeResourceHandleOp", scope.makeOpName("TensorForestTreeResourceHandleOp")); - opBuilder = scope.apply(opBuilder); - 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 TensorForestTreeResourceHandleOp(opBuilder.build()); - } - - /** - * @param container - */ - public static Options container(String container) { - return new Options().container(container); - } - - /** - * @param sharedName - */ - public static Options sharedName(String sharedName) { - return new Options().sharedName(sharedName); - } - - /** - */ - public Output resource() { - return resource; - } - - @Override - @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) resource; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorForestTreeResourceHandleOp"; - - private Output resource; - - private TensorForestTreeResourceHandleOp(Operation operation) { - super(operation); - int outputIdx = 0; - resource = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeSerialize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeSerialize.java deleted file mode 100644 index 3ac7ead2a7d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeSerialize.java +++ /dev/null @@ -1,72 +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.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.TString; - -/** - * Serializes the tree handle to a proto - */ -public final class TensorForestTreeSerialize extends RawOp implements Operand { - - /** - * Factory method to create a class wrapping a new TensorForestTreeSerialize operation. - * - * @param scope current scope - * @param treeHandle Handle to the tree resource to be serialized. - * @return a new instance of TensorForestTreeSerialize - */ - @Endpoint(describeByClass = true) - public static TensorForestTreeSerialize create(Scope scope, Operand treeHandle) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorForestTreeSerialize", scope.makeOpName("TensorForestTreeSerialize")); - opBuilder.addInput(treeHandle.asOutput()); - opBuilder = scope.apply(opBuilder); - return new TensorForestTreeSerialize(opBuilder.build()); - } - - /** - * Serialied proto string of the tree resource. - */ - public Output treeConfig() { - return treeConfig; - } - - @Override - public Output asOutput() { - return treeConfig; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorForestTreeSerialize"; - - private Output treeConfig; - - private TensorForestTreeSerialize(Operation operation) { - super(operation); - int outputIdx = 0; - treeConfig = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeSize.java deleted file mode 100644 index d0de55fd4c8..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeSize.java +++ /dev/null @@ -1,72 +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.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.TInt32; - -/** - * Get the number of nodes in a tree - */ -public final class TensorForestTreeSize extends RawOp implements Operand { - - /** - * Factory method to create a class wrapping a new TensorForestTreeSize operation. - * - * @param scope current scope - * @param treeHandle Handle to the tree resource. - * @return a new instance of TensorForestTreeSize - */ - @Endpoint(describeByClass = true) - public static TensorForestTreeSize create(Scope scope, Operand treeHandle) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorForestTreeSize", scope.makeOpName("TensorForestTreeSize")); - opBuilder.addInput(treeHandle.asOutput()); - opBuilder = scope.apply(opBuilder); - return new TensorForestTreeSize(opBuilder.build()); - } - - /** - * The size of the tree. - */ - public Output treeSize() { - return treeSize; - } - - @Override - public Output asOutput() { - return treeSize; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorForestTreeSize"; - - private Output treeSize; - - private TensorForestTreeSize(Operation operation) { - super(operation); - int outputIdx = 0; - treeSize = operation.output(outputIdx++); - } -} 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 e419a43b504..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,83 +17,140 @@ 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; /** * Concats all tensors in the list along the 0th dimension. - *

* Requires that all tensors have the same shape except the first dimension. - *

- * input_handle: The input list. + *

input_handle: The input list. * element_shape: The shape of the uninitialized elements in the list. If the first - * dimension is not -1, it is assumed that all list elements have the same - * leading dim. + * dimension is not -1, it is assumed that all list elements have the same + * leading dim. * leading_dims: The list of leading dims of uninitialized list elements. Used if - * the leading dim of input_handle.element_shape or the element_shape input arg - * is not already set. + * the leading dim of input_handle.element_shape or the element_shape input arg + * 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 { - /** - * Factory method to create a class wrapping a new TensorListConcat operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListConcatV2"; + + private Output tensor; + + private Output lengths; + + public TensorListConcat(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + tensor = operation.output(outputIdx++); + lengths = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorListConcatV2 operation. + * * @param scope current scope - * @param inputHandle - * @param elementShape - * @param leadingDims - * @param elementDtype + * @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 */ - @Endpoint(describeByClass = true) - public static TensorListConcat create(Scope scope, Operand inputHandle, Operand elementShape, Operand leadingDims, Class elementDtype) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorListConcatV2", scope.makeOpName("TensorListConcat")); + @Endpoint( + describeByClass = true + ) + public static TensorListConcat create(Scope scope, + Operand inputHandle, Operand elementShape, + Operand leadingDims, Class elementDtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorListConcat"); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(elementShape.asOutput()); opBuilder.addInput(leadingDims.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("element_dtype", Operands.toDataType(elementDtype)); - return new TensorListConcat(opBuilder.build()); + return new TensorListConcat<>(opBuilder.build()); } - + /** + * Gets tensor. + * + * @return tensor. */ public Output tensor() { return tensor; } - + /** + * Gets lengths. + * + * @return lengths. */ public Output lengths() { return lengths; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListConcatV2"; - - private Output tensor; - private Output lengths; - - private TensorListConcat(Operation operation) { - super(operation); - int outputIdx = 0; - tensor = operation.output(outputIdx++); - lengths = operation.output(outputIdx++); + + @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 25b2e06df84..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,61 +17,108 @@ 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListConcatLists"; + + private Output output; + + @SuppressWarnings("unchecked") + public TensorListConcatLists(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListConcatLists operation. - * + * * @param scope current scope - * @param inputA - * @param inputB - * @param elementDtype + * @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 */ - @Endpoint(describeByClass = true) - public static TensorListConcatLists create(Scope scope, Operand inputA, Operand inputB, Class elementDtype) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorListConcatLists", scope.makeOpName("TensorListConcatLists")); + @Endpoint( + describeByClass = true + ) + public static TensorListConcatLists create(Scope scope, + Operand inputA, Operand inputB, Class elementDtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorListConcatLists"); opBuilder.addInput(inputA.asOutput()); opBuilder.addInput(inputB.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("element_dtype", Operands.toDataType(elementDtype)); return new TensorListConcatLists(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListConcatLists"; - - private Output output; - - private TensorListConcatLists(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 a985213de4e..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,64 +17,101 @@ 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 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 elementShape()} output + * input_handle: the list + * element_shape: the shape of elements of the list */ +@OpMetadata( + opType = TensorListElementShape.OP_NAME, + inputsClass = TensorListElementShape.Inputs.class +) @Operator public final class TensorListElementShape extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListElementShape"; + + private Output elementShape; + + public TensorListElementShape(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + elementShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListElementShape operation. - * + * * @param scope current scope - * @param inputHandle - * @param shapeType + * @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 */ - @Endpoint(describeByClass = true) - public static TensorListElementShape create(Scope scope, Operand inputHandle, Class shapeType) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorListElementShape", scope.makeOpName("TensorListElementShape")); + @Endpoint( + describeByClass = true + ) + public static TensorListElementShape create(Scope scope, + Operand inputHandle, Class shapeType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorListElementShape"); opBuilder.addInput(inputHandle.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("shape_type", Operands.toDataType(shapeType)); - return new TensorListElementShape(opBuilder.build()); + return new TensorListElementShape<>(opBuilder.build()); } - + /** + * Gets elementShape. + * + * @return elementShape. */ public Output elementShape() { return elementShape; } - + @Override public Output asOutput() { return elementShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListElementShape"; - - private Output elementShape; - - private TensorListElementShape(Operation operation) { - super(operation); - int outputIdx = 0; - elementShape = operation.output(outputIdx++); + + @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 128c23f0947..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,65 +17,114 @@ 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; /** - * Creates a TensorList which, when stacked, has the value of `tensor`. - *

+ * Creates a TensorList which, when stacked, has the value of {@code tensor}. * Each tensor in the result list corresponds to one row of the input tensor. - *

- * tensor: The input tensor. + *

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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListFromTensor"; + + private Output outputHandle; + + @SuppressWarnings("unchecked") + public TensorListFromTensor(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListFromTensor operation. - * + * * @param scope current scope - * @param tensor - * @param elementShape + * @param tensor The tensor value + * @param elementShape The elementShape value * @return a new instance of TensorListFromTensor */ - @Endpoint(describeByClass = true) - public static TensorListFromTensor create(Scope scope, Operand tensor, Operand elementShape) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorListFromTensor", scope.makeOpName("TensorListFromTensor")); + @Endpoint( + describeByClass = true + ) + public static TensorListFromTensor create(Scope scope, Operand tensor, + Operand elementShape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorListFromTensor"); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(elementShape.asOutput()); - opBuilder = scope.apply(opBuilder); return new TensorListFromTensor(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListFromTensor"; - - private Output outputHandle; - - private TensorListFromTensor(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); + + @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 90cacdd0435..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,73 +17,121 @@ 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 by indexing into the TensorList. - *

* Each row in the produced Tensor corresponds to the element in the TensorList - * specified by the given index (see `tf.gather`). - *

- * input_handle: The input tensor list. + * specified by the given index (see {@code tf.gather}). + *

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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListGather"; + + private Output values; + + public TensorListGather(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + values = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListGather operation. - * + * * @param scope current scope - * @param inputHandle - * @param indices - * @param elementShape - * @param elementDtype + * @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 */ - @Endpoint(describeByClass = true) - public static TensorListGather create(Scope scope, Operand inputHandle, Operand indices, Operand elementShape, Class elementDtype) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorListGather", scope.makeOpName("TensorListGather")); + @Endpoint( + describeByClass = true + ) + public static TensorListGather create(Scope scope, + Operand inputHandle, Operand indices, Operand elementShape, + Class elementDtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorListGather"); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(elementShape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("element_dtype", Operands.toDataType(elementDtype)); - return new TensorListGather(opBuilder.build()); + return new TensorListGather<>(opBuilder.build()); } - + /** + * Gets values. + * + * @return values. */ public Output values() { return values; } - + @Override public Output asOutput() { return values; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListGather"; - - private Output values; - - private TensorListGather(Operation operation) { - super(operation); - int outputIdx = 0; - values = operation.output(outputIdx++); + + @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 7f96f897242..8fbdb5e80e0 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,64 +17,126 @@ 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; /** - * @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 { - +public final class TensorListGetItem extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListGetItem"; + + private Output item; + + public TensorListGetItem(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + item = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListGetItem operation. - * + * * @param scope current scope - * @param inputHandle - * @param index - * @param elementShape - * @param elementDtype + * @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 */ - @Endpoint(describeByClass = true) - public static TensorListGetItem create(Scope scope, Operand inputHandle, Operand index, Operand elementShape, Class elementDtype) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorListGetItem", scope.makeOpName("TensorListGetItem")); + @Endpoint( + describeByClass = true + ) + public static TensorListGetItem create(Scope scope, + Operand inputHandle, Operand index, + Operand elementShape, Class elementDtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorListGetItem"); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(index.asOutput()); opBuilder.addInput(elementShape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("element_dtype", Operands.toDataType(elementDtype)); - return new TensorListGetItem(opBuilder.build()); + return new TensorListGetItem<>(opBuilder.build()); } - + /** + * Gets item. + * + * @return item. */ - public Output item() { + public Output item() { return item; } - + @Override - public Output asOutput() { + public Output asOutput() { return item; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListGetItem"; - - private Output item; - - private TensorListGetItem(Operation operation) { - super(operation); - int outputIdx = 0; - item = operation.output(outputIdx++); + + @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; + + /** + * The Tshape attribute + */ + public final DataType Tshape; + + public Inputs(GraphOperation op) { + super(new TensorListGetItem<>(op), op, Arrays.asList("element_dtype", "Tshape")); + int inputIndex = 0; + inputHandle = (Operand) op.input(inputIndex++); + index = (Operand) op.input(inputIndex++); + elementShape = (Operand) op.input(inputIndex++); + elementDtype = op.attributes().getAttrType("element_dtype"); + Tshape = op.attributes().getAttrType("Tshape"); + } } } 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 b583a498ea5..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,59 +17,89 @@ 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; /** * Returns the number of tensors in the input tensor list. - *

* 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListLength"; + + private Output length; + + public TensorListLength(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + length = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListLength operation. - * + * * @param scope current scope - * @param inputHandle + * @param inputHandle The inputHandle value * @return a new instance of TensorListLength */ - @Endpoint(describeByClass = true) - public static TensorListLength create(Scope scope, Operand inputHandle) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorListLength", scope.makeOpName("TensorListLength")); + @Endpoint( + describeByClass = true + ) + public static TensorListLength create(Scope scope, Operand inputHandle) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorListLength"); opBuilder.addInput(inputHandle.asOutput()); - opBuilder = scope.apply(opBuilder); return new TensorListLength(opBuilder.build()); } - + /** + * Gets length. + * + * @return length. */ public Output length() { return length; } - + @Override public Output asOutput() { return length; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListLength"; - - private Output length; - - private TensorListLength(Operation operation) { - super(operation); - int outputIdx = 0; - length = operation.output(outputIdx++); + + @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 5600bf69778..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,74 +17,120 @@ 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; /** * Returns the last element of the input list as well as a list with all but that element. - *

* Fails if the list is empty. - *

- * input_handle: the input list + *

input_handle: the input list * 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListPopBack"; + + private Output outputHandle; + + private Output tensor; + + @SuppressWarnings("unchecked") + public TensorListPopBack(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + tensor = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListPopBack operation. - * + * * @param scope current scope - * @param inputHandle - * @param elementShape - * @param elementDtype + * @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 */ - @Endpoint(describeByClass = true) - public static TensorListPopBack create(Scope scope, Operand inputHandle, Operand elementShape, Class elementDtype) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorListPopBack", scope.makeOpName("TensorListPopBack")); + @Endpoint( + describeByClass = true + ) + public static TensorListPopBack create(Scope scope, + Operand inputHandle, Operand elementShape, Class elementDtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorListPopBack"); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(elementShape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("element_dtype", Operands.toDataType(elementDtype)); - return new TensorListPopBack(opBuilder.build()); + return new TensorListPopBack<>(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + /** + * Gets tensor. + * + * @return tensor. */ public Output tensor() { return tensor; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListPopBack"; - - private Output outputHandle; - private Output tensor; - - private TensorListPopBack(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); - tensor = operation.output(outputIdx++); + + @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 8f831c0ba7c..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,65 +17,109 @@ 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 list which has the passed-in `Tensor` as last element and the other elements of the given list in `input_handle`. - *

+ * Returns a list which has the passed-in {@code Tensor} as last element and the other elements of the given list in {@code input_handle}. * tensor: The tensor to put on the list. * input_handle: The old list. * output_handle: A list with the elements of the old list followed by tensor. * 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListPushBack"; + + private Output outputHandle; + + @SuppressWarnings("unchecked") + public TensorListPushBack(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListPushBack operation. - * + * * @param scope current scope - * @param inputHandle - * @param tensor + * @param inputHandle The inputHandle value + * @param tensor The tensor value * @return a new instance of TensorListPushBack */ - @Endpoint(describeByClass = true) - public static TensorListPushBack create(Scope scope, Operand inputHandle, Operand tensor) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorListPushBack", scope.makeOpName("TensorListPushBack")); + @Endpoint( + describeByClass = true + ) + public static TensorListPushBack create(Scope scope, Operand inputHandle, + Operand tensor) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorListPushBack"); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(tensor.asOutput()); - opBuilder = scope.apply(opBuilder); return new TensorListPushBack(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListPushBack"; - - private Output outputHandle; - - private TensorListPushBack(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); + + @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 b39bb5027fd..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,58 +17,104 @@ 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListPushBackBatch"; + + private Output outputHandles; + + @SuppressWarnings("unchecked") + public TensorListPushBackBatch(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputHandles = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListPushBackBatch operation. - * + * * @param scope current scope - * @param inputHandles - * @param tensor + * @param inputHandles The inputHandles value + * @param tensor The tensor value * @return a new instance of TensorListPushBackBatch */ - @Endpoint(describeByClass = true) - public static TensorListPushBackBatch create(Scope scope, Operand inputHandles, Operand tensor) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorListPushBackBatch", scope.makeOpName("TensorListPushBackBatch")); + @Endpoint( + describeByClass = true + ) + public static TensorListPushBackBatch create(Scope scope, Operand inputHandles, + Operand tensor) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorListPushBackBatch"); opBuilder.addInput(inputHandles.asOutput()); opBuilder.addInput(tensor.asOutput()); - opBuilder = scope.apply(opBuilder); return new TensorListPushBackBatch(opBuilder.build()); } - + /** + * Gets outputHandles. + * + * @return outputHandles. */ - public Output outputHandles() { + public Output outputHandles() { return outputHandles; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandles; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListPushBackBatch"; - - private Output outputHandles; - - private TensorListPushBackBatch(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandles = operation.output(outputIdx++); + + @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 19bf60b1ce2..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,69 +17,120 @@ 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; /** * List of the given size with empty elements. - *

* element_shape: the shape of the future elements of the list * num_elements: the number of elements to reserve * 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListReserve"; + + private Output handle; + + @SuppressWarnings("unchecked") + public TensorListReserve(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListReserve operation. - * + * * @param scope current scope - * @param elementShape - * @param numElements - * @param elementDtype + * @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 */ - @Endpoint(describeByClass = true) - public static TensorListReserve create(Scope scope, Operand elementShape, Operand numElements, Class elementDtype) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorListReserve", scope.makeOpName("TensorListReserve")); + @Endpoint( + describeByClass = true + ) + public static TensorListReserve create(Scope scope, + Operand elementShape, Operand numElements, Class elementDtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorListReserve"); opBuilder.addInput(elementShape.asOutput()); opBuilder.addInput(numElements.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("element_dtype", Operands.toDataType(elementDtype)); return new TensorListReserve(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListReserve"; - - private Output handle; - - private TensorListReserve(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 e9fc0516c16..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,65 +17,100 @@ 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; /** * Resizes the list. - *

- * * 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListResize"; + + private Output outputHandle; + + @SuppressWarnings("unchecked") + public TensorListResize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListResize operation. - * + * * @param scope current scope - * @param inputHandle - * @param size + * @param inputHandle The inputHandle value + * @param sizeOutput The sizeOutput value * @return a new instance of TensorListResize */ - @Endpoint(describeByClass = true) - public static TensorListResize create(Scope scope, Operand inputHandle, Operand size) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorListResize", scope.makeOpName("TensorListResize")); + @Endpoint( + describeByClass = true + ) + public static TensorListResize create(Scope scope, Operand inputHandle, + Operand sizeOutput) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorListResize"); opBuilder.addInput(inputHandle.asOutput()); - opBuilder.addInput(size.asOutput()); - opBuilder = scope.apply(opBuilder); + opBuilder.addInput(sizeOutput.asOutput()); return new TensorListResize(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListResize"; - - private Output outputHandle; - - private TensorListResize(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); + + @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 98aaadd7a7c..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,77 +17,139 @@ 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; /** * Creates a TensorList by indexing into a Tensor. - *

* Each member of the TensorList corresponds to one row of the input tensor, - * specified by the given index (see `tf.gather`). - *

- * tensor: The input tensor. + * specified by the given index (see {@code tf.gather}). + *

tensor: The input tensor. * indices: The indices used to index into the list. * element_shape: The shape of the elements in the list (can be less specified than - * the shape of the tensor). + * the shape of the tensor). * num_elements: The size of the output list. Must be large enough to accommodate - * the largest index in indices. If -1, the list is just large enough to include - * the largest index in indices. + * the largest index in indices. If -1, the list is just large enough to include + * 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 { - /** - * Factory method to create a class wrapping a new TensorListScatter operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListScatterV2"; + + private Output outputHandle; + + @SuppressWarnings("unchecked") + public TensorListScatter(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorListScatterV2 operation. + * * @param scope current scope - * @param tensor - * @param indices - * @param elementShape - * @param numElements + * @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(describeByClass = true) - public static TensorListScatter create(Scope scope, Operand tensor, Operand indices, Operand elementShape, Operand numElements) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorListScatterV2", scope.makeOpName("TensorListScatter")); + @Endpoint( + describeByClass = true + ) + public static TensorListScatter create(Scope scope, Operand tensor, + Operand indices, Operand elementShape, + Operand numElements) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorListScatter"); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(elementShape.asOutput()); opBuilder.addInput(numElements.asOutput()); - opBuilder = scope.apply(opBuilder); return new TensorListScatter(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListScatterV2"; - - private Output outputHandle; - - private TensorListScatter(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); + + @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 da49a9d672f..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,70 +17,120 @@ 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; /** * Scatters tensor at indices in an input list. - *

* Each member of the TensorList corresponds to one row of the input tensor, - * specified by the given index (see `tf.gather`). - *

- * input_handle: The list to scatter into. + * specified by the given index (see {@code tf.gather}). + *

input_handle: The list to scatter into. * tensor: The input tensor. * 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListScatterIntoExistingList"; + + private Output outputHandle; + + @SuppressWarnings("unchecked") + public TensorListScatterIntoExistingList(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListScatterIntoExistingList operation. - * + * * @param scope current scope - * @param inputHandle - * @param tensor - * @param indices + * @param inputHandle The inputHandle value + * @param tensor The tensor value + * @param indices The indices value * @return a new instance of TensorListScatterIntoExistingList */ - @Endpoint(describeByClass = true) - public static TensorListScatterIntoExistingList create(Scope scope, Operand inputHandle, Operand tensor, Operand indices) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorListScatterIntoExistingList", scope.makeOpName("TensorListScatterIntoExistingList")); + @Endpoint( + describeByClass = true + ) + public static TensorListScatterIntoExistingList create(Scope scope, + Operand inputHandle, Operand tensor, + Operand indices) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorListScatterIntoExistingList"); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); return new TensorListScatterIntoExistingList(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListScatterIntoExistingList"; - - private Output outputHandle; - - private TensorListScatterIntoExistingList(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); + + @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 3f8df2fd889..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,61 +17,162 @@ 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; /** + * 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListSetItem"; + + private Output outputHandle; + + @SuppressWarnings("unchecked") + public TensorListSetItem(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListSetItem operation. - * + * * @param scope current scope - * @param inputHandle - * @param index - * @param item + * @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) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorListSetItem", scope.makeOpName("TensorListSetItem")); + @Endpoint( + describeByClass = true + ) + public static TensorListSetItem create(Scope scope, Operand inputHandle, + 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()); - opBuilder = scope.apply(opBuilder); + 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. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListSetItem"; - - private Output outputHandle; - - private TensorListSetItem(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); + + /** + * 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 2dc7bf979b5..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,71 +17,126 @@ 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; /** * Splits a tensor into a list. - *

* list[i] corresponds to lengths[i] tensors from the input tensor. * The tensor must have rank at least 1 and contain exactly sum(lengths) elements. - *

- * tensor: The input tensor. + *

tensor: The input tensor. * element_shape: A shape compatible with that of elements in the tensor. * 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListSplit"; + + private Output outputHandle; + + @SuppressWarnings("unchecked") + public TensorListSplit(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListSplit operation. - * + * * @param scope current scope - * @param tensor - * @param elementShape - * @param lengths + * @param tensor The tensor value + * @param elementShape The elementShape value + * @param lengths The lengths value * @return a new instance of TensorListSplit */ - @Endpoint(describeByClass = true) - public static TensorListSplit create(Scope scope, Operand tensor, Operand elementShape, Operand lengths) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorListSplit", scope.makeOpName("TensorListSplit")); + @Endpoint( + describeByClass = true + ) + public static TensorListSplit create(Scope scope, Operand tensor, + Operand elementShape, Operand lengths) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorListSplit"); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(elementShape.asOutput()); opBuilder.addInput(lengths.asOutput()); - opBuilder = scope.apply(opBuilder); return new TensorListSplit(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListSplit"; - - private Output outputHandle; - - private TensorListSplit(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); + + @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 20284f1e76e..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,68 +17,70 @@ 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; /** * Stacks all tensors in the list. - *

* Requires that all tensors have the same shape. - *

- * input_handle: the input list + *

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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.TensorListStack} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param numElements - */ - public Options numElements(Long numElements) { - this.numElements = numElements; - return this; - } - - private Long numElements; - - private Options() { - } + public static final String OP_NAME = "TensorListStack"; + + private Output tensor; + + public TensorListStack(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + tensor = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new TensorListStack operation. - * + * * @param scope current scope - * @param inputHandle - * @param elementShape - * @param elementDtype - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static TensorListStack create(Scope scope, Operand inputHandle, Operand elementShape, Class elementDtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorListStack", scope.makeOpName("TensorListStack")); + @Endpoint( + describeByClass = true + ) + public static TensorListStack create(Scope scope, + Operand inputHandle, Operand elementShape, Class elementDtype, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorListStack"); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(elementShape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("element_dtype", Operands.toDataType(elementDtype)); if (options != null) { for (Options opts : options) { @@ -87,35 +89,85 @@ public static TensorListStack create(Scope scope, Operand(opBuilder.build()); + return new TensorListStack<>(opBuilder.build()); } - + /** - * @param numElements + * Sets the numElements option. + * + * @param numElements the numElements option + * @return this Options instance. */ public static Options numElements(Long numElements) { return new Options().numElements(numElements); } - + /** + * Gets tensor. + * + * @return tensor. */ public Output tensor() { return tensor; } - + @Override public Output asOutput() { return tensor; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListStack"; - - private Output tensor; - - private TensorListStack(Operation operation) { - super(operation); - int outputIdx = 0; - tensor = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.TensorListStack} + */ + public static class Options { + private Long numElements; + + private Options() { + } + + /** + * Sets the numElements option. + * + * @param numElements the numElements option + * @return this Options instance. + */ + public Options numElements(Long numElements) { + this.numElements = 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 cd3fd969829..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,66 +17,117 @@ 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 map with item from given key erased. - *

* input_handle: the original map * output_handle: the map with value from given key removed * key: the key of the value to be erased */ +@OpMetadata( + opType = TensorMapErase.OP_NAME, + inputsClass = TensorMapErase.Inputs.class +) @Operator public final class TensorMapErase extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorMapErase"; + + private Output outputHandle; + + @SuppressWarnings("unchecked") + public TensorMapErase(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorMapErase operation. - * + * * @param scope current scope - * @param inputHandle - * @param key - * @param valueDtype + * @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 */ - @Endpoint(describeByClass = true) - public static TensorMapErase create(Scope scope, Operand inputHandle, Operand key, Class valueDtype) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorMapErase", scope.makeOpName("TensorMapErase")); + @Endpoint( + describeByClass = true + ) + public static TensorMapErase create(Scope scope, + Operand inputHandle, Operand key, Class valueDtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorMapErase"); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(key.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("value_dtype", Operands.toDataType(valueDtype)); return new TensorMapErase(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorMapErase"; - - private Output outputHandle; - - private TensorMapErase(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); + + @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 75a432c34b1..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,63 +17,106 @@ 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; /** * Returns whether the given key exists in the map. - *

* input_handle: the input map * key: the key to check * has_key: whether the key is already in the map or not */ +@OpMetadata( + opType = TensorMapHasKey.OP_NAME, + inputsClass = TensorMapHasKey.Inputs.class +) @Operator public final class TensorMapHasKey extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorMapHasKey"; + + private Output hasKey; + + public TensorMapHasKey(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + hasKey = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorMapHasKey operation. - * + * * @param scope current scope - * @param inputHandle - * @param key + * @param inputHandle The inputHandle value + * @param key The key value * @return a new instance of TensorMapHasKey */ - @Endpoint(describeByClass = true) - public static TensorMapHasKey create(Scope scope, Operand inputHandle, Operand key) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorMapHasKey", scope.makeOpName("TensorMapHasKey")); + @Endpoint( + describeByClass = true + ) + public static TensorMapHasKey create(Scope scope, Operand inputHandle, + Operand key) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorMapHasKey"); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(key.asOutput()); - opBuilder = scope.apply(opBuilder); return new TensorMapHasKey(opBuilder.build()); } - + /** + * Gets hasKey. + * + * @return hasKey. */ public Output hasKey() { return hasKey; } - + @Override public Output asOutput() { return hasKey; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorMapHasKey"; - - private Output hasKey; - - private TensorMapHasKey(Operation operation) { - super(operation); - int outputIdx = 0; - hasKey = operation.output(outputIdx++); + + @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 2a1ea4eb399..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,66 +17,122 @@ 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 map that is the 'input_handle' with the given key-value pair inserted. - *

* input_handle: the original map * output_handle: the map with key and value inserted * key: the key to be inserted * value: the value to be inserted */ +@OpMetadata( + opType = TensorMapInsert.OP_NAME, + inputsClass = TensorMapInsert.Inputs.class +) @Operator public final class TensorMapInsert extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorMapInsert"; + + private Output outputHandle; + + @SuppressWarnings("unchecked") + public TensorMapInsert(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorMapInsert operation. - * + * * @param scope current scope - * @param inputHandle - * @param key - * @param value + * @param inputHandle The inputHandle value + * @param key The key value + * @param value The value value * @return a new instance of TensorMapInsert */ - @Endpoint(describeByClass = true) - public static TensorMapInsert create(Scope scope, Operand inputHandle, Operand key, Operand value) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorMapInsert", scope.makeOpName("TensorMapInsert")); + @Endpoint( + describeByClass = true + ) + public static TensorMapInsert create(Scope scope, Operand inputHandle, + Operand key, Operand value) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorMapInsert"); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(key.asOutput()); opBuilder.addInput(value.asOutput()); - opBuilder = scope.apply(opBuilder); return new TensorMapInsert(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorMapInsert"; - - private Output outputHandle; - - private TensorMapInsert(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); + + @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 a8b17f51ee1..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,67 +17,115 @@ 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 the value from a given key in a tensor map. - *

* input_handle: the input map * key: the key to be looked up * value: the value found from the given key - * - * @param data type for {@code value()} output */ +@OpMetadata( + opType = TensorMapLookup.OP_NAME, + inputsClass = TensorMapLookup.Inputs.class +) @Operator public final class TensorMapLookup extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorMapLookup"; + + private Output value; + + public TensorMapLookup(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + value = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorMapLookup operation. - * + * * @param scope current scope - * @param inputHandle - * @param key - * @param valueDtype + * @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 */ - @Endpoint(describeByClass = true) - public static TensorMapLookup create(Scope scope, Operand inputHandle, Operand key, Class valueDtype) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorMapLookup", scope.makeOpName("TensorMapLookup")); + @Endpoint( + describeByClass = true + ) + public static TensorMapLookup create(Scope scope, + Operand inputHandle, Operand key, Class valueDtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorMapLookup"); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(key.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("value_dtype", Operands.toDataType(valueDtype)); - return new TensorMapLookup(opBuilder.build()); + return new TensorMapLookup<>(opBuilder.build()); } - + /** + * Gets value. + * + * @return value. */ public Output value() { return value; } - + @Override public Output asOutput() { return value; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorMapLookup"; - - private Output value; - - private TensorMapLookup(Operation operation) { - super(operation); - int outputIdx = 0; - value = operation.output(outputIdx++); + + @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 8e3ea33c75b..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,59 +17,89 @@ 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; /** * Returns the number of tensors in the input tensor map. - *

* 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorMapSize"; + + private Output output; + + public TensorMapSize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorMapSize operation. - * + * * @param scope current scope - * @param inputHandle + * @param inputHandle The inputHandle value * @return a new instance of TensorMapSize */ - @Endpoint(describeByClass = true) - public static TensorMapSize create(Scope scope, Operand inputHandle) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorMapSize", scope.makeOpName("TensorMapSize")); + @Endpoint( + describeByClass = true + ) + public static TensorMapSize create(Scope scope, Operand inputHandle) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorMapSize"); opBuilder.addInput(inputHandle.asOutput()); - opBuilder = scope.apply(opBuilder); return new TensorMapSize(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorMapSize"; - - private Output output; - - private TensorMapSize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 6166ddb357f..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,64 +17,100 @@ 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorMapStackKeys"; + + private Output keys; + + public TensorMapStackKeys(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + keys = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorMapStackKeys operation. - * + * * @param scope current scope - * @param inputHandle - * @param keyDtype + * @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 */ - @Endpoint(describeByClass = true) - public static TensorMapStackKeys create(Scope scope, Operand inputHandle, Class keyDtype) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorMapStackKeys", scope.makeOpName("TensorMapStackKeys")); + @Endpoint( + describeByClass = true + ) + public static TensorMapStackKeys create(Scope scope, + Operand inputHandle, Class keyDtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorMapStackKeys"); opBuilder.addInput(inputHandle.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("key_dtype", Operands.toDataType(keyDtype)); - return new TensorMapStackKeys(opBuilder.build()); + return new TensorMapStackKeys<>(opBuilder.build()); } - + /** + * Gets keys. + * + * @return keys. */ public Output keys() { return keys; } - + @Override public Output asOutput() { return keys; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorMapStackKeys"; - - private Output keys; - - private TensorMapStackKeys(Operation operation) { - super(operation); - int outputIdx = 0; - keys = operation.output(outputIdx++); + + @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 52954e4e323..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,124 +17,231 @@ 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; /** - * Adds sparse `updates` to an existing tensor according to `indices`. - *

- * This operation creates a new tensor by adding sparse `updates` to the passed - * in `tensor`. - * This operation is very similar to `tf.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. - *

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

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

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

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

- * The simplest form of tensor_scatter_add is to add individual elements to a + * 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. + *

{@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}: + *

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

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

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

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: - *

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

- * We can also, insert entire slices of a higher rank tensor all at once. For + *

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) + * 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: - *

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

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) + * 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 { - /** - * Factory method to create a class wrapping a new TensorScatterNdAdd operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorScatterAdd"; + + private Output output; + + public TensorScatterNdAdd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorScatterAdd operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static TensorScatterNdAdd create(Scope scope, Operand tensor, Operand indices, Operand updates) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorScatterAdd", scope.makeOpName("TensorScatterNdAdd")); + @Endpoint( + describeByClass = true + ) + public static TensorScatterNdAdd create(Scope scope, Operand tensor, + 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()); - opBuilder = scope.apply(opBuilder); - return new TensorScatterNdAdd(opBuilder.build()); + 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. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorScatterAdd"; - - private Output output; - - private TensorScatterNdAdd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * 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 bd6d0be53e1..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,62 +17,177 @@ 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; /** - * @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 { - /** - * Factory method to create a class wrapping a new TensorScatterNdMax operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorScatterMax"; + + private Output output; + + public TensorScatterNdMax(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorScatterMax operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static TensorScatterNdMax create(Scope scope, Operand tensor, Operand indices, Operand updates) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorScatterMax", scope.makeOpName("TensorScatterNdMax")); + @Endpoint( + describeByClass = true + ) + public static TensorScatterNdMax create(Scope scope, Operand tensor, + 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()); - opBuilder = scope.apply(opBuilder); - return new TensorScatterNdMax(opBuilder.build()); + 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. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorScatterMax"; - - private Output output; - - private TensorScatterNdMax(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * 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 b823931fef8..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,62 +17,163 @@ 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; /** - * @param data type for {@code output()} output + * The TensorScatterMin operation */ +@OpMetadata( + opType = TensorScatterNdMin.OP_NAME, + inputsClass = TensorScatterNdMin.Inputs.class +) @Operator public final class TensorScatterNdMin extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TensorScatterNdMin operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorScatterMin"; + + private Output output; + + public TensorScatterNdMin(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorScatterMin operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static TensorScatterNdMin create(Scope scope, Operand tensor, Operand indices, Operand updates) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorScatterMin", scope.makeOpName("TensorScatterNdMin")); + @Endpoint( + describeByClass = true + ) + public static TensorScatterNdMin create(Scope scope, Operand tensor, + 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()); - opBuilder = scope.apply(opBuilder); - return new TensorScatterNdMin(opBuilder.build()); + 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. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorScatterMin"; - - private Output output; - - private TensorScatterNdMin(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * 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 a29743da711..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,60 +17,62 @@ 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; /** - * Subtracts sparse `updates` from an existing tensor according to `indices`. - *

- * This operation creates a new tensor by subtracting sparse `updates` from the - * passed in `tensor`. - * This operation is very similar to `tf.scatter_nd_sub`, except that the updates + * Subtracts sparse {@code updates} from an existing tensor according to {@code indices}. + * This operation creates a new tensor by subtracting sparse {@code updates} from the + * passed in {@code tensor}. + * This operation is very similar to {@code tf.scatter_nd_sub}, except that the updates * are subtracted from 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. - *

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

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

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

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

- * The simplest form of tensor_scatter_sub is to subtract individual elements + *

{@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}: + *

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

The last dimension of {@code indices} corresponds to indices into 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 + *

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

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

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

{@code
+ * 

In Python, this scatter subtract 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_sub(tensor, indices, updates)
  *     print(updated)
- * }
- * The resulting tensor would look like this: - *

- * [1, -10, 1, -9, -8, 1, 1, -11] - *

- * We can also, insert entire slices of a higher rank tensor all at once. For + *

+ *

The resulting tensor would look like this: + *

+ * [1, -10, 1, -9, -8, 1, 1, -11]
+ * 
+ *

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: - *

{@code
+ * 

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]],
@@ -79,61 +81,154 @@
  *     tensor = tf.ones([4, 4, 4],dtype=tf.int32)
  *     updated = tf.tensor_scatter_nd_sub(tensor, indices, updates)
  *     print(updated)
- * }
- * The resulting tensor would look like this: - *

- * [[[-4, -4, -4, -4], [-5, -5, -5, -5], [-6, -6, -6, -6], [-7, -7, -7, -7]], - * [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]], - * [[-4, -4, -4, -4], [-5, -5, -5, -5], [-6, -6, -6, -6], [-7, -7, -7, -7]], - * [[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. + *

+ *

The resulting tensor would look like this: + *

+ * [[[-4, -4, -4, -4], [-5, -5, -5, -5], [-6, -6, -6, -6], [-7, -7, -7, -7]],
+ *  [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]],
+ *  [[-4, -4, -4, -4], [-5, -5, -5, -5], [-6, -6, -6, -6], [-7, -7, -7, -7]],
+ *  [[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 */ +@OpMetadata( + opType = TensorScatterNdSub.OP_NAME, + inputsClass = TensorScatterNdSub.Inputs.class +) @Operator public final class TensorScatterNdSub extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TensorScatterNdSub operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorScatterSub"; + + private Output output; + + public TensorScatterNdSub(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorScatterSub operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static TensorScatterNdSub create(Scope scope, Operand tensor, Operand indices, Operand updates) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorScatterSub", scope.makeOpName("TensorScatterNdSub")); + @Endpoint( + describeByClass = true + ) + public static TensorScatterNdSub create(Scope scope, Operand tensor, + 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()); - opBuilder = scope.apply(opBuilder); - return new TensorScatterNdSub(opBuilder.build()); + 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. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorScatterSub"; - - private Output output; - - private TensorScatterNdSub(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * 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 6cb02e0a8a0..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,104 +17,202 @@ 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 `updates` into an existing tensor according to `indices`. - *

- * This operation creates a new tensor by applying sparse `updates` to the passed - * in `tensor`. - * This operation is very similar to `tf.scatter_nd`, except that the updates are + * Scatter {@code updates} into an existing tensor according to {@code indices}. + * This operation creates a new tensor by applying sparse {@code updates} to the passed + * in {@code tensor}. + * This operation is very similar to {@code tf.scatter_nd}, except that the updates are * scattered onto an existing tensor (as opposed to a zero-tensor). If the memory * for the existing tensor cannot be re-used, a copy is made and updated. - *

- * If `indices` contains duplicates, then 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. - * - The order in which updates are applied is nondeterministic, so the output - * will be nondeterministic if `indices` contains duplicates. - *

- * `indices` is an integer tensor containing indices into a new tensor of shape - * `shape`. + *

If {@code indices} contains duplicates, then we pick the last update for the index. + *

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

    - *
  • - * `indices` must have at least 2 axes: `(num_updates, index_depth)`. - *
  • - *
  • - * The last axis of `indices` is how deep to index into `tensor` so this index - * depth must be less than the rank of `tensor`: `indices.shape[-1] <= tensor.ndim` - *
  • + *
  • If an out of bound index is found, the index is ignored.
  • + *
  • The order in which updates are applied is nondeterministic, so the output + * will be nondeterministic if {@code indices} contains duplicates.
  • *
- * if `indices.shape[-1] = tensor.rank` this Op indexes and updates scalar elements. - * if `indices.shape[-1] < tensor.rank` it indexes and updates slices of the input - * `tensor`. - *

- * Each `update` has a rank of `tensor.rank - indices.shape[-1]`. - * The overall shape of `updates` is: - *

{@code
+ * 

{@code indices} is an integer tensor containing indices into a new tensor of shape + * {@code shape}. + *

    + *
  • {@code indices} must have at least 2 axes: {@code (num_updates, index_depth)}.
  • + *
  • The last axis of {@code indices} is how deep to index into {@code tensor} so this index + * depth must be less than the rank of {@code tensor}: {@code indices.shape[-1] <= tensor.ndim}
  • + *
+ *

if {@code indices.shape[-1] = tensor.rank} this Op indexes and updates scalar elements. + * if {@code indices.shape[-1] < tensor.rank} it indexes and updates slices of the input + * {@code tensor}. + *

Each {@code update} has a rank of {@code tensor.rank - indices.shape[-1]}. + * The overall shape of {@code updates} is: + *

  * indices.shape[:-1] + tensor.shape[indices.shape[-1]:]
- * }
- * For usage examples see the python [tf.tensor_scatter_nd_update]( - * https://www.tensorflow.org/api_docs/python/tf/tensor_scatter_nd_update) function - * - * - * @param data type for {@code output()} output + *
+ *

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 */ +@OpMetadata( + opType = TensorScatterNdUpdate.OP_NAME, + inputsClass = TensorScatterNdUpdate.Inputs.class +) @Operator public final class TensorScatterNdUpdate extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TensorScatterNdUpdate operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorScatterUpdate"; + + private Output output; + + public TensorScatterNdUpdate(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorScatterUpdate operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static TensorScatterNdUpdate create(Scope scope, Operand tensor, Operand indices, Operand updates) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorScatterUpdate", scope.makeOpName("TensorScatterNdUpdate")); + @Endpoint( + describeByClass = true + ) + public static TensorScatterNdUpdate create(Scope scope, Operand tensor, + 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()); - opBuilder = scope.apply(opBuilder); - return new TensorScatterNdUpdate(opBuilder.build()); + 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 * to the indices. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorScatterUpdate"; - - private Output output; - - private TensorScatterNdUpdate(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * 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 d7ad46b5362..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,108 +17,76 @@ 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; /** - * Assign `value` to the sliced l-value reference of `input`. - *

- * The values of `value` are assigned to the positions in the tensor `input` 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 `input`. - * - * @param data type for {@code output()} output + * Assign {@code value} to the sliced l-value reference of {@code input}. + * The values of {@code value} are assigned to the positions in the tensor {@code input} that + * are selected by the slice parameters. The slice parameters {@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 input}. */ +@OpMetadata( + opType = TensorStridedSliceUpdate.OP_NAME, + inputsClass = TensorStridedSliceUpdate.Inputs.class +) @Operator public final class TensorStridedSliceUpdate extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.TensorStridedSliceUpdate} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param beginMask - */ - public Options beginMask(Long beginMask) { - this.beginMask = beginMask; - return this; - } - - /** - * @param endMask - */ - public Options endMask(Long endMask) { - this.endMask = endMask; - return this; - } - - /** - * @param ellipsisMask - */ - public Options ellipsisMask(Long ellipsisMask) { - this.ellipsisMask = ellipsisMask; - return this; - } - - /** - * @param newAxisMask - */ - public Options newAxisMask(Long newAxisMask) { - this.newAxisMask = newAxisMask; - return this; - } - - /** - * @param shrinkAxisMask - */ - public Options shrinkAxisMask(Long shrinkAxisMask) { - this.shrinkAxisMask = shrinkAxisMask; - return this; - } - - private Long beginMask; - private Long endMask; - private Long ellipsisMask; - private Long newAxisMask; - private Long shrinkAxisMask; - - private Options() { - } + public static final String OP_NAME = "TensorStridedSliceUpdate"; + + private Output output; + + public TensorStridedSliceUpdate(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new TensorStridedSliceUpdate operation. - * + * * @param scope current scope - * @param input - * @param begin - * @param end - * @param strides - * @param value - * @param options carries optional attributes values + * @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 * @return a new instance of TensorStridedSliceUpdate */ - @Endpoint(describeByClass = true) - public static TensorStridedSliceUpdate create(Scope scope, Operand input, Operand begin, Operand end, Operand strides, Operand value, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorStridedSliceUpdate", scope.makeOpName("TensorStridedSliceUpdate")); + @Endpoint( + describeByClass = true + ) + public static TensorStridedSliceUpdate create(Scope scope, + Operand input, Operand begin, Operand end, Operand strides, Operand value, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorStridedSliceUpdate"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(begin.asOutput()); opBuilder.addInput(end.asOutput()); opBuilder.addInput(strides.asOutput()); opBuilder.addInput(value.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.beginMask != null) { @@ -138,63 +106,225 @@ public static TensorStridedSliceUpdate c } } } - return new TensorStridedSliceUpdate(opBuilder.build()); + return new TensorStridedSliceUpdate<>(opBuilder.build()); } - + /** - * @param beginMask + * Sets the beginMask option. + * + * @param beginMask the beginMask option + * @return this Options instance. */ public static Options beginMask(Long beginMask) { return new Options().beginMask(beginMask); } - + /** - * @param endMask + * Sets the endMask option. + * + * @param endMask the endMask option + * @return this Options instance. */ public static Options endMask(Long endMask) { return new Options().endMask(endMask); } - + /** - * @param ellipsisMask + * Sets the ellipsisMask option. + * + * @param ellipsisMask the ellipsisMask option + * @return this Options instance. */ public static Options ellipsisMask(Long ellipsisMask) { return new Options().ellipsisMask(ellipsisMask); } - + /** - * @param newAxisMask + * Sets the newAxisMask option. + * + * @param newAxisMask the newAxisMask option + * @return this Options instance. */ public static Options newAxisMask(Long newAxisMask) { return new Options().newAxisMask(newAxisMask); } - + /** - * @param shrinkAxisMask + * Sets the shrinkAxisMask option. + * + * @param shrinkAxisMask the shrinkAxisMask option + * @return this Options instance. */ public static Options shrinkAxisMask(Long shrinkAxisMask) { return new Options().shrinkAxisMask(shrinkAxisMask); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorStridedSliceUpdate"; - - private Output output; - - private TensorStridedSliceUpdate(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.TensorStridedSliceUpdate} + */ + public static class Options { + private Long beginMask; + + private Long endMask; + + private Long ellipsisMask; + + private Long newAxisMask; + + private Long shrinkAxisMask; + + private Options() { + } + + /** + * Sets the beginMask option. + * + * @param beginMask the beginMask option + * @return this Options instance. + */ + public Options beginMask(Long beginMask) { + this.beginMask = beginMask; + return this; + } + + /** + * Sets the endMask option. + * + * @param endMask the endMask option + * @return this Options instance. + */ + public Options endMask(Long endMask) { + this.endMask = endMask; + return this; + } + + /** + * Sets the ellipsisMask option. + * + * @param ellipsisMask the ellipsisMask option + * @return this Options instance. + */ + public Options ellipsisMask(Long ellipsisMask) { + this.ellipsisMask = ellipsisMask; + return this; + } + + /** + * Sets the newAxisMask option. + * + * @param newAxisMask the newAxisMask option + * @return this Options instance. + */ + public Options newAxisMask(Long newAxisMask) { + this.newAxisMask = newAxisMask; + return this; + } + + /** + * Sets the shrinkAxisMask option. + * + * @param shrinkAxisMask the shrinkAxisMask option + * @return this Options instance. + */ + public Options shrinkAxisMask(Long shrinkAxisMask) { + this.shrinkAxisMask = 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 c7ee253114c..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,88 +17,141 @@ 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; /** * Constructs a tensor by tiling a given tensor. - *

- * This operation creates a new tensor by replicating `input` `multiples` times. - * The output tensor's i'th dimension has `input.dims(i) * multiples[i]` elements, - * and the values of `input` are replicated `multiples[i]` times along the 'i'th - * dimension. For example, tiling `[a b c d]` by `[2]` produces - * `[a b c d a b c d]`. - *

- * >>> a = tf.constant([[1,2,3],[4,5,6]], tf.int32) - * >>> b = tf.constant([1,2], tf.int32) - * >>> tf.tile(a, b) - * + *

+ *
+ *

a = tf.constant([[1,2,3],[4,5,6]], tf.int32) + * b = tf.constant([1,2], tf.int32) + * tf.tile(a, b) + * <tf.Tensor: shape=(2, 6), dtype=int32, numpy= * array([[1, 2, 3, 1, 2, 3], - * [4, 5, 6, 4, 5, 6]], dtype=int32)> - * >>> c = tf.constant([2,1], tf.int32) - * >>> tf.tile(a, c) - * - * >>> d = tf.constant([2,2], tf.int32) - * >>> tf.tile(a, d) - * - * - * @param data type for {@code output()} output + * [4, 5, 6, 4, 5, 6], + * [1, 2, 3, 1, 2, 3], + * [4, 5, 6, 4, 5, 6]], dtype=int32)> + *

+ *
+ * */ +@OpMetadata( + opType = Tile.OP_NAME, + inputsClass = Tile.Inputs.class +) @Operator public final class Tile extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Tile"; + + private Output output; + + public Tile(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Tile operation. - * + * * @param scope current scope - * @param input 1-D or higher. - * @param multiples 1-D. Length must be the same as the number of dimensions in `input` + * @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 */ - @Endpoint(describeByClass = true) - public static Tile create(Scope scope, Operand input, Operand multiples) { - OperationBuilder opBuilder = scope.env().opBuilder("Tile", scope.makeOpName("Tile")); + @Endpoint( + describeByClass = true + ) + public static Tile create(Scope scope, Operand input, + Operand multiples) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Tile"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(multiples.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Tile(opBuilder.build()); + return new Tile<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Tile"; - - private Output output; - - private Tile(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 30a7d13d4a5..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,59 +17,89 @@ 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 `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. + * Returns the timestamp as a {@code float64} for seconds since the Unix epoch. + *

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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Timestamp"; + + private Output ts; + + public Timestamp(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + ts = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Timestamp operation. - * + * * @param scope current scope * @return a new instance of Timestamp */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Timestamp create(Scope scope) { - OperationBuilder opBuilder = scope.env().opBuilder("Timestamp", scope.makeOpName("Timestamp")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Timestamp"); return new Timestamp(opBuilder.build()); } - + /** + * Gets ts. + * + * @return ts. */ public Output ts() { return ts; } - + @Override public Output asOutput() { return ts; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Timestamp"; - - private Output ts; - - private Timestamp(Operation operation) { - super(operation); - int outputIdx = 0; - ts = operation.output(outputIdx++); + + @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 1904a513a5a..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,21 +17,25 @@ 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; /** - * Returns the TopK unique values in the array in sorted order. The - *

- * running time is proportional to the product of K and the input + * Returns the TopK unique values in the array in sorted order. + * The running time is proportional to the product of K and the input * size. Sorting the whole array is more efficient for sufficiently large * values of K. The median-of-medians algorithm is probably faster, but * difficult to implement efficiently in XLA. If there are fewer than K @@ -44,48 +48,83 @@ * 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TopKUnique"; + + private Output topk; + + private Output topkIndices; + + public TopKUnique(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + topk = operation.output(outputIdx++); + topkIndices = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TopKUnique operation. - * + * * @param scope current scope - * @param input - * @param k + * @param input The input value + * @param k The value of the k attribute * @return a new instance of TopKUnique */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TopKUnique create(Scope scope, Operand input, Long k) { - OperationBuilder opBuilder = scope.env().opBuilder("TopKUnique", scope.makeOpName("TopKUnique")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TopKUnique"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("k", k); return new TopKUnique(opBuilder.build()); } - + /** + * Gets topk. + * + * @return topk. */ public Output topk() { return topk; } - + /** + * Gets topkIndices. + * + * @return topkIndices. */ public Output topkIndices() { return topkIndices; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TopKUnique"; - - private Output topk; - private Output topkIndices; - - private TopKUnique(Operation operation) { - super(operation); - int outputIdx = 0; - topk = operation.output(outputIdx++); - topkIndices = operation.output(outputIdx++); + + @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 a2cc2c2adf5..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,67 +17,107 @@ 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; /** - * Returns the TopK values in the array in sorted order. This is a combination - *

- * of MakeUnique and TopKUnique. The returned top-K will have its lower bits - * replaced by iota, thus it will be close to the original value but not exactly - * the same. The running time is proportional to the product of K and the input - * size. NaNs are never returned. Subnormal numbers are flushed to zero. + * Returns the TopK values in the array in sorted order. + * This is a combination of MakeUnique and TopKUnique. The returned top-K will + * have its lower bits replaced by iota, thus it will be close to the original + * value but not exactly the same. The running time is proportional to the product + * of K and the input size. NaNs are never returned. Subnormal numbers are flushed + * to zero. */ +@OpMetadata( + opType = TopKWithUnique.OP_NAME, + inputsClass = TopKWithUnique.Inputs.class +) @Operator public final class TopKWithUnique extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TopKWithUnique"; + + private Output topk; + + private Output topkIndices; + + public TopKWithUnique(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + topk = operation.output(outputIdx++); + topkIndices = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TopKWithUnique operation. - * + * * @param scope current scope - * @param input - * @param k + * @param input The input value + * @param k The value of the k attribute * @return a new instance of TopKWithUnique */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TopKWithUnique create(Scope scope, Operand input, Long k) { - OperationBuilder opBuilder = scope.env().opBuilder("TopKWithUnique", scope.makeOpName("TopKWithUnique")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TopKWithUnique"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("k", k); return new TopKWithUnique(opBuilder.build()); } - + /** + * Gets topk. + * + * @return topk. */ public Output topk() { return topk; } - + /** + * Gets topkIndices. + * + * @return topkIndices. */ public Output topkIndices() { return topkIndices; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TopKWithUnique"; - - private Output topk; - private Output topkIndices; - - private TopKWithUnique(Operation operation) { - super(operation); - int outputIdx = 0; - topk = operation.output(outputIdx++); - topkIndices = operation.output(outputIdx++); + + @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/TryRpc.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TryRpc.java deleted file mode 100644 index eaf5f97335b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TryRpc.java +++ /dev/null @@ -1,226 +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.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.TString; - -/** - * Perform batches of RPC requests. - *

- * This op asynchronously performs either a single RPC request, or a batch - * of requests. RPC requests are defined by three main parameters: - *

- * - `address` (the host+port or BNS address of the request) - * - `method` (the method name for the request) - * - `request` (the serialized proto string, or vector of strings, - * of the RPC request argument). - *

- * For example, if you have an RPC service running on port localhost:2345, - * and its interface is configured with the following proto declaration: - *

{@code
- * service MyService {
- *   rpc MyMethod(MyRequestProto) returns (MyResponseProto) {
- *   }
- * };
- * }
- * then call this op with arguments: - *
{@code
- * address = "localhost:2345"
- * method = "MyService/MyMethod"
- * }
- * The `request` tensor is a string tensor representing serialized `MyRequestProto` - * strings; and the output string tensor `response` will have the same shape - * and contain (upon successful completion) corresponding serialized - * `MyResponseProto` strings. - *

- * For example, to send a single, empty, `MyRequestProto`, call - * this op with `request = ""`. To send 5 parallel empty requests, - * call this op with `request = ["", "", "", "", ""]`. - *

- * More generally, one can create a batch of `MyRequestProto` serialized protos - * from regular batched tensors using the `encode_proto` op, and convert - * the response `MyResponseProto` serialized protos to batched tensors - * using the `decode_proto` op. - *

- * NOTE Working with serialized proto strings is faster than instantiating - * actual proto objects in memory, so no performance degradation is expected - * compared to writing custom kernels for this workflow. - *

- * Unlike the standard `Rpc` op, if the connection fails or the remote worker - * returns an error status, this op does not reraise the exception. - * Instead, the `status_code` and `status_message` entry for the corresponding RPC - * call is set with the error returned from the RPC call. The `response` tensor - * will contain valid response values for those minibatch entries whose RPCs did - * not fail; the rest of the entries will have empty strings. - */ -@Operator -public final class TryRpc extends RawOp { - - /** - * Optional attributes for {@link org.tensorflow.op.core.TryRpc} - */ - public static class Options { - - /** - * @param protocol RPC protocol to use. Empty string means use the default protocol. - * Options include 'grpc'. - */ - public Options protocol(String protocol) { - this.protocol = protocol; - return this; - } - - /** - * @param failFast `boolean`. If `true` (default), then failures to connect - * (i.e., the server does not immediately respond) cause an RPC failure. - */ - public Options failFast(Boolean failFast) { - this.failFast = failFast; - return this; - } - - /** - * @param timeoutInMs `int`. If `0` (default), then the kernel will run the RPC - * request and only time out if the RPC deadline passes or the session times out. - * If this value is greater than `0`, then the op will raise an exception if - * the RPC takes longer than `timeout_in_ms`. - */ - public Options timeoutInMs(Long timeoutInMs) { - this.timeoutInMs = timeoutInMs; - return this; - } - - private String protocol; - private Boolean failFast; - private Long timeoutInMs; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new TryRpc operation. - * - * @param scope current scope - * @param address `0-D` or `1-D`. The address (i.e. host_name:port) of the RPC server. - * If this tensor has more than 1 element, then multiple parallel rpc requests - * are sent. This argument broadcasts with `method` and `request`. - * @param method `0-D` or `1-D`. The method address on the RPC server. - * If this tensor has more than 1 element, then multiple parallel rpc requests - * are sent. This argument broadcasts with `address` and `request`. - * @param request `0-D` or `1-D`. Serialized proto strings: the rpc request argument. - * If this tensor has more than 1 element, then multiple parallel rpc requests - * are sent. This argument broadcasts with `address` and `method`. - * @param options carries optional attributes values - * @return a new instance of TryRpc - */ - @Endpoint(describeByClass = true) - public static TryRpc create(Scope scope, Operand address, Operand method, Operand request, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("TryRpc", scope.makeOpName("TryRpc")); - opBuilder.addInput(address.asOutput()); - opBuilder.addInput(method.asOutput()); - opBuilder.addInput(request.asOutput()); - opBuilder = scope.apply(opBuilder); - if (options != null) { - for (Options opts : options) { - if (opts.protocol != null) { - opBuilder.setAttr("protocol", opts.protocol); - } - if (opts.failFast != null) { - opBuilder.setAttr("fail_fast", opts.failFast); - } - if (opts.timeoutInMs != null) { - opBuilder.setAttr("timeout_in_ms", opts.timeoutInMs); - } - } - } - return new TryRpc(opBuilder.build()); - } - - /** - * @param protocol RPC protocol to use. Empty string means use the default protocol. - * Options include 'grpc'. - */ - public static Options protocol(String protocol) { - return new Options().protocol(protocol); - } - - /** - * @param failFast `boolean`. If `true` (default), then failures to connect - * (i.e., the server does not immediately respond) cause an RPC failure. - */ - public static Options failFast(Boolean failFast) { - return new Options().failFast(failFast); - } - - /** - * @param timeoutInMs `int`. If `0` (default), then the kernel will run the RPC - * request and only time out if the RPC deadline passes or the session times out. - * If this value is greater than `0`, then the op will raise an exception if - * the RPC takes longer than `timeout_in_ms`. - */ - public static Options timeoutInMs(Long timeoutInMs) { - return new Options().timeoutInMs(timeoutInMs); - } - - /** - * Same shape as `request`. Serialized proto strings: the rpc responses. - */ - public Output response() { - return response; - } - - /** - * Same shape as `request`. Values correspond to tensorflow Status enum codes. - */ - public Output statusCode() { - return statusCode; - } - - /** - * Same shape as `request`. Values correspond to Status messages - * returned from the RPC calls. - */ - public Output statusMessage() { - return statusMessage; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TryRpc"; - - private Output response; - private Output statusCode; - private Output statusMessage; - - private TryRpc(Operation operation) { - super(operation); - int outputIdx = 0; - response = operation.output(outputIdx++); - statusCode = operation.output(outputIdx++); - statusMessage = operation.output(outputIdx++); - } -} 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 4d2ccd8e552..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,90 +17,83 @@ 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; /** * Reverses the operation of Batch for a single output Tensor. - *

* An instance of Unbatch either receives an empty batched_tensor, in which case it * asynchronously waits until the values become available from a concurrently * running instance of Unbatch with the same container and shared_name, or receives * a non-empty batched_tensor in which case it finalizes all other concurrently * running instances and outputs its own element from the batch. - *

- * batched_tensor: The possibly transformed output of Batch. The size of the first - * dimension should remain unchanged by the transformations for the operation to - * work. + *

batched_tensor: The possibly transformed output of Batch. The size of the first + * dimension should remain unchanged by the transformations for the operation to + * work. * batch_index: The matching batch_index obtained from Batch. * id: The id scalar emitted by Batch. * unbatched_tensor: The Tensor corresponding to this execution. * timeout_micros: Maximum amount of time (in microseconds) to wait to receive the - * batched input tensor associated with a given invocation of the op. + * batched input tensor associated with a given invocation of the op. * container: Container to control resource sharing. * 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 unbatchedTensor()} output + * assumed to possibly belong to the same batch. If left empty, the op name will + * be used as the shared name. */ +@OpMetadata( + opType = Unbatch.OP_NAME, + inputsClass = Unbatch.Inputs.class +) @Operator public final class Unbatch extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Unbatch} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "Unbatch"; + + private Output unbatchedTensor; + + public Unbatch(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + unbatchedTensor = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Unbatch operation. - * + * * @param scope current scope - * @param batchedTensor - * @param batchIndex - * @param id - * @param timeoutMicros - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static Unbatch create(Scope scope, Operand batchedTensor, Operand batchIndex, Operand id, Long timeoutMicros, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Unbatch", scope.makeOpName("Unbatch")); + @Endpoint( + describeByClass = true + ) + public static Unbatch create(Scope scope, Operand batchedTensor, + Operand batchIndex, Operand id, Long timeoutMicros, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Unbatch"); opBuilder.addInput(batchedTensor.asOutput()); opBuilder.addInput(batchIndex.asOutput()); opBuilder.addInput(id.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("timeout_micros", timeoutMicros); if (options != null) { for (Options opts : options) { @@ -112,42 +105,126 @@ public static Unbatch create(Scope scope, Operand batche } } } - return new Unbatch(opBuilder.build()); + return new Unbatch<>(opBuilder.build()); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * 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 unbatchedTensor. + * + * @return unbatchedTensor. */ public Output unbatchedTensor() { return unbatchedTensor; } - + @Override public Output asOutput() { return unbatchedTensor; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Unbatch"; - - private Output unbatchedTensor; - - private Unbatch(Operation operation) { - super(operation); - int outputIdx = 0; - unbatchedTensor = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Unbatch} + */ + 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; + } + } + + @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 91bb7c52cf4..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,25 +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.TInt64; import org.tensorflow.types.family.TType; /** * Gradient of Unbatch. - *

* Acts like Batch but using the given batch_index index of batching things as they * become available. This ensures that the gradients are propagated back in the * same session which did the forward pass. - *

- * original_input: The input to the Unbatch operation this is the gradient of. + *

original_input: The input to the Unbatch operation this is the gradient of. * batch_index: The batch_index given to the Unbatch operation this is the gradient * of. * grad: The downstream gradient. @@ -43,61 +47,50 @@ * batched_grad: The return value, either an empty tensor or the batched gradient. * container: Container to control resource sharing. * 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 batchedGrad()} output + * are assumed to possibly belong to the same batch. If left empty, the op name + * will be used as the shared name. */ +@OpMetadata( + opType = UnbatchGrad.OP_NAME, + inputsClass = UnbatchGrad.Inputs.class +) @Operator public final class UnbatchGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.UnbatchGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "UnbatchGrad"; + + private Output batchedGrad; + + public UnbatchGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + batchedGrad = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new UnbatchGrad operation. - * + * * @param scope current scope - * @param originalInput - * @param batchIndex - * @param grad - * @param id - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static UnbatchGrad create(Scope scope, Operand originalInput, Operand batchIndex, Operand grad, Operand id, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("UnbatchGrad", scope.makeOpName("UnbatchGrad")); + @Endpoint( + describeByClass = true + ) + public static UnbatchGrad create(Scope scope, Operand originalInput, + Operand batchIndex, Operand grad, Operand id, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UnbatchGrad"); opBuilder.addInput(originalInput.asOutput()); opBuilder.addInput(batchIndex.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(id.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.container != null) { @@ -108,42 +101,126 @@ public static UnbatchGrad create(Scope scope, Operand or } } } - return new UnbatchGrad(opBuilder.build()); + return new UnbatchGrad<>(opBuilder.build()); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * 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 batchedGrad. + * + * @return batchedGrad. */ public Output batchedGrad() { return batchedGrad; } - + @Override public Output asOutput() { return batchedGrad; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnbatchGrad"; - - private Output batchedGrad; - - private UnbatchGrad(Operation operation) { - super(operation); - int outputIdx = 0; - batchedGrad = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.UnbatchGrad} + */ + 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; + } + } + + @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 acbbbbc14cb..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,127 +17,185 @@ 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; /** * Finds unique elements along an axis of a tensor. - *

- * This operation either returns a tensor `y` containing unique elements - * along the `axis` of a tensor. The returned unique elements is sorted - * in the same order as they occur along `axis` in `x`. - * This operation also returns a tensor `idx` that is the same size as - * the number of the elements in `x` along the `axis` dimension. It - * contains the index in the unique output `y`. - * In other words, for an `1-D` tensor `x` with `axis = None: - *

- * `y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]` - *

- * For example: - *

{@code
+ * This operation either returns a tensor {@code y} containing unique elements
+ * along the {@code axis} of a tensor. The returned unique elements is sorted
+ * in the same order as they occur along {@code axis} in {@code x}.
+ * This operation also returns a tensor {@code idx} that is the same size as
+ * the number of the elements in {@code x} along the {@code axis} dimension. It
+ * contains the index in the unique output {@code y}.
+ * In other words, for an {@code 1-D} tensor {@code x} with `axis = None:
+ * 

{@code y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]} + *

For example: + *

  * # tensor 'x' is [1, 1, 2, 4, 4, 4, 7, 8, 8]
  * y, idx = unique(x)
- * y ==> [1, 2, 4, 7, 8]
- * idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
- * }
- * For an `2-D` tensor `x` with `axis = 0`: - *
{@code
+ * y ==> [1, 2, 4, 7, 8]
+ * idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
+ * 
+ *

For an {@code 2-D} tensor {@code x} with {@code axis = 0}: + *

  * # tensor 'x' is [[1, 0, 0],
  * #                [1, 0, 0],
  * #                [2, 0, 0]]
  * y, idx = unique(x, axis=0)
- * y ==> [[1, 0, 0],
+ * y ==> [[1, 0, 0],
  *        [2, 0, 0]]
- * idx ==> [0, 0, 1]
- * }
- * For an `2-D` tensor `x` with `axis = 1`: - *
{@code
+ * idx ==> [0, 0, 1]
+ * 
+ *

For an {@code 2-D} tensor {@code x} with {@code axis = 1}: + *

  * # tensor 'x' is [[1, 0, 0],
  * #                [1, 0, 0],
  * #                [2, 0, 0]]
  * y, idx = unique(x, axis=1)
- * y ==> [[1, 0],
+ * y ==> [[1, 0],
  *        [1, 0],
  *        [2, 0]]
- * idx ==> [0, 1, 1]
- * }
- * - * - * @param data type for {@code y()} output - * @param data type for {@code idx()} output + * idx ==> [0, 1, 1] + *
*/ +@OpMetadata( + opType = Unique.OP_NAME, + inputsClass = Unique.Inputs.class +) @Operator public final class Unique extends RawOp { - /** - * Factory method to create a class wrapping a new Unique operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UniqueV2"; + + private Output y; + + private Output idx; + + public Unique(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + idx = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new UniqueV2 operation. + * * @param scope current scope - * @param x A `Tensor`. - * @param axis A `Tensor` of type `int32` (default: None). The axis of the Tensor to + * @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 + * @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 */ - @Endpoint(describeByClass = true) - public static Unique create(Scope scope, Operand x, Operand axis, Class outIdx) { - OperationBuilder opBuilder = scope.env().opBuilder("UniqueV2", scope.makeOpName("Unique")); + @Endpoint( + describeByClass = true + ) + public static Unique create(Scope scope, Operand x, + Operand axis, Class outIdx) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Unique"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_idx", Operands.toDataType(outIdx)); - return new Unique(opBuilder.build()); + return new Unique<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Unique operation using default output types. - * + * Factory method to create a class wrapping a new UniqueV2 operation, with the default output types. + * * @param scope current scope - * @param x A `Tensor`. - * @param axis A `Tensor` of type `int32` (default: None). The axis of the Tensor to + * @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. - * @return a new instance of Unique + * @param data type for {@code UniqueV2} output and operands + * @return a new instance of Unique, with default output types */ - @Endpoint(describeByClass = true) - public static Unique create(Scope scope, Operand x, Operand axis) { + @Endpoint( + describeByClass = true + ) + public static Unique create(Scope scope, Operand x, + Operand axis) { return create(scope, x, axis, TInt32.class); } - + /** - * A `Tensor`. Unique elements along the `axis` of `Tensor` x. + * Gets y. + * A {@code Tensor}. Unique elements along the {@code axis} of {@code Tensor} x. + * @return y. */ public Output y() { return y; } - + /** + * Gets idx. * A 1-D Tensor. Has the same type as x that contains the index of each * value of x in the output y. + * @return idx. */ public Output idx() { return idx; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UniqueV2"; - - private Output y; - private Output idx; - - private Unique(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - idx = operation.output(outputIdx++); + + @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 b2a9a5c2193..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,140 +17,201 @@ 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; /** * Finds unique elements along an axis of a tensor. - *

- * This operation either returns a tensor `y` containing unique elements - * along the `axis` of a tensor. The returned unique elements is sorted - * in the same order as they occur along `axis` in `x`. - * This operation also returns a tensor `idx` and a tensor `count` - * that are the same size as the number of the elements in `x` along the - * `axis` dimension. The `idx` contains the index in the unique output `y` - * and the `count` contains the count in the unique output `y`. - * In other words, for an `1-D` tensor `x` with `axis = None: - *

- * `y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]` - *

- * For example: - *

{@code
- * # tensor 'x' is [1, 1, 2, 4, 4, 4, 7, 8, 8]
- * y, idx, count = unique_with_counts(x)
- * y ==> [1, 2, 4, 7, 8]
- * idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
- * count ==> [2, 1, 3, 1, 2]
- * }
- * For an `2-D` tensor `x` with `axis = 0`: - *
{@code
- * # tensor 'x' is [[1, 0, 0],
- * #                [1, 0, 0],
- * #                [2, 0, 0]]
- * y, idx, count = unique_with_counts(x, axis=0)
- * y ==> [[1, 0, 0],
+ * This operation either returns a tensor {@code y} containing unique elements
+ * along the {@code axis} of a tensor. The returned unique elements is sorted
+ * in the same order as they occur along {@code axis} in {@code x}.
+ * This operation also returns a tensor {@code idx} and a tensor {@code count}
+ * that are the same size as the number of the elements in {@code x} along the
+ * {@code axis} dimension. The {@code idx} contains the index in the unique output {@code y}
+ * and the {@code count} contains the count in the unique output {@code y}.
+ * In other words, for an {@code 1-D} tensor {@code x} with `axis = None:
+ * 

{@code y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]} + *

For example: + *

+ * x = tf.constant([1, 1, 2, 4, 4, 4, 7, 8, 8])
+ * 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]
+ * 
+ *

For a {@code 2-D} tensor {@code x} with {@code axis = 0}: + *

+ * x = tf.constant([[1, 0, 0],
+ *                 [1, 0, 0],
+ *                 [2, 0, 0]])
+ * y, idx, count = tf.raw_ops.UniqueWithCountsV2(x=x, axis=[0])
+ * y ==> [[1, 0, 0],
  *        [2, 0, 0]]
- * idx ==> [0, 0, 1]
- * count ==> [2, 1]
- * }
- * For an `2-D` tensor `x` with `axis = 1`: - *
{@code
- * # tensor 'x' is [[1, 0, 0],
- * #                [1, 0, 0],
- * #                [2, 0, 0]]
- * y, idx, count = unique_with_counts(x, axis=1)
- * y ==> [[1, 0],
+ * idx ==> [0, 0, 1]
+ * count ==> [2, 1]
+ * 
+ *

For a {@code 2-D} tensor {@code x} with {@code axis = 1}: + *

+ * x = tf.constant([[1, 0, 0],
+ *                 [1, 0, 0],
+ *                 [2, 0, 0]])
+ * 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 + * idx ==> [0, 1, 1] + * count ==> [1, 2] + *
*/ +@OpMetadata( + opType = UniqueWithCounts.OP_NAME, + inputsClass = UniqueWithCounts.Inputs.class +) @Operator public final class UniqueWithCounts extends RawOp { - /** - * Factory method to create a class wrapping a new UniqueWithCounts operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UniqueWithCountsV2"; + + private Output y; + + private Output idx; + + private Output count; + + public UniqueWithCounts(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + idx = operation.output(outputIdx++); + count = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new UniqueWithCountsV2 operation. + * * @param scope current scope - * @param x A `Tensor`. - * @param axis A `Tensor` of type `int32` (default: None). The axis of the Tensor to + * @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 + * @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 */ - @Endpoint(describeByClass = true) - public static UniqueWithCounts create(Scope scope, Operand x, Operand axis, Class outIdx) { - OperationBuilder opBuilder = scope.env().opBuilder("UniqueWithCountsV2", scope.makeOpName("UniqueWithCounts")); + @Endpoint( + describeByClass = true + ) + public static UniqueWithCounts create(Scope scope, + Operand x, Operand axis, Class outIdx) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UniqueWithCounts"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_idx", Operands.toDataType(outIdx)); - return new UniqueWithCounts(opBuilder.build()); + return new UniqueWithCounts<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new UniqueWithCounts operation using default output types. - * + * Factory method to create a class wrapping a new UniqueWithCountsV2 operation, with the default output types. + * * @param scope current scope - * @param x A `Tensor`. - * @param axis A `Tensor` of type `int32` (default: None). The axis of the Tensor to + * @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. - * @return a new instance of UniqueWithCounts + * @param data type for {@code UniqueWithCountsV2} output and operands + * @return a new instance of UniqueWithCounts, with default output types */ - @Endpoint(describeByClass = true) - public static UniqueWithCounts create(Scope scope, Operand x, Operand axis) { + @Endpoint( + describeByClass = true + ) + public static UniqueWithCounts create(Scope scope, Operand x, + Operand axis) { return create(scope, x, axis, TInt32.class); } - + /** - * A `Tensor`. Unique elements along the `axis` of `Tensor` x. + * Gets y. + * A {@code Tensor}. Unique elements along the {@code axis} of {@code Tensor} x. + * @return y. */ public Output y() { return y; } - + /** + * Gets idx. * A 1-D Tensor. Has the same type as x that contains the index of each * value of x in the output y. + * @return idx. */ public Output idx() { return idx; } - + /** + * Gets count. * A 1-D Tensor. The count of each value of x in the output y. + * @return count. */ public Output count() { return count; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UniqueWithCountsV2"; - - private Output y; - private Output idx; - private Output count; - - private UniqueWithCounts(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - idx = operation.output(outputIdx++); - count = operation.output(outputIdx++); + + @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 0ce98a63884..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,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; /** * Converts an array of flat indices into a tuple of coordinate arrays. - *

- * * Example: - *

{@code
+ * 
  * y = tf.unravel_index(indices=[2, 5, 7], dims=[3, 3])
  * # 'dims' represent a hypothetical (3, 3) tensor of indices:
  * # [[0, 1, *2*],
@@ -40,60 +44,98 @@
  * #  [6, *7*, 8]]
  * # For each entry from 'indices', this operation returns
  * # its coordinates (marked with '*'), such as
- * # 2 ==> (0, 2)
- * # 5 ==> (1, 2)
- * # 7 ==> (2, 1)
- * y ==> [[0, 1, 2], [2, 2, 1]]
- * }
- * @compatibility(numpy) + * # 2 ==> (0, 2) + * # 5 ==> (1, 2) + * # 7 ==> (2, 1) + * y ==> [[0, 1, 2], [2, 2, 1]] + *
+ *

{@literal @}compatibility(numpy)
* Equivalent to np.unravel_index - * @end_compatibility - * - * @param data type for {@code output()} output + *
{@literal @}end_compatibility */ +@OpMetadata( + opType = UnravelIndex.OP_NAME, + inputsClass = UnravelIndex.Inputs.class +) @Operator public final class UnravelIndex extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UnravelIndex"; + + private Output output; + + public UnravelIndex(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new UnravelIndex operation. - * + * * @param scope current scope - * @param indices An 0-D or 1-D `int` Tensor whose elements are indices into the + * @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 `int` Tensor. The shape of the array to use for unraveling + * @param dims An 1-D {@code int} Tensor. The shape of the array to use for unraveling * indices. + * @param data type for {@code UnravelIndex} output and operands * @return a new instance of UnravelIndex */ - @Endpoint(describeByClass = true) - public static UnravelIndex create(Scope scope, Operand indices, Operand dims) { - OperationBuilder opBuilder = scope.env().opBuilder("UnravelIndex", scope.makeOpName("UnravelIndex")); + @Endpoint( + describeByClass = true + ) + public static UnravelIndex create(Scope scope, Operand indices, + Operand dims) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UnravelIndex"); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(dims.asOutput()); - opBuilder = scope.apply(opBuilder); - return new UnravelIndex(opBuilder.build()); + return new UnravelIndex<>(opBuilder.build()); } - + /** + * Gets output. * An 2-D (or 1-D if indices is 0-D) tensor where each row has the * same shape as the indices array. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnravelIndex"; - - private Output output; - - private UnravelIndex(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 f1c46f3fa39..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,71 +20,72 @@ 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; /** - * Unpacks a given dimension of a rank-`R` tensor into `num` rank-`(R-1)` tensors. - *

- * Unpacks `num` tensors from `value` by chipping it along the `axis` dimension. - * For example, given a tensor of shape `(A, B, C, D)`; - *

- * If `axis == 0` then the i'th tensor in `output` is the slice `value[i, :, :, :]` - * and each tensor in `output` will have shape `(B, C, D)`. (Note that the - * dimension unpacked along is gone, unlike `split`). - *

- * If `axis == 1` then the i'th tensor in `output` is the slice `value[:, i, :, :]` - * and each tensor in `output` will have shape `(A, C, D)`. + * Unpacks a given dimension of a rank-{@code R} tensor into {@code num} rank-{@code (R-1)} tensors. + * Unpacks {@code num} tensors from {@code value} by chipping it along the {@code axis} dimension. + * For example, given a tensor of shape {@code (A, B, C, D)}; + *

If {@code axis == 0} then the i'th tensor in {@code output} is the slice {@code value[i, :, :, :]} + * and each tensor in {@code output} will have shape {@code (B, C, D)}. (Note that the + * dimension unpacked along is gone, unlike {@code split}). + *

If {@code axis == 1} then the i'th tensor in {@code output} is the slice {@code value[:, i, :, :]} + * and each tensor in {@code output} will have shape {@code (A, C, D)}. * Etc. - *

- * This is the opposite of `pack`. - * - * @param data type for {@code output()} output + *

This is the opposite of {@code pack}. */ +@OpMetadata( + opType = Unstack.OP_NAME, + inputsClass = Unstack.Inputs.class +) @Operator public final class Unstack extends RawOp implements Iterable> { - /** - * Optional attributes for {@link org.tensorflow.op.core.Unstack} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param axis Dimension along which to unpack. Negative values wrap around, so the - * valid range is `[-R, R)`. - */ - public Options axis(Long axis) { - this.axis = axis; - return this; - } - - private Long axis; - - private Options() { - } + public static final String OP_NAME = "Unpack"; + + private List> output; + + @SuppressWarnings("unchecked") + public Unstack(Operation operation) { + super(operation, OP_NAME); + 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 Unstack operation. - * + * Factory method to create a class wrapping a new Unpack operation. + * * @param scope current scope - * @param value 1-D or higher, with `axis` dimension size equal to `num`. - * @param num - * @param options carries optional attributes values + * @param value 1-D or higher, with {@code axis} dimension size equal to {@code num}. + * @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 */ - @Endpoint(describeByClass = true) - public static Unstack create(Scope scope, Operand value, Long num, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Unpack", scope.makeOpName("Unstack")); + @Endpoint( + describeByClass = true + ) + public static Unstack create(Scope scope, Operand value, Long num, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Unstack"); opBuilder.addInput(value.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num", num); if (options != null) { for (Options opts : options) { @@ -93,41 +94,83 @@ public static Unstack create(Scope scope, Operand value, } } } - return new Unstack(opBuilder.build()); + return new Unstack<>(opBuilder.build()); } - + /** + * Sets the axis option. + * * @param axis Dimension along which to unpack. Negative values wrap around, so the - * valid range is `[-R, R)`. + * valid range is {@code [-R, R)}. + * @return this Options instance. */ public static Options axis(Long axis) { return new Options().axis(axis); } - + /** - * The list of tensors unpacked from `value`. + * Gets output. + * The list of tensors unpacked from {@code value}. + * @return output. */ public List> output() { return output; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) output.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Unpack"; - - private List> output; - - @SuppressWarnings("unchecked") - private Unstack(Operation operation) { - super(operation); - int outputIdx = 0; - int outputLength = operation.outputListLength("output"); - output = Arrays.asList((Output[])operation.outputList(outputIdx, outputLength)); - outputIdx += outputLength; + + /** + * Optional attributes for {@link org.tensorflow.op.core.Unstack} + */ + public static class Options { + private Long axis; + + private Options() { + } + + /** + * Sets the axis option. + * + * @param axis Dimension along which to unpack. Negative values wrap around, so the + * valid range is {@code [-R, R)}. + * @return this Options instance. + */ + public Options axis(Long axis) { + this.axis = 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 2997b5eaa57..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,84 +20,63 @@ 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; /** * Op is similar to a lightweight Dequeue. - *

* 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> { - /** - * Optional attributes for {@link org.tensorflow.op.core.Unstage} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "Unstage"; + + private List> values; + + @SuppressWarnings("unchecked") + public Unstage(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int valuesLength = operation.outputListLength("values"); + values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); + outputIdx += valuesLength; } - + /** * Factory method to create a class wrapping a new Unstage operation. - * + * * @param scope current scope - * @param dtypes - * @param options carries optional attributes values + * @param dtypes The value of the dtypes attribute + * @param options carries optional attribute values * @return a new instance of Unstage */ - @Endpoint(describeByClass = true) - public static Unstage create(Scope scope, List> dtypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Unstage", scope.makeOpName("Unstage")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static Unstage create(Scope scope, List> dtypes, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Unstage"); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); if (options != null) { for (Options opts : options) { @@ -117,57 +96,159 @@ public static Unstage create(Scope scope, List> dtypes, O } return new Unstage(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * 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 values. + * + * @return values. */ public List> values() { return values; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) values.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Unstage"; - - private List> values; - - private Unstage(Operation operation) { - super(operation); - int outputIdx = 0; - int valuesLength = operation.outputListLength("values"); - values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); - outputIdx += valuesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.core.Unstage} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * 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; + } + } + + @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 6bc9d8034fd..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,100 +17,150 @@ 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; /** * 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 - * `np.searchsorted(sorted_inputs, values, side='right')`. - *

- * The result is not a global index to the entire - * `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 data type for {@code output()} output + * {@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]] */ +@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 + */ + public static final String OP_NAME = "UpperBound"; + + private Output output; + + public UpperBound(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new UpperBound operation. - * + * * @param scope current scope * @param sortedInputs 2-D Tensor where each row is ordered. - * @param values 2-D Tensor with the same numbers of rows as `sorted_search_values`. Contains - * the values that will be searched for in `sorted_search_values`. - * @param outType + * @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 */ - @Endpoint(describeByClass = true) - public static UpperBound create(Scope scope, Operand sortedInputs, Operand values, Class outType) { - OperationBuilder opBuilder = scope.env().opBuilder("UpperBound", scope.makeOpName("UpperBound")); + @Endpoint( + describeByClass = true + ) + public static UpperBound create(Scope scope, + Operand sortedInputs, Operand values, Class outType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UpperBound"); opBuilder.addInput(sortedInputs.asOutput()); opBuilder.addInput(values.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new UpperBound(opBuilder.build()); + return new UpperBound<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new UpperBound operation using default output types. - * + * Factory method to create a class wrapping a new UpperBound operation, with the default output types. + * * @param scope current scope * @param sortedInputs 2-D Tensor where each row is ordered. - * @param values 2-D Tensor with the same numbers of rows as `sorted_search_values`. Contains - * the values that will be searched for in `sorted_search_values`. - * @return a new instance of UpperBound + * @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 */ - @Endpoint(describeByClass = true) - public static UpperBound create(Scope scope, Operand sortedInputs, Operand values) { + @Endpoint( + describeByClass = true + ) + public static UpperBound create(Scope scope, Operand sortedInputs, + Operand values) { return create(scope, sortedInputs, values, TInt32.class); } - + /** - * A `Tensor` with the same shape as `values`. It contains the last scalar index + * Gets output. + * A {@code Tensor} with the same shape as {@code values}. It contains the last scalar index * into the last dimension where values can be inserted without changing the * ordered property. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UpperBound"; - - private Output output; - - private UpperBound(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 41d962d4381..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. @@ -17,7 +17,9 @@ 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; @@ -25,69 +27,55 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.VarHandleOp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container the container this variable is placed in. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName the name by which this variable is referred to. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param allowedDevices DEPRECATED. The allowed devices containing the resource variable. Set when the - * output ResourceHandle represents a per-replica/partitioned resource variable. - */ - public Options allowedDevices(List allowedDevices) { - this.allowedDevices = allowedDevices; - return this; - } - - private String container; - private String sharedName; - private List allowedDevices; - - private Options() { - } + public static final String OP_NAME = "VarHandleOp"; + + private Output resource; + + @SuppressWarnings("unchecked") + public VarHandleOp(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + resource = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new VarHandleOp operation. - * + * * @param scope current scope * @param dtype the type of this variable. Must agree with the dtypes * of all ops using this variable. * @param shape The (possibly partially specified) shape of this variable. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code VarHandleOp} output and operands * @return a new instance of VarHandleOp */ - @Endpoint(describeByClass = true) - public static VarHandleOp create(Scope scope, Class dtype, Shape shape, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("VarHandleOp", scope.makeOpName("VarHandleOp")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static VarHandleOp create(Scope scope, Class dtype, Shape shape, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "VarHandleOp"); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); opBuilder.setAttr("shape", shape); if (options != null) { @@ -98,9 +86,12 @@ 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) { + for (int i = 0 ; i < allowedDevicesArray.length ; i++) { allowedDevicesArray[i] = opts.allowedDevices.get(i); } opBuilder.setAttr("allowed_devices", allowedDevicesArray); @@ -109,49 +100,192 @@ public static VarHandleOp create(Scope scope, Class dtype, } return new VarHandleOp(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container the container this variable is placed in. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName the name by which this variable is referred to. + * @return this Options instance. */ 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. + * * @param allowedDevices DEPRECATED. The allowed devices containing the resource variable. Set when the * output ResourceHandle represents a per-replica/partitioned resource variable. + * @return this Options instance. */ public static Options allowedDevices(List allowedDevices) { return new Options().allowedDevices(allowedDevices); } - + + /** + * Sets the allowedDevices option. + * + * @param allowedDevices DEPRECATED. The allowed devices containing the resource variable. Set when the + * output ResourceHandle represents a per-replica/partitioned resource variable. + * @return this Options instance. + */ + public static Options allowedDevices(String... allowedDevices) { + return new Options().allowedDevices(allowedDevices); + } + /** + * Gets resource. + * + * @return resource. */ - public Output resource() { + public Output resource() { return resource; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) resource; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "VarHandleOp"; - - private Output resource; - - private VarHandleOp(Operation operation) { - super(operation); - int outputIdx = 0; - resource = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.VarHandleOp} + */ + public static class Options { + private String container; + + private String sharedName; + + private String debugName; + + private List allowedDevices; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container the container this variable is placed in. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the name by which this variable is referred to. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = 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. + * + * @param allowedDevices DEPRECATED. The allowed devices containing the resource variable. Set when the + * output ResourceHandle represents a per-replica/partitioned resource variable. + * @return this Options instance. + */ + public Options allowedDevices(List allowedDevices) { + this.allowedDevices = allowedDevices; + return this; + } + + /** + * Sets the allowedDevices option. + * + * @param allowedDevices DEPRECATED. The allowed devices containing the resource variable. Set when the + * output ResourceHandle represents a per-replica/partitioned resource variable. + * @return this Options instance. + */ + public Options allowedDevices(String... allowedDevices) { + this.allowedDevices = Arrays.asList(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 16ee42372b3..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,58 +17,88 @@ 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; /** * 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "VarIsInitializedOp"; + + private Output isInitialized; + + public VarIsInitializedOp(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + isInitialized = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new VarIsInitializedOp operation. - * + * * @param scope current scope * @param resource the input resource handle. * @return a new instance of VarIsInitializedOp */ - @Endpoint(describeByClass = true) - public static VarIsInitializedOp create(Scope scope, Operand resource) { - OperationBuilder opBuilder = scope.env().opBuilder("VarIsInitializedOp", scope.makeOpName("VarIsInitializedOp")); + @Endpoint( + describeByClass = true + ) + public static VarIsInitializedOp create(Scope scope, Operand resource) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "VarIsInitializedOp"); opBuilder.addInput(resource.asOutput()); - opBuilder = scope.apply(opBuilder); return new VarIsInitializedOp(opBuilder.build()); } - + /** + * Gets isInitialized. * a scalar boolean which is true if the variable has been * initialized. + * @return isInitialized. */ public Output isInitialized() { return isInitialized; } - + @Override public Output asOutput() { return isInitialized; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "VarIsInitializedOp"; - - private Output isInitialized; - - private VarIsInitializedOp(Operation operation) { - super(operation); - int outputIdx = 0; - isInitialized = operation.output(outputIdx++); + + @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 98e545d7b76..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,66 +26,56 @@ 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; /** * Holds state in the form of a tensor that persists across steps. - *

* 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 { - /** - * Optional attributes for {@link org.tensorflow.op.core.Variable} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this variable is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this variable is named in the given bucket - * with this shared_name. Otherwise, the node name is used instead. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "VariableV2"; + + private Output ref; + + public Variable(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + ref = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Variable operation. - * + * Factory method to create a class wrapping a new VariableV2 operation. + * * @param scope current scope * @param shape The shape of the variable tensor. * @param dtype The type of elements in the variable tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code VariableV2} output and operands * @return a new instance of Variable */ - @Endpoint(describeByClass = true) - public static Variable create(Scope scope, Shape shape, Class dtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("VariableV2", scope.makeOpName("Variable")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static Variable create(Scope scope, Shape shape, Class dtype, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Variable"); opBuilder.setAttr("shape", shape); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); if (options != null) { @@ -96,45 +88,114 @@ public static Variable create(Scope scope, Shape shape, Cla } } } - return new Variable(opBuilder.build()); + return new Variable<>(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this variable is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this variable is named in the given bucket * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets ref. * A reference to the variable tensor. + * @return ref. */ public Output ref() { return ref; } - + @Override public Output asOutput() { return ref; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "VariableV2"; - - private Output ref; - - private Variable(Operation operation) { - super(operation); - int outputIdx = 0; - ref = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Variable} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this variable is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this variable is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = 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 ab37a6c4d08..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,83 +17,120 @@ 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; /** - * Returns the shape of the variable pointed to by `resource`. - *

- * This operation returns a 1-D integer tensor representing the shape of `input`. - *

- * For example: - *

{@code
+ * Returns the shape of the variable pointed to by {@code resource}.
+ * This operation returns a 1-D integer tensor representing the shape of {@code input}.
+ * 

For example: + *

  * # '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 + * shape(t) ==> [2, 2, 3] + *
*/ +@OpMetadata( + opType = VariableShape.OP_NAME, + inputsClass = VariableShape.Inputs.class +) @Operator public final class VariableShape extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "VariableShape"; + + private Output output; + + public VariableShape(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new VariableShape operation. - * + * * @param scope current scope - * @param input - * @param outType + * @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 */ - @Endpoint(describeByClass = true) - public static VariableShape create(Scope scope, Operand input, Class outType) { - OperationBuilder opBuilder = scope.env().opBuilder("VariableShape", scope.makeOpName("VariableShape")); + @Endpoint( + describeByClass = true + ) + public static VariableShape create(Scope scope, + Operand input, Class outType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "VariableShape"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new VariableShape(opBuilder.build()); + return new VariableShape<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new VariableShape operation using default output types. - * + * Factory method to create a class wrapping a new VariableShape operation, with the default output types. + * * @param scope current scope - * @param input - * @return a new instance of VariableShape + * @param input The input value + * @return a new instance of VariableShape, with default output types */ - @Endpoint(describeByClass = true) - public static VariableShape create(Scope scope, Operand input) { + @Endpoint( + describeByClass = true + ) + public static VariableShape 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "VariableShape"; - - private Output output; - - private VariableShape(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 558da8d85ac..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,36 +17,40 @@ 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; /** * Returns locations of nonzero / true values in a tensor. - *

- * This operation returns the coordinates of true elements in `condition`. The + * This operation returns the coordinates of true elements in {@code condition}. The * coordinates are returned in a 2-D tensor where the first dimension (rows) * represents the number of true elements, and the second dimension (columns) * represents the coordinates of the true elements. Keep in mind, the shape of * the output tensor can vary depending on how many true values there are in - * `condition`. Indices are output in row-major order. - *

- * For example: - *

{@code
+ * {@code condition}. Indices are output in row-major order.
+ * 

For example: + *

  * # 'input' tensor is [[True, False]
  * #                    [True, False]]
  * # 'input' has two true values, so output has two coordinates.
  * # 'input' has rank of 2, so coordinates have two indices.
- * where(input) ==> [[0, 0],
+ * where(input) ==> [[0, 0],
  *                   [1, 0]]
- * 
+ *
  * # `condition` tensor is [[[True, False]
  * #                     [True, False]]
  * #                    [[False, True]
@@ -55,12 +59,12 @@
  * #                     [False, True]]]
  * # 'input' has 5 true values, so output has 5 coordinates.
  * # 'input' has rank of 3, so coordinates have three indices.
- * where(input) ==> [[0, 0, 0],
+ * where(input) ==> [[0, 0, 0],
  *                   [0, 1, 0],
  *                   [1, 0, 1],
  *                   [1, 1, 1],
  *                   [2, 1, 1]]
- * 
+ *
  * # `condition` tensor is [[[1.5,  0.0]
  * #                     [-0.5, 0.0]]
  * #                    [[0.0,  0.25]
@@ -69,12 +73,12 @@
  * #                     [0.0,  0.01]]]
  * # 'input' has 5 nonzero values, so output has 5 coordinates.
  * # 'input' has rank of 3, so coordinates have three indices.
- * where(input) ==> [[0, 0, 0],
+ * where(input) ==> [[0, 0, 0],
  *                   [0, 1, 0],
  *                   [1, 0, 1],
  *                   [1, 1, 1],
  *                   [2, 1, 1]]
- * 
+ *
  * # `condition` tensor is [[[1.5 + 0.0j, 0.0  + 0.0j]
  * #                     [0.0 + 0.5j, 0.0  + 0.0j]]
  * #                    [[0.0 + 0.0j, 0.25 + 1.5j]
@@ -83,51 +87,81 @@
  * #                     [0.0 + 0.0j, 0.01 + 0.0j]]]
  * # 'input' has 5 nonzero magnitude values, so output has 5 coordinates.
  * # 'input' has rank of 3, so coordinates have three indices.
- * where(input) ==> [[0, 0, 0],
+ * where(input) ==> [[0, 0, 0],
  *                   [0, 1, 0],
  *                   [1, 0, 1],
  *                   [1, 1, 1],
  *                   [2, 1, 1]]
- * }
- * + *
*/ +@OpMetadata( + opType = Where.OP_NAME, + inputsClass = Where.Inputs.class +) @Operator public final class Where extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Where"; + + private Output index; + + public Where(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + index = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Where operation. - * + * * @param scope current scope - * @param condition + * @param condition The condition value * @return a new instance of Where */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Where create(Scope scope, Operand condition) { - OperationBuilder opBuilder = scope.env().opBuilder("Where", scope.makeOpName("Where")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Where"); opBuilder.addInput(condition.asOutput()); - opBuilder = scope.apply(opBuilder); return new Where(opBuilder.build()); } - + /** + * Gets index. + * + * @return index. */ public Output index() { return index; } - + @Override public Output asOutput() { return index; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Where"; - - private Output index; - - private Where(Operation operation) { - super(operation); - int outputIdx = 0; - index = operation.output(outputIdx++); + + @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 new file mode 100644 index 00000000000..d7c1b564a44 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/While.java @@ -0,0 +1,166 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.Output; +import org.tensorflow.ndarray.Shape; +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) } + * + *

Selects between {@link StatefulWhile} and {@link StatelessWhile} based on the statefulness of the function arguments. + */ +@Operator +public interface While extends Iterable> { + /** + * Factory method to create a class wrapping a new While 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.
+   * 
+ * @param options carries optional attribute values + * @return a new instance of While + */ + @Endpoint( + describeByClass = true, + name = "whileOp" + ) + static While create(Scope scope, Iterable> input, ConcreteFunction cond, + ConcreteFunction body, Options... options) { + boolean isStateful = false; + if (cond.isStateful()) { + isStateful = true; + } + if (body.isStateful()) { + isStateful = true; + } + if (isStateful) { + return StatefulWhile.create(scope, input, cond, body, options); + } else { + return StatelessWhile.create(scope, input, cond, body, options); + } + } + + /** + * Sets the outputShapes option. + * + * @param outputShapes the outputShapes option + * @return this Options instance. + */ + static Options outputShapes(List outputShapes) { + return new Options().outputShapes(outputShapes); + } + + /** + * Sets the outputShapes option. + * + * @param outputShapes the outputShapes option + * @return this Options instance. + */ + static Options outputShapes(Shape... outputShapes) { + return new Options().outputShapes(outputShapes); + } + + /** + * Sets the parallelIterations option. + * + * @param parallelIterations the parallelIterations option + * @return this Options instance. + */ + static Options parallelIterations(Long parallelIterations) { + return new Options().parallelIterations(parallelIterations); + } + + /** + * Gets output. + * A list of output tensors whose types are T. + * @return output. + */ + List> output(); + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + Iterator> iterator(); + + /** + * Optional attributes for {@link org.tensorflow.op.core.While} + */ + class Options { + List outputShapes; + + 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/core/XlaSpmdFullToShardShape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/XlaSpmdFullToShardShape.java deleted file mode 100644 index e1a89b8b3a3..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/XlaSpmdFullToShardShape.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.core; - -import org.tensorflow.Operand; -import org.tensorflow.Operation; -import org.tensorflow.OperationBuilder; -import org.tensorflow.Output; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.family.TType; - -/** - * 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 -public final class XlaSpmdFullToShardShape extends RawOp implements Operand { - - /** - * Factory method to create a class wrapping a new XlaSpmdFullToShardShape operation. - * - * @param scope current scope - * @param input - * @param manualSharding - * @return a new instance of XlaSpmdFullToShardShape - */ - @Endpoint(describeByClass = true) - public static XlaSpmdFullToShardShape create(Scope scope, Operand input, String manualSharding) { - OperationBuilder opBuilder = scope.env().opBuilder("XlaSpmdFullToShardShape", scope.makeOpName("XlaSpmdFullToShardShape")); - opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("manual_sharding", manualSharding); - return new XlaSpmdFullToShardShape(opBuilder.build()); - } - - /** - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaSpmdFullToShardShape"; - - private Output output; - - private XlaSpmdFullToShardShape(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/XlaSpmdShardToFullShape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/XlaSpmdShardToFullShape.java deleted file mode 100644 index 1014c328351..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/XlaSpmdShardToFullShape.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.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.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 -public final class XlaSpmdShardToFullShape extends RawOp implements Operand { - - /** - * Factory method to create a class wrapping a new XlaSpmdShardToFullShape operation. - * - * @param scope current scope - * @param input - * @param manualSharding - * @param fullShape - * @return a new instance of XlaSpmdShardToFullShape - */ - @Endpoint(describeByClass = true) - public static XlaSpmdShardToFullShape create(Scope scope, Operand input, String manualSharding, Shape fullShape) { - OperationBuilder opBuilder = scope.env().opBuilder("XlaSpmdShardToFullShape", scope.makeOpName("XlaSpmdShardToFullShape")); - opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("manual_sharding", manualSharding); - opBuilder.setAttr("full_shape", fullShape); - return new XlaSpmdShardToFullShape(opBuilder.build()); - } - - /** - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaSpmdShardToFullShape"; - - private Output output; - - private XlaSpmdShardToFullShape(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ZerosLike.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ZerosLike.java index f3353d53023..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,59 +17,94 @@ 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 { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ZerosLike"; + + private Output y; + + public ZerosLike(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ZerosLike operation. - * + * * @param scope current scope * @param x a tensor of type T. + * @param data type for {@code ZerosLike} output and operands * @return a new instance of ZerosLike */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ZerosLike create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("ZerosLike", scope.makeOpName("ZerosLike")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ZerosLike"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new ZerosLike(opBuilder.build()); + return new ZerosLike<>(opBuilder.build()); } - + /** + * Gets y. * a tensor of the same shape and type as x but filled with zeros. + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ZerosLike"; - - private Output y; - - private ZerosLike(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 3be3e0be3eb..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,72 +17,110 @@ 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. */ -@Operator(group = "data") -public final class AnonymousIterator extends RawOp { - +@OpMetadata( + opType = AnonymousIterator.OP_NAME, + inputsClass = AnonymousIterator.Inputs.class +) +@Operator( + group = "data" +) +public final class AnonymousIterator extends RawOp implements Operand { /** - * Factory method to create a class wrapping a new AnonymousIterator operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AnonymousIteratorV3"; + + private Output handle; + + @SuppressWarnings("unchecked") + public AnonymousIterator(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new AnonymousIteratorV3 operation. + * * @param scope current scope - * @param outputTypes - * @param outputShapes + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of AnonymousIterator */ - @Endpoint(describeByClass = true) - public static AnonymousIterator create(Scope scope, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("AnonymousIteratorV2", scope.makeOpName("AnonymousIterator")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static AnonymousIterator create(Scope scope, List> outputTypes, + List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AnonymousIterator"); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new AnonymousIterator(opBuilder.build()); } - + /** - * A handle to the iterator that can be passed to a "MakeIterator" or - * "IteratorGetNext" op. In contrast to Iterator, AnonymousIterator prevents + * Gets handle. + * A handle to the iterator that can be passed to a "MakeIterator" or + * "IteratorGetNext" op. In contrast to Iterator, AnonymousIterator prevents * resource sharing by name, and does not keep a reference to the resource * container. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - - /** - * A variant deleter that should be passed into the op that deletes the iterator. - */ - public Output deleter() { - return deleter; + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AnonymousIteratorV2"; - - private Output handle; - private Output deleter; - - private AnonymousIterator(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - deleter = operation.output(outputIdx++); + + @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 e75f88d40d2..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,53 +17,87 @@ 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 + */ + public static final String OP_NAME = "AnonymousMemoryCache"; + + private Output handle; + + private Output deleter; + + @SuppressWarnings("unchecked") + public AnonymousMemoryCache(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 AnonymousMemoryCache operation. - * + * * @param scope current scope * @return a new instance of AnonymousMemoryCache */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static AnonymousMemoryCache create(Scope scope) { - OperationBuilder opBuilder = scope.env().opBuilder("AnonymousMemoryCache", scope.makeOpName("AnonymousMemoryCache")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AnonymousMemoryCache"); return new AnonymousMemoryCache(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + /** + * Gets deleter. + * + * @return deleter. */ - public Output deleter() { + public Output deleter() { return deleter; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AnonymousMemoryCache"; - - private Output handle; - private Output deleter; - - private AnonymousMemoryCache(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - deleter = operation.output(outputIdx++); + + @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 d02a1f37cf3..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,77 +17,122 @@ 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 { /** - * Factory method to create a class wrapping a new AnonymousMultiDeviceIterator operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AnonymousMultiDeviceIteratorV3"; + + private Output handle; + + @SuppressWarnings("unchecked") + public AnonymousMultiDeviceIterator(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new AnonymousMultiDeviceIteratorV3 operation. + * * @param scope current scope - * @param devices - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static AnonymousMultiDeviceIterator create(Scope scope, List devices, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("AnonymousMultiDeviceIterator", scope.makeOpName("AnonymousMultiDeviceIterator")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static AnonymousMultiDeviceIterator create(Scope scope, List devices, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AnonymousMultiDeviceIterator"); String[] devicesArray = new String[devices.size()]; - for (int i = 0; i < devicesArray.length; ++i) { + for (int i = 0 ; i < devicesArray.length ; i++) { devicesArray[i] = devices.get(i); } opBuilder.setAttr("devices", devicesArray); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new AnonymousMultiDeviceIterator(opBuilder.build()); } - + /** + * Gets handle. * A handle to a multi device iterator that can be passed to a - * "MultiDeviceIteratorGetNextFromShard" op. In contrast to MultiDeviceIterator, + * "MultiDeviceIteratorGetNextFromShard" op. In contrast to MultiDeviceIterator, * AnonymousIterator prevents resource sharing by name, and does not keep a * reference to the resource container. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - - /** - * A variant deleter that should be passed into the op that deletes the iterator. - */ - public Output deleter() { - return deleter; + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AnonymousMultiDeviceIterator"; - - private Output handle; - private Output deleter; - - private AnonymousMultiDeviceIterator(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - deleter = operation.output(outputIdx++); + + @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 new file mode 100644 index 00000000000..f81fd1f4a62 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AssertCardinalityDataset.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.TInt64; +import org.tensorflow.types.family.TType; + +/** + * The AssertCardinalityDataset operation + */ +@OpMetadata( + opType = AssertCardinalityDataset.OP_NAME, + inputsClass = AssertCardinalityDataset.Inputs.class +) +@Operator( + group = "data" +) +public final class AssertCardinalityDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AssertCardinalityDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public AssertCardinalityDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * 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 attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of AssertCardinalityDataset + */ + @Endpoint( + describeByClass = true + ) + public static AssertCardinalityDataset create(Scope scope, Operand inputDataset, + Operand cardinality, List> outputTypes, + List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AssertCardinalityDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInput(cardinality.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 AssertCardinalityDataset(opBuilder.build()); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + 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 ee9da65be4d..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,73 +27,126 @@ 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 happen next. - *

- * This transformation checks whether the camel-case names (i.e. "FlatMap", not - * "flat_map") of the transformations following this transformation match the list - * of names in the `transformations` argument. If there is a mismatch, the + * This transformation checks whether the camel-case names (i.e. "FlatMap", not + * "flat_map") of the transformations following this transformation match the list + * of names in the {@code transformations} argument. 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 + *

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 = AssertNextDataset.OP_NAME, + inputsClass = AssertNextDataset.Inputs.class +) +@Operator( + group = "data" +) public final class AssertNextDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AssertNextDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public AssertNextDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new AssertNextDataset operation. - * + * * @param scope current scope * @param inputDataset A variant tensor representing the input dataset. - * `data.AssertNextDataset` passes through the outputs of its input dataset. - * @param transformations A `tf.string` vector `tf.Tensor` identifying the transformations that are + * {@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 - * @param outputShapes + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of AssertNextDataset */ - @Endpoint(describeByClass = true) - public static AssertNextDataset create(Scope scope, Operand inputDataset, Operand transformations, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("AssertNextDataset", scope.makeOpName("AssertNextDataset")); + @Endpoint( + describeByClass = true + ) + public static AssertNextDataset create(Scope scope, Operand inputDataset, + Operand transformations, List> outputTypes, + List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AssertNextDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(transformations.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new AssertNextDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AssertNextDataset"; - - private Output handle; - - private AssertNextDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 d16064aa7f3..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,75 +27,72 @@ 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 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 + *

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" +) public final class AutoShardDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.AutoShardDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param autoShardPolicy - */ - public Options autoShardPolicy(Long autoShardPolicy) { - this.autoShardPolicy = autoShardPolicy; - return this; - } - - /** - * @param numReplicas - */ - public Options numReplicas(Long numReplicas) { - this.numReplicas = numReplicas; - return this; - } - - private Long autoShardPolicy; - private Long numReplicas; - - private Options() { - } + public static final String OP_NAME = "AutoShardDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public AutoShardDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new AutoShardDataset operation. - * + * * @param scope current scope * @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 - * @param outputShapes - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static AutoShardDataset create(Scope scope, Operand inputDataset, Operand numWorkers, Operand index, List> outputTypes, List outputShapes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("AutoShardDataset", scope.makeOpName("AutoShardDataset")); + @Endpoint( + describeByClass = true + ) + public static AutoShardDataset create(Scope scope, Operand inputDataset, + Operand numWorkers, Operand index, List> outputTypes, + List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AutoShardDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(numWorkers.asOutput()); opBuilder.addInput(index.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -109,41 +108,125 @@ public static AutoShardDataset create(Scope scope, Operand inputDataset, Oper } return new AutoShardDataset(opBuilder.build()); } - + /** - * @param autoShardPolicy + * Sets the autoShardPolicy option. + * + * @param autoShardPolicy the autoShardPolicy option + * @return this Options instance. */ public static Options autoShardPolicy(Long autoShardPolicy) { return new Options().autoShardPolicy(autoShardPolicy); } - + /** - * @param numReplicas + * Sets the numReplicas option. + * + * @param numReplicas the numReplicas option + * @return this Options instance. */ public static Options numReplicas(Long numReplicas) { return new Options().numReplicas(numReplicas); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AutoShardDataset"; - - private Output handle; - - private AutoShardDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.AutoShardDataset} + */ + public static class Options { + private Long autoShardPolicy; + + private Long numReplicas; + + private Options() { + } + + /** + * Sets the autoShardPolicy option. + * + * @param autoShardPolicy the autoShardPolicy option + * @return this Options instance. + */ + public Options autoShardPolicy(Long autoShardPolicy) { + this.autoShardPolicy = autoShardPolicy; + return this; + } + + /** + * Sets the numReplicas option. + * + * @param numReplicas the numReplicas option + * @return this Options instance. + */ + public Options numReplicas(Long numReplicas) { + this.numReplicas = 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 ee03bac2b95..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,61 +27,68 @@ 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; /** - * Creates a dataset that batches `batch_size` elements from `input_dataset`. + * Creates a dataset that batches {@code batch_size} elements from {@code input_dataset}. */ -@Operator(group = "data") +@OpMetadata( + opType = BatchDataset.OP_NAME, + inputsClass = BatchDataset.Inputs.class +) +@Operator( + group = "data" +) public final class BatchDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.BatchDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param parallelCopy - */ - public Options parallelCopy(Boolean parallelCopy) { - this.parallelCopy = parallelCopy; - return this; - } - - private Boolean parallelCopy; - - private Options() { - } + public static final String OP_NAME = "BatchDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + public BatchDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new BatchDataset operation. - * + * Factory method to create a class wrapping a new BatchDatasetV2 operation. + * * @param scope current scope - * @param inputDataset + * @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 - * @param outputShapes - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static BatchDataset create(Scope scope, Operand inputDataset, Operand batchSize, Operand dropRemainder, List> outputTypes, List outputShapes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchDatasetV2", scope.makeOpName("BatchDataset")); + @Endpoint( + describeByClass = true + ) + public static BatchDataset create(Scope scope, Operand inputDataset, + Operand batchSize, Operand dropRemainder, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(batchSize.asOutput()); opBuilder.addInput(dropRemainder.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -88,38 +97,133 @@ public static BatchDataset create(Scope scope, Operand inputDataset, Operand< if (opts.parallelCopy != null) { opBuilder.setAttr("parallel_copy", opts.parallelCopy); } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } } } return new BatchDataset(opBuilder.build()); } - + /** - * @param parallelCopy + * Sets the parallelCopy option. + * + * @param parallelCopy the parallelCopy option + * @return this Options instance. */ 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. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchDatasetV2"; - - private Output handle; - - private BatchDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.BatchDataset} + */ + public static class Options { + private Boolean parallelCopy; + + private String metadata; + + private Options() { + } + + /** + * Sets the parallelCopy option. + * + * @param parallelCopy the parallelCopy option + * @return this Options instance. + */ + 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 b9cea475727..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,62 +27,114 @@ 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 `input_dataset` in a StatsAggregator. + * 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" +) public final class BytesProducedStatsDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BytesProducedStatsDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public BytesProducedStatsDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BytesProducedStatsDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param tag - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static BytesProducedStatsDataset create(Scope scope, Operand inputDataset, Operand tag, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("BytesProducedStatsDataset", scope.makeOpName("BytesProducedStatsDataset")); + @Endpoint( + describeByClass = true + ) + public static BytesProducedStatsDataset create(Scope scope, Operand inputDataset, + Operand tag, List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BytesProducedStatsDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(tag.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new BytesProducedStatsDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BytesProducedStatsDataset"; - - private Output handle; - - private BytesProducedStatsDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 d2df9f2f263..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,37 +27,69 @@ 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; import org.tensorflow.types.family.TType; /** + * The CSVDatasetV2 operation */ +@OpMetadata( + opType = CSVDataset.OP_NAME, + inputsClass = CSVDataset.Inputs.class +) +@Operator( + group = "data" +) public final class CSVDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new CSVDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CSVDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + public CSVDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new CSVDatasetV2 operation. + * * @param scope current scope - * @param filenames - * @param compressionType - * @param bufferSize - * @param header - * @param fieldDelim - * @param useQuoteDelim - * @param naValue - * @param selectCols - * @param recordDefaults - * @param outputShapes + * @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(describeByClass = true) - public static CSVDataset create(Scope scope, Operand filenames, Operand compressionType, Operand bufferSize, Operand header, Operand fieldDelim, Operand useQuoteDelim, Operand naValue, Operand selectCols, Iterable> recordDefaults, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("CSVDataset", scope.makeOpName("CSVDataset")); + @Endpoint( + describeByClass = true + ) + public static CSVDataset create(Scope scope, Operand filenames, + Operand compressionType, Operand bufferSize, Operand header, + Operand fieldDelim, Operand useQuoteDelim, Operand naValue, + Operand selectCols, Iterable> recordDefaults, Operand excludeCols, + List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CSVDataset"); opBuilder.addInput(filenames.asOutput()); opBuilder.addInput(compressionType.asOutput()); opBuilder.addInput(bufferSize.asOutput()); @@ -65,35 +99,111 @@ public static CSVDataset create(Scope scope, Operand filenames, Operand opBuilder.addInput(naValue.asOutput()); opBuilder.addInput(selectCols.asOutput()); opBuilder.addInputList(Operands.asOutputs(recordDefaults)); - opBuilder = scope.apply(opBuilder); + opBuilder.addInput(excludeCols.asOutput()); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new CSVDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CSVDataset"; - - private Output handle; - - private CSVDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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/CSVDatasetV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CSVDatasetV2.java deleted file mode 100644 index f724dca8e93..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CSVDatasetV2.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.data; - -import java.util.List; -import org.tensorflow.Operand; -import org.tensorflow.Operation; -import org.tensorflow.OperationBuilder; -import org.tensorflow.Output; -import org.tensorflow.ndarray.Shape; -import org.tensorflow.op.Operands; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.TBool; -import org.tensorflow.types.TInt64; -import org.tensorflow.types.TString; -import org.tensorflow.types.family.TType; - -/** - */ -public final class CSVDatasetV2 extends RawOp implements Operand { - - /** - * Factory method to create a class wrapping a new CSVDatasetV2 operation. - * - * @param scope current scope - * @param filenames - * @param compressionType - * @param bufferSize - * @param header - * @param fieldDelim - * @param useQuoteDelim - * @param naValue - * @param selectCols - * @param recordDefaults - * @param excludeCols - * @param outputShapes - * @return a new instance of CSVDatasetV2 - */ - @Endpoint(describeByClass = true) - public static CSVDatasetV2 create(Scope scope, Operand filenames, Operand compressionType, Operand bufferSize, Operand header, Operand fieldDelim, Operand useQuoteDelim, Operand naValue, Operand selectCols, Iterable> recordDefaults, Operand excludeCols, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("CSVDatasetV2", scope.makeOpName("CSVDatasetV2")); - opBuilder.addInput(filenames.asOutput()); - opBuilder.addInput(compressionType.asOutput()); - opBuilder.addInput(bufferSize.asOutput()); - opBuilder.addInput(header.asOutput()); - opBuilder.addInput(fieldDelim.asOutput()); - opBuilder.addInput(useQuoteDelim.asOutput()); - opBuilder.addInput(naValue.asOutput()); - opBuilder.addInput(selectCols.asOutput()); - opBuilder.addInputList(Operands.asOutputs(recordDefaults)); - opBuilder.addInput(excludeCols.asOutput()); - opBuilder = scope.apply(opBuilder); - Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { - outputShapesArray[i] = outputShapes.get(i); - } - opBuilder.setAttr("output_shapes", outputShapesArray); - return new CSVDatasetV2(opBuilder.build()); - } - - /** - */ - public Output handle() { - return handle; - } - - @Override - @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CSVDatasetV2"; - - private Output handle; - - private CSVDatasetV2(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CacheDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CacheDataset.java index 25431c48ec6..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,68 +27,168 @@ 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 caches elements from `input_dataset`. - *

- * A CacheDataset will iterate over the input_dataset, and store tensors. If the - * cache already exists, the cache will be used. If the cache is inappropriate - * (e.g. cannot be opened, contains tensors of the wrong shape / size), an error - * will the returned when used. + * The CacheDatasetV2 operation */ +@OpMetadata( + opType = CacheDataset.OP_NAME, + inputsClass = CacheDataset.Inputs.class +) +@Operator( + group = "data" +) public final class CacheDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new CacheDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CacheDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + public CacheDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new CacheDatasetV2 operation. + * * @param scope current scope - * @param inputDataset - * @param filename A path on the filesystem where we should cache the dataset. Note: this - * will be a directory. - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static CacheDataset create(Scope scope, Operand inputDataset, Operand filename, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("CacheDataset", scope.makeOpName("CacheDataset")); + @Endpoint( + describeByClass = true + ) + public static CacheDataset create(Scope scope, Operand inputDataset, + Operand filename, Operand cache, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CacheDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(filename.asOutput()); - opBuilder = scope.apply(opBuilder); + opBuilder.addInput(cache.asOutput()); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + 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 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. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CacheDataset"; - - private Output handle; - - private CacheDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * 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/CacheDatasetV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CacheDatasetV2.java deleted file mode 100644 index c5cd457be55..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CacheDatasetV2.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.data; - -import java.util.List; -import org.tensorflow.Operand; -import org.tensorflow.Operation; -import org.tensorflow.OperationBuilder; -import org.tensorflow.Output; -import org.tensorflow.ndarray.Shape; -import org.tensorflow.op.Operands; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.TString; -import org.tensorflow.types.family.TType; - -/** - */ -public final class CacheDatasetV2 extends RawOp implements Operand { - - /** - * Factory method to create a class wrapping a new CacheDatasetV2 operation. - * - * @param scope current scope - * @param inputDataset - * @param filename - * @param cache - * @param outputTypes - * @param outputShapes - * @return a new instance of CacheDatasetV2 - */ - @Endpoint(describeByClass = true) - public static CacheDatasetV2 create(Scope scope, Operand inputDataset, Operand filename, Operand cache, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("CacheDatasetV2", scope.makeOpName("CacheDatasetV2")); - opBuilder.addInput(inputDataset.asOutput()); - opBuilder.addInput(filename.asOutput()); - opBuilder.addInput(cache.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); - Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { - outputShapesArray[i] = outputShapes.get(i); - } - opBuilder.setAttr("output_shapes", outputShapesArray); - return new CacheDatasetV2(opBuilder.build()); - } - - /** - */ - public Output handle() { - return handle; - } - - @Override - @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CacheDatasetV2"; - - private Output handle; - - private CacheDatasetV2(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ChooseFastestBranchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ChooseFastestBranchDataset.java new file mode 100644 index 00000000000..2239a2f7d2e --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ChooseFastestBranchDataset.java @@ -0,0 +1,194 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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 ChooseFastestBranchDataset operation + */ +@OpMetadata( + opType = ChooseFastestBranchDataset.OP_NAME, + inputsClass = ChooseFastestBranchDataset.Inputs.class +) +@Operator( + group = "data" +) +public final class ChooseFastestBranchDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ChooseFastestBranchDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ChooseFastestBranchDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * 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 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( + describeByClass = true + ) + public static ChooseFastestBranchDataset create(Scope scope, + Operand inputDataset, Operand ratioNumerator, + Operand ratioDenominator, Iterable> otherArguments, + Long numElementsPerBranch, List branches, List otherArgumentsLengths, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ChooseFastestBranchDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInput(ratioNumerator.asOutput()); + opBuilder.addInput(ratioDenominator.asOutput()); + opBuilder.addInputList(Operands.asOutputs(otherArguments)); + opBuilder.setAttr("num_elements_per_branch", numElementsPerBranch); + ConcreteFunction[] branchesArray = new ConcreteFunction[branches.size()]; + for (int i = 0 ; i < branchesArray.length ; i++) { + branchesArray[i] = branches.get(i); + } + opBuilder.setAttr("branches", branchesArray); + long[] otherArgumentsLengthsArray = new long[otherArgumentsLengths.size()]; + for (int i = 0 ; i < otherArgumentsLengthsArray.length ; i++) { + otherArgumentsLengthsArray[i] = otherArgumentsLengths.get(i); + } + opBuilder.setAttr("other_arguments_lengths", otherArgumentsLengthsArray); + 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 ChooseFastestBranchDataset(opBuilder.build()); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + 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 e29e27f73f4..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,60 +27,116 @@ 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" +) public final class ChooseFastestDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ChooseFastestDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ChooseFastestDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ChooseFastestDataset operation. - * + * * @param scope current scope - * @param inputDatasets - * @param numExperiments - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static ChooseFastestDataset create(Scope scope, Iterable> inputDatasets, Long numExperiments, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ChooseFastestDataset", scope.makeOpName("ChooseFastestDataset")); + @Endpoint( + describeByClass = true + ) + public static ChooseFastestDataset create(Scope scope, + Iterable> inputDatasets, Long numExperiments, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ChooseFastestDataset"); opBuilder.addInputList(Operands.asOutputs(inputDatasets)); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_experiments", numExperiments); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new ChooseFastestDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ChooseFastestDataset"; - - private Output handle; - - private ChooseFastestDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 new file mode 100644 index 00000000000..b070f5995d4 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CompressElement.java @@ -0,0 +1,116 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.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 + */ + public static final String OP_NAME = "CompressElement"; + + private Output compressed; + + @SuppressWarnings("unchecked") + public CompressElement(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + compressed = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new CompressElement operation. + * + * @param scope current scope + * @param components The components value + * @return a new instance of CompressElement + */ + @Endpoint( + describeByClass = true + ) + public static CompressElement create(Scope scope, Iterable> components) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CompressElement"); + opBuilder.addInputList(Operands.asOutputs(components)); + return new CompressElement(opBuilder.build()); + } + + /** + * Gets compressed. + * + * @return compressed. + */ + public Output compressed() { + return compressed; + } + + @Override + @SuppressWarnings("unchecked") + 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 bd32060b138..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,62 +27,159 @@ 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 `input_dataset` with `another_dataset`. + * Creates a dataset that concatenates {@code input_dataset} with {@code another_dataset}. */ -@Operator(group = "data") +@OpMetadata( + opType = ConcatenateDataset.OP_NAME, + inputsClass = ConcatenateDataset.Inputs.class +) +@Operator( + group = "data" +) public final class ConcatenateDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ConcatenateDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ConcatenateDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ConcatenateDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param anotherDataset - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static ConcatenateDataset create(Scope scope, Operand inputDataset, Operand anotherDataset, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ConcatenateDataset", scope.makeOpName("ConcatenateDataset")); + @Endpoint( + describeByClass = true + ) + public static ConcatenateDataset create(Scope scope, Operand inputDataset, + Operand anotherDataset, List> outputTypes, + List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ConcatenateDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(anotherDataset.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + 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 ConcatenateDataset(opBuilder.build()); } - + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. */ - public Output handle() { + 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ConcatenateDataset"; - - private Output handle; - - private ConcatenateDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * 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/DatasetCardinality.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetCardinality.java index 121ae2d2120..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,59 +17,137 @@ 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; /** - * Returns the cardinality of `input_dataset`. - *

- * Returns the cardinality of `input_dataset`. + * 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" +) public final class DatasetCardinality extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DatasetCardinality"; + + private Output cardinality; + + public DatasetCardinality(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + cardinality = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DatasetCardinality 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) { - OperationBuilder opBuilder = scope.env().opBuilder("DatasetCardinality", scope.makeOpName("DatasetCardinality")); + @Endpoint( + describeByClass = true + ) + public static DatasetCardinality create(Scope scope, Operand inputDataset, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DatasetCardinality"); opBuilder.addInput(inputDataset.asOutput()); - opBuilder = scope.apply(opBuilder); + 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); + } + /** - * The cardinality of `input_dataset`. Named constants are used to represent + * Gets cardinality. + * The cardinality of {@code input_dataset}. Named constants are used to represent * infinite and unknown cardinality. + * @return cardinality. */ public Output cardinality() { return cardinality; } - + @Override public Output asOutput() { return cardinality; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DatasetCardinality"; - - private Output cardinality; - - private DatasetCardinality(Operation operation) { - super(operation); - int outputIdx = 0; - cardinality = operation.output(outputIdx++); + + /** + * 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 71ba9356f09..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,60 +17,92 @@ 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; /** - * Creates a dataset from the given `graph_def`. - *

- * Creates a dataset from the provided `graph_def`. + * 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" +) public final class DatasetFromGraph extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DatasetFromGraph"; + + private Output handle; + + @SuppressWarnings("unchecked") + public DatasetFromGraph(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DatasetFromGraph operation. - * + * * @param scope current scope * @param graphDef The graph representation of the dataset (as serialized GraphDef). * @return a new instance of DatasetFromGraph */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DatasetFromGraph create(Scope scope, Operand graphDef) { - OperationBuilder opBuilder = scope.env().opBuilder("DatasetFromGraph", scope.makeOpName("DatasetFromGraph")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DatasetFromGraph"); opBuilder.addInput(graphDef.asOutput()); - opBuilder = scope.apply(opBuilder); return new DatasetFromGraph(opBuilder.build()); } - + /** + * Gets handle. * A variant tensor representing the dataset. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DatasetFromGraph"; - - private Output handle; - - private DatasetFromGraph(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 e9f5757cd40..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,64 +17,62 @@ 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 a serialized GraphDef representing `input_dataset`. - *

- * Returns a graph representation for `input_dataset`. + * 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" +) public final class DatasetToGraph extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.DatasetToGraph} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param externalStatePolicy - */ - public Options externalStatePolicy(Long externalStatePolicy) { - this.externalStatePolicy = externalStatePolicy; - return this; - } - - /** - * @param stripDeviceAssignment - */ - public Options stripDeviceAssignment(Boolean stripDeviceAssignment) { - this.stripDeviceAssignment = stripDeviceAssignment; - return this; - } - - private Long externalStatePolicy; - private Boolean stripDeviceAssignment; - - private Options() { - } + public static final String OP_NAME = "DatasetToGraphV2"; + + private Output graph; + + public DatasetToGraph(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + graph = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new DatasetToGraph operation. - * + * Factory method to create a class wrapping a new DatasetToGraphV2 operation. + * * @param scope current scope * @param inputDataset A variant tensor representing the dataset to return the graph representation for. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of DatasetToGraph */ - @Endpoint(describeByClass = true) - public static DatasetToGraph create(Scope scope, Operand inputDataset, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DatasetToGraphV2", scope.makeOpName("DatasetToGraph")); + @Endpoint( + describeByClass = true + ) + public static DatasetToGraph create(Scope scope, Operand inputDataset, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DatasetToGraph"); opBuilder.addInput(inputDataset.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.externalStatePolicy != null) { @@ -87,41 +85,100 @@ public static DatasetToGraph create(Scope scope, Operand inputDataset, Option } return new DatasetToGraph(opBuilder.build()); } - + /** - * @param externalStatePolicy + * Sets the externalStatePolicy option. + * + * @param externalStatePolicy the externalStatePolicy option + * @return this Options instance. */ public static Options externalStatePolicy(Long externalStatePolicy) { return new Options().externalStatePolicy(externalStatePolicy); } - + /** - * @param stripDeviceAssignment + * Sets the stripDeviceAssignment option. + * + * @param stripDeviceAssignment the stripDeviceAssignment option + * @return this Options instance. */ public static Options stripDeviceAssignment(Boolean stripDeviceAssignment) { return new Options().stripDeviceAssignment(stripDeviceAssignment); } - + /** + * Gets graph. * The graph representation of the dataset (as serialized GraphDef). + * @return graph. */ public Output graph() { return graph; } - + @Override public Output asOutput() { return graph; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DatasetToGraphV2"; - - private Output graph; - - private DatasetToGraph(Operation operation) { - super(operation); - int outputIdx = 0; - graph = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.DatasetToGraph} + */ + public static class Options { + private Long externalStatePolicy; + + private Boolean stripDeviceAssignment; + + private Options() { + } + + /** + * Sets the externalStatePolicy option. + * + * @param externalStatePolicy the externalStatePolicy option + * @return this Options instance. + */ + public Options externalStatePolicy(Long externalStatePolicy) { + this.externalStatePolicy = externalStatePolicy; + return this; + } + + /** + * Sets the stripDeviceAssignment option. + * + * @param stripDeviceAssignment the stripDeviceAssignment option + * @return this Options instance. + */ + public Options stripDeviceAssignment(Boolean stripDeviceAssignment) { + this.stripDeviceAssignment = 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 a74413e1935..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,62 +28,152 @@ 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" +) public final class DatasetToSingleElement extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DatasetToSingleElement"; + + private List> components; + + @SuppressWarnings("unchecked") + public DatasetToSingleElement(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 DatasetToSingleElement operation. - * + * * @param scope current scope * @param dataset A handle to a dataset that contains a single element. - * @param outputTypes - * @param outputShapes + * @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) { - OperationBuilder opBuilder = scope.env().opBuilder("DatasetToSingleElement", scope.makeOpName("DatasetToSingleElement")); + @Endpoint( + describeByClass = true + ) + public static DatasetToSingleElement create(Scope scope, Operand dataset, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DatasetToSingleElement"); opBuilder.addInput(dataset.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + 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 DatasetToSingleElement(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); + } + /** - * The components of the single element of `input`. + * Gets components. + * The components of the single element of {@code input}. + * @return components. */ public List> components() { return components; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) components.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DatasetToSingleElement"; - - private List> components; - - private DatasetToSingleElement(Operation operation) { - super(operation); - int outputIdx = 0; - int componentsLength = operation.outputListLength("components"); - components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); - outputIdx += componentsLength; + + /** + * 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 12504c93af8..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,44 +17,89 @@ 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; /** * Writes the given dataset to the given file using the TFRecord format. */ +@OpMetadata( + opType = DatasetToTfRecord.OP_NAME, + inputsClass = DatasetToTfRecord.Inputs.class +) +@Operator( + group = "data" +) public final class DatasetToTfRecord extends RawOp { - /** - * Factory method to create a class wrapping a new DatasetToTfRecord operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DatasetToTFRecord"; + + public DatasetToTfRecord(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new DatasetToTFRecord operation. + * * @param scope current scope * @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". + * compression), (ii) "ZLIB", or (iii) "GZIP". * @return a new instance of DatasetToTfRecord */ - @Endpoint(describeByClass = true) - public static DatasetToTfRecord create(Scope scope, Operand inputDataset, Operand filename, Operand compressionType) { - OperationBuilder opBuilder = scope.env().opBuilder("DatasetToTFRecord", scope.makeOpName("DatasetToTfRecord")); + @Endpoint( + describeByClass = true + ) + public static DatasetToTfRecord create(Scope scope, Operand inputDataset, + Operand filename, Operand compressionType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DatasetToTfRecord"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(filename.asOutput()); opBuilder.addInput(compressionType.asOutput()); - opBuilder = scope.apply(opBuilder); return new DatasetToTfRecord(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DatasetToTFRecord"; - - private DatasetToTfRecord(Operation operation) { - super(operation); + + @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 2995866c0f6..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,41 +17,78 @@ 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. */ -@Operator(group = "data") +@OpMetadata( + opType = DeleteIterator.OP_NAME, + inputsClass = DeleteIterator.Inputs.class +) +@Operator( + group = "data" +) public final class DeleteIterator extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DeleteIterator"; + + public DeleteIterator(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new DeleteIterator operation. - * + * * @param scope current scope * @param handle A handle to the iterator to delete. * @param deleter A variant deleter. * @return a new instance of DeleteIterator */ - @Endpoint(describeByClass = true) - public static DeleteIterator create(Scope scope, Operand handle, Operand deleter) { - OperationBuilder opBuilder = scope.env().opBuilder("DeleteIterator", scope.makeOpName("DeleteIterator")); + @Endpoint( + describeByClass = true + ) + public static DeleteIterator create(Scope scope, Operand handle, + Operand deleter) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DeleteIterator"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(deleter.asOutput()); - opBuilder = scope.apply(opBuilder); return new DeleteIterator(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DeleteIterator"; - - private DeleteIterator(Operation operation) { - super(operation); + + @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 4faca573dc8..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,39 +17,78 @@ 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"; + + 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 - * @param deleter + * @param handle The handle value + * @param deleter The deleter value * @return a new instance of DeleteMemoryCache */ - @Endpoint(describeByClass = true) - public static DeleteMemoryCache create(Scope scope, Operand handle, Operand deleter) { - OperationBuilder opBuilder = scope.env().opBuilder("DeleteMemoryCache", scope.makeOpName("DeleteMemoryCache")); + @Endpoint( + describeByClass = true + ) + public static DeleteMemoryCache create(Scope scope, Operand handle, + Operand deleter) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DeleteMemoryCache"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(deleter.asOutput()); - opBuilder = scope.apply(opBuilder); return new DeleteMemoryCache(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DeleteMemoryCache"; - - private DeleteMemoryCache(Operation operation) { - super(operation); + + @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 12fbd2e3cdf..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,43 +17,90 @@ 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"; + + public DeleteMultiDeviceIterator(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new DeleteMultiDeviceIterator operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static DeleteMultiDeviceIterator create(Scope scope, Operand multiDeviceIterator, Iterable> iterators, Operand deleter) { - OperationBuilder opBuilder = scope.env().opBuilder("DeleteMultiDeviceIterator", scope.makeOpName("DeleteMultiDeviceIterator")); + @Endpoint( + describeByClass = true + ) + public static DeleteMultiDeviceIterator create(Scope scope, + Operand multiDeviceIterator, Iterable> iterators, + Operand deleter) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DeleteMultiDeviceIterator"); opBuilder.addInput(multiDeviceIterator.asOutput()); opBuilder.addInputList(Operands.asOutputs(iterators)); opBuilder.addInput(deleter.asOutput()); - opBuilder = scope.apply(opBuilder); return new DeleteMultiDeviceIterator(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DeleteMultiDeviceIterator"; - - private DeleteMultiDeviceIterator(Operation operation) { - super(operation); + + @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 1b5c9ec6ceb..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,67 +27,129 @@ 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" +) public final class DenseToSparseBatchDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DenseToSparseBatchDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public DenseToSparseBatchDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DenseToSparseBatchDataset operation. - * + * * @param scope current scope * @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 `-1` to indicate + * 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 - * @param outputShapes + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of DenseToSparseBatchDataset */ - @Endpoint(describeByClass = true) - public static DenseToSparseBatchDataset create(Scope scope, Operand inputDataset, Operand batchSize, Operand rowShape, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("DenseToSparseBatchDataset", scope.makeOpName("DenseToSparseBatchDataset")); + @Endpoint( + describeByClass = true + ) + public static DenseToSparseBatchDataset create(Scope scope, Operand inputDataset, + Operand batchSize, Operand rowShape, List> outputTypes, + List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DenseToSparseBatchDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(batchSize.asOutput()); opBuilder.addInput(rowShape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new DenseToSparseBatchDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DenseToSparseBatchDataset"; - - private Output handle; - - private DenseToSparseBatchDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 54e1df16001..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,42 +17,80 @@ 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. */ -@Operator(group = "data") +@OpMetadata( + opType = DeserializeIterator.OP_NAME, + inputsClass = DeserializeIterator.Inputs.class +) +@Operator( + group = "data" +) public final class DeserializeIterator extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DeserializeIterator"; + + public DeserializeIterator(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new DeserializeIterator operation. - * + * * @param scope current scope * @param resourceHandle A handle to an iterator resource. * @param serialized A variant tensor storing the state of the iterator contained in the * resource. * @return a new instance of DeserializeIterator */ - @Endpoint(describeByClass = true) - public static DeserializeIterator create(Scope scope, Operand resourceHandle, Operand serialized) { - OperationBuilder opBuilder = scope.env().opBuilder("DeserializeIterator", scope.makeOpName("DeserializeIterator")); + @Endpoint( + describeByClass = true + ) + public static DeserializeIterator create(Scope scope, Operand resourceHandle, + Operand serialized) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DeserializeIterator"); opBuilder.addInput(resourceHandle.asOutput()); opBuilder.addInput(serialized.asOutput()); - opBuilder = scope.apply(opBuilder); return new DeserializeIterator(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DeserializeIterator"; - - private DeserializeIterator(Operation operation) { - super(operation); + + @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 0e543dc351a..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,63 +27,166 @@ 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 `InterleaveDataset` on a fixed list of `N` datasets. + * 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" +) public final class DirectedInterleaveDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DirectedInterleaveDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public DirectedInterleaveDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DirectedInterleaveDataset operation. - * + * * @param scope current scope - * @param selectorInputDataset A dataset of scalar `DT_INT64` elements that determines which of the - * `N` data inputs should produce the next output element. - * @param dataInputDatasets `N` datasets with the same type that will be interleaved according to - * the values of `selector_input_dataset`. - * @param outputTypes - * @param outputShapes + * @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 + * @param options carries optional attribute values * @return a new instance of DirectedInterleaveDataset */ - @Endpoint(describeByClass = true) - public static DirectedInterleaveDataset create(Scope scope, Operand selectorInputDataset, Iterable> dataInputDatasets, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("DirectedInterleaveDataset", scope.makeOpName("DirectedInterleaveDataset")); + @Endpoint( + describeByClass = true + ) + public static DirectedInterleaveDataset create(Scope scope, + Operand selectorInputDataset, + Iterable> dataInputDatasets, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DirectedInterleaveDataset"); opBuilder.addInput(selectorInputDataset.asOutput()); opBuilder.addInputList(Operands.asOutputs(dataInputDatasets)); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + 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.stopOnEmptyDataset != null) { + opBuilder.setAttr("stop_on_empty_dataset", opts.stopOnEmptyDataset); + } + } + } return new DirectedInterleaveDataset(opBuilder.build()); } - + /** + * Sets the stopOnEmptyDataset option. + * + * @param stopOnEmptyDataset the stopOnEmptyDataset option + * @return this Options instance. */ - public Output handle() { + public static Options stopOnEmptyDataset(Boolean stopOnEmptyDataset) { + return new Options().stopOnEmptyDataset(stopOnEmptyDataset); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DirectedInterleaveDataset"; - - private Output handle; - - private DirectedInterleaveDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.DirectedInterleaveDataset} + */ + public static class Options { + private Boolean stopOnEmptyDataset; + + private Options() { + } + + /** + * Sets the stopOnEmptyDataset option. + * + * @param stopOnEmptyDataset the stopOnEmptyDataset option + * @return this Options instance. + */ + public Options stopOnEmptyDataset(Boolean stopOnEmptyDataset) { + this.stopOnEmptyDataset = 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 new file mode 100644 index 00000000000..be7fc1c6ee8 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DummyIterationCounter.java @@ -0,0 +1,98 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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; + +/** + * 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 + */ + public static final String OP_NAME = "DummyIterationCounter"; + + private Output handle; + + @SuppressWarnings("unchecked") + public DummyIterationCounter(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new DummyIterationCounter operation. + * + * @param scope current scope + * @return a new instance of DummyIterationCounter + */ + @Endpoint( + describeByClass = true + ) + public static DummyIterationCounter create(Scope scope) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DummyIterationCounter"); + return new DummyIterationCounter(opBuilder.build()); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + 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 d1d1c55e08f..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,59 +27,106 @@ 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 `input_dataset` having true in the last component. + * 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" +) public final class FilterByLastComponentDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FilterByLastComponentDataset"; + + private Output output; + + @SuppressWarnings("unchecked") + public FilterByLastComponentDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new FilterByLastComponentDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static FilterByLastComponentDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("FilterByLastComponentDataset", scope.makeOpName("FilterByLastComponentDataset")); + @Endpoint( + describeByClass = true + ) + public static FilterByLastComponentDataset create(Scope scope, + Operand inputDataset, List> outputTypes, + List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FilterByLastComponentDataset"); opBuilder.addInput(inputDataset.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new FilterByLastComponentDataset(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FilterByLastComponentDataset"; - - private Output output; - - private FilterByLastComponentDataset(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 new file mode 100644 index 00000000000..050fecfe986 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FilterDataset.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.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.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}.
  • + *
+ */ +@OpMetadata( + opType = FilterDataset.OP_NAME, + inputsClass = FilterDataset.Inputs.class +) +@Operator( + group = "data" +) +public final class FilterDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FilterDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public FilterDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new FilterDataset 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 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 FilterDataset + */ + @Endpoint( + describeByClass = true + ) + public static FilterDataset create(Scope scope, Operand inputDataset, + Iterable> otherArguments, ConcreteFunction predicate, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FilterDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInputList(Operands.asOutputs(otherArguments)); + 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.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. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + 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 new file mode 100644 index 00000000000..e6cc09a0a8c --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FinalizeDataset.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.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 by applying {@code tf.data.Options} to {@code input_dataset}. + */ +@OpMetadata( + opType = FinalizeDataset.OP_NAME, + inputsClass = FinalizeDataset.Inputs.class +) +@Operator( + group = "data" +) +public final class FinalizeDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FinalizeDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public FinalizeDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new FinalizeDataset operation. + * + * @param scope current scope + * @param inputDataset A variant tensor representing the 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 FinalizeDataset + */ + @Endpoint( + describeByClass = true + ) + public static FinalizeDataset create(Scope scope, Operand inputDataset, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FinalizeDataset"); + opBuilder.addInput(inputDataset.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.hasCapturedRef != null) { + opBuilder.setAttr("has_captured_ref", opts.hasCapturedRef); + } + } + } + return new FinalizeDataset(opBuilder.build()); + } + + /** + * Sets the hasCapturedRef option. + * + * @param hasCapturedRef the hasCapturedRef option + * @return this Options instance. + */ + public static Options hasCapturedRef(Boolean hasCapturedRef) { + return new Options().hasCapturedRef(hasCapturedRef); + } + + /** + * 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.FinalizeDataset} + */ + public static class Options { + private Boolean hasCapturedRef; + + private Options() { + } + + /** + * Sets the hasCapturedRef option. + * + * @param hasCapturedRef the hasCapturedRef option + * @return this Options instance. + */ + public Options hasCapturedRef(Boolean hasCapturedRef) { + this.hasCapturedRef = 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 10a7c791e17..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,67 +17,179 @@ 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; /** + * The FixedLengthRecordDatasetV2 operation */ +@OpMetadata( + opType = FixedLengthRecordDataset.OP_NAME, + inputsClass = FixedLengthRecordDataset.Inputs.class +) +@Operator( + group = "data" +) public final class FixedLengthRecordDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new FixedLengthRecordDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FixedLengthRecordDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + public FixedLengthRecordDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new FixedLengthRecordDatasetV2 operation. + * * @param scope current scope - * @param filenames - * @param headerBytes - * @param recordBytes - * @param footerBytes - * @param bufferSize - * @param compressionType + * @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(describeByClass = true) - public static FixedLengthRecordDataset create(Scope scope, Operand filenames, Operand headerBytes, Operand recordBytes, Operand footerBytes, Operand bufferSize, Operand compressionType) { - OperationBuilder opBuilder = scope.env().opBuilder("FixedLengthRecordDatasetV2", scope.makeOpName("FixedLengthRecordDataset")); + @Endpoint( + describeByClass = true + ) + public static FixedLengthRecordDataset create(Scope scope, Operand filenames, + Operand headerBytes, Operand recordBytes, Operand footerBytes, + Operand bufferSize, Operand compressionType, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FixedLengthRecordDataset"); opBuilder.addInput(filenames.asOutput()); opBuilder.addInput(headerBytes.asOutput()); opBuilder.addInput(recordBytes.asOutput()); opBuilder.addInput(footerBytes.asOutput()); opBuilder.addInput(bufferSize.asOutput()); opBuilder.addInput(compressionType.asOutput()); - opBuilder = scope.apply(opBuilder); + 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. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FixedLengthRecordDatasetV2"; - - private Output handle; - - private FixedLengthRecordDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * 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 new file mode 100644 index 00000000000..163094b2950 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FlatMapDataset.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.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.family.TType; + +/** + * Creates a dataset that applies {@code f} to the outputs of {@code input_dataset}. + * Unlike MapDataset, the {@code f} in FlatMapDataset is expected to return a + * Dataset variant, and FlatMapDataset will flatten successive results + * into a single Dataset. + */ +@OpMetadata( + opType = FlatMapDataset.OP_NAME, + inputsClass = FlatMapDataset.Inputs.class +) +@Operator( + group = "data" +) +public final class FlatMapDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FlatMapDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public FlatMapDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * 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 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 + * @param options carries optional attribute values + * @return a new instance of FlatMapDataset + */ + @Endpoint( + describeByClass = true + ) + public static FlatMapDataset create(Scope scope, Operand inputDataset, + Iterable> otherArguments, ConcreteFunction f, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FlatMapDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInputList(Operands.asOutputs(otherArguments)); + opBuilder.setAttr("f", f); + 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 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. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + 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 new file mode 100644 index 00000000000..2ca97fa2418 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/GeneratorDataset.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.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.family.TType; + +/** + * Creates a dataset that invokes a function to generate elements. + */ +@OpMetadata( + opType = GeneratorDataset.OP_NAME, + inputsClass = GeneratorDataset.Inputs.class +) +@Operator( + group = "data" +) +public final class GeneratorDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GeneratorDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public GeneratorDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * 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 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( + describeByClass = true + ) + public static GeneratorDataset create(Scope scope, Iterable> initFuncOtherArgs, + Iterable> nextFuncOtherArgs, Iterable> finalizeFuncOtherArgs, + ConcreteFunction initFunc, ConcreteFunction nextFunc, ConcreteFunction finalizeFunc, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GeneratorDataset"); + opBuilder.addInputList(Operands.asOutputs(initFuncOtherArgs)); + opBuilder.addInputList(Operands.asOutputs(nextFuncOtherArgs)); + opBuilder.addInputList(Operands.asOutputs(finalizeFuncOtherArgs)); + opBuilder.setAttr("init_func", initFunc); + opBuilder.setAttr("next_func", nextFunc); + opBuilder.setAttr("finalize_func", finalizeFunc); + 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 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. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + 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 new file mode 100644 index 00000000000..7591cbce6fa --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/GroupByReducerDataset.java @@ -0,0 +1,220 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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" +) +public final class GroupByReducerDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GroupByReducerDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public GroupByReducerDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new GroupByReducerDataset operation. + * + * @param scope current scope + * @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 + */ + @Endpoint( + describeByClass = true + ) + public static GroupByReducerDataset create(Scope scope, Operand inputDataset, + Iterable> keyFuncOtherArguments, Iterable> initFuncOtherArguments, + Iterable> reduceFuncOtherArguments, + Iterable> finalizeFuncOtherArguments, ConcreteFunction keyFunc, + ConcreteFunction initFunc, ConcreteFunction reduceFunc, ConcreteFunction finalizeFunc, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GroupByReducerDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInputList(Operands.asOutputs(keyFuncOtherArguments)); + opBuilder.addInputList(Operands.asOutputs(initFuncOtherArguments)); + opBuilder.addInputList(Operands.asOutputs(reduceFuncOtherArguments)); + opBuilder.addInputList(Operands.asOutputs(finalizeFuncOtherArguments)); + opBuilder.setAttr("key_func", keyFunc); + opBuilder.setAttr("init_func", initFunc); + opBuilder.setAttr("reduce_func", reduceFunc); + opBuilder.setAttr("finalize_func", finalizeFunc); + 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 GroupByReducerDataset(opBuilder.build()); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + 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 new file mode 100644 index 00000000000..55b76655428 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/GroupByWindowDataset.java @@ -0,0 +1,236 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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" +) +public final class GroupByWindowDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GroupByWindowDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public GroupByWindowDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * 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 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 + * @param options carries optional attribute values + * @return a new instance of GroupByWindowDataset + */ + @Endpoint( + describeByClass = true + ) + public static GroupByWindowDataset create(Scope scope, Operand inputDataset, + Iterable> keyFuncOtherArguments, Iterable> reduceFuncOtherArguments, + Iterable> windowSizeFuncOtherArguments, ConcreteFunction keyFunc, + ConcreteFunction reduceFunc, ConcreteFunction windowSizeFunc, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GroupByWindowDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInputList(Operands.asOutputs(keyFuncOtherArguments)); + opBuilder.addInputList(Operands.asOutputs(reduceFuncOtherArguments)); + opBuilder.addInputList(Operands.asOutputs(windowSizeFuncOtherArguments)); + opBuilder.setAttr("key_func", keyFunc); + opBuilder.setAttr("reduce_func", reduceFunc); + opBuilder.setAttr("window_size_func", windowSizeFunc); + 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 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. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + 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 02c64a0b24e..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,53 +27,60 @@ 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 `input_dataset` ignoring errors. + * 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" +) public final class IgnoreErrorsDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.IgnoreErrorsDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param logWarning - */ - public Options logWarning(Boolean logWarning) { - this.logWarning = logWarning; - return this; - } - - private Boolean logWarning; - - private Options() { - } + public static final String OP_NAME = "IgnoreErrorsDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public IgnoreErrorsDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new IgnoreErrorsDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param outputTypes - * @param outputShapes - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static IgnoreErrorsDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("IgnoreErrorsDataset", scope.makeOpName("IgnoreErrorsDataset")); + @Endpoint( + describeByClass = true + ) + public static IgnoreErrorsDataset create(Scope scope, Operand inputDataset, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IgnoreErrorsDataset"); opBuilder.addInput(inputDataset.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -84,34 +93,84 @@ public static IgnoreErrorsDataset create(Scope scope, Operand inputDataset, L } return new IgnoreErrorsDataset(opBuilder.build()); } - + /** - * @param logWarning + * Sets the logWarning option. + * + * @param logWarning the logWarning option + * @return this Options instance. */ public static Options logWarning(Boolean logWarning) { return new Options().logWarning(logWarning); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IgnoreErrorsDataset"; - - private Output handle; - - private IgnoreErrorsDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.IgnoreErrorsDataset} + */ + public static class Options { + private Boolean logWarning; + + private Options() { + } + + /** + * Sets the logWarning option. + * + * @param logWarning the logWarning option + * @return this Options instance. + */ + public Options logWarning(Boolean logWarning) { + this.logWarning = 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 3008e032cb5..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,39 +17,78 @@ 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" +) public final class InitializeTableFromDataset extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "InitializeTableFromDataset"; + + 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 - * @param dataset + * @param tableHandle The tableHandle value + * @param dataset The dataset value * @return a new instance of InitializeTableFromDataset */ - @Endpoint(describeByClass = true) - public static InitializeTableFromDataset create(Scope scope, Operand tableHandle, Operand dataset) { - OperationBuilder opBuilder = scope.env().opBuilder("InitializeTableFromDataset", scope.makeOpName("InitializeTableFromDataset")); + @Endpoint( + describeByClass = true + ) + public static InitializeTableFromDataset create(Scope scope, Operand tableHandle, + Operand dataset) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "InitializeTableFromDataset"); opBuilder.addInput(tableHandle.asOutput()); opBuilder.addInput(dataset.asOutput()); - opBuilder = scope.apply(opBuilder); return new InitializeTableFromDataset(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InitializeTableFromDataset"; - - private InitializeTableFromDataset(Operation operation) { - super(operation); + + @OpInputsMetadata( + outputsClass = InitializeTableFromDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * 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 new file mode 100644 index 00000000000..4113a6905ee --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/InterleaveDataset.java @@ -0,0 +1,221 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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 that applies {@code f} to the outputs of {@code input_dataset}. + * Unlike MapDataset, the {@code f} in InterleaveDataset is expected to return + * a Dataset variant, and InterleaveDataset will flatten successive + * results into a single Dataset. Unlike FlatMapDataset, + * 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" +) +public final class InterleaveDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "InterleaveDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public InterleaveDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * 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 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 + * @param options carries optional attribute values + * @return a new instance of InterleaveDataset + */ + @Endpoint( + describeByClass = true + ) + public static InterleaveDataset create(Scope scope, Operand inputDataset, + Iterable> otherArguments, Operand cycleLength, Operand blockLength, + ConcreteFunction f, List> outputTypes, List outputShapes, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "InterleaveDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInputList(Operands.asOutputs(otherArguments)); + opBuilder.addInput(cycleLength.asOutput()); + opBuilder.addInput(blockLength.asOutput()); + opBuilder.setAttr("f", f); + 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 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. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + 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 d20e98d5c9b..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,61 +27,113 @@ 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 */ -@Operator(group = "data") +@OpMetadata( + opType = Iterator.OP_NAME, + inputsClass = Iterator.Inputs.class +) +@Operator( + group = "data" +) public final class Iterator extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Iterator operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IteratorV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + public Iterator(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new IteratorV2 operation. + * * @param scope current scope - * @param sharedName - * @param container - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static Iterator create(Scope scope, String sharedName, String container, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("IteratorV2", scope.makeOpName("Iterator")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static Iterator create(Scope scope, String sharedName, String container, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Iterator"); opBuilder.setAttr("shared_name", sharedName); opBuilder.setAttr("container", container); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new Iterator(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IteratorV2"; - - private Output handle; - - private Iterator(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 4de1a9f1e9e..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. @@ -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,55 +27,63 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.data.IteratorFromStringHandle} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param outputShapes - */ - public Options outputShapes(List outputShapes) { - this.outputShapes = outputShapes; - return this; - } - - private List outputShapes; - - private Options() { - } + public static final String OP_NAME = "IteratorFromStringHandleV2"; + + private Output resourceHandle; + + @SuppressWarnings("unchecked") + public IteratorFromStringHandle(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + resourceHandle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new IteratorFromStringHandle operation. - * + * Factory method to create a class wrapping a new IteratorFromStringHandleV2 operation. + * * @param scope current scope - * @param stringHandle - * @param outputTypes - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static IteratorFromStringHandle create(Scope scope, Operand stringHandle, List> outputTypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("IteratorFromStringHandleV2", scope.makeOpName("IteratorFromStringHandle")); + @Endpoint( + describeByClass = true + ) + public static IteratorFromStringHandle create(Scope scope, Operand stringHandle, + List> outputTypes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IteratorFromStringHandle"); opBuilder.addInput(stringHandle.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); 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) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = opts.outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -82,34 +92,99 @@ public static IteratorFromStringHandle create(Scope scope, Operand stri } return new IteratorFromStringHandle(opBuilder.build()); } - + /** - * @param outputShapes + * 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 Output resourceHandle() { + public static Options outputShapes(Shape... outputShapes) { + return new Options().outputShapes(outputShapes); + } + + /** + * Gets resourceHandle. + * + * @return resourceHandle. + */ + public Output resourceHandle() { return resourceHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) resourceHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IteratorFromStringHandleV2"; - - private Output resourceHandle; - - private IteratorFromStringHandle(Operation operation) { - super(operation); - int outputIdx = 0; - resourceHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.IteratorFromStringHandle} + */ + public static class Options { + private List outputShapes; + + 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; + } + } + + @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 a07649736c9..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,55 +17,89 @@ 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 `resource` has been placed. + * 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 + */ + public static final String OP_NAME = "IteratorGetDevice"; + + private Output device; + + public IteratorGetDevice(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + device = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new IteratorGetDevice operation. - * + * * @param scope current scope - * @param resource + * @param resource The resource value * @return a new instance of IteratorGetDevice */ - @Endpoint(describeByClass = true) - public static IteratorGetDevice create(Scope scope, Operand resource) { - OperationBuilder opBuilder = scope.env().opBuilder("IteratorGetDevice", scope.makeOpName("IteratorGetDevice")); + @Endpoint( + describeByClass = true + ) + public static IteratorGetDevice create(Scope scope, Operand resource) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IteratorGetDevice"); opBuilder.addInput(resource.asOutput()); - opBuilder = scope.apply(opBuilder); return new IteratorGetDevice(opBuilder.build()); } - + /** + * Gets device. + * + * @return device. */ public Output device() { return device; } - + @Override public Output asOutput() { return device; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IteratorGetDevice"; - - private Output device; - - private IteratorGetDevice(Operation operation) { - super(operation); - int outputIdx = 0; - device = operation.output(outputIdx++); + + @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 a41f441f650..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,62 +28,107 @@ 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 . */ -@Operator(group = "data") +@OpMetadata( + opType = IteratorGetNext.OP_NAME, + inputsClass = IteratorGetNext.Inputs.class +) +@Operator( + group = "data" +) public final class IteratorGetNext extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IteratorGetNext"; + + private List> components; + + @SuppressWarnings("unchecked") + public IteratorGetNext(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 IteratorGetNext operation. - * + * * @param scope current scope - * @param iterator - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static IteratorGetNext create(Scope scope, Operand iterator, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("IteratorGetNext", scope.makeOpName("IteratorGetNext")); + @Endpoint( + describeByClass = true + ) + public static IteratorGetNext create(Scope scope, Operand iterator, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IteratorGetNext"); opBuilder.addInput(iterator.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new IteratorGetNext(opBuilder.build()); } - + /** + * Gets components. + * + * @return components. */ public List> components() { return components; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) components.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IteratorGetNext"; - - private List> components; - - private IteratorGetNext(Operation operation) { - super(operation); - int outputIdx = 0; - int componentsLength = operation.outputListLength("components"); - components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); - outputIdx += componentsLength; + + @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 7d4f441eb83..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,60 +27,105 @@ 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. */ -@Operator(group = "data") +@OpMetadata( + opType = IteratorGetNextAsOptional.OP_NAME, + inputsClass = IteratorGetNextAsOptional.Inputs.class +) +@Operator( + group = "data" +) public final class IteratorGetNextAsOptional extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IteratorGetNextAsOptional"; + + private Output optional; + + @SuppressWarnings("unchecked") + public IteratorGetNextAsOptional(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + optional = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new IteratorGetNextAsOptional operation. - * + * * @param scope current scope - * @param iterator - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static IteratorGetNextAsOptional create(Scope scope, Operand iterator, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("IteratorGetNextAsOptional", scope.makeOpName("IteratorGetNextAsOptional")); + @Endpoint( + describeByClass = true + ) + public static IteratorGetNextAsOptional create(Scope scope, Operand iterator, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IteratorGetNextAsOptional"); opBuilder.addInput(iterator.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new IteratorGetNextAsOptional(opBuilder.build()); } - + /** + * Gets optional. + * + * @return optional. */ - public Output optional() { + public Output optional() { return optional; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) optional; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IteratorGetNextAsOptional"; - - private Output optional; - - private IteratorGetNextAsOptional(Operation operation) { - super(operation); - int outputIdx = 0; - optional = operation.output(outputIdx++); + + @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 bdce447dd0a..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,67 +28,111 @@ 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. - *

* This operation is a synchronous version IteratorGetNext. It should only be used * in situations where the iterator does not block the calling thread, or where * the calling thread is not a member of the thread pool used to execute parallel * operations (e.g. in eager mode). */ -@Operator(group = "data") +@OpMetadata( + opType = IteratorGetNextSync.OP_NAME, + inputsClass = IteratorGetNextSync.Inputs.class +) +@Operator( + group = "data" +) public final class IteratorGetNextSync extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IteratorGetNextSync"; + + private List> components; + + @SuppressWarnings("unchecked") + public IteratorGetNextSync(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 IteratorGetNextSync operation. - * + * * @param scope current scope - * @param iterator - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static IteratorGetNextSync create(Scope scope, Operand iterator, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("IteratorGetNextSync", scope.makeOpName("IteratorGetNextSync")); + @Endpoint( + describeByClass = true + ) + public static IteratorGetNextSync create(Scope scope, Operand iterator, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IteratorGetNextSync"); opBuilder.addInput(iterator.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new IteratorGetNextSync(opBuilder.build()); } - + /** + * Gets components. + * + * @return components. */ public List> components() { return components; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) components.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IteratorGetNextSync"; - - private List> components; - - private IteratorGetNextSync(Operation operation) { - super(operation); - int outputIdx = 0; - int componentsLength = operation.outputListLength("components"); - components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); - outputIdx += componentsLength; + + @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 94dd5feace7..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,57 +17,90 @@ 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; /** - * Converts the given `resource_handle` representing an iterator to a string. + * Converts the given {@code resource_handle} representing an iterator to a string. */ -@Operator(group = "data") +@OpMetadata( + opType = IteratorToStringHandle.OP_NAME, + inputsClass = IteratorToStringHandle.Inputs.class +) +@Operator( + group = "data" +) public final class IteratorToStringHandle extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IteratorToStringHandle"; + + private Output stringHandle; + + public IteratorToStringHandle(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + stringHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new IteratorToStringHandle operation. - * + * * @param scope current scope * @param resourceHandle A handle to an iterator resource. * @return a new instance of IteratorToStringHandle */ - @Endpoint(describeByClass = true) - public static IteratorToStringHandle create(Scope scope, Operand resourceHandle) { - OperationBuilder opBuilder = scope.env().opBuilder("IteratorToStringHandle", scope.makeOpName("IteratorToStringHandle")); + @Endpoint( + describeByClass = true + ) + public static IteratorToStringHandle create(Scope scope, + Operand resourceHandle) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IteratorToStringHandle"); opBuilder.addInput(resourceHandle.asOutput()); - opBuilder = scope.apply(opBuilder); return new IteratorToStringHandle(opBuilder.build()); } - + /** + * Gets stringHandle. * A string representation of the given handle. + * @return stringHandle. */ public Output stringHandle() { return stringHandle; } - + @Override public Output asOutput() { return stringHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IteratorToStringHandle"; - - private Output stringHandle; - - private IteratorToStringHandle(Operation operation) { - super(operation); - int outputIdx = 0; - stringHandle = operation.output(outputIdx++); + + @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 c67912ec018..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,72 +27,116 @@ 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 emits the key-value pairs in one or more LMDB files. - *

* The Lightning Memory-Mapped Database Manager, or LMDB, is an embedded binary * key-value database. This dataset can read the contents of LMDB database files, - * the names of which generally have the `.mdb` suffix. - *

- * Each output element consists of a key-value pair represented as a pair of - * scalar string `Tensor`s, where the first `Tensor` contains the key and the - * second `Tensor` contains the value. - *

- * LMDB uses different file formats on big- and little-endian machines. - * `data.LMDBDataset` can only read files in the format of the host machine. + * the names of which generally have the {@code .mdb} suffix. + *

Each output element consists of a key-value pair represented as a pair of + * scalar string {@code Tensor}s, where the first {@code Tensor} contains the key and the + * second {@code Tensor} contains the value. + *

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" +) public final class LMDBDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LMDBDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public LMDBDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LMDBDataset 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 - * @param outputShapes + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of LMDBDataset */ - @Endpoint(describeByClass = true) - public static LMDBDataset create(Scope scope, Operand filenames, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("LMDBDataset", scope.makeOpName("LMDBDataset")); + @Endpoint( + describeByClass = true + ) + public static LMDBDataset create(Scope scope, Operand filenames, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LMDBDataset"); opBuilder.addInput(filenames.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new LMDBDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LMDBDataset"; - - private Output handle; - - private LMDBDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 047057a1c25..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,62 +27,114 @@ 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 `input_dataset` elements in a StatsAggregator. + * Records the latency of producing {@code input_dataset} elements in a StatsAggregator. */ +@OpMetadata( + opType = LatencyStatsDataset.OP_NAME, + inputsClass = LatencyStatsDataset.Inputs.class +) +@Operator( + group = "data" +) public final class LatencyStatsDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LatencyStatsDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public LatencyStatsDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LatencyStatsDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param tag - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static LatencyStatsDataset create(Scope scope, Operand inputDataset, Operand tag, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("LatencyStatsDataset", scope.makeOpName("LatencyStatsDataset")); + @Endpoint( + describeByClass = true + ) + public static LatencyStatsDataset create(Scope scope, Operand inputDataset, + Operand tag, List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LatencyStatsDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(tag.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new LatencyStatsDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LatencyStatsDataset"; - - private Output handle; - - private LatencyStatsDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 3b41dd2e918..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,58 +17,65 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.data.LeakyReluGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param alpha - */ - public Options alpha(Float alpha) { - this.alpha = alpha; - return this; - } - - private Float alpha; - - private Options() { - } + public static final String OP_NAME = "LeakyReluGrad"; + + private Output backprops; + + public LeakyReluGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + backprops = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new LeakyReluGrad operation. - * + * * @param scope current scope * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code LeakyReluGrad} output and operands * @return a new instance of LeakyReluGrad */ - @Endpoint(describeByClass = true) - public static LeakyReluGrad create(Scope scope, Operand gradients, Operand features, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("LeakyReluGrad", scope.makeOpName("LeakyReluGrad")); + @Endpoint( + describeByClass = true + ) + public static LeakyReluGrad create(Scope scope, Operand gradients, + Operand features, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LeakyReluGrad"); opBuilder.addInput(gradients.asOutput()); opBuilder.addInput(features.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.alpha != null) { @@ -76,36 +83,86 @@ public static LeakyReluGrad create(Scope scope, Operand(opBuilder.build()); + return new LeakyReluGrad<>(opBuilder.build()); } - + /** - * @param alpha + * Sets the alpha option. + * + * @param alpha the alpha option + * @return this Options instance. */ public static Options alpha(Float alpha) { return new Options().alpha(alpha); } - + /** - * `gradients * (features > 0) + alpha * gradients * (features <= 0)`. + * Gets backprops. + * {@code gradients * (features > 0) + alpha * gradients * (features <= 0)}. + * @return backprops. */ public Output backprops() { return backprops; } - + @Override public Output asOutput() { return backprops; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LeakyReluGrad"; - - private Output backprops; - - private LeakyReluGrad(Operation operation) { - super(operation); - int outputIdx = 0; - backprops = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.LeakyReluGrad} + */ + public static class Options { + private Float alpha; + + private Options() { + } + + /** + * Sets the alpha option. + * + * @param alpha the alpha option + * @return this Options instance. + */ + public Options alpha(Float alpha) { + this.alpha = 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 new file mode 100644 index 00000000000..51e9cef8460 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LegacyParallelInterleaveDataset.java @@ -0,0 +1,272 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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 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! + */ +@OpMetadata( + opType = LegacyParallelInterleaveDataset.OP_NAME, + inputsClass = LegacyParallelInterleaveDataset.Inputs.class +) +@Operator( + group = "data" +) +public final class LegacyParallelInterleaveDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LegacyParallelInterleaveDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + public LegacyParallelInterleaveDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * 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 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 + * @param options carries optional attribute values + * @return a new instance of LegacyParallelInterleaveDataset + */ + @Endpoint( + describeByClass = true + ) + public static LegacyParallelInterleaveDataset create(Scope scope, + Operand inputDataset, Iterable> otherArguments, + Operand cycleLength, Operand blockLength, + Operand bufferOutputElements, Operand prefetchInputElements, + ConcreteFunction f, List> outputTypes, List outputShapes, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LegacyParallelInterleaveDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInputList(Operands.asOutputs(otherArguments)); + opBuilder.addInput(cycleLength.asOutput()); + opBuilder.addInput(blockLength.asOutput()); + opBuilder.addInput(bufferOutputElements.asOutput()); + opBuilder.addInput(prefetchInputElements.asOutput()); + opBuilder.setAttr("f", f); + 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 LegacyParallelInterleaveDataset(opBuilder.build()); + } + + /** + * Sets the deterministic option. + * + * @param deterministic the deterministic option + * @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.LegacyParallelInterleaveDataset} + */ + public static class Options { + private String deterministic; + + private String metadata; + + private Options() { + } + + /** + * Sets the deterministic option. + * + * @param deterministic the deterministic option + * @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 = 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 new file mode 100644 index 00000000000..53e32585c1f --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LoadDataset.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.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 LoadDataset operation + */ +@OpMetadata( + opType = LoadDataset.OP_NAME, + inputsClass = LoadDataset.Inputs.class +) +@Operator( + group = "data" +) +public final class LoadDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LoadDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public LoadDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * 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 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 + */ + @Endpoint( + describeByClass = true + ) + public static LoadDataset create(Scope scope, Operand path, + Iterable> readerFuncOtherArgs, List> outputTypes, + List outputShapes, ConcreteFunction readerFunc, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadDataset"); + opBuilder.addInput(path.asOutput()); + opBuilder.addInputList(Operands.asOutputs(readerFuncOtherArgs)); + 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("reader_func", readerFunc); + if (options != null) { + for (Options opts : options) { + if (opts.compression != null) { + opBuilder.setAttr("compression", opts.compression); + } + } + } + return new LoadDataset(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.LoadDataset} + */ + 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 = 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 7bd453d2fd7..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,44 +17,80 @@ 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; /** - * Makes a new iterator from the given `dataset` and stores it in `iterator`. - *

+ * Makes a new iterator from the given {@code dataset} and stores it in {@code iterator}. * This operation may be executed multiple times. Each execution will reset the - * iterator in `iterator` to the first element of `dataset`. + * iterator in {@code iterator} to the first element of {@code dataset}. */ -@Operator(group = "data") +@OpMetadata( + opType = MakeIterator.OP_NAME, + inputsClass = MakeIterator.Inputs.class +) +@Operator( + group = "data" +) public final class MakeIterator extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MakeIterator"; + + 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 - * @param iterator + * @param dataset The dataset value + * @param iterator The iterator value * @return a new instance of MakeIterator */ - @Endpoint(describeByClass = true) - public static MakeIterator create(Scope scope, Operand dataset, Operand iterator) { - OperationBuilder opBuilder = scope.env().opBuilder("MakeIterator", scope.makeOpName("MakeIterator")); + @Endpoint( + describeByClass = true + ) + public static MakeIterator create(Scope scope, Operand dataset, + Operand iterator) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MakeIterator"); opBuilder.addInput(dataset.asOutput()); opBuilder.addInput(iterator.asOutput()); - opBuilder = scope.apply(opBuilder); return new MakeIterator(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MakeIterator"; - - private MakeIterator(Operation operation) { - super(operation); + + @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 new file mode 100644 index 00000000000..ec935a6f8ee --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MapAndBatchDataset.java @@ -0,0 +1,271 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.TBool; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; + +/** + * 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. + */ +@OpMetadata( + opType = MapAndBatchDataset.OP_NAME, + inputsClass = MapAndBatchDataset.Inputs.class +) +@Operator( + group = "data" +) +public final class MapAndBatchDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MapAndBatchDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public MapAndBatchDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new MapAndBatchDataset operation. + * + * @param scope current scope + * @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 + */ + @Endpoint( + describeByClass = true + ) + public static MapAndBatchDataset create(Scope scope, Operand inputDataset, + Iterable> otherArguments, Operand batchSize, + Operand numParallelCalls, Operand dropRemainder, ConcreteFunction f, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MapAndBatchDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInputList(Operands.asOutputs(otherArguments)); + opBuilder.addInput(batchSize.asOutput()); + opBuilder.addInput(numParallelCalls.asOutput()); + opBuilder.addInput(dropRemainder.asOutput()); + opBuilder.setAttr("f", f); + 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.preserveCardinality != null) { + opBuilder.setAttr("preserve_cardinality", opts.preserveCardinality); + } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } + return new MapAndBatchDataset(opBuilder.build()); + } + + /** + * Sets the preserveCardinality option. + * + * @param preserveCardinality the preserveCardinality option + * @return this Options instance. + */ + 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. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + /** + * Optional attributes for {@link org.tensorflow.op.data.MapAndBatchDataset} + */ + public static class Options { + private Boolean preserveCardinality; + + private String metadata; + + private Options() { + } + + /** + * Sets the preserveCardinality option. + * + * @param preserveCardinality the preserveCardinality option + * @return this Options instance. + */ + 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 new file mode 100644 index 00000000000..4b6e7355a51 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MapDataset.java @@ -0,0 +1,292 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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" +) +public final class MapDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MapDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public MapDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * 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 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 + */ + @Endpoint( + describeByClass = true + ) + public static MapDataset create(Scope scope, Operand inputDataset, + Iterable> otherArguments, ConcreteFunction f, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MapDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInputList(Operands.asOutputs(otherArguments)); + opBuilder.setAttr("f", f); + 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.useInterOpParallelism != null) { + opBuilder.setAttr("use_inter_op_parallelism", opts.useInterOpParallelism); + } + 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()); + } + + /** + * Sets the useInterOpParallelism option. + * + * @param useInterOpParallelism the useInterOpParallelism option + * @return this Options instance. + */ + public static Options useInterOpParallelism(Boolean useInterOpParallelism) { + return new Options().useInterOpParallelism(useInterOpParallelism); + } + + /** + * Sets the preserveCardinality option. + * + * @param preserveCardinality the preserveCardinality option + * @return this Options instance. + */ + 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. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + /** + * Optional attributes for {@link org.tensorflow.op.data.MapDataset} + */ + public static class Options { + private Boolean useInterOpParallelism; + + private Boolean preserveCardinality; + + private Boolean forceSynchronous; + + private String metadata; + + private Options() { + } + + /** + * Sets the useInterOpParallelism option. + * + * @param useInterOpParallelism the useInterOpParallelism option + * @return this Options instance. + */ + public Options useInterOpParallelism(Boolean useInterOpParallelism) { + this.useInterOpParallelism = useInterOpParallelism; + return this; + } + + /** + * Sets the preserveCardinality option. + * + * @param preserveCardinality the preserveCardinality option + * @return this Options instance. + */ + 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 c6a0d3b64d8..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,56 +17,91 @@ 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; /** + * The MatchingFilesDataset operation */ +@OpMetadata( + opType = MatchingFilesDataset.OP_NAME, + inputsClass = MatchingFilesDataset.Inputs.class +) +@Operator( + group = "data" +) public final class MatchingFilesDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MatchingFilesDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public MatchingFilesDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MatchingFilesDataset operation. - * + * * @param scope current scope - * @param patterns + * @param patterns The patterns value * @return a new instance of MatchingFilesDataset */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static MatchingFilesDataset create(Scope scope, Operand patterns) { - OperationBuilder opBuilder = scope.env().opBuilder("MatchingFilesDataset", scope.makeOpName("MatchingFilesDataset")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MatchingFilesDataset"); opBuilder.addInput(patterns.asOutput()); - opBuilder = scope.apply(opBuilder); return new MatchingFilesDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatchingFilesDataset"; - - private Output handle; - - private MatchingFilesDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 14a35d14d07..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,62 +27,115 @@ 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" +) public final class MaxIntraOpParallelismDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MaxIntraOpParallelismDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public MaxIntraOpParallelismDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MaxIntraOpParallelismDataset operation. - * + * * @param scope current scope - * @param inputDataset + * @param inputDataset The inputDataset value * @param maxIntraOpParallelism Identifies the maximum intra-op parallelism to use. - * @param outputTypes - * @param outputShapes + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of MaxIntraOpParallelismDataset */ - @Endpoint(describeByClass = true) - public static MaxIntraOpParallelismDataset create(Scope scope, Operand inputDataset, Operand maxIntraOpParallelism, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("MaxIntraOpParallelismDataset", scope.makeOpName("MaxIntraOpParallelismDataset")); + @Endpoint( + describeByClass = true + ) + public static MaxIntraOpParallelismDataset create(Scope scope, + Operand inputDataset, Operand maxIntraOpParallelism, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MaxIntraOpParallelismDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(maxIntraOpParallelism.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new MaxIntraOpParallelismDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MaxIntraOpParallelismDataset"; - - private Output handle; - - private MaxIntraOpParallelismDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 6b102be4fc7..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,73 +27,61 @@ 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" +) public final class ModelDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.ModelDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param algorithm - */ - public Options algorithm(Long algorithm) { - this.algorithm = algorithm; - return this; - } - - /** - * @param cpuBudget - */ - public Options cpuBudget(Long cpuBudget) { - this.cpuBudget = cpuBudget; - return this; - } - - /** - * @param ramBudget - */ - public Options ramBudget(Long ramBudget) { - this.ramBudget = ramBudget; - return this; - } - - private Long algorithm; - private Long cpuBudget; - private Long ramBudget; - - private Options() { - } + public static final String OP_NAME = "ModelDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ModelDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ModelDataset operation. - * + * * @param scope current scope * @param inputDataset A variant tensor representing the input dataset. - * @param outputTypes - * @param outputShapes - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static ModelDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ModelDataset", scope.makeOpName("ModelDataset")); + @Endpoint( + describeByClass = true + ) + public static ModelDataset create(Scope scope, Operand inputDataset, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ModelDataset"); opBuilder.addInput(inputDataset.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -110,48 +100,142 @@ public static ModelDataset create(Scope scope, Operand inputDataset, List handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ModelDataset"; - - private Output handle; - - private ModelDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.ModelDataset} + */ + public static class Options { + private Long algorithm; + + private Long cpuBudget; + + private Long ramBudget; + + private Options() { + } + + /** + * Sets the algorithm option. + * + * @param algorithm the algorithm option + * @return this Options instance. + */ + public Options algorithm(Long algorithm) { + this.algorithm = algorithm; + return this; + } + + /** + * Sets the cpuBudget option. + * + * @param cpuBudget the cpuBudget option + * @return this Options instance. + */ + public Options cpuBudget(Long cpuBudget) { + this.cpuBudget = cpuBudget; + return this; + } + + /** + * Sets the ramBudget option. + * + * @param ramBudget the ramBudget option + * @return this Options instance. + */ + public Options ramBudget(Long ramBudget) { + this.ramBudget = 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 e6ee9d12c02..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,19 +27,43 @@ 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 + */ + public static final String OP_NAME = "MultiDeviceIterator"; + + private Output handle; + + @SuppressWarnings("unchecked") + public MultiDeviceIterator(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MultiDeviceIterator operation. - * + * * @param scope current scope * @param devices A list of devices the iterator works across. * @param sharedName If non-empty, this resource will be shared under the given name @@ -48,12 +74,14 @@ public final class MultiDeviceIterator extends RawOp implements Operand { * @param outputShapes The list of shapes being produced. * @return a new instance of MultiDeviceIterator */ - @Endpoint(describeByClass = true) - public static MultiDeviceIterator create(Scope scope, List devices, String sharedName, String container, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("MultiDeviceIterator", scope.makeOpName("MultiDeviceIterator")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static MultiDeviceIterator create(Scope scope, List devices, String sharedName, + String container, List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MultiDeviceIterator"); String[] devicesArray = new String[devices.size()]; - for (int i = 0; i < devicesArray.length; ++i) { + for (int i = 0 ; i < devicesArray.length ; i++) { devicesArray[i] = devices.get(i); } opBuilder.setAttr("devices", devicesArray); @@ -61,34 +89,67 @@ public static MultiDeviceIterator create(Scope scope, List devices, Stri opBuilder.setAttr("container", container); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new MultiDeviceIterator(opBuilder.build()); } - + /** + * Gets handle. * Handle to the resource created. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MultiDeviceIterator"; - - private Output handle; - - private MultiDeviceIterator(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 5e6fdb1c640..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. @@ -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,56 +27,63 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.data.MultiDeviceIteratorFromStringHandle} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param outputShapes The list of shapes being produced. - */ - public Options outputShapes(List outputShapes) { - this.outputShapes = outputShapes; - return this; - } - - private List outputShapes; - - private Options() { - } + public static final String OP_NAME = "MultiDeviceIteratorFromStringHandle"; + + private Output multiDeviceIterator; + + @SuppressWarnings("unchecked") + public MultiDeviceIteratorFromStringHandle(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + multiDeviceIterator = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new MultiDeviceIteratorFromStringHandle operation. - * + * * @param scope current scope * @param stringHandle String representing the resource. * @param outputTypes The type list for the return values. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of MultiDeviceIteratorFromStringHandle */ - @Endpoint(describeByClass = true) - public static MultiDeviceIteratorFromStringHandle create(Scope scope, Operand stringHandle, List> outputTypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MultiDeviceIteratorFromStringHandle", scope.makeOpName("MultiDeviceIteratorFromStringHandle")); + @Endpoint( + describeByClass = true + ) + public static MultiDeviceIteratorFromStringHandle create(Scope scope, + Operand stringHandle, List> outputTypes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MultiDeviceIteratorFromStringHandle"); opBuilder.addInput(stringHandle.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); 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) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = opts.outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -83,35 +92,99 @@ public static MultiDeviceIteratorFromStringHandle create(Scope scope, Operand outputShapes) { return new Options().outputShapes(outputShapes); } - + + /** + * Sets the outputShapes option. + * + * @param outputShapes The list of shapes being produced. + * @return this Options instance. + */ + public static Options outputShapes(Shape... outputShapes) { + return new Options().outputShapes(outputShapes); + } + /** + * Gets multiDeviceIterator. * A MultiDeviceIterator resource. + * @return multiDeviceIterator. */ - public Output multiDeviceIterator() { + public Output multiDeviceIterator() { return multiDeviceIterator; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) multiDeviceIterator; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MultiDeviceIteratorFromStringHandle"; - - private Output multiDeviceIterator; - - private MultiDeviceIteratorFromStringHandle(Operation operation) { - super(operation); - int outputIdx = 0; - multiDeviceIterator = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.MultiDeviceIteratorFromStringHandle} + */ + public static class Options { + private List outputShapes; + + private Options() { + } + + /** + * Sets the outputShapes option. + * + * @param outputShapes The list of shapes being produced. + * @return this Options instance. + */ + public Options outputShapes(List outputShapes) { + this.outputShapes = outputShapes; + return this; + } + + /** + * Sets the outputShapes option. + * + * @param outputShapes The list of shapes being produced. + * @return this Options instance. + */ + public Options outputShapes(Shape... outputShapes) { + this.outputShapes = Arrays.asList(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 578bf00fe78..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,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.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -37,11 +42,33 @@ /** * 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 + */ + public static final String OP_NAME = "MultiDeviceIteratorGetNextFromShard"; + + private List> components; + + @SuppressWarnings("unchecked") + public MultiDeviceIteratorGetNextFromShard(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 MultiDeviceIteratorGetNextFromShard operation. - * + * * @param scope current scope * @param multiDeviceIterator A MultiDeviceIterator resource. * @param shardNum Integer representing which shard to fetch data for. @@ -50,45 +77,78 @@ public final class MultiDeviceIteratorGetNextFromShard extends RawOp implements * @param outputShapes The list of shapes being produced. * @return a new instance of MultiDeviceIteratorGetNextFromShard */ - @Endpoint(describeByClass = true) - public static MultiDeviceIteratorGetNextFromShard create(Scope scope, Operand multiDeviceIterator, Operand shardNum, Operand incarnationId, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("MultiDeviceIteratorGetNextFromShard", scope.makeOpName("MultiDeviceIteratorGetNextFromShard")); + @Endpoint( + describeByClass = true + ) + public static MultiDeviceIteratorGetNextFromShard create(Scope scope, + Operand multiDeviceIterator, Operand shardNum, + Operand incarnationId, List> outputTypes, + List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MultiDeviceIteratorGetNextFromShard"); opBuilder.addInput(multiDeviceIterator.asOutput()); opBuilder.addInput(shardNum.asOutput()); opBuilder.addInput(incarnationId.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new MultiDeviceIteratorGetNextFromShard(opBuilder.build()); } - + /** + * Gets components. * Result of the get_next on the dataset. + * @return components. */ public List> components() { return components; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) components.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MultiDeviceIteratorGetNextFromShard"; - - private List> components; - - private MultiDeviceIteratorGetNextFromShard(Operation operation) { - super(operation); - int outputIdx = 0; - int componentsLength = operation.outputListLength("components"); - components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); - outputIdx += componentsLength; + + @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 3c57db226a5..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,61 +17,107 @@ 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 + */ + public static final String OP_NAME = "MultiDeviceIteratorInit"; + + private Output incarnationId; + + public MultiDeviceIteratorInit(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + incarnationId = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MultiDeviceIteratorInit operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static MultiDeviceIteratorInit create(Scope scope, Operand dataset, Operand multiDeviceIterator, Operand maxBufferSize) { - OperationBuilder opBuilder = scope.env().opBuilder("MultiDeviceIteratorInit", scope.makeOpName("MultiDeviceIteratorInit")); + @Endpoint( + describeByClass = true + ) + public static MultiDeviceIteratorInit create(Scope scope, Operand dataset, + Operand multiDeviceIterator, Operand maxBufferSize) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MultiDeviceIteratorInit"); opBuilder.addInput(dataset.asOutput()); opBuilder.addInput(multiDeviceIterator.asOutput()); opBuilder.addInput(maxBufferSize.asOutput()); - opBuilder = scope.apply(opBuilder); return new MultiDeviceIteratorInit(opBuilder.build()); } - + /** + * Gets incarnationId. * An int64 indicating which incarnation of the MultiDeviceIterator * is running. + * @return incarnationId. */ public Output incarnationId() { return incarnationId; } - + @Override public Output asOutput() { return incarnationId; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MultiDeviceIteratorInit"; - - private Output incarnationId; - - private MultiDeviceIteratorInit(Operation operation) { - super(operation); - int outputIdx = 0; - incarnationId = operation.output(outputIdx++); + + @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 028d0a9497c..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,56 +17,90 @@ 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 + */ + public static final String OP_NAME = "MultiDeviceIteratorToStringHandle"; + + private Output stringHandle; + + public MultiDeviceIteratorToStringHandle(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + stringHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MultiDeviceIteratorToStringHandle operation. - * + * * @param scope current scope * @param multiDeviceIterator A MultiDeviceIterator resource. * @return a new instance of MultiDeviceIteratorToStringHandle */ - @Endpoint(describeByClass = true) - public static MultiDeviceIteratorToStringHandle create(Scope scope, Operand multiDeviceIterator) { - OperationBuilder opBuilder = scope.env().opBuilder("MultiDeviceIteratorToStringHandle", scope.makeOpName("MultiDeviceIteratorToStringHandle")); + @Endpoint( + describeByClass = true + ) + public static MultiDeviceIteratorToStringHandle create(Scope scope, + Operand multiDeviceIterator) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MultiDeviceIteratorToStringHandle"); opBuilder.addInput(multiDeviceIterator.asOutput()); - opBuilder = scope.apply(opBuilder); return new MultiDeviceIteratorToStringHandle(opBuilder.build()); } - + /** + * Gets stringHandle. * A string representing the resource. + * @return stringHandle. */ public Output stringHandle() { return stringHandle; } - + @Override public Output asOutput() { return stringHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MultiDeviceIteratorToStringHandle"; - - private Output stringHandle; - - private MultiDeviceIteratorToStringHandle(Operation operation) { - super(operation); - int outputIdx = 0; - stringHandle = operation.output(outputIdx++); + + @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 49fece5850f..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,58 +27,105 @@ 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" +) public final class NonSerializableDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "NonSerializableDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public NonSerializableDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NonSerializableDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static NonSerializableDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("NonSerializableDataset", scope.makeOpName("NonSerializableDataset")); + @Endpoint( + describeByClass = true + ) + public static NonSerializableDataset create(Scope scope, Operand inputDataset, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "NonSerializableDataset"); opBuilder.addInput(inputDataset.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new NonSerializableDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NonSerializableDataset"; - - private Output handle; - - private NonSerializableDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 new file mode 100644 index 00000000000..bd34c84c511 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OneShotIterator.java @@ -0,0 +1,221 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.family.TType; + +/** + * Makes a "one-shot" iterator that can be iterated only once. + * A one-shot iterator bundles the logic for defining the dataset and + * the state of the iterator in a single op, which allows simple input + * pipelines to be defined without an additional initialization + * ("MakeIterator") step. + *

One-shot iterators have the following limitations: + *

    + *
  • They do not support parameterization: all logic for creating the underlying + * dataset must be bundled in the {@code dataset_factory} function.
  • + *
  • They are not resettable. Once a one-shot iterator reaches the end of its + * underlying dataset, subsequent "IteratorGetNext" operations on that + * iterator will always produce an {@code OutOfRange} error.
  • + *
+ *

For greater flexibility, use "Iterator" and "MakeIterator" to define + * an iterator using an arbitrary subgraph, which may capture tensors + * (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" +) +public final class OneShotIterator extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "OneShotIterator"; + + private Output handle; + + @SuppressWarnings("unchecked") + public OneShotIterator(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new OneShotIterator 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 attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of OneShotIterator + */ + @Endpoint( + describeByClass = true + ) + public static OneShotIterator create(Scope scope, ConcreteFunction datasetFactory, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OneShotIterator"); + opBuilder.setAttr("dataset_factory", datasetFactory); + 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.container != null) { + opBuilder.setAttr("container", opts.container); + } + if (opts.sharedName != null) { + opBuilder.setAttr("shared_name", opts.sharedName); + } + } + } + return new OneShotIterator(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 handle. + * A handle to the iterator that can be passed to an "IteratorGetNext" + * op. + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + /** + * Optional attributes for {@link org.tensorflow.op.data.OneShotIterator} + */ + 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; + } + } + + @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 c9bd55a0320..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. @@ -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,58 +27,70 @@ 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 by applying optimizations to `input_dataset`. - *

- * Creates a dataset by applying optimizations to `input_dataset`. + * 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" +) public final class OptimizeDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.OptimizeDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param optimizationConfigs - */ - public Options optimizationConfigs(List optimizationConfigs) { - this.optimizationConfigs = optimizationConfigs; - return this; - } - - private List optimizationConfigs; - - private Options() { - } + public static final String OP_NAME = "OptimizeDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + public OptimizeDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new OptimizeDataset operation. - * + * Factory method to create a class wrapping a new OptimizeDatasetV2 operation. + * * @param scope current scope * @param inputDataset A variant tensor representing the input dataset. - * @param optimizations A `tf.string` vector `tf.Tensor` identifying optimizations to use. - * @param outputTypes - * @param outputShapes - * @param options carries optional attributes values + * @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 attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of OptimizeDataset */ - @Endpoint(describeByClass = true) - public static OptimizeDataset create(Scope scope, Operand inputDataset, Operand optimizations, List> outputTypes, List outputShapes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("OptimizeDataset", scope.makeOpName("OptimizeDataset")); + @Endpoint( + describeByClass = true + ) + public static OptimizeDataset create(Scope scope, Operand inputDataset, + Operand optimizationsEnabled, Operand optimizationsDisabled, + Operand optimizationsDefault, List> outputTypes, + List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OptimizeDataset"); opBuilder.addInput(inputDataset.asOutput()); - opBuilder.addInput(optimizations.asOutput()); - opBuilder = scope.apply(opBuilder); + opBuilder.addInput(optimizationsEnabled.asOutput()); + opBuilder.addInput(optimizationsDisabled.asOutput()); + opBuilder.addInput(optimizationsDefault.asOutput()); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -84,7 +98,7 @@ public static OptimizeDataset create(Scope scope, Operand inputDataset, Opera for (Options opts : options) { if (opts.optimizationConfigs != null) { String[] optimizationConfigsArray = new String[opts.optimizationConfigs.size()]; - for (int i = 0; i < optimizationConfigsArray.length; ++i) { + for (int i = 0 ; i < optimizationConfigsArray.length ; i++) { optimizationConfigsArray[i] = opts.optimizationConfigs.get(i); } opBuilder.setAttr("optimization_configs", optimizationConfigsArray); @@ -93,34 +107,123 @@ public static OptimizeDataset create(Scope scope, Operand inputDataset, Opera } return new OptimizeDataset(opBuilder.build()); } - + /** - * @param optimizationConfigs + * Sets the optimizationConfigs option. + * + * @param optimizationConfigs the optimizationConfigs option + * @return this Options instance. */ public static Options optimizationConfigs(List optimizationConfigs) { return new Options().optimizationConfigs(optimizationConfigs); } - + /** + * Sets the optimizationConfigs option. + * + * @param optimizationConfigs the optimizationConfigs option + * @return this Options instance. */ - public Output handle() { + public static Options optimizationConfigs(String... optimizationConfigs) { + return new Options().optimizationConfigs(optimizationConfigs); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OptimizeDataset"; - - private Output handle; - - private OptimizeDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.OptimizeDataset} + */ + public static class Options { + private List optimizationConfigs; + + private Options() { + } + + /** + * Sets the optimizationConfigs option. + * + * @param optimizationConfigs the optimizationConfigs option + * @return this Options instance. + */ + public Options optimizationConfigs(List optimizationConfigs) { + this.optimizationConfigs = optimizationConfigs; + return this; + } + + /** + * Sets the optimizationConfigs option. + * + * @param optimizationConfigs the optimizationConfigs option + * @return this Options instance. + */ + public Options optimizationConfigs(String... optimizationConfigs) { + this.optimizationConfigs = Arrays.asList(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/OptimizeDatasetV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptimizeDatasetV2.java deleted file mode 100644 index 06e90b20cbc..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptimizeDatasetV2.java +++ /dev/null @@ -1,130 +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.TString; -import org.tensorflow.types.family.TType; - -/** - * Creates a dataset by applying related optimizations to `input_dataset`. - *

- * Creates a dataset by applying related optimizations to `input_dataset`. - */ -public final class OptimizeDatasetV2 extends RawOp implements Operand { - - /** - * Optional attributes for {@link org.tensorflow.op.data.OptimizeDatasetV2} - */ - public static class Options { - - /** - * @param optimizationConfigs - */ - public Options optimizationConfigs(List optimizationConfigs) { - this.optimizationConfigs = optimizationConfigs; - return this; - } - - private List optimizationConfigs; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new OptimizeDatasetV2 operation. - * - * @param scope current scope - * @param inputDataset A variant tensor representing the input dataset. - * @param optimizationsEnabled A `tf.string` vector `tf.Tensor` identifying user enabled optimizations. - * @param optimizationsDisabled A `tf.string` vector `tf.Tensor` identifying user disabled optimizations. - * @param optimizationsDefault A `tf.string` vector `tf.Tensor` identifying optimizations by default. - * @param outputTypes - * @param outputShapes - * @param options carries optional attributes values - * @return a new instance of OptimizeDatasetV2 - */ - @Endpoint(describeByClass = true) - public static OptimizeDatasetV2 create(Scope scope, Operand inputDataset, Operand optimizationsEnabled, Operand optimizationsDisabled, Operand optimizationsDefault, List> outputTypes, List outputShapes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("OptimizeDatasetV2", scope.makeOpName("OptimizeDatasetV2")); - opBuilder.addInput(inputDataset.asOutput()); - opBuilder.addInput(optimizationsEnabled.asOutput()); - opBuilder.addInput(optimizationsDisabled.asOutput()); - opBuilder.addInput(optimizationsDefault.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); - Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { - outputShapesArray[i] = outputShapes.get(i); - } - opBuilder.setAttr("output_shapes", outputShapesArray); - if (options != null) { - for (Options opts : options) { - if (opts.optimizationConfigs != null) { - String[] optimizationConfigsArray = new String[opts.optimizationConfigs.size()]; - for (int i = 0; i < optimizationConfigsArray.length; ++i) { - optimizationConfigsArray[i] = opts.optimizationConfigs.get(i); - } - opBuilder.setAttr("optimization_configs", optimizationConfigsArray); - } - } - } - return new OptimizeDatasetV2(opBuilder.build()); - } - - /** - * @param optimizationConfigs - */ - public static Options optimizationConfigs(List optimizationConfigs) { - return new Options().optimizationConfigs(optimizationConfigs); - } - - /** - */ - public Output handle() { - return handle; - } - - @Override - @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OptimizeDatasetV2"; - - private Output handle; - - private OptimizeDatasetV2(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalFromValue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalFromValue.java index 51a6f072b19..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,58 +17,100 @@ 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. */ -@Operator(group = "data") +@OpMetadata( + opType = OptionalFromValue.OP_NAME, + inputsClass = OptionalFromValue.Inputs.class +) +@Operator( + group = "data" +) public final class OptionalFromValue extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "OptionalFromValue"; + + private Output optional; + + @SuppressWarnings("unchecked") + public OptionalFromValue(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + optional = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new OptionalFromValue operation. - * + * * @param scope current scope - * @param components + * @param components The components value * @return a new instance of OptionalFromValue */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static OptionalFromValue create(Scope scope, Iterable> components) { - OperationBuilder opBuilder = scope.env().opBuilder("OptionalFromValue", scope.makeOpName("OptionalFromValue")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OptionalFromValue"); opBuilder.addInputList(Operands.asOutputs(components)); - opBuilder = scope.apply(opBuilder); return new OptionalFromValue(opBuilder.build()); } - + /** + * Gets optional. + * + * @return optional. */ - public Output optional() { + public Output optional() { return optional; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) optional; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OptionalFromValue"; - - private Output optional; - - private OptionalFromValue(Operation operation) { - super(operation); - int outputIdx = 0; - optional = operation.output(outputIdx++); + + @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 eeaa8d61642..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,62 +28,107 @@ 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. */ -@Operator(group = "data") +@OpMetadata( + opType = OptionalGetValue.OP_NAME, + inputsClass = OptionalGetValue.Inputs.class +) +@Operator( + group = "data" +) public final class OptionalGetValue extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "OptionalGetValue"; + + private List> components; + + @SuppressWarnings("unchecked") + public OptionalGetValue(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 OptionalGetValue operation. - * + * * @param scope current scope - * @param optional - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static OptionalGetValue create(Scope scope, Operand optional, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("OptionalGetValue", scope.makeOpName("OptionalGetValue")); + @Endpoint( + describeByClass = true + ) + public static OptionalGetValue create(Scope scope, Operand optional, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OptionalGetValue"); opBuilder.addInput(optional.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new OptionalGetValue(opBuilder.build()); } - + /** + * Gets components. + * + * @return components. */ public List> components() { return components; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) components.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OptionalGetValue"; - - private List> components; - - private OptionalGetValue(Operation operation) { - super(operation); - int outputIdx = 0; - int componentsLength = operation.outputListLength("components"); - components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); - outputIdx += componentsLength; + + @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 3d8da00f28e..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,56 +17,89 @@ 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; /** * Returns true if and only if the given Optional variant has a value. */ -@Operator(group = "data") +@OpMetadata( + opType = OptionalHasValue.OP_NAME, + inputsClass = OptionalHasValue.Inputs.class +) +@Operator( + group = "data" +) public final class OptionalHasValue extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "OptionalHasValue"; + + private Output hasValue; + + public OptionalHasValue(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + hasValue = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new OptionalHasValue operation. - * + * * @param scope current scope - * @param optional + * @param optional The optional value * @return a new instance of OptionalHasValue */ - @Endpoint(describeByClass = true) - public static OptionalHasValue create(Scope scope, Operand optional) { - OperationBuilder opBuilder = scope.env().opBuilder("OptionalHasValue", scope.makeOpName("OptionalHasValue")); + @Endpoint( + describeByClass = true + ) + public static OptionalHasValue create(Scope scope, Operand optional) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OptionalHasValue"); opBuilder.addInput(optional.asOutput()); - opBuilder = scope.apply(opBuilder); return new OptionalHasValue(opBuilder.build()); } - + /** + * Gets hasValue. + * + * @return hasValue. */ public Output hasValue() { return hasValue; } - + @Override public Output asOutput() { return hasValue; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OptionalHasValue"; - - private Output hasValue; - - private OptionalHasValue(Operation operation) { - super(operation); - int outputIdx = 0; - hasValue = operation.output(outputIdx++); + + @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 1262726a4b1..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,55 +17,82 @@ 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. */ -@Operator(group = "data") +@OpMetadata( + opType = OptionalNone.OP_NAME, + inputsClass = OptionalNone.Inputs.class +) +@Operator( + group = "data" +) public final class OptionalNone extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "OptionalNone"; + + private Output optional; + + @SuppressWarnings("unchecked") + public OptionalNone(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + optional = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new OptionalNone operation. - * + * * @param scope current scope * @return a new instance of OptionalNone */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static OptionalNone create(Scope scope) { - OperationBuilder opBuilder = scope.env().opBuilder("OptionalNone", scope.makeOpName("OptionalNone")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OptionalNone"); return new OptionalNone(opBuilder.build()); } - + /** + * Gets optional. + * + * @return optional. */ - public Output optional() { + public Output optional() { return optional; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) optional; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OptionalNone"; - - private Output optional; - - private OptionalNone(Operation operation) { - super(operation); - int outputIdx = 0; - optional = operation.output(outputIdx++); + + @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 new file mode 100644 index 00000000000..529b1b93eaa --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionsDataset.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.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 by attaching tf.data.Options to {@code input_dataset}. + */ +@OpMetadata( + opType = OptionsDataset.OP_NAME, + inputsClass = OptionsDataset.Inputs.class +) +@Operator( + group = "data" +) +public final class OptionsDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "OptionsDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public OptionsDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new OptionsDataset 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 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, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OptionsDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.setAttr("serialized_options", serializedOptions); + 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 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. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + 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 24c19c1ebf6..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,67 +27,76 @@ 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; /** - * Creates a dataset that batches and pads `batch_size` elements from the input. + * 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" +) public final class PaddedBatchDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.PaddedBatchDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param parallelCopy - */ - public Options parallelCopy(Boolean parallelCopy) { - this.parallelCopy = parallelCopy; - return this; - } - - private Boolean parallelCopy; - - private Options() { - } + public static final String OP_NAME = "PaddedBatchDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + public PaddedBatchDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new PaddedBatchDataset operation. - * + * Factory method to create a class wrapping a new PaddedBatchDatasetV2 operation. + * * @param scope current scope - * @param inputDataset + * @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 * of the corresponding output components. These shapes may be partially - * specified, using `-1` to indicate that a particular dimension should be + * specified, using {@code -1} to indicate that a particular dimension should be * padded to the maximum size of all batch elements. * @param paddingValues A list of scalars containing the padding value to use for * 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 - * @param options carries optional attributes values + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of PaddedBatchDataset */ - @Endpoint(describeByClass = true) - public static PaddedBatchDataset create(Scope scope, Operand inputDataset, Operand batchSize, Iterable> paddedShapes, Iterable> paddingValues, Operand dropRemainder, List outputShapes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("PaddedBatchDatasetV2", scope.makeOpName("PaddedBatchDataset")); + @Endpoint( + describeByClass = true + ) + public static PaddedBatchDataset create(Scope scope, Operand inputDataset, + Operand batchSize, Iterable> paddedShapes, + Iterable> paddingValues, Operand dropRemainder, List outputShapes, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "PaddedBatchDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(batchSize.asOutput()); opBuilder.addInputList(Operands.asOutputs(paddedShapes)); opBuilder.addInputList(Operands.asOutputs(paddingValues)); opBuilder.addInput(dropRemainder.asOutput()); - opBuilder = scope.apply(opBuilder); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -94,38 +105,154 @@ public static PaddedBatchDataset create(Scope scope, Operand inputDataset, Op if (opts.parallelCopy != null) { opBuilder.setAttr("parallel_copy", opts.parallelCopy); } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } } } return new PaddedBatchDataset(opBuilder.build()); } - + /** - * @param parallelCopy + * Sets the parallelCopy option. + * + * @param parallelCopy the parallelCopy option + * @return this Options instance. */ 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 Output handle() { + 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "PaddedBatchDatasetV2"; - - private Output handle; - - private PaddedBatchDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.PaddedBatchDataset} + */ + public static class Options { + private Boolean parallelCopy; + + private String metadata; + + private Options() { + } + + /** + * Sets the parallelCopy option. + * + * @param parallelCopy the parallelCopy option + * @return this Options instance. + */ + 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 new file mode 100644 index 00000000000..55b54d5cf24 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParallelBatchDataset.java @@ -0,0 +1,267 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.TBool; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; + +/** + * The ParallelBatchDataset operation + */ +@OpMetadata( + opType = ParallelBatchDataset.OP_NAME, + inputsClass = ParallelBatchDataset.Inputs.class +) +@Operator( + group = "data" +) +public final class ParallelBatchDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ParallelBatchDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ParallelBatchDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * 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 attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of ParallelBatchDataset + */ + @Endpoint( + describeByClass = true + ) + public static ParallelBatchDataset create(Scope scope, Operand inputDataset, + Operand batchSize, Operand numParallelCalls, Operand dropRemainder, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ParallelBatchDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInput(batchSize.asOutput()); + opBuilder.addInput(numParallelCalls.asOutput()); + opBuilder.addInput(dropRemainder.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.parallelCopy != null) { + opBuilder.setAttr("parallel_copy", opts.parallelCopy); + } + if (opts.deterministic != null) { + opBuilder.setAttr("deterministic", opts.deterministic); + } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } + return new ParallelBatchDataset(opBuilder.build()); + } + + /** + * Sets the parallelCopy option. + * + * @param parallelCopy the parallelCopy option + * @return this Options instance. + */ + public static Options parallelCopy(Boolean parallelCopy) { + return new Options().parallelCopy(parallelCopy); + } + + /** + * Sets the deterministic option. + * + * @param deterministic the deterministic option + * @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.ParallelBatchDataset} + */ + public static class Options { + private Boolean parallelCopy; + + private String deterministic; + + private String metadata; + + private Options() { + } + + /** + * Sets the parallelCopy option. + * + * @param parallelCopy the parallelCopy option + * @return this Options instance. + */ + public Options parallelCopy(Boolean parallelCopy) { + this.parallelCopy = parallelCopy; + return this; + } + + /** + * Sets the deterministic option. + * + * @param deterministic the deterministic option + * @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 = 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 new file mode 100644 index 00000000000..d46fd839fc4 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParallelInterleaveDataset.java @@ -0,0 +1,312 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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 that applies {@code f} to the outputs of {@code input_dataset}. + * The resulting dataset is similar to the {@code InterleaveDataset}, except that the + * dataset will fetch records from the interleaved datasets in parallel. + *

The {@code tf.data} Python API creates instances of this op from + * {@code Dataset.interleave()} when the {@code num_parallel_calls} parameter of that method + * is set to any value other than {@code None}. + *

By default, the output of this dataset will be deterministic, which may result + * in the dataset blocking if the next data item to be returned isn't available. + * In order to avoid head-of-line blocking, one can either set the {@code deterministic} + * attribute to "false", or leave it as "default" and set the + * {@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" +) +public final class ParallelInterleaveDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ParallelInterleaveDatasetV4"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ParallelInterleaveDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ParallelInterleaveDatasetV4 operation. + * + * @param scope current scope + * @param inputDataset Dataset that produces a stream of arguments for the function {@code f}. + * @param otherArguments Additional arguments to pass to {@code f} beyond those produced by {@code input_dataset}. + * Evaluated once when the dataset is instantiated. + * @param cycleLength 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. + * @param blockLength Number of elements at a time to produce from each interleaved invocation of a + * dataset returned by {@code f}. + * @param bufferOutputElements The number of elements each iterator being interleaved should buffer (similar + * to the {@code .prefetch()} transformation for each interleaved iterator). + * @param prefetchInputElements Determines the number of iterators to prefetch, allowing buffers to warm up and + * data to be pre-fetched without blocking the main thread. + * @param numParallelCalls 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. + * @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 + * @param options carries optional attribute values + * @return a new instance of ParallelInterleaveDataset + */ + @Endpoint( + describeByClass = true + ) + public static ParallelInterleaveDataset create(Scope scope, Operand inputDataset, + Iterable> otherArguments, Operand cycleLength, Operand blockLength, + Operand bufferOutputElements, Operand prefetchInputElements, + Operand numParallelCalls, ConcreteFunction f, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ParallelInterleaveDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInputList(Operands.asOutputs(otherArguments)); + opBuilder.addInput(cycleLength.asOutput()); + opBuilder.addInput(blockLength.asOutput()); + opBuilder.addInput(bufferOutputElements.asOutput()); + opBuilder.addInput(prefetchInputElements.asOutput()); + opBuilder.addInput(numParallelCalls.asOutput()); + opBuilder.setAttr("f", f); + 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 ParallelInterleaveDataset(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.ParallelInterleaveDataset} + */ + 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 = 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 new file mode 100644 index 00000000000..6b783929411 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParallelMapDataset.java @@ -0,0 +1,337 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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 that applies {@code f} to the outputs of {@code input_dataset}. + * 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" +) +public final class ParallelMapDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ParallelMapDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ParallelMapDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * 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 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 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 + */ + @Endpoint( + describeByClass = true + ) + public static ParallelMapDataset create(Scope scope, Operand inputDataset, + Iterable> otherArguments, Operand numParallelCalls, ConcreteFunction f, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ParallelMapDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInputList(Operands.asOutputs(otherArguments)); + opBuilder.addInput(numParallelCalls.asOutput()); + opBuilder.setAttr("f", f); + 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.useInterOpParallelism != null) { + opBuilder.setAttr("use_inter_op_parallelism", opts.useInterOpParallelism); + } + if (opts.deterministic != null) { + opBuilder.setAttr("deterministic", opts.deterministic); + } + 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()); + } + + /** + * Sets the useInterOpParallelism option. + * + * @param useInterOpParallelism the useInterOpParallelism option + * @return this Options instance. + */ + public static Options useInterOpParallelism(Boolean useInterOpParallelism) { + return new Options().useInterOpParallelism(useInterOpParallelism); + } + + /** + * Sets the deterministic option. + * + * @param deterministic the deterministic option + * @return this Options instance. + */ + public static Options deterministic(String deterministic) { + return new Options().deterministic(deterministic); + } + + /** + * Sets the preserveCardinality option. + * + * @param preserveCardinality the preserveCardinality option + * @return this Options instance. + */ + 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. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + /** + * Optional attributes for {@link org.tensorflow.op.data.ParallelMapDataset} + */ + public static class Options { + private Boolean useInterOpParallelism; + + private String deterministic; + + private Boolean preserveCardinality; + + private Boolean useUnboundedThreadpool; + + private String metadata; + + private Options() { + } + + /** + * Sets the useInterOpParallelism option. + * + * @param useInterOpParallelism the useInterOpParallelism option + * @return this Options instance. + */ + public Options useInterOpParallelism(Boolean useInterOpParallelism) { + this.useInterOpParallelism = useInterOpParallelism; + return this; + } + + /** + * Sets the deterministic option. + * + * @param deterministic the deterministic option + * @return this Options instance. + */ + public Options deterministic(String deterministic) { + this.deterministic = deterministic; + return this; + } + + /** + * Sets the preserveCardinality option. + * + * @param preserveCardinality the preserveCardinality option + * @return this Options instance. + */ + 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 new file mode 100644 index 00000000000..c50ec51e906 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParseExampleDataset.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.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.TInt64; +import org.tensorflow.types.family.TNumber; +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" +) +public final class ParseExampleDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ParseExampleDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ParseExampleDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * 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 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 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 + */ + @Endpoint( + describeByClass = true + ) + public static ParseExampleDataset create(Scope scope, Operand inputDataset, + Operand numParallelCalls, Iterable> denseDefaults, List sparseKeys, + List denseKeys, List> sparseTypes, List denseShapes, + List> outputTypes, List outputShapes, + List> raggedValueTypes, + List> raggedSplitTypes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ParseExampleDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInput(numParallelCalls.asOutput()); + opBuilder.addInputList(Operands.asOutputs(denseDefaults)); + String[] sparseKeysArray = new String[sparseKeys.size()]; + for (int i = 0 ; i < sparseKeysArray.length ; i++) { + sparseKeysArray[i] = sparseKeys.get(i); + } + opBuilder.setAttr("sparse_keys", sparseKeysArray); + String[] denseKeysArray = new String[denseKeys.size()]; + for (int i = 0 ; i < denseKeysArray.length ; i++) { + denseKeysArray[i] = denseKeys.get(i); + } + opBuilder.setAttr("dense_keys", denseKeysArray); + opBuilder.setAttr("sparse_types", Operands.toDataTypes(sparseTypes)); + Shape[] denseShapesArray = new Shape[denseShapes.size()]; + for (int i = 0 ; i < denseShapesArray.length ; i++) { + denseShapesArray[i] = denseShapes.get(i); + } + opBuilder.setAttr("dense_shapes", denseShapesArray); + 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("ragged_value_types", Operands.toDataTypes(raggedValueTypes)); + opBuilder.setAttr("ragged_split_types", Operands.toDataTypes(raggedSplitTypes)); + if (options != null) { + for (Options opts : options) { + if (opts.deterministic != null) { + opBuilder.setAttr("deterministic", opts.deterministic); + } + if (opts.raggedKeys != null) { + String[] raggedKeysArray = new String[opts.raggedKeys.size()]; + for (int i = 0 ; i < raggedKeysArray.length ; i++) { + raggedKeysArray[i] = opts.raggedKeys.get(i); + } + opBuilder.setAttr("ragged_keys", raggedKeysArray); + } + } + } + return new ParseExampleDataset(opBuilder.build()); + } + + /** + * Sets the deterministic option. + * + * @param deterministic 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}. + * @return this Options instance. + */ + public static Options deterministic(String deterministic) { + return new Options().deterministic(deterministic); + } + + /** + * Sets the raggedKeys option. + * + * @param raggedKeys the raggedKeys option + * @return this Options instance. + */ + public static Options raggedKeys(List raggedKeys) { + return new Options().raggedKeys(raggedKeys); + } + + /** + * Sets the raggedKeys option. + * + * @param raggedKeys the raggedKeys option + * @return this Options instance. + */ + public static Options raggedKeys(String... raggedKeys) { + return new Options().raggedKeys(raggedKeys); + } + + /** + * 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.ParseExampleDataset} + */ + public static class Options { + private String deterministic; + + private List raggedKeys; + + private Options() { + } + + /** + * Sets the deterministic option. + * + * @param deterministic 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}. + * @return this Options instance. + */ + public Options deterministic(String deterministic) { + this.deterministic = deterministic; + return this; + } + + /** + * Sets the raggedKeys option. + * + * @param raggedKeys the raggedKeys option + * @return this Options instance. + */ + public Options raggedKeys(List raggedKeys) { + this.raggedKeys = raggedKeys; + return this; + } + + /** + * Sets the raggedKeys option. + * + * @param raggedKeys the raggedKeys option + * @return this Options instance. + */ + public Options raggedKeys(String... raggedKeys) { + this.raggedKeys = Arrays.asList(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 27409a575a9..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,75 +27,65 @@ 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 `input_dataset`. + * Creates a dataset that asynchronously prefetches elements from {@code input_dataset}. */ +@OpMetadata( + opType = PrefetchDataset.OP_NAME, + inputsClass = PrefetchDataset.Inputs.class +) +@Operator( + group = "data" +) public final class PrefetchDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.PrefetchDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param slackPeriod - */ - public Options slackPeriod(Long slackPeriod) { - this.slackPeriod = slackPeriod; - return this; - } - - /** - * @param legacyAutotune - */ - public Options legacyAutotune(Boolean legacyAutotune) { - this.legacyAutotune = legacyAutotune; - return this; - } - - /** - * @param bufferSizeMin - */ - public Options bufferSizeMin(Long bufferSizeMin) { - this.bufferSizeMin = bufferSizeMin; - return this; - } - - private Long slackPeriod; - private Boolean legacyAutotune; - private Long bufferSizeMin; - - private Options() { - } + public static final String OP_NAME = "PrefetchDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public PrefetchDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new PrefetchDataset operation. - * + * * @param scope current scope - * @param inputDataset + * @param inputDataset The inputDataset value * @param bufferSize The maximum number of elements to buffer in an iterator over * this dataset. - * @param outputTypes - * @param outputShapes - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static PrefetchDataset create(Scope scope, Operand inputDataset, Operand bufferSize, List> outputTypes, List outputShapes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("PrefetchDataset", scope.makeOpName("PrefetchDataset")); + @Endpoint( + describeByClass = true + ) + public static PrefetchDataset create(Scope scope, Operand inputDataset, + Operand bufferSize, List> outputTypes, + List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "PrefetchDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(bufferSize.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -108,52 +100,185 @@ public static PrefetchDataset create(Scope scope, Operand inputDataset, Opera 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()); } - + /** - * @param slackPeriod + * Sets the slackPeriod option. + * + * @param slackPeriod the slackPeriod option + * @return this Options instance. */ public static Options slackPeriod(Long slackPeriod) { return new Options().slackPeriod(slackPeriod); } - + /** - * @param legacyAutotune + * Sets the legacyAutotune option. + * + * @param legacyAutotune the legacyAutotune option + * @return this Options instance. */ public static Options legacyAutotune(Boolean legacyAutotune) { return new Options().legacyAutotune(legacyAutotune); } - + /** - * @param bufferSizeMin + * Sets the bufferSizeMin option. + * + * @param bufferSizeMin the bufferSizeMin option + * @return this Options instance. */ 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 Output handle() { + 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "PrefetchDataset"; - - private Output handle; - - private PrefetchDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.PrefetchDataset} + */ + public static class Options { + private Long slackPeriod; + + private Boolean legacyAutotune; + + private Long bufferSizeMin; + + private String metadata; + + private Options() { + } + + /** + * Sets the slackPeriod option. + * + * @param slackPeriod the slackPeriod option + * @return this Options instance. + */ + public Options slackPeriod(Long slackPeriod) { + this.slackPeriod = slackPeriod; + return this; + } + + /** + * Sets the legacyAutotune option. + * + * @param legacyAutotune the legacyAutotune option + * @return this Options instance. + */ + public Options legacyAutotune(Boolean legacyAutotune) { + this.legacyAutotune = legacyAutotune; + return this; + } + + /** + * Sets the bufferSizeMin option. + * + * @param bufferSizeMin the bufferSizeMin option + * @return this Options instance. + */ + 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 92d7753b54a..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,62 +27,115 @@ 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 `input_dataset`. + * 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" +) public final class PrivateThreadPoolDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "PrivateThreadPoolDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public PrivateThreadPoolDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new PrivateThreadPoolDataset operation. - * + * * @param scope current scope - * @param inputDataset + * @param inputDataset The inputDataset value * @param numThreads Identifies the number of threads to use for the private threadpool. - * @param outputTypes - * @param outputShapes + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of PrivateThreadPoolDataset */ - @Endpoint(describeByClass = true) - public static PrivateThreadPoolDataset create(Scope scope, Operand inputDataset, Operand numThreads, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("PrivateThreadPoolDataset", scope.makeOpName("PrivateThreadPoolDataset")); + @Endpoint( + describeByClass = true + ) + public static PrivateThreadPoolDataset create(Scope scope, Operand inputDataset, + Operand numThreads, List> outputTypes, + List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "PrivateThreadPoolDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(numThreads.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new PrivateThreadPoolDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "PrivateThreadPoolDataset"; - - private Output handle; - - private PrivateThreadPoolDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 5108bec6d0d..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,75 +27,216 @@ 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. - *

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

- * Instances of this dataset are also created as a result of the - * `hoist_random_uniform` static optimization. Whether this optimization is - * performed is determined by the `experimental_optimization.hoist_random_uniform` - * option of `tf.data.Options`. + * 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.RandomDatasetV2}. */ +@OpMetadata( + opType = RandomDataset.OP_NAME, + inputsClass = RandomDataset.Inputs.class +) +@Operator( + group = "data" +) public final class RandomDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new RandomDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RandomDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + public RandomDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * 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 - * @param outputShapes + * @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) { - OperationBuilder opBuilder = scope.env().opBuilder("RandomDataset", scope.makeOpName("RandomDataset")); + @Endpoint( + describeByClass = true + ) + public static RandomDataset create(Scope scope, Operand seed, Operand seed2, + Operand seedGenerator, List> outputTypes, + List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RandomDataset"); opBuilder.addInput(seed.asOutput()); opBuilder.addInput(seed2.asOutput()); - opBuilder = scope.apply(opBuilder); + 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) { + 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 Output handle() { + 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. + * + * @return handle. + */ + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RandomDataset"; - - private Output handle; - - private RandomDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * 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 0acede3a72b..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,65 +27,200 @@ 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. */ -@Operator(group = "data") +@OpMetadata( + opType = RangeDataset.OP_NAME, + inputsClass = RangeDataset.Inputs.class +) +@Operator( + group = "data" +) public final class RangeDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RangeDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public RangeDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RangeDataset operation. - * + * * @param scope current scope * @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 - * @param outputShapes + * @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) { - OperationBuilder opBuilder = scope.env().opBuilder("RangeDataset", scope.makeOpName("RangeDataset")); + @Endpoint( + describeByClass = true + ) + public static RangeDataset create(Scope scope, Operand start, Operand stop, + Operand step, List> outputTypes, List outputShapes, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RangeDataset"); opBuilder.addInput(start.asOutput()); opBuilder.addInput(stop.asOutput()); opBuilder.addInput(step.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + 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); + } + if (opts.replicateOnSplit != null) { + opBuilder.setAttr("replicate_on_split", opts.replicateOnSplit); + } + } + } return new RangeDataset(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); + } + /** + * Sets the replicateOnSplit option. + * + * @param replicateOnSplit the replicateOnSplit option + * @return this Options instance. */ - public Output handle() { + public static Options replicateOnSplit(Boolean replicateOnSplit) { + return new Options().replicateOnSplit(replicateOnSplit); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RangeDataset"; - - private Output handle; - - private RangeDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * 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/RebatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RebatchDataset.java deleted file mode 100644 index 4d73b0dbbcf..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RebatchDataset.java +++ /dev/null @@ -1,125 +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.family.TType; - -/** - * Creates a dataset that changes the batch size. - *

- * Creates a dataset that changes the batch size of the dataset to current batch - * size // num_workers. - */ -public final class RebatchDataset extends RawOp implements Operand { - - /** - * Optional attributes for {@link org.tensorflow.op.data.RebatchDataset} - */ - public static class Options { - - /** - * @param useFallback - */ - public Options useFallback(Boolean useFallback) { - this.useFallback = useFallback; - return this; - } - - private Boolean useFallback; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new RebatchDataset operation. - * - * @param scope current scope - * @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 - * @param outputShapes - * @param options carries optional attributes values - * @return a new instance of RebatchDataset - */ - @Endpoint(describeByClass = true) - public static RebatchDataset create(Scope scope, Operand inputDataset, Operand numReplicas, List> outputTypes, List outputShapes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RebatchDataset", scope.makeOpName("RebatchDataset")); - opBuilder.addInput(inputDataset.asOutput()); - opBuilder.addInput(numReplicas.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); - Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { - outputShapesArray[i] = outputShapes.get(i); - } - opBuilder.setAttr("output_shapes", outputShapesArray); - if (options != null) { - for (Options opts : options) { - if (opts.useFallback != null) { - opBuilder.setAttr("use_fallback", opts.useFallback); - } - } - } - return new RebatchDataset(opBuilder.build()); - } - - /** - * @param useFallback - */ - public static Options useFallback(Boolean useFallback) { - return new Options().useFallback(useFallback); - } - - /** - */ - public Output handle() { - return handle; - } - - @Override - @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RebatchDataset"; - - private Output handle; - - private RebatchDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RebatchDatasetV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RebatchDatasetV2.java index dd39cda094b..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,69 +27,128 @@ 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; /** * Creates a dataset that changes the batch size. - *

- * Creates a dataset that rebatches elements from `input_dataset` into new batch + * 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" +) public final class RebatchDatasetV2 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RebatchDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + public RebatchDatasetV2(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RebatchDatasetV2 operation. - * + * * @param scope current scope * @param inputDataset A variant tensor representing the input dataset. * @param batchSizes A vector of integers representing the size of batches to produce. These values * are cycled through in order. - * @param dropRemainder - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static RebatchDatasetV2 create(Scope scope, Operand inputDataset, Operand batchSizes, Operand dropRemainder, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("RebatchDatasetV2", scope.makeOpName("RebatchDatasetV2")); + @Endpoint( + describeByClass = true + ) + public static RebatchDatasetV2 create(Scope scope, Operand inputDataset, + Operand batchSizes, Operand dropRemainder, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RebatchDatasetV2"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(batchSizes.asOutput()); opBuilder.addInput(dropRemainder.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new RebatchDatasetV2(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RebatchDatasetV2"; - - private Output handle; - - private RebatchDatasetV2(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 new file mode 100644 index 00000000000..6b48d82f307 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ReduceDataset.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.data; + +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.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" +) +public final class ReduceDataset extends RawOp implements Iterable> { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReduceDataset"; + + private List> components; + + @SuppressWarnings("unchecked") + public ReduceDataset(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 ReduceDataset operation. + * + * @param scope current scope + * @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 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 attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of ReduceDataset + */ + @Endpoint( + describeByClass = true + ) + public static ReduceDataset create(Scope scope, Operand inputDataset, + Iterable> initialState, Iterable> otherArguments, ConcreteFunction f, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReduceDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInputList(Operands.asOutputs(initialState)); + opBuilder.addInputList(Operands.asOutputs(otherArguments)); + opBuilder.setAttr("f", f); + 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.useInterOpParallelism != null) { + opBuilder.setAttr("use_inter_op_parallelism", opts.useInterOpParallelism); + } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } + return new ReduceDataset(opBuilder.build()); + } + + /** + * Sets the useInterOpParallelism option. + * + * @param useInterOpParallelism the useInterOpParallelism option + * @return this Options instance. + */ + 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. + * + * @return components. + */ + public List> components() { + return components; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + public Iterator> iterator() { + return (Iterator) components.iterator(); + } + + /** + * Optional attributes for {@link org.tensorflow.op.data.ReduceDataset} + */ + public static class Options { + private Boolean useInterOpParallelism; + + private String metadata; + + private Options() { + } + + /** + * Sets the useInterOpParallelism option. + * + * @param useInterOpParallelism the useInterOpParallelism option + * @return this Options instance. + */ + 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 a211c35c009..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,62 +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. */ -public final class RegisterDataset extends RawOp implements Operand { - +@OpMetadata( + opType = RegisterDataset.OP_NAME, + inputsClass = RegisterDataset.Inputs.class +) +@Operator( + group = "data" +) +public final class RegisterDataset extends RawOp implements Operand { /** - * Factory method to create a class wrapping a new RegisterDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RegisterDatasetV2"; + + private Output datasetId; + + public RegisterDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + datasetId = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new RegisterDatasetV2 operation. + * * @param scope current scope - * @param dataset - * @param address - * @param protocol - * @param externalStatePolicy + * @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) { - OperationBuilder opBuilder = scope.env().opBuilder("RegisterDataset", scope.makeOpName("RegisterDataset")); + @Endpoint( + describeByClass = true + ) + public static RegisterDataset create(Scope scope, Operand dataset, + 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 = scope.apply(opBuilder); 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RegisterDataset"; - - private Output datasetId; - - private RegisterDataset(Operation operation) { - super(operation); - int outputIdx = 0; - datasetId = operation.output(outputIdx++); + + /** + * 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 ad327527c06..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,64 +27,162 @@ 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 `input_dataset` `count` times. + * Creates a dataset that emits the outputs of {@code input_dataset} {@code count} times. */ -@Operator(group = "data") +@OpMetadata( + opType = RepeatDataset.OP_NAME, + inputsClass = RepeatDataset.Inputs.class +) +@Operator( + group = "data" +) public final class RepeatDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RepeatDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public RepeatDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RepeatDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param count A scalar representing the number of times that `input_dataset` should - * be repeated. A value of `-1` indicates that it should be repeated infinitely. - * @param outputTypes - * @param outputShapes + * @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 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) { - OperationBuilder opBuilder = scope.env().opBuilder("RepeatDataset", scope.makeOpName("RepeatDataset")); + @Endpoint( + describeByClass = true + ) + public static RepeatDataset create(Scope scope, Operand inputDataset, + Operand count, List> outputTypes, List outputShapes, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RepeatDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(count.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + 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 RepeatDataset(opBuilder.build()); } - + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. */ - public Output handle() { + 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RepeatDataset"; - - private Output handle; - - private RepeatDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * 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 7f67f238136..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,74 +27,139 @@ 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; /** * Creates a dataset that takes a Bernoulli sample of the contents of another dataset. - *

- * There is no transformation in the `tf.data` Python API for creating this dataset. - * Instead, it is created as a result of the `filter_with_random_uniform_fusion` + * There is no transformation in the {@code tf.data} Python API for creating this dataset. + * Instead, it is created as a result of the {@code filter_with_random_uniform_fusion} * static optimization. Whether this optimization is performed is determined by the - * `experimental_optimization.filter_with_random_uniform_fusion` option of - * `tf.data.Options`. + * {@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" +) public final class SamplingDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SamplingDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public SamplingDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SamplingDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param rate A scalar representing the sample rate. Each element of `input_dataset` is + * @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 - * @param outputShapes + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of SamplingDataset */ - @Endpoint(describeByClass = true) - public static SamplingDataset create(Scope scope, Operand inputDataset, Operand rate, Operand seed, Operand seed2, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("SamplingDataset", scope.makeOpName("SamplingDataset")); + @Endpoint( + describeByClass = true + ) + public static SamplingDataset create(Scope scope, Operand inputDataset, + Operand rate, Operand seed, Operand seed2, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SamplingDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(rate.asOutput()); opBuilder.addInput(seed.asOutput()); opBuilder.addInput(seed2.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new SamplingDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SamplingDataset"; - - private Output handle; - - private SamplingDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 new file mode 100644 index 00000000000..67dd8890c15 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SaveDataset.java @@ -0,0 +1,237 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.TString; +import org.tensorflow.types.family.TType; + +/** + * The SaveDatasetV2 operation + */ +@OpMetadata( + opType = SaveDataset.OP_NAME, + inputsClass = SaveDataset.Inputs.class +) +@Operator( + group = "data" +) +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 = "SaveDatasetV2"; + + private Output handle; + + @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 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 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 + */ + @Endpoint( + describeByClass = true + ) + public static SaveDataset create(Scope scope, Operand inputDataset, + Operand path, Iterable> shardFuncOtherArgs, ConcreteFunction shardFunc, + 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) { + opBuilder.setAttr("compression", opts.compression); + } + if (opts.useShardFunc != null) { + opBuilder.setAttr("use_shard_func", opts.useShardFunc); + } + } + } + return new SaveDataset(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); + } + + /** + * Sets the useShardFunc option. + * + * @param useShardFunc the useShardFunc option + * @return this Options instance. + */ + 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} + */ + public static class Options { + private String compression; + + private Boolean useShardFunc; + + 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; + } + + /** + * Sets the useShardFunc option. + * + * @param useShardFunc the useShardFunc option + * @return this Options instance. + */ + public Options useShardFunc(Boolean useShardFunc) { + this.useShardFunc = 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 new file mode 100644 index 00000000000..df67784e95e --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ScanDataset.java @@ -0,0 +1,276 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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" +) +public final class ScanDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ScanDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ScanDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * 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 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 + */ + @Endpoint( + describeByClass = true + ) + public static ScanDataset create(Scope scope, Operand inputDataset, + Iterable> initialState, Iterable> otherArguments, ConcreteFunction f, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ScanDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInputList(Operands.asOutputs(initialState)); + opBuilder.addInputList(Operands.asOutputs(otherArguments)); + opBuilder.setAttr("f", f); + 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.preserveCardinality != null) { + opBuilder.setAttr("preserve_cardinality", opts.preserveCardinality); + } + 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()); + } + + /** + * Sets the preserveCardinality option. + * + * @param preserveCardinality the preserveCardinality option + * @return this Options instance. + */ + public static Options preserveCardinality(Boolean preserveCardinality) { + return new Options().preserveCardinality(preserveCardinality); + } + + /** + * Sets the useDefaultDevice option. + * + * @param useDefaultDevice the useDefaultDevice option + * @return this Options instance. + */ + 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. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + /** + * Optional attributes for {@link org.tensorflow.op.data.ScanDataset} + */ + public static class Options { + private Boolean preserveCardinality; + + private Boolean useDefaultDevice; + + private String metadata; + + private Options() { + } + + /** + * Sets the preserveCardinality option. + * + * @param preserveCardinality the preserveCardinality option + * @return this Options instance. + */ + public Options preserveCardinality(Boolean preserveCardinality) { + this.preserveCardinality = preserveCardinality; + return this; + } + + /** + * Sets the useDefaultDevice option. + * + * @param useDefaultDevice the useDefaultDevice option + * @return this Options instance. + */ + 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 4e9449781db..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,54 +17,61 @@ 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 `resource_handle` representing an iterator to a variant tensor. + * Converts the given {@code resource_handle} representing an iterator to a variant tensor. */ -@Operator(group = "data") +@OpMetadata( + opType = SerializeIterator.OP_NAME, + inputsClass = SerializeIterator.Inputs.class +) +@Operator( + group = "data" +) public final class SerializeIterator extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.SerializeIterator} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param externalStatePolicy - */ - public Options externalStatePolicy(Long externalStatePolicy) { - this.externalStatePolicy = externalStatePolicy; - return this; - } - - private Long externalStatePolicy; - - private Options() { - } + public static final String OP_NAME = "SerializeIterator"; + + private Output serialized; + + @SuppressWarnings("unchecked") + public SerializeIterator(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + serialized = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SerializeIterator operation. - * + * * @param scope current scope * @param resourceHandle A handle to an iterator resource. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of SerializeIterator */ - @Endpoint(describeByClass = true) - public static SerializeIterator create(Scope scope, Operand resourceHandle, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SerializeIterator", scope.makeOpName("SerializeIterator")); + @Endpoint( + describeByClass = true + ) + public static SerializeIterator create(Scope scope, Operand resourceHandle, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SerializeIterator"); opBuilder.addInput(resourceHandle.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.externalStatePolicy != null) { @@ -74,36 +81,73 @@ public static SerializeIterator create(Scope scope, Operand resourceHandle, O } return new SerializeIterator(opBuilder.build()); } - + /** - * @param externalStatePolicy + * Sets the externalStatePolicy option. + * + * @param externalStatePolicy the externalStatePolicy option + * @return this Options instance. */ public static Options externalStatePolicy(Long externalStatePolicy) { return new Options().externalStatePolicy(externalStatePolicy); } - + /** + * Gets serialized. * A variant tensor storing the state of the iterator contained in the * resource. + * @return serialized. */ - public Output serialized() { + public Output serialized() { return serialized; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) serialized; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SerializeIterator"; - - private Output serialized; - - private SerializeIterator(Operation operation) { - super(operation); - int outputIdx = 0; - serialized = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.SerializeIterator} + */ + public static class Options { + private Long externalStatePolicy; + + private Options() { + } + + /** + * Sets the externalStatePolicy option. + * + * @param externalStatePolicy the externalStatePolicy option + * @return this Options instance. + */ + public Options externalStatePolicy(Long externalStatePolicy) { + this.externalStatePolicy = 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 7e774e3a103..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,65 +27,132 @@ 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" +) public final class SetStatsAggregatorDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SetStatsAggregatorDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public SetStatsAggregatorDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SetStatsAggregatorDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param statsAggregator - * @param tag - * @param counterPrefix - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static SetStatsAggregatorDataset create(Scope scope, Operand inputDataset, Operand statsAggregator, Operand tag, Operand counterPrefix, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("SetStatsAggregatorDataset", scope.makeOpName("SetStatsAggregatorDataset")); + @Endpoint( + describeByClass = true + ) + public static SetStatsAggregatorDataset create(Scope scope, Operand inputDataset, + Operand statsAggregator, Operand tag, + Operand counterPrefix, List> outputTypes, + List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SetStatsAggregatorDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(statsAggregator.asOutput()); opBuilder.addInput(tag.asOutput()); opBuilder.addInput(counterPrefix.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new SetStatsAggregatorDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SetStatsAggregatorDataset"; - - private Output handle; - - private SetStatsAggregatorDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 53b184949e7..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,58 +27,66 @@ 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 includes only 1/`num_shards` of this dataset. + * 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" +) public final class ShardDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.ShardDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param requireNonEmpty - */ - public Options requireNonEmpty(Boolean requireNonEmpty) { - this.requireNonEmpty = requireNonEmpty; - return this; - } - - private Boolean requireNonEmpty; - - private Options() { - } + public static final String OP_NAME = "ShardDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ShardDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ShardDataset operation. - * + * * @param scope current scope - * @param inputDataset + * @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 - * @param outputShapes - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static ShardDataset create(Scope scope, Operand inputDataset, Operand numShards, Operand index, List> outputTypes, List outputShapes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ShardDataset", scope.makeOpName("ShardDataset")); + @Endpoint( + describeByClass = true + ) + public static ShardDataset create(Scope scope, Operand inputDataset, + Operand numShards, Operand index, List> outputTypes, + List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ShardDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(numShards.asOutput()); opBuilder.addInput(index.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -85,38 +95,132 @@ public static ShardDataset create(Scope scope, Operand inputDataset, Operand< 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()); } - + /** - * @param requireNonEmpty + * Sets the requireNonEmpty option. + * + * @param requireNonEmpty the requireNonEmpty option + * @return this Options instance. */ 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. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ShardDataset"; - - private Output handle; - - private ShardDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.ShardDataset} + */ + public static class Options { + private Boolean requireNonEmpty; + + private String metadata; + + private Options() { + } + + /** + * Sets the requireNonEmpty option. + * + * @param requireNonEmpty the requireNonEmpty option + * @return this Options instance. + */ + 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 bc486a3777c..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,63 +27,73 @@ 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" +) public final class ShuffleAndRepeatDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.ShuffleAndRepeatDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param reshuffleEachIteration - */ - public Options reshuffleEachIteration(Boolean reshuffleEachIteration) { - this.reshuffleEachIteration = reshuffleEachIteration; - return this; - } - - private Boolean reshuffleEachIteration; - - private Options() { - } + public static final String OP_NAME = "ShuffleAndRepeatDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ShuffleAndRepeatDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ShuffleAndRepeatDataset operation. - * + * Factory method to create a class wrapping a new ShuffleAndRepeatDatasetV2 operation. + * * @param scope current scope - * @param inputDataset - * @param bufferSize - * @param seed - * @param seed2 - * @param count - * @param seedGenerator - * @param outputTypes - * @param outputShapes - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static ShuffleAndRepeatDataset create(Scope scope, Operand inputDataset, Operand bufferSize, Operand seed, Operand seed2, Operand count, Operand seedGenerator, List> outputTypes, List outputShapes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ShuffleAndRepeatDatasetV2", scope.makeOpName("ShuffleAndRepeatDataset")); + @Endpoint( + describeByClass = true + ) + public static ShuffleAndRepeatDataset create(Scope scope, Operand inputDataset, + Operand bufferSize, Operand seed, Operand seed2, + Operand count, Operand seedGenerator, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ShuffleAndRepeatDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(bufferSize.asOutput()); opBuilder.addInput(seed.asOutput()); opBuilder.addInput(seed2.asOutput()); opBuilder.addInput(count.asOutput()); opBuilder.addInput(seedGenerator.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -90,38 +102,150 @@ public static ShuffleAndRepeatDataset create(Scope scope, Operand inputDatase if (opts.reshuffleEachIteration != null) { opBuilder.setAttr("reshuffle_each_iteration", opts.reshuffleEachIteration); } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } } } return new ShuffleAndRepeatDataset(opBuilder.build()); } - + /** - * @param reshuffleEachIteration + * 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() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ShuffleAndRepeatDatasetV2"; - - private Output handle; - - private ShuffleAndRepeatDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.ShuffleAndRepeatDataset} + */ + 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 = 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 d458c12b68c..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,61 +27,71 @@ 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" +) public final class ShuffleDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.ShuffleDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param reshuffleEachIteration - */ - public Options reshuffleEachIteration(Boolean reshuffleEachIteration) { - this.reshuffleEachIteration = reshuffleEachIteration; - return this; - } - - private Boolean reshuffleEachIteration; - - private Options() { - } + public static final String OP_NAME = "ShuffleDatasetV3"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ShuffleDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ShuffleDataset operation. - * + * Factory method to create a class wrapping a new ShuffleDatasetV3 operation. + * * @param scope current scope - * @param inputDataset - * @param bufferSize - * @param seed - * @param seed2 - * @param seedGenerator - * @param outputTypes - * @param outputShapes - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static ShuffleDataset create(Scope scope, Operand inputDataset, Operand bufferSize, Operand seed, Operand seed2, Operand seedGenerator, List> outputTypes, List outputShapes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ShuffleDatasetV3", scope.makeOpName("ShuffleDataset")); + @Endpoint( + describeByClass = true + ) + public static ShuffleDataset create(Scope scope, Operand inputDataset, + Operand bufferSize, Operand seed, Operand seed2, + Operand seedGenerator, List> outputTypes, + List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ShuffleDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(bufferSize.asOutput()); opBuilder.addInput(seed.asOutput()); opBuilder.addInput(seed2.asOutput()); opBuilder.addInput(seedGenerator.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -88,38 +100,144 @@ public static ShuffleDataset create(Scope scope, Operand inputDataset, Operan 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()); } - + /** - * @param reshuffleEachIteration + * 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 Output handle() { + 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ShuffleDatasetV3"; - - private Output handle; - - private ShuffleDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.ShuffleDataset} + */ + 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 = 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 dea92ac046b..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,64 +27,162 @@ 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 `count` elements from the `input_dataset`. + * Creates a dataset that skips {@code count} elements from the {@code input_dataset}. */ -@Operator(group = "data") +@OpMetadata( + opType = SkipDataset.OP_NAME, + inputsClass = SkipDataset.Inputs.class +) +@Operator( + group = "data" +) public final class SkipDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SkipDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public SkipDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SkipDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param count A scalar representing the number of elements from the `input_dataset` + * @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 - * @param outputShapes + * @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) { - OperationBuilder opBuilder = scope.env().opBuilder("SkipDataset", scope.makeOpName("SkipDataset")); + @Endpoint( + describeByClass = true + ) + public static SkipDataset create(Scope scope, Operand inputDataset, + Operand count, List> outputTypes, List outputShapes, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SkipDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(count.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + 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 SkipDataset(opBuilder.build()); } - + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. */ - public Output handle() { + 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SkipDataset"; - - private Output handle; - - private SkipDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * 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 926cc93fe89..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,61 +27,115 @@ 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" +) public final class SleepDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SleepDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public SleepDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SleepDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param sleepMicroseconds - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static SleepDataset create(Scope scope, Operand inputDataset, Operand sleepMicroseconds, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("SleepDataset", scope.makeOpName("SleepDataset")); + @Endpoint( + describeByClass = true + ) + public static SleepDataset create(Scope scope, Operand inputDataset, + Operand sleepMicroseconds, List> outputTypes, + List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SleepDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(sleepMicroseconds.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new SleepDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SleepDataset"; - - private Output handle; - - private SleepDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 2c10ea43cd9..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,69 +27,182 @@ 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 `input_dataset`. + * Creates a dataset that passes a sliding window over {@code input_dataset}. */ +@OpMetadata( + opType = SlidingWindowDataset.OP_NAME, + inputsClass = SlidingWindowDataset.Inputs.class +) +@Operator( + group = "data" +) public final class SlidingWindowDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SlidingWindowDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public SlidingWindowDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SlidingWindowDataset operation. - * + * * @param scope current scope - * @param inputDataset + * @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 - * @param outputShapes + * @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(describeByClass = true) - public static SlidingWindowDataset create(Scope scope, Operand inputDataset, Operand windowSize, Operand windowShift, Operand windowStride, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("SlidingWindowDataset", scope.makeOpName("SlidingWindowDataset")); + @Endpoint( + describeByClass = true + ) + public static SlidingWindowDataset create(Scope scope, Operand inputDataset, + Operand windowSize, Operand windowShift, Operand windowStride, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SlidingWindowDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(windowSize.asOutput()); opBuilder.addInput(windowShift.asOutput()); opBuilder.addInput(windowStride.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + 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.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 Output handle() { + public static Options dropRemainder(Boolean dropRemainder) { + return new Options().dropRemainder(dropRemainder); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SlidingWindowDataset"; - - private Output handle; - - private SlidingWindowDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * 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 new file mode 100644 index 00000000000..38d3a7f88a3 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SnapshotDataset.java @@ -0,0 +1,389 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.TString; +import org.tensorflow.types.family.TType; + +/** + * Creates a dataset that will write to / read from a snapshot. + * This dataset attempts to determine whether a valid snapshot exists at the + * {@code snapshot_path}, and reads from the snapshot in lieu of using {@code input_dataset}. + * 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" +) +public final class SnapshotDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SnapshotDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + public SnapshotDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new SnapshotDatasetV2 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 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 + * @return a new instance of SnapshotDataset + */ + @Endpoint( + describeByClass = true + ) + public static SnapshotDataset create(Scope scope, Operand inputDataset, + Operand path, Iterable> readerFuncOtherArgs, + Iterable> shardFuncOtherArgs, List> outputTypes, + List outputShapes, ConcreteFunction readerFunc, ConcreteFunction shardFunc, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SnapshotDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInput(path.asOutput()); + opBuilder.addInputList(Operands.asOutputs(readerFuncOtherArgs)); + opBuilder.addInputList(Operands.asOutputs(shardFuncOtherArgs)); + 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("reader_func", readerFunc); + opBuilder.setAttr("shard_func", shardFunc); + if (options != null) { + for (Options opts : options) { + if (opts.compression != null) { + opBuilder.setAttr("compression", opts.compression); + } + if (opts.readerPrefix != null) { + opBuilder.setAttr("reader_prefix", opts.readerPrefix); + } + if (opts.writerPrefix != null) { + opBuilder.setAttr("writer_prefix", opts.writerPrefix); + } + if (opts.hashValid != null) { + opBuilder.setAttr("hash_valid", opts.hashValid); + } + if (opts.hash != null) { + opBuilder.setAttr("hash", opts.hash); + } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } + return new SnapshotDataset(opBuilder.build()); + } + + /** + * Sets the compression option. + * + * @param compression The type of compression to be applied to the saved snapshot files. + * @return this Options instance. + */ + public static Options compression(String compression) { + return new Options().compression(compression); + } + + /** + * Sets the readerPrefix option. + * + * @param readerPrefix the readerPrefix option + * @return this Options instance. + */ + public static Options readerPrefix(String readerPrefix) { + return new Options().readerPrefix(readerPrefix); + } + + /** + * Sets the writerPrefix option. + * + * @param writerPrefix the writerPrefix option + * @return this Options instance. + */ + public static Options writerPrefix(String writerPrefix) { + return new Options().writerPrefix(writerPrefix); + } + + /** + * Sets the hashValid option. + * + * @param hashValid the hashValid option + * @return this Options instance. + */ + public static Options hashValid(Boolean hashValid) { + return new Options().hashValid(hashValid); + } + + /** + * Sets the hash option. + * + * @param hash the hash option + * @return this Options instance. + */ + 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. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + /** + * Optional attributes for {@link org.tensorflow.op.data.SnapshotDataset} + */ + public static class Options { + private String compression; + + private String readerPrefix; + + private String writerPrefix; + + private Boolean hashValid; + + private Long hash; + + private String metadata; + + private Options() { + } + + /** + * Sets the compression option. + * + * @param compression The type of compression to be applied to the saved snapshot files. + * @return this Options instance. + */ + public Options compression(String compression) { + this.compression = compression; + return this; + } + + /** + * Sets the readerPrefix option. + * + * @param readerPrefix the readerPrefix option + * @return this Options instance. + */ + public Options readerPrefix(String readerPrefix) { + this.readerPrefix = readerPrefix; + return this; + } + + /** + * Sets the writerPrefix option. + * + * @param writerPrefix the writerPrefix option + * @return this Options instance. + */ + public Options writerPrefix(String writerPrefix) { + this.writerPrefix = writerPrefix; + return this; + } + + /** + * Sets the hashValid option. + * + * @param hashValid the hashValid option + * @return this Options instance. + */ + public Options hashValid(Boolean hashValid) { + this.hashValid = hashValid; + return this; + } + + /** + * Sets the hash option. + * + * @param hash the hash option + * @return this Options instance. + */ + 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 new file mode 100644 index 00000000000..8a20a594bcf --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SnapshotDatasetReader.java @@ -0,0 +1,195 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; + +/** + * 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 + */ + public static final String OP_NAME = "SnapshotDatasetReader"; + + private Output handle; + + @SuppressWarnings("unchecked") + public SnapshotDatasetReader(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * 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 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 + */ + @Endpoint( + describeByClass = true + ) + public static SnapshotDatasetReader create(Scope scope, Operand shardDir, + Operand startIndex, List> outputTypes, + List outputShapes, Long version, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SnapshotDatasetReader"); + opBuilder.addInput(shardDir.asOutput()); + opBuilder.addInput(startIndex.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("version", version); + if (options != null) { + for (Options opts : options) { + if (opts.compression != null) { + opBuilder.setAttr("compression", opts.compression); + } + } + } + return new SnapshotDatasetReader(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.SnapshotDatasetReader} + */ + 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 = 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 new file mode 100644 index 00000000000..3d60a2cc237 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SnapshotNestedDatasetReader.java @@ -0,0 +1,134 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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 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 + */ + public static final String OP_NAME = "SnapshotNestedDatasetReader"; + + private Output handle; + + @SuppressWarnings("unchecked") + public SnapshotNestedDatasetReader(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * 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 attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of SnapshotNestedDatasetReader + */ + @Endpoint( + describeByClass = true + ) + public static SnapshotNestedDatasetReader create(Scope scope, + Iterable> inputs, List> outputTypes, + List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SnapshotNestedDatasetReader"); + 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 SnapshotNestedDatasetReader(opBuilder.build()); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + 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 540355e650b..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,61 +17,115 @@ 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" +) public final class SparseTensorSliceDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseTensorSliceDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public SparseTensorSliceDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseTensorSliceDataset operation. - * + * * @param scope current scope - * @param indices - * @param values - * @param denseShape + * @param indices The indices value + * @param values The values value + * @param denseShape The denseShape value * @return a new instance of SparseTensorSliceDataset */ - @Endpoint(describeByClass = true) - public static SparseTensorSliceDataset create(Scope scope, Operand indices, Operand values, Operand denseShape) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseTensorSliceDataset", scope.makeOpName("SparseTensorSliceDataset")); + @Endpoint( + describeByClass = true + ) + public static SparseTensorSliceDataset create(Scope scope, Operand indices, + Operand values, Operand denseShape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseTensorSliceDataset"); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(values.asOutput()); opBuilder.addInput(denseShape.asOutput()); - opBuilder = scope.apply(opBuilder); return new SparseTensorSliceDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseTensorSliceDataset"; - - private Output handle; - - private SparseTensorSliceDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 e22c4f13bb1..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,64 +27,123 @@ 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" +) public final class SqlDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SqlDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public SqlDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SqlDataset operation. - * + * * @param scope current scope * @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 - * @param outputShapes + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of SqlDataset */ - @Endpoint(describeByClass = true) - public static SqlDataset create(Scope scope, Operand driverName, Operand dataSourceName, Operand query, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("SqlDataset", scope.makeOpName("SqlDataset")); + @Endpoint( + describeByClass = true + ) + public static SqlDataset create(Scope scope, Operand driverName, + Operand dataSourceName, Operand query, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SqlDataset"); opBuilder.addInput(driverName.asOutput()); opBuilder.addInput(dataSourceName.asOutput()); opBuilder.addInput(query.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new SqlDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SqlDataset"; - - private Output handle; - - private SqlDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 5a2f602bf62..c17850e66a4 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,60 +17,58 @@ 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 statistics manager resource. + * The StatsAggregatorHandleV2 operation */ +@OpMetadata( + opType = StatsAggregatorHandle.OP_NAME, + inputsClass = StatsAggregatorHandle.Inputs.class +) +@Operator( + group = "data" +) public final class StatsAggregatorHandle extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.StatsAggregatorHandle} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "StatsAggregatorHandleV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + public StatsAggregatorHandle(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new StatsAggregatorHandle operation. - * + * Factory method to create a class wrapping a new StatsAggregatorHandleV2 operation. + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of StatsAggregatorHandle */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static StatsAggregatorHandle create(Scope scope, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("StatsAggregatorHandle", scope.makeOpName("StatsAggregatorHandle")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatsAggregatorHandle"); if (options != null) { for (Options opts : options) { if (opts.container != null) { @@ -83,41 +81,98 @@ public static StatsAggregatorHandle create(Scope scope, Options... options) { } return new StatsAggregatorHandle(opBuilder.build()); } - + /** - * @param container + * Sets the container option. + * + * @param container The name of {@code container} should start with {@code '.'} or {@code letter} or {@code digit}, + * with ['-', '.', '/'] or {@code letter} or {@code digit} follows several times. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * 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 handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatsAggregatorHandle"; - - private Output handle; - - private StatsAggregatorHandle(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.StatsAggregatorHandle} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container The name of {@code container} should start with {@code '.'} or {@code letter} or {@code digit}, + * with ['-', '.', '/'] or {@code letter} or {@code digit} follows several times. + * @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; + } + } + + @OpInputsMetadata( + outputsClass = StatsAggregatorHandle.class + ) + public static class Inputs extends RawOpInputs { + /** + * The name of {@code container} should start with {@code '.'} or {@code letter} or {@code digit}, + * with ['-', '.', '/'] or {@code letter} or {@code digit} follows several times. + */ + 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 new file mode 100644 index 00000000000..c610409f62a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/StatsAggregatorSetSummaryWriter.java @@ -0,0 +1,94 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.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"; + + 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 + * @return a new instance of StatsAggregatorSetSummaryWriter + */ + @Endpoint( + describeByClass = true + ) + public static StatsAggregatorSetSummaryWriter create(Scope scope, + Operand statsAggregator, Operand summary) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatsAggregatorSetSummaryWriter"); + opBuilder.addInput(statsAggregator.asOutput()); + 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 61d3ebc7916..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,65 +27,164 @@ 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 `count` elements from the `input_dataset`. + * Creates a dataset that contains {@code count} elements from the {@code input_dataset}. */ -@Operator(group = "data") +@OpMetadata( + opType = TakeDataset.OP_NAME, + inputsClass = TakeDataset.Inputs.class +) +@Operator( + group = "data" +) public final class TakeDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TakeDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public TakeDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TakeDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param count A scalar representing the number of elements from the `input_dataset` - * that should be taken. A value of `-1` indicates that all of `input_dataset` + * @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 - * @param outputShapes + * @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) { - OperationBuilder opBuilder = scope.env().opBuilder("TakeDataset", scope.makeOpName("TakeDataset")); + @Endpoint( + describeByClass = true + ) + public static TakeDataset create(Scope scope, Operand inputDataset, + Operand count, List> outputTypes, List outputShapes, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TakeDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(count.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + 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 TakeDataset(opBuilder.build()); } - + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. */ - public Output handle() { + 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TakeDataset"; - - private Output handle; - - private TakeDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * 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 new file mode 100644 index 00000000000..5df499a1e60 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TakeWhileDataset.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.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.family.TType; + +/** + * 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}.
  • + *
+ */ +@OpMetadata( + opType = TakeWhileDataset.OP_NAME, + inputsClass = TakeWhileDataset.Inputs.class +) +@Operator( + group = "data" +) +public final class TakeWhileDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TakeWhileDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public TakeWhileDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TakeWhileDataset 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 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 TakeWhileDataset + */ + @Endpoint( + describeByClass = true + ) + public static TakeWhileDataset create(Scope scope, Operand inputDataset, + Iterable> otherArguments, ConcreteFunction predicate, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TakeWhileDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInputList(Operands.asOutputs(otherArguments)); + 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.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. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + 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 87dd3df1dbd..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,57 +27,150 @@ 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 `components` as a tuple of tensors once. + * 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" +) public final class TensorDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public TensorDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorDataset operation. - * + * * @param scope current scope - * @param components - * @param outputShapes + * @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) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorDataset", scope.makeOpName("TensorDataset")); + @Endpoint( + describeByClass = true + ) + public static TensorDataset create(Scope scope, Iterable> components, + List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorDataset"); opBuilder.addInputList(Operands.asOutputs(components)); - opBuilder = scope.apply(opBuilder); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + 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 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. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorDataset"; - - private Output handle; - - private TensorDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * 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 6af845b1176..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,58 +27,214 @@ 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 `components` once. + * Creates a dataset that emits each dim-0 slice of {@code components} once. */ -@Operator(group = "data") +@OpMetadata( + opType = TensorSliceDataset.OP_NAME, + inputsClass = TensorSliceDataset.Inputs.class +) +@Operator( + group = "data" +) public final class TensorSliceDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorSliceDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public TensorSliceDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorSliceDataset operation. - * + * * @param scope current scope - * @param components - * @param outputShapes + * @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) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorSliceDataset", scope.makeOpName("TensorSliceDataset")); + @Endpoint( + describeByClass = true + ) + public static TensorSliceDataset create(Scope scope, Iterable> components, + List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorSliceDataset"); opBuilder.addInputList(Operands.asOutputs(components)); - opBuilder = scope.apply(opBuilder); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + 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.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 Output handle() { + 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. + * + * @return handle. + */ + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorSliceDataset"; - - private Output handle; - - private TensorSliceDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * 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 efa9ea5ba94..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,50 +37,138 @@ /** * Creates a dataset that emits the lines of one or more text files. */ -@Operator(group = "data") +@OpMetadata( + opType = TextLineDataset.OP_NAME, + inputsClass = TextLineDataset.Inputs.class +) +@Operator( + group = "data" +) public final class TextLineDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TextLineDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public TextLineDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TextLineDataset operation. - * + * * @param scope current scope * @param filenames A scalar or a vector containing the name(s) of the file(s) to be * read. * @param compressionType A scalar containing either (i) the empty string (no - * compression), (ii) "ZLIB", or (iii) "GZIP". + * 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) { - OperationBuilder opBuilder = scope.env().opBuilder("TextLineDataset", scope.makeOpName("TextLineDataset")); + @Endpoint( + describeByClass = true + ) + public static TextLineDataset create(Scope scope, Operand filenames, + 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()); - opBuilder = scope.apply(opBuilder); + 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. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TextLineDataset"; - - private Output handle; - - private TextLineDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * 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 de774c113b4..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,51 +37,151 @@ /** * Creates a dataset that emits the records from one or more TFRecord files. */ -@Operator(group = "data") +@OpMetadata( + opType = TfRecordDataset.OP_NAME, + inputsClass = TfRecordDataset.Inputs.class +) +@Operator( + group = "data" +) public final class TfRecordDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TfRecordDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TFRecordDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + public TfRecordDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * 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 * read. * @param compressionType A scalar containing either (i) the empty string (no - * compression), (ii) "ZLIB", or (iii) "GZIP". + * 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) { - OperationBuilder opBuilder = scope.env().opBuilder("TFRecordDataset", scope.makeOpName("TfRecordDataset")); + @Endpoint( + describeByClass = true + ) + public static TfRecordDataset create(Scope scope, Operand filenames, + 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 = scope.apply(opBuilder); + 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 Output handle() { + 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TFRecordDataset"; - - private Output handle; - - private TfRecordDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * 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 fe1f7d9f859..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,61 +27,114 @@ 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 `input_dataset`. + * 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" +) public final class ThreadPoolDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ThreadPoolDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ThreadPoolDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ThreadPoolDataset operation. - * + * * @param scope current scope - * @param inputDataset + * @param inputDataset The inputDataset value * @param threadPool A resource produced by the ThreadPoolHandle op. - * @param outputTypes - * @param outputShapes + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of ThreadPoolDataset */ - @Endpoint(describeByClass = true) - public static ThreadPoolDataset create(Scope scope, Operand inputDataset, Operand threadPool, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ThreadPoolDataset", scope.makeOpName("ThreadPoolDataset")); + @Endpoint( + describeByClass = true + ) + public static ThreadPoolDataset create(Scope scope, Operand inputDataset, + Operand threadPool, List> outputTypes, + List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ThreadPoolDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(threadPool.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new ThreadPoolDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ThreadPoolDataset"; - - private Output handle; - - private ThreadPoolDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 e45932145c1..f372fcd859d 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,74 +17,62 @@ 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 `input_dataset`. + * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.data.ThreadPoolHandle} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param maxIntraOpParallelism The maximum degree of parallelism to use within operations that execute on this - * threadpool. - */ - public Options maxIntraOpParallelism(Long maxIntraOpParallelism) { - this.maxIntraOpParallelism = maxIntraOpParallelism; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long maxIntraOpParallelism; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "ThreadPoolHandle"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ThreadPoolHandle(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ThreadPoolHandle operation. - * + * * @param scope current scope * @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 attributes values + * @param options carries optional attribute values * @return a new instance of ThreadPoolHandle */ - @Endpoint(describeByClass = true) - public static ThreadPoolHandle create(Scope scope, Long numThreads, String displayName, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ThreadPoolHandle", scope.makeOpName("ThreadPoolHandle")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static ThreadPoolHandle create(Scope scope, Long numThreads, String displayName, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ThreadPoolHandle"); opBuilder.setAttr("num_threads", numThreads); opBuilder.setAttr("display_name", displayName); if (options != null) { @@ -102,51 +90,143 @@ public static ThreadPoolHandle create(Scope scope, Long numThreads, String displ } return new ThreadPoolHandle(opBuilder.build()); } - + /** + * Sets the maxIntraOpParallelism option. + * * @param maxIntraOpParallelism The maximum degree of parallelism to use within operations that execute on this * threadpool. + * @return this Options instance. */ public static Options maxIntraOpParallelism(Long maxIntraOpParallelism) { return new Options().maxIntraOpParallelism(maxIntraOpParallelism); } - + /** - * @param container + * Sets the container option. + * + * @param container The name of {@code container} should start with {@code '.'} or {@code letter} or {@code digit}, + * with ['-', '.', '/'] or {@code letter} or {@code digit} follows several times. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * A resource that can be consumed by one or more ExperimentalThreadPoolDataset - * ops. + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ThreadPoolHandle"; - - private Output handle; - - private ThreadPoolHandle(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.ThreadPoolHandle} + */ + public static class Options { + private Long maxIntraOpParallelism; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the maxIntraOpParallelism option. + * + * @param maxIntraOpParallelism The maximum degree of parallelism to use within operations that execute on this + * threadpool. + * @return this Options instance. + */ + public Options maxIntraOpParallelism(Long maxIntraOpParallelism) { + this.maxIntraOpParallelism = maxIntraOpParallelism; + return this; + } + + /** + * Sets the container option. + * + * @param container The name of {@code container} should start with {@code '.'} or {@code letter} or {@code digit}, + * with ['-', '.', '/'] or {@code letter} or {@code digit} follows several times. + * @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; + } + } + + @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. + */ + public final String displayName; + + /** + * The name of {@code container} should start with {@code '.'} or {@code letter} or {@code digit}, + * with ['-', '.', '/'] or {@code letter} or {@code digit} follows several times. + */ + 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 1e8cc5cd305..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,59 +27,150 @@ 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" +) public final class UnbatchDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UnbatchDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public UnbatchDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new UnbatchDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param outputTypes - * @param outputShapes + * @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) { - OperationBuilder opBuilder = scope.env().opBuilder("UnbatchDataset", scope.makeOpName("UnbatchDataset")); + @Endpoint( + describeByClass = true + ) + public static UnbatchDataset create(Scope scope, Operand inputDataset, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UnbatchDataset"); opBuilder.addInput(inputDataset.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + 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 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. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnbatchDataset"; - - private Output handle; - - private UnbatchDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * 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 new file mode 100644 index 00000000000..9c871ae7b08 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UncompressElement.java @@ -0,0 +1,134 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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.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 + */ + public static final String OP_NAME = "UncompressElement"; + + private List> components; + + @SuppressWarnings("unchecked") + public UncompressElement(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 UncompressElement operation. + * + * @param scope current scope + * @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( + describeByClass = true + ) + public static UncompressElement create(Scope scope, Operand compressed, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UncompressElement"); + opBuilder.addInput(compressed.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 UncompressElement(opBuilder.build()); + } + + /** + * Gets components. + * + * @return components. + */ + public List> components() { + return components; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + 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 6bd918a3db0..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,59 +27,150 @@ 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 `input_dataset`. + * Creates a dataset that contains the unique elements of {@code input_dataset}. */ +@OpMetadata( + opType = UniqueDataset.OP_NAME, + inputsClass = UniqueDataset.Inputs.class +) +@Operator( + group = "data" +) public final class UniqueDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UniqueDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public UniqueDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new UniqueDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param outputTypes - * @param outputShapes + * @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) { - OperationBuilder opBuilder = scope.env().opBuilder("UniqueDataset", scope.makeOpName("UniqueDataset")); + @Endpoint( + describeByClass = true + ) + public static UniqueDataset create(Scope scope, Operand inputDataset, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UniqueDataset"); opBuilder.addInput(inputDataset.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + 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 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. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UniqueDataset"; - - private Output handle; - - private UniqueDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * 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 7798ca8c9cd..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,55 +17,90 @@ 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" +) public final class UnwrapDatasetVariant extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UnwrapDatasetVariant"; + + private Output outputHandle; + + @SuppressWarnings("unchecked") + public UnwrapDatasetVariant(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new UnwrapDatasetVariant operation. - * + * * @param scope current scope - * @param inputHandle + * @param inputHandle The inputHandle value * @return a new instance of UnwrapDatasetVariant */ - @Endpoint(describeByClass = true) - public static UnwrapDatasetVariant create(Scope scope, Operand inputHandle) { - OperationBuilder opBuilder = scope.env().opBuilder("UnwrapDatasetVariant", scope.makeOpName("UnwrapDatasetVariant")); + @Endpoint( + describeByClass = true + ) + public static UnwrapDatasetVariant create(Scope scope, Operand inputHandle) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UnwrapDatasetVariant"); opBuilder.addInput(inputHandle.asOutput()); - opBuilder = scope.apply(opBuilder); return new UnwrapDatasetVariant(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnwrapDatasetVariant"; - - private Output outputHandle; - - private UnwrapDatasetVariant(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); + + @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 a44807564c1..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,116 +27,233 @@ 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; /** - * Combines (nests of) input elements into a dataset of (nests of) windows. - *

- * A "window" is a finite dataset of flat elements of size `size` (or possibly - * fewer if there are not enough input elements to fill the window and - * `drop_remainder` evaluates to false). - *

- * The `shift` argument determines the number of input elements by which - * the window moves on each iteration. The first element in the `k`th window - * will be element - *

- *

{@code
- *   1 + (k-1) * shift
- *   }
- * of the input dataset. In particular, the first element of the first window - * will always be the first element of the input dataset. - *

- * If the `stride` parameter is greater than 1, then each window will skip - * `(stride - 1)` input elements between each element that appears in the - * window. Output windows will still contain `size` elements regardless of - * the value of `stride`. - *

- * The `stride` argument determines the stride of the input elements, and the - * `shift` argument determines the shift of the window. - *

- * For example, letting `{...}` to represent a Dataset: - *

- * - `tf.data.Dataset.range(7).window(2)` produces - * `{{0, 1}, {2, 3}, {4, 5}, {6}}` - * - `tf.data.Dataset.range(7).window(3, 2, 1, True)` produces - * `{{0, 1, 2}, {2, 3, 4}, {4, 5, 6}}` - * - `tf.data.Dataset.range(7).window(3, 1, 2, True)` produces - * `{{0, 2, 4}, {1, 3, 5}, {2, 4, 6}}` - *

- * Note that when the `window` transformation is applied to a dataset of - * nested elements, it produces a dataset of nested windows. - *

- * For example: - *

- * - `tf.data.Dataset.from_tensor_slices((range(4), range(4))).window(2)` - * produces `{({0, 1}, {0, 1}), ({2, 3}, {2, 3})}` - * - `tf.data.Dataset.from_tensor_slices({"a": range(4)}).window(2)` - * produces `{{"a": {0, 1}}, {"a": {2, 3}}}` + * Combines (nests of) input elements into a dataset of (nests of) windows. + *

A "window" is a finite dataset of flat elements of size {@code size} (or possibly + * fewer if there are not enough input elements to fill the window and + * {@code drop_remainder} evaluates to false). + *

The {@code shift} argument determines the number of input elements by which + * the window moves on each iteration. The first element in the {@code k}th window + * will be element + *

+ * 1 + (k-1) * shift
+ * 
+ *

of the input dataset. In particular, the first element of the first window + * will always be the first element of the input dataset. + *

If the {@code stride} parameter is greater than 1, then each window will skip + * {@code (stride - 1)} input elements between each element that appears in the + * window. Output windows will still contain {@code size} elements regardless of + * the value of {@code stride}. + *

The {@code stride} argument determines the stride of the input elements, and the + * {@code shift} argument determines the shift of the window. + *

For example, letting {@code {...}} to represent a Dataset: + *

    + *
  • {@code tf.data.Dataset.range(7).window(2)} produces + * {@code {{0, 1}, {2, 3}, {4, 5}, {6}}}
  • + *
  • {@code tf.data.Dataset.range(7).window(3, 2, 1, True)} produces + * {@code {{0, 1, 2}, {2, 3, 4}, {4, 5, 6}}}
  • + *
  • {@code tf.data.Dataset.range(7).window(3, 1, 2, True)} produces + * {@code {{0, 2, 4}, {1, 3, 5}, {2, 4, 6}}}
  • + *
+ *

Note that when the {@code window} transformation is applied to a dataset of + * nested elements, it produces a dataset of nested windows. + *

For example: + *

    + *
  • {@code tf.data.Dataset.from_tensor_slices((range(4), range(4))).window(2)} + * produces {@code {({0, 1}, {0, 1}), ({2, 3}, {2, 3})}}
  • + *
  • {@code tf.data.Dataset.from_tensor_slices({"a": range(4)}).window(2)} + * produces {@code {{"a": {0, 1}}, {"a": {2, 3}}}}
  • + *
*/ +@OpMetadata( + opType = WindowDataset.OP_NAME, + inputsClass = WindowDataset.Inputs.class +) +@Operator( + group = "data" +) public final class WindowDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "WindowDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public WindowDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new WindowDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param size An integer scalar, representing the number of elements + * @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 - * by which the window moves in each iteration. Defaults to `size`. + * by which the window moves in each iteration. Defaults to {@code size}. * Must be positive. * @param stride 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". + * "retain every input element". * @param dropRemainder A Boolean scalar, representing whether the last window should be - * dropped if its size is smaller than `window_size`. - * @param outputTypes - * @param outputShapes + * dropped if its size is smaller than {@code window_size}. + * @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(describeByClass = true) - public static WindowDataset create(Scope scope, Operand inputDataset, Operand size, Operand shift, Operand stride, Operand dropRemainder, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("WindowDataset", scope.makeOpName("WindowDataset")); + @Endpoint( + describeByClass = true + ) + public static WindowDataset create(Scope scope, Operand inputDataset, + Operand sizeOutput, Operand shift, Operand stride, + Operand dropRemainder, List> outputTypes, + List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "WindowDataset"); opBuilder.addInput(inputDataset.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder.addInput(shift.asOutput()); opBuilder.addInput(stride.asOutput()); opBuilder.addInput(dropRemainder.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + 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 WindowDataset(opBuilder.build()); } - + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. */ - public Output handle() { + 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "WindowDataset"; - - private Output handle; - - private WindowDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * 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 58823c1de2c..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,55 +17,90 @@ 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" +) public final class WrapDatasetVariant extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "WrapDatasetVariant"; + + private Output outputHandle; + + @SuppressWarnings("unchecked") + public WrapDatasetVariant(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new WrapDatasetVariant operation. - * + * * @param scope current scope - * @param inputHandle + * @param inputHandle The inputHandle value * @return a new instance of WrapDatasetVariant */ - @Endpoint(describeByClass = true) - public static WrapDatasetVariant create(Scope scope, Operand inputHandle) { - OperationBuilder opBuilder = scope.env().opBuilder("WrapDatasetVariant", scope.makeOpName("WrapDatasetVariant")); + @Endpoint( + describeByClass = true + ) + public static WrapDatasetVariant create(Scope scope, Operand inputHandle) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "WrapDatasetVariant"); opBuilder.addInput(inputHandle.asOutput()); - opBuilder = scope.apply(opBuilder); return new WrapDatasetVariant(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "WrapDatasetVariant"; - - private Output outputHandle; - - private WrapDatasetVariant(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); + + @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 47dd0be0775..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,66 +27,156 @@ 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 zips together `input_datasets`. - *

+ * Creates a dataset that zips together {@code input_datasets}. * The elements of the resulting dataset are created by zipping corresponding * elements from each of the input datasets. - *

- * The size of the resulting dataset will match the size of the smallest input + *

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. */ -@Operator(group = "data") +@OpMetadata( + opType = ZipDataset.OP_NAME, + inputsClass = ZipDataset.Inputs.class +) +@Operator( + group = "data" +) public final class ZipDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ZipDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ZipDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ZipDataset operation. - * + * * @param scope current scope - * @param inputDatasets List of `N` variant Tensors representing datasets to be zipped together. - * @param outputTypes - * @param outputShapes + * @param inputDatasets List of {@code N} variant Tensors representing datasets to be zipped together. + * @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) { - OperationBuilder opBuilder = scope.env().opBuilder("ZipDataset", scope.makeOpName("ZipDataset")); + @Endpoint( + describeByClass = true + ) + public static ZipDataset create(Scope scope, Iterable> inputDatasets, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ZipDataset"); opBuilder.addInputList(Operands.asOutputs(inputDatasets)); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + 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 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. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ZipDataset"; - - private Output handle; - - private ZipDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * 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/AssertCardinalityDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AssertCardinalityDataset.java deleted file mode 100644 index 8ab5989b44b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AssertCardinalityDataset.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.data.experimental; - -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.family.TType; - -/** - */ -public final class AssertCardinalityDataset extends RawOp implements Operand { - - /** - * Factory method to create a class wrapping a new AssertCardinalityDataset operation. - * - * @param scope current scope - * @param inputDataset - * @param cardinality - * @param outputTypes - * @param outputShapes - * @return a new instance of AssertCardinalityDataset - */ - @Endpoint(describeByClass = true) - public static AssertCardinalityDataset create(Scope scope, Operand inputDataset, Operand cardinality, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("AssertCardinalityDataset", scope.makeOpName("AssertCardinalityDataset")); - opBuilder.addInput(inputDataset.asOutput()); - opBuilder.addInput(cardinality.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); - Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { - outputShapesArray[i] = outputShapes.get(i); - } - opBuilder.setAttr("output_shapes", outputShapesArray); - return new AssertCardinalityDataset(opBuilder.build()); - } - - /** - */ - public Output handle() { - return handle; - } - - @Override - @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AssertCardinalityDataset"; - - private Output handle; - - private AssertCardinalityDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AssertNextDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AssertNextDataset.java index 2483e971723..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,61 +27,115 @@ 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 { - /** - * Factory method to create a class wrapping a new AssertNextDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalAssertNextDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public AssertNextDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalAssertNextDataset operation. + * * @param scope current scope - * @param inputDataset - * @param transformations - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static AssertNextDataset create(Scope scope, Operand inputDataset, Operand transformations, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalAssertNextDataset", scope.makeOpName("AssertNextDataset")); + @Endpoint( + describeByClass = true + ) + public static AssertNextDataset create(Scope scope, Operand inputDataset, + Operand transformations, List> outputTypes, + List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AssertNextDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(transformations.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new AssertNextDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalAssertNextDataset"; - - private Output handle; - - private AssertNextDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 fc630d53919..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,66 +27,72 @@ 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 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 + *

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 { - /** - * Optional attributes for {@link org.tensorflow.op.data.experimental.AutoShardDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param autoShardPolicy - */ - public Options autoShardPolicy(Long autoShardPolicy) { - this.autoShardPolicy = autoShardPolicy; - return this; - } - - private Long autoShardPolicy; - - private Options() { - } + public static final String OP_NAME = "ExperimentalAutoShardDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public AutoShardDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new AutoShardDataset operation. - * + * Factory method to create a class wrapping a new ExperimentalAutoShardDataset operation. + * * @param scope current scope * @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 - * @param outputShapes - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static AutoShardDataset create(Scope scope, Operand inputDataset, Operand numWorkers, Operand index, List> outputTypes, List outputShapes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalAutoShardDataset", scope.makeOpName("AutoShardDataset")); + @Endpoint( + describeByClass = true + ) + public static AutoShardDataset create(Scope scope, Operand inputDataset, + Operand numWorkers, Operand index, List> outputTypes, + List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AutoShardDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(numWorkers.asOutput()); opBuilder.addInput(index.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -97,34 +105,96 @@ public static AutoShardDataset create(Scope scope, Operand inputDataset, Oper } return new AutoShardDataset(opBuilder.build()); } - + /** - * @param autoShardPolicy + * Sets the autoShardPolicy option. + * + * @param autoShardPolicy the autoShardPolicy option + * @return this Options instance. */ public static Options autoShardPolicy(Long autoShardPolicy) { return new Options().autoShardPolicy(autoShardPolicy); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalAutoShardDataset"; - - private Output handle; - - private AutoShardDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.experimental.AutoShardDataset} + */ + public static class Options { + private Long autoShardPolicy; + + private Options() { + } + + /** + * Sets the autoShardPolicy option. + * + * @param autoShardPolicy the autoShardPolicy option + * @return this Options instance. + */ + public Options autoShardPolicy(Long autoShardPolicy) { + this.autoShardPolicy = 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 76a5a96f895..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,62 +27,114 @@ 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 `input_dataset` in a StatsAggregator. + * 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 { - /** - * Factory method to create a class wrapping a new BytesProducedStatsDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalBytesProducedStatsDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public BytesProducedStatsDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalBytesProducedStatsDataset operation. + * * @param scope current scope - * @param inputDataset - * @param tag - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static BytesProducedStatsDataset create(Scope scope, Operand inputDataset, Operand tag, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalBytesProducedStatsDataset", scope.makeOpName("BytesProducedStatsDataset")); + @Endpoint( + describeByClass = true + ) + public static BytesProducedStatsDataset create(Scope scope, Operand inputDataset, + Operand tag, List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BytesProducedStatsDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(tag.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new BytesProducedStatsDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalBytesProducedStatsDataset"; - - private Output handle; - - private BytesProducedStatsDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 b9af7f275db..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,37 +27,67 @@ 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; import org.tensorflow.types.family.TType; /** + * The ExperimentalCSVDataset operation */ +@OpMetadata( + opType = CSVDataset.OP_NAME, + inputsClass = CSVDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class CSVDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new CSVDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalCSVDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public CSVDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalCSVDataset operation. + * * @param scope current scope - * @param filenames - * @param compressionType - * @param bufferSize - * @param header - * @param fieldDelim - * @param useQuoteDelim - * @param naValue - * @param selectCols - * @param recordDefaults - * @param outputShapes + * @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(describeByClass = true) - public static CSVDataset create(Scope scope, Operand filenames, Operand compressionType, Operand bufferSize, Operand header, Operand fieldDelim, Operand useQuoteDelim, Operand naValue, Operand selectCols, Iterable> recordDefaults, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalCSVDataset", scope.makeOpName("CSVDataset")); + @Endpoint( + describeByClass = true + ) + public static CSVDataset create(Scope scope, Operand filenames, + Operand compressionType, Operand bufferSize, Operand header, + Operand fieldDelim, Operand useQuoteDelim, Operand naValue, + Operand selectCols, Iterable> recordDefaults, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CSVDataset"); opBuilder.addInput(filenames.asOutput()); opBuilder.addInput(compressionType.asOutput()); opBuilder.addInput(bufferSize.asOutput()); @@ -65,35 +97,104 @@ public static CSVDataset create(Scope scope, Operand filenames, Operand opBuilder.addInput(naValue.asOutput()); opBuilder.addInput(selectCols.asOutput()); opBuilder.addInputList(Operands.asOutputs(recordDefaults)); - opBuilder = scope.apply(opBuilder); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new CSVDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalCSVDataset"; - - private Output handle; - - private CSVDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 b735a535c48..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,60 +27,116 @@ 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 { - /** - * Factory method to create a class wrapping a new ChooseFastestDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalChooseFastestDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ChooseFastestDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalChooseFastestDataset operation. + * * @param scope current scope - * @param inputDatasets - * @param numExperiments - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static ChooseFastestDataset create(Scope scope, Iterable> inputDatasets, Long numExperiments, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalChooseFastestDataset", scope.makeOpName("ChooseFastestDataset")); + @Endpoint( + describeByClass = true + ) + public static ChooseFastestDataset create(Scope scope, + Iterable> inputDatasets, Long numExperiments, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ChooseFastestDataset"); opBuilder.addInputList(Operands.asOutputs(inputDatasets)); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_experiments", numExperiments); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new ChooseFastestDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalChooseFastestDataset"; - - private Output handle; - - private ChooseFastestDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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/CompressElement.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/CompressElement.java deleted file mode 100644 index d4b0efb4dd3..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/CompressElement.java +++ /dev/null @@ -1,73 +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.experimental; - -import org.tensorflow.Operand; -import org.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; - -/** - * Compresses a dataset element. - */ -public final class CompressElement extends RawOp implements Operand { - - /** - * Factory method to create a class wrapping a new CompressElement operation. - * - * @param scope current scope - * @param components - * @return a new instance of CompressElement - */ - @Endpoint(describeByClass = true) - public static CompressElement create(Scope scope, Iterable> components) { - OperationBuilder opBuilder = scope.env().opBuilder("CompressElement", scope.makeOpName("CompressElement")); - opBuilder.addInputList(Operands.asOutputs(components)); - opBuilder = scope.apply(opBuilder); - return new CompressElement(opBuilder.build()); - } - - /** - */ - public Output compressed() { - return compressed; - } - - @Override - @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) compressed; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CompressElement"; - - private Output compressed; - - private CompressElement(Operation operation) { - super(operation); - int outputIdx = 0; - compressed = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DataServiceDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DataServiceDataset.java deleted file mode 100644 index 6307dddf9dc..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DataServiceDataset.java +++ /dev/null @@ -1,131 +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.experimental; - -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; - -/** - */ -@Operator(group = "data.experimental") -public final class DataServiceDataset extends RawOp implements Operand { - - /** - * Optional attributes for {@link org.tensorflow.op.data.experimental.DataServiceDataset} - */ - public static class Options { - - /** - * @param taskRefreshIntervalHintMs - */ - public Options taskRefreshIntervalHintMs(Long taskRefreshIntervalHintMs) { - this.taskRefreshIntervalHintMs = taskRefreshIntervalHintMs; - return this; - } - - private Long taskRefreshIntervalHintMs; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new DataServiceDataset operation. - * - * @param scope current scope - * @param datasetId - * @param processingMode - * @param address - * @param protocol - * @param jobName - * @param maxOutstandingRequests - * @param iterationCounter - * @param outputTypes - * @param outputShapes - * @param options carries optional attributes 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 maxOutstandingRequests, Operand iterationCounter, List> outputTypes, List outputShapes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DataServiceDataset", scope.makeOpName("DataServiceDataset")); - opBuilder.addInput(datasetId.asOutput()); - opBuilder.addInput(processingMode.asOutput()); - opBuilder.addInput(address.asOutput()); - opBuilder.addInput(protocol.asOutput()); - opBuilder.addInput(jobName.asOutput()); - opBuilder.addInput(maxOutstandingRequests.asOutput()); - opBuilder.addInput(iterationCounter.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); - Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { - outputShapesArray[i] = outputShapes.get(i); - } - opBuilder.setAttr("output_shapes", outputShapesArray); - if (options != null) { - for (Options opts : options) { - if (opts.taskRefreshIntervalHintMs != null) { - opBuilder.setAttr("task_refresh_interval_hint_ms", opts.taskRefreshIntervalHintMs); - } - } - } - return new DataServiceDataset(opBuilder.build()); - } - - /** - * @param taskRefreshIntervalHintMs - */ - public static Options taskRefreshIntervalHintMs(Long taskRefreshIntervalHintMs) { - return new Options().taskRefreshIntervalHintMs(taskRefreshIntervalHintMs); - } - - /** - */ - public Output handle() { - return handle; - } - - @Override - @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DataServiceDataset"; - - private Output handle; - - private DataServiceDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DatasetCardinality.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DatasetCardinality.java index 638ef3e1220..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,59 +17,91 @@ 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; /** - * Returns the cardinality of `input_dataset`. - *

- * Returns the cardinality of `input_dataset`. + * 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 { - /** - * Factory method to create a class wrapping a new DatasetCardinality operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalDatasetCardinality"; + + private Output cardinality; + + public DatasetCardinality(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + cardinality = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalDatasetCardinality operation. + * * @param scope current scope * @param inputDataset A variant tensor representing the dataset to return cardinality for. * @return a new instance of DatasetCardinality */ - @Endpoint(describeByClass = true) - public static DatasetCardinality create(Scope scope, Operand inputDataset) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalDatasetCardinality", scope.makeOpName("DatasetCardinality")); + @Endpoint( + describeByClass = true + ) + public static DatasetCardinality create(Scope scope, Operand inputDataset) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DatasetCardinality"); opBuilder.addInput(inputDataset.asOutput()); - opBuilder = scope.apply(opBuilder); return new DatasetCardinality(opBuilder.build()); } - + /** - * The cardinality of `input_dataset`. Named constants are used to represent + * Gets cardinality. + * The cardinality of {@code input_dataset}. Named constants are used to represent * infinite and unknown cardinality. + * @return cardinality. */ public Output cardinality() { return cardinality; } - + @Override public Output asOutput() { return cardinality; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalDatasetCardinality"; - - private Output cardinality; - - private DatasetCardinality(Operation operation) { - super(operation); - int outputIdx = 0; - cardinality = operation.output(outputIdx++); + + @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 5c57272415f..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,44 +17,89 @@ 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 { - /** - * Factory method to create a class wrapping a new DatasetToTFRecord operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalDatasetToTFRecord"; + + public DatasetToTFRecord(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new ExperimentalDatasetToTFRecord operation. + * * @param scope current scope * @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". + * compression), (ii) "ZLIB", or (iii) "GZIP". * @return a new instance of DatasetToTFRecord */ - @Endpoint(describeByClass = true) - public static DatasetToTFRecord create(Scope scope, Operand inputDataset, Operand filename, Operand compressionType) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalDatasetToTFRecord", scope.makeOpName("DatasetToTFRecord")); + @Endpoint( + describeByClass = true + ) + public static DatasetToTFRecord create(Scope scope, Operand inputDataset, + Operand filename, Operand compressionType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DatasetToTFRecord"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(filename.asOutput()); opBuilder.addInput(compressionType.asOutput()); - opBuilder = scope.apply(opBuilder); return new DatasetToTFRecord(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalDatasetToTFRecord"; - - private DatasetToTFRecord(Operation operation) { - super(operation); + + @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 fd19c2fc45c..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,67 +27,129 @@ 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 { - /** - * Factory method to create a class wrapping a new DenseToSparseBatchDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalDenseToSparseBatchDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public DenseToSparseBatchDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalDenseToSparseBatchDataset operation. + * * @param scope current scope * @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 `-1` to indicate + * 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 - * @param outputShapes + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of DenseToSparseBatchDataset */ - @Endpoint(describeByClass = true) - public static DenseToSparseBatchDataset create(Scope scope, Operand inputDataset, Operand batchSize, Operand rowShape, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalDenseToSparseBatchDataset", scope.makeOpName("DenseToSparseBatchDataset")); + @Endpoint( + describeByClass = true + ) + public static DenseToSparseBatchDataset create(Scope scope, Operand inputDataset, + Operand batchSize, Operand rowShape, List> outputTypes, + List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DenseToSparseBatchDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(batchSize.asOutput()); opBuilder.addInput(rowShape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new DenseToSparseBatchDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalDenseToSparseBatchDataset"; - - private Output handle; - - private DenseToSparseBatchDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 c1bdefa37dc..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,63 +27,121 @@ 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 `InterleaveDataset` on a fixed list of `N` datasets. + * 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 { - /** - * Factory method to create a class wrapping a new DirectedInterleaveDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalDirectedInterleaveDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public DirectedInterleaveDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalDirectedInterleaveDataset operation. + * * @param scope current scope - * @param selectorInputDataset A dataset of scalar `DT_INT64` elements that determines which of the - * `N` data inputs should produce the next output element. - * @param dataInputDatasets `N` datasets with the same type that will be interleaved according to - * the values of `selector_input_dataset`. - * @param outputTypes - * @param outputShapes + * @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 */ - @Endpoint(describeByClass = true) - public static DirectedInterleaveDataset create(Scope scope, Operand selectorInputDataset, Iterable> dataInputDatasets, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalDirectedInterleaveDataset", scope.makeOpName("DirectedInterleaveDataset")); + @Endpoint( + describeByClass = true + ) + public static DirectedInterleaveDataset create(Scope scope, + Operand selectorInputDataset, + Iterable> dataInputDatasets, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DirectedInterleaveDataset"); opBuilder.addInput(selectorInputDataset.asOutput()); opBuilder.addInputList(Operands.asOutputs(dataInputDatasets)); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new DirectedInterleaveDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalDirectedInterleaveDataset"; - - private Output handle; - - private DirectedInterleaveDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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/DummyIterationCounter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DummyIterationCounter.java deleted file mode 100644 index 1ae74bfc8c9..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DummyIterationCounter.java +++ /dev/null @@ -1,69 +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.experimental; - -import 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; - -/** - */ -public final class DummyIterationCounter extends RawOp implements Operand { - - /** - * Factory method to create a class wrapping a new DummyIterationCounter operation. - * - * @param scope current scope - * @return a new instance of DummyIterationCounter - */ - @Endpoint(describeByClass = true) - public static DummyIterationCounter create(Scope scope) { - OperationBuilder opBuilder = scope.env().opBuilder("DummyIterationCounter", scope.makeOpName("DummyIterationCounter")); - opBuilder = scope.apply(opBuilder); - return new DummyIterationCounter(opBuilder.build()); - } - - /** - */ - public Output handle() { - return handle; - } - - @Override - @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DummyIterationCounter"; - - private Output handle; - - private DummyIterationCounter(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/GroupByReducerDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/GroupByReducerDataset.java new file mode 100644 index 00000000000..db37b2fc4e8 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/GroupByReducerDataset.java @@ -0,0 +1,220 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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; +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 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 + */ + public static final String OP_NAME = "ExperimentalGroupByReducerDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public GroupByReducerDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalGroupByReducerDataset operation. + * + * @param scope current scope + * @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 + */ + @Endpoint( + describeByClass = true + ) + public static GroupByReducerDataset create(Scope scope, Operand inputDataset, + Iterable> keyFuncOtherArguments, Iterable> initFuncOtherArguments, + Iterable> reduceFuncOtherArguments, + Iterable> finalizeFuncOtherArguments, ConcreteFunction keyFunc, + ConcreteFunction initFunc, ConcreteFunction reduceFunc, ConcreteFunction finalizeFunc, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GroupByReducerDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInputList(Operands.asOutputs(keyFuncOtherArguments)); + opBuilder.addInputList(Operands.asOutputs(initFuncOtherArguments)); + opBuilder.addInputList(Operands.asOutputs(reduceFuncOtherArguments)); + opBuilder.addInputList(Operands.asOutputs(finalizeFuncOtherArguments)); + opBuilder.setAttr("key_func", keyFunc); + opBuilder.setAttr("init_func", initFunc); + opBuilder.setAttr("reduce_func", reduceFunc); + opBuilder.setAttr("finalize_func", finalizeFunc); + 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 GroupByReducerDataset(opBuilder.build()); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + 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 new file mode 100644 index 00000000000..a24b41f050d --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/GroupByWindowDataset.java @@ -0,0 +1,191 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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; +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 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 + */ + public static final String OP_NAME = "ExperimentalGroupByWindowDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public GroupByWindowDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * 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 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 + */ + @Endpoint( + describeByClass = true + ) + public static GroupByWindowDataset create(Scope scope, Operand inputDataset, + Iterable> keyFuncOtherArguments, Iterable> reduceFuncOtherArguments, + Iterable> windowSizeFuncOtherArguments, ConcreteFunction keyFunc, + ConcreteFunction reduceFunc, ConcreteFunction windowSizeFunc, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GroupByWindowDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInputList(Operands.asOutputs(keyFuncOtherArguments)); + opBuilder.addInputList(Operands.asOutputs(reduceFuncOtherArguments)); + opBuilder.addInputList(Operands.asOutputs(windowSizeFuncOtherArguments)); + opBuilder.setAttr("key_func", keyFunc); + opBuilder.setAttr("reduce_func", reduceFunc); + opBuilder.setAttr("window_size_func", windowSizeFunc); + 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 GroupByWindowDataset(opBuilder.build()); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + 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 83ddc19fe19..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,53 +27,60 @@ 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 `input_dataset` ignoring errors. + * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.data.experimental.IgnoreErrorsDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param logWarning - */ - public Options logWarning(Boolean logWarning) { - this.logWarning = logWarning; - return this; - } - - private Boolean logWarning; - - private Options() { - } + public static final String OP_NAME = "ExperimentalIgnoreErrorsDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public IgnoreErrorsDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new IgnoreErrorsDataset operation. - * + * Factory method to create a class wrapping a new ExperimentalIgnoreErrorsDataset operation. + * * @param scope current scope - * @param inputDataset - * @param outputTypes - * @param outputShapes - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static IgnoreErrorsDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalIgnoreErrorsDataset", scope.makeOpName("IgnoreErrorsDataset")); + @Endpoint( + describeByClass = true + ) + public static IgnoreErrorsDataset create(Scope scope, Operand inputDataset, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IgnoreErrorsDataset"); opBuilder.addInput(inputDataset.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -84,34 +93,84 @@ public static IgnoreErrorsDataset create(Scope scope, Operand inputDataset, L } return new IgnoreErrorsDataset(opBuilder.build()); } - + /** - * @param logWarning + * Sets the logWarning option. + * + * @param logWarning the logWarning option + * @return this Options instance. */ public static Options logWarning(Boolean logWarning) { return new Options().logWarning(logWarning); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalIgnoreErrorsDataset"; - - private Output handle; - - private IgnoreErrorsDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.experimental.IgnoreErrorsDataset} + */ + public static class Options { + private Boolean logWarning; + + private Options() { + } + + /** + * Sets the logWarning option. + * + * @param logWarning the logWarning option + * @return this Options instance. + */ + public Options logWarning(Boolean logWarning) { + this.logWarning = 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 5ee5a398f04..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,55 +17,89 @@ 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 `resource` has been placed. + * 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 { - /** - * Factory method to create a class wrapping a new IteratorGetDevice operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalIteratorGetDevice"; + + private Output device; + + public IteratorGetDevice(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + device = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalIteratorGetDevice operation. + * * @param scope current scope - * @param resource + * @param resource The resource value * @return a new instance of IteratorGetDevice */ - @Endpoint(describeByClass = true) - public static IteratorGetDevice create(Scope scope, Operand resource) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalIteratorGetDevice", scope.makeOpName("IteratorGetDevice")); + @Endpoint( + describeByClass = true + ) + public static IteratorGetDevice create(Scope scope, Operand resource) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IteratorGetDevice"); opBuilder.addInput(resource.asOutput()); - opBuilder = scope.apply(opBuilder); return new IteratorGetDevice(opBuilder.build()); } - + /** + * Gets device. + * + * @return device. */ public Output device() { return device; } - + @Override public Output asOutput() { return device; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalIteratorGetDevice"; - - private Output device; - - private IteratorGetDevice(Operation operation) { - super(operation); - int outputIdx = 0; - device = operation.output(outputIdx++); + + @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 1c333d77ac5..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,62 +27,114 @@ 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 `input_dataset` elements in a StatsAggregator. + * 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 { - /** - * Factory method to create a class wrapping a new LatencyStatsDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalLatencyStatsDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public LatencyStatsDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalLatencyStatsDataset operation. + * * @param scope current scope - * @param inputDataset - * @param tag - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static LatencyStatsDataset create(Scope scope, Operand inputDataset, Operand tag, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalLatencyStatsDataset", scope.makeOpName("LatencyStatsDataset")); + @Endpoint( + describeByClass = true + ) + public static LatencyStatsDataset create(Scope scope, Operand inputDataset, + Operand tag, List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LatencyStatsDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(tag.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new LatencyStatsDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalLatencyStatsDataset"; - - private Output handle; - - private LatencyStatsDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 4cdb41cc8e3..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,59 +27,106 @@ 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 { - /** - * Factory method to create a class wrapping a new LmdbDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalLMDBDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public LmdbDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalLMDBDataset operation. + * * @param scope current scope - * @param filenames - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static LmdbDataset create(Scope scope, Operand filenames, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalLMDBDataset", scope.makeOpName("LmdbDataset")); + @Endpoint( + describeByClass = true + ) + public static LmdbDataset create(Scope scope, Operand filenames, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LmdbDataset"); opBuilder.addInput(filenames.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new LmdbDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalLMDBDataset"; - - private Output handle; - - private LmdbDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 new file mode 100644 index 00000000000..18ac4e051f9 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MapAndBatchDataset.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.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; +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.TBool; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; + +/** + * 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. + */ +@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 + */ + public static final String OP_NAME = "ExperimentalMapAndBatchDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public MapAndBatchDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalMapAndBatchDataset operation. + * + * @param scope current scope + * @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 + */ + @Endpoint( + describeByClass = true + ) + public static MapAndBatchDataset create(Scope scope, Operand inputDataset, + Iterable> otherArguments, Operand batchSize, + Operand numParallelCalls, Operand dropRemainder, ConcreteFunction f, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MapAndBatchDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInputList(Operands.asOutputs(otherArguments)); + opBuilder.addInput(batchSize.asOutput()); + opBuilder.addInput(numParallelCalls.asOutput()); + opBuilder.addInput(dropRemainder.asOutput()); + opBuilder.setAttr("f", f); + 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.preserveCardinality != null) { + opBuilder.setAttr("preserve_cardinality", opts.preserveCardinality); + } + } + } + return new MapAndBatchDataset(opBuilder.build()); + } + + /** + * Sets the preserveCardinality option. + * + * @param preserveCardinality the preserveCardinality option + * @return this Options instance. + */ + public static Options preserveCardinality(Boolean preserveCardinality) { + return new Options().preserveCardinality(preserveCardinality); + } + + /** + * 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.experimental.MapAndBatchDataset} + */ + public static class Options { + private Boolean preserveCardinality; + + private Options() { + } + + /** + * Sets the preserveCardinality option. + * + * @param preserveCardinality the preserveCardinality option + * @return this Options instance. + */ + public Options preserveCardinality(Boolean preserveCardinality) { + this.preserveCardinality = 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 new file mode 100644 index 00000000000..7c8cfafc8f4 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MapDataset.java @@ -0,0 +1,260 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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; +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 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 + */ + public static final String OP_NAME = "ExperimentalMapDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public MapDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * 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 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 + */ + @Endpoint( + describeByClass = true + ) + public static MapDataset create(Scope scope, Operand inputDataset, + Iterable> otherArguments, ConcreteFunction f, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MapDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInputList(Operands.asOutputs(otherArguments)); + opBuilder.setAttr("f", f); + 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.useInterOpParallelism != null) { + opBuilder.setAttr("use_inter_op_parallelism", opts.useInterOpParallelism); + } + 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()); + } + + /** + * Sets the useInterOpParallelism option. + * + * @param useInterOpParallelism the useInterOpParallelism option + * @return this Options instance. + */ + public static Options useInterOpParallelism(Boolean useInterOpParallelism) { + return new Options().useInterOpParallelism(useInterOpParallelism); + } + + /** + * Sets the preserveCardinality option. + * + * @param preserveCardinality the preserveCardinality option + * @return this Options instance. + */ + 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. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + /** + * Optional attributes for {@link org.tensorflow.op.data.experimental.MapDataset} + */ + public static class Options { + private Boolean useInterOpParallelism; + + private Boolean preserveCardinality; + + private Boolean forceSynchronous; + + private Options() { + } + + /** + * Sets the useInterOpParallelism option. + * + * @param useInterOpParallelism the useInterOpParallelism option + * @return this Options instance. + */ + public Options useInterOpParallelism(Boolean useInterOpParallelism) { + this.useInterOpParallelism = useInterOpParallelism; + return this; + } + + /** + * Sets the preserveCardinality option. + * + * @param preserveCardinality the preserveCardinality option + * @return this Options instance. + */ + 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 bb33854bea9..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,56 +17,91 @@ 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 { - /** - * Factory method to create a class wrapping a new MatchingFilesDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalMatchingFilesDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public MatchingFilesDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalMatchingFilesDataset operation. + * * @param scope current scope - * @param patterns + * @param patterns The patterns value * @return a new instance of MatchingFilesDataset */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static MatchingFilesDataset create(Scope scope, Operand patterns) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalMatchingFilesDataset", scope.makeOpName("MatchingFilesDataset")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MatchingFilesDataset"); opBuilder.addInput(patterns.asOutput()); - opBuilder = scope.apply(opBuilder); return new MatchingFilesDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalMatchingFilesDataset"; - - private Output handle; - - private MatchingFilesDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 37d6f3915cc..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,62 +27,115 @@ 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 { - /** - * Factory method to create a class wrapping a new MaxIntraOpParallelismDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalMaxIntraOpParallelismDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public MaxIntraOpParallelismDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalMaxIntraOpParallelismDataset operation. + * * @param scope current scope - * @param inputDataset + * @param inputDataset The inputDataset value * @param maxIntraOpParallelism Identifies the maximum intra-op parallelism to use. - * @param outputTypes - * @param outputShapes + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of MaxIntraOpParallelismDataset */ - @Endpoint(describeByClass = true) - public static MaxIntraOpParallelismDataset create(Scope scope, Operand inputDataset, Operand maxIntraOpParallelism, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalMaxIntraOpParallelismDataset", scope.makeOpName("MaxIntraOpParallelismDataset")); + @Endpoint( + describeByClass = true + ) + public static MaxIntraOpParallelismDataset create(Scope scope, + Operand inputDataset, Operand maxIntraOpParallelism, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MaxIntraOpParallelismDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(maxIntraOpParallelism.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new MaxIntraOpParallelismDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalMaxIntraOpParallelismDataset"; - - private Output handle; - - private MaxIntraOpParallelismDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 ef096a1b19f..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,58 +27,105 @@ 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 { - /** - * Factory method to create a class wrapping a new NonSerializableDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalNonSerializableDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public NonSerializableDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalNonSerializableDataset operation. + * * @param scope current scope - * @param inputDataset - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static NonSerializableDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalNonSerializableDataset", scope.makeOpName("NonSerializableDataset")); + @Endpoint( + describeByClass = true + ) + public static NonSerializableDataset create(Scope scope, Operand inputDataset, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "NonSerializableDataset"); opBuilder.addInput(inputDataset.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new NonSerializableDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalNonSerializableDataset"; - - private Output handle; - - private NonSerializableDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 new file mode 100644 index 00000000000..df03bf4d26a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ParallelInterleaveDataset.java @@ -0,0 +1,203 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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; +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.TBool; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; + +/** + * 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! + */ +@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 + */ + public static final String OP_NAME = "ExperimentalParallelInterleaveDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ParallelInterleaveDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * 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 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 + */ + @Endpoint( + describeByClass = true + ) + public static ParallelInterleaveDataset create(Scope scope, Operand inputDataset, + Iterable> otherArguments, Operand cycleLength, Operand blockLength, + Operand sloppy, Operand bufferOutputElements, + Operand prefetchInputElements, ConcreteFunction f, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ParallelInterleaveDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInputList(Operands.asOutputs(otherArguments)); + opBuilder.addInput(cycleLength.asOutput()); + opBuilder.addInput(blockLength.asOutput()); + opBuilder.addInput(sloppy.asOutput()); + opBuilder.addInput(bufferOutputElements.asOutput()); + opBuilder.addInput(prefetchInputElements.asOutput()); + opBuilder.setAttr("f", f); + 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 ParallelInterleaveDataset(opBuilder.build()); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + 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 eb9aceba455..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,68 +27,59 @@ 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; /** - * Transforms `input_dataset` containing `Example` protos as vectors of DT_STRING into a dataset of `Tensor` or `SparseTensor` objects representing the parsed features. + * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.data.experimental.ParseExampleDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param deterministic 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 `experimental_deterministic` parameter of `tf.data.Options`. - */ - public Options deterministic(String deterministic) { - this.deterministic = deterministic; - return this; - } - - /** - * @param raggedKeys - */ - public Options raggedKeys(List raggedKeys) { - this.raggedKeys = raggedKeys; - return this; - } - - private String deterministic; - private List raggedKeys; - - private Options() { - } + public static final String OP_NAME = "ExperimentalParseExampleDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ParseExampleDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ParseExampleDataset operation. - * + * Factory method to create a class wrapping a new ExperimentalParseExampleDataset operation. + * * @param scope current scope - * @param inputDataset - * @param numParallelCalls - * @param denseDefaults A dict mapping string keys to `Tensor`s. + * @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 `SparseTensor` objects. + * 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 `DTypes` of the same length as `sparse_keys`. - * Only `tf.float32` (`FloatList`), `tf.int64` (`Int64List`), - * and `tf.string` (`BytesList`) are supported. - * @param denseShapes List of tuples with the same length as `dense_keys`. - * The shape of the data for each dense feature referenced by `dense_keys`. - * Required for any input tensors identified by `dense_keys`. Must be + * @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 @@ -95,97 +88,188 @@ private Options() { * given feature along this dimension. * @param outputTypes The type list for the return values. * @param outputShapes The list of shapes being produced. - * @param raggedValueTypes - * @param raggedSplitTypes - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ParseExampleDataset */ - @Endpoint(describeByClass = true) - public static ParseExampleDataset create(Scope scope, Operand inputDataset, Operand numParallelCalls, Iterable> denseDefaults, List sparseKeys, List denseKeys, List> sparseTypes, List denseShapes, List> outputTypes, List outputShapes, List> raggedValueTypes, List> raggedSplitTypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ParseExampleDatasetV2", scope.makeOpName("ParseExampleDataset")); + @Endpoint( + describeByClass = true + ) + public static ParseExampleDataset create(Scope scope, Operand inputDataset, + Operand numParallelCalls, Iterable> denseDefaults, List sparseKeys, + List denseKeys, List> sparseTypes, List denseShapes, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ParseExampleDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(numParallelCalls.asOutput()); opBuilder.addInputList(Operands.asOutputs(denseDefaults)); - opBuilder = scope.apply(opBuilder); String[] sparseKeysArray = new String[sparseKeys.size()]; - for (int i = 0; i < sparseKeysArray.length; ++i) { + for (int i = 0 ; i < sparseKeysArray.length ; i++) { sparseKeysArray[i] = sparseKeys.get(i); } opBuilder.setAttr("sparse_keys", sparseKeysArray); String[] denseKeysArray = new String[denseKeys.size()]; - for (int i = 0; i < denseKeysArray.length; ++i) { + for (int i = 0 ; i < denseKeysArray.length ; i++) { denseKeysArray[i] = denseKeys.get(i); } opBuilder.setAttr("dense_keys", denseKeysArray); opBuilder.setAttr("sparse_types", Operands.toDataTypes(sparseTypes)); Shape[] denseShapesArray = new Shape[denseShapes.size()]; - for (int i = 0; i < denseShapesArray.length; ++i) { + for (int i = 0 ; i < denseShapesArray.length ; i++) { denseShapesArray[i] = denseShapes.get(i); } opBuilder.setAttr("dense_shapes", denseShapesArray); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); - opBuilder.setAttr("ragged_value_types", Operands.toDataTypes(raggedValueTypes)); - opBuilder.setAttr("ragged_split_types", Operands.toDataTypes(raggedSplitTypes)); if (options != null) { for (Options opts : options) { - if (opts.deterministic != null) { - opBuilder.setAttr("deterministic", opts.deterministic); - } - if (opts.raggedKeys != null) { - String[] raggedKeysArray = new String[opts.raggedKeys.size()]; - for (int i = 0; i < raggedKeysArray.length; ++i) { - raggedKeysArray[i] = opts.raggedKeys.get(i); - } - opBuilder.setAttr("ragged_keys", raggedKeysArray); + if (opts.sloppy != null) { + opBuilder.setAttr("sloppy", opts.sloppy); } } } return new ParseExampleDataset(opBuilder.build()); } - - /** - * @param deterministic 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 `experimental_deterministic` parameter of `tf.data.Options`. - */ - public static Options deterministic(String deterministic) { - return new Options().deterministic(deterministic); - } - + /** - * @param raggedKeys + * Sets the sloppy option. + * + * @param sloppy the sloppy option + * @return this Options instance. */ - public static Options raggedKeys(List raggedKeys) { - return new Options().raggedKeys(raggedKeys); + public static Options sloppy(Boolean sloppy) { + return new Options().sloppy(sloppy); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ParseExampleDatasetV2"; - - private Output handle; - - private ParseExampleDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.experimental.ParseExampleDataset} + */ + public static class Options { + private Boolean sloppy; + + private Options() { + } + + /** + * Sets the sloppy option. + * + * @param sloppy the sloppy option + * @return this Options instance. + */ + public Options sloppy(Boolean sloppy) { + this.sloppy = 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 bc0a4750675..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,62 +27,115 @@ 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 `input_dataset`. + * 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 { - /** - * Factory method to create a class wrapping a new PrivateThreadPoolDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalPrivateThreadPoolDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public PrivateThreadPoolDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalPrivateThreadPoolDataset operation. + * * @param scope current scope - * @param inputDataset + * @param inputDataset The inputDataset value * @param numThreads Identifies the number of threads to use for the private threadpool. - * @param outputTypes - * @param outputShapes + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of PrivateThreadPoolDataset */ - @Endpoint(describeByClass = true) - public static PrivateThreadPoolDataset create(Scope scope, Operand inputDataset, Operand numThreads, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalPrivateThreadPoolDataset", scope.makeOpName("PrivateThreadPoolDataset")); + @Endpoint( + describeByClass = true + ) + public static PrivateThreadPoolDataset create(Scope scope, Operand inputDataset, + Operand numThreads, List> outputTypes, + List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "PrivateThreadPoolDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(numThreads.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new PrivateThreadPoolDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalPrivateThreadPoolDataset"; - - private Output handle; - - private PrivateThreadPoolDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 435d331f68e..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,64 +27,118 @@ 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 { - /** - * Factory method to create a class wrapping a new RandomDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalRandomDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public RandomDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalRandomDataset 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 - * @param outputShapes + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of RandomDataset */ - @Endpoint(describeByClass = true) - public static RandomDataset create(Scope scope, Operand seed, Operand seed2, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalRandomDataset", scope.makeOpName("RandomDataset")); + @Endpoint( + describeByClass = true + ) + public static RandomDataset create(Scope scope, Operand seed, Operand seed2, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RandomDataset"); opBuilder.addInput(seed.asOutput()); opBuilder.addInput(seed2.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new RandomDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalRandomDataset"; - - private Output handle; - - private RandomDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 219f9bd44b4..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,61 +27,68 @@ 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 changes the batch size. - *

* 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 { - /** - * Optional attributes for {@link org.tensorflow.op.data.experimental.RebatchDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useFallback - */ - public Options useFallback(Boolean useFallback) { - this.useFallback = useFallback; - return this; - } - - private Boolean useFallback; - - private Options() { - } + public static final String OP_NAME = "ExperimentalRebatchDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public RebatchDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new RebatchDataset operation. - * + * Factory method to create a class wrapping a new ExperimentalRebatchDataset operation. + * * @param scope current scope * @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 - * @param outputShapes - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static RebatchDataset create(Scope scope, Operand inputDataset, Operand numReplicas, List> outputTypes, List outputShapes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalRebatchDataset", scope.makeOpName("RebatchDataset")); + @Endpoint( + describeByClass = true + ) + public static RebatchDataset create(Scope scope, Operand inputDataset, + Operand numReplicas, List> outputTypes, + List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RebatchDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(numReplicas.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -92,34 +101,92 @@ public static RebatchDataset create(Scope scope, Operand inputDataset, Operan } return new RebatchDataset(opBuilder.build()); } - + /** - * @param useFallback + * Sets the useFallback option. + * + * @param useFallback the useFallback option + * @return this Options instance. */ public static Options useFallback(Boolean useFallback) { return new Options().useFallback(useFallback); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalRebatchDataset"; - - private Output handle; - - private RebatchDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.experimental.RebatchDataset} + */ + public static class Options { + private Boolean useFallback; + + private Options() { + } + + /** + * Sets the useFallback option. + * + * @param useFallback the useFallback option + * @return this Options instance. + */ + public Options useFallback(Boolean useFallback) { + this.useFallback = 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 new file mode 100644 index 00000000000..782889a68ba --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ScanDataset.java @@ -0,0 +1,212 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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; +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 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 + */ + public static final String OP_NAME = "ExperimentalScanDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ScanDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * 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 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 + */ + @Endpoint( + describeByClass = true + ) + public static ScanDataset create(Scope scope, Operand inputDataset, + Iterable> initialState, Iterable> otherArguments, ConcreteFunction f, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ScanDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInputList(Operands.asOutputs(initialState)); + opBuilder.addInputList(Operands.asOutputs(otherArguments)); + opBuilder.setAttr("f", f); + 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.preserveCardinality != null) { + opBuilder.setAttr("preserve_cardinality", opts.preserveCardinality); + } + } + } + return new ScanDataset(opBuilder.build()); + } + + /** + * Sets the preserveCardinality option. + * + * @param preserveCardinality the preserveCardinality option + * @return this Options instance. + */ + public static Options preserveCardinality(Boolean preserveCardinality) { + return new Options().preserveCardinality(preserveCardinality); + } + + /** + * 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.experimental.ScanDataset} + */ + public static class Options { + private Boolean preserveCardinality; + + private Options() { + } + + /** + * Sets the preserveCardinality option. + * + * @param preserveCardinality the preserveCardinality option + * @return this Options instance. + */ + public Options preserveCardinality(Boolean preserveCardinality) { + this.preserveCardinality = 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 b87aa6597ea..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,65 +27,132 @@ 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 { - /** - * Factory method to create a class wrapping a new SetStatsAggregatorDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalSetStatsAggregatorDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public SetStatsAggregatorDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalSetStatsAggregatorDataset operation. + * * @param scope current scope - * @param inputDataset - * @param statsAggregator - * @param tag - * @param counterPrefix - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static SetStatsAggregatorDataset create(Scope scope, Operand inputDataset, Operand statsAggregator, Operand tag, Operand counterPrefix, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalSetStatsAggregatorDataset", scope.makeOpName("SetStatsAggregatorDataset")); + @Endpoint( + describeByClass = true + ) + public static SetStatsAggregatorDataset create(Scope scope, Operand inputDataset, + Operand statsAggregator, Operand tag, + Operand counterPrefix, List> outputTypes, + List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SetStatsAggregatorDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(statsAggregator.asOutput()); opBuilder.addInput(tag.asOutput()); opBuilder.addInput(counterPrefix.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new SetStatsAggregatorDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalSetStatsAggregatorDataset"; - - private Output handle; - - private SetStatsAggregatorDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 4fac4cfc637..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,61 +27,115 @@ 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 { - /** - * Factory method to create a class wrapping a new SleepDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalSleepDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public SleepDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalSleepDataset operation. + * * @param scope current scope - * @param inputDataset - * @param sleepMicroseconds - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static SleepDataset create(Scope scope, Operand inputDataset, Operand sleepMicroseconds, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalSleepDataset", scope.makeOpName("SleepDataset")); + @Endpoint( + describeByClass = true + ) + public static SleepDataset create(Scope scope, Operand inputDataset, + Operand sleepMicroseconds, List> outputTypes, + List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SleepDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(sleepMicroseconds.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new SleepDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalSleepDataset"; - - private Output handle; - - private SleepDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 85dde0defb6..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,69 +27,137 @@ 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 `input_dataset`. + * 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 { - /** - * Factory method to create a class wrapping a new SlidingWindowDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalSlidingWindowDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public SlidingWindowDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalSlidingWindowDataset operation. + * * @param scope current scope - * @param inputDataset + * @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 - * @param outputShapes + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of SlidingWindowDataset */ - @Endpoint(describeByClass = true) - public static SlidingWindowDataset create(Scope scope, Operand inputDataset, Operand windowSize, Operand windowShift, Operand windowStride, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalSlidingWindowDataset", scope.makeOpName("SlidingWindowDataset")); + @Endpoint( + describeByClass = true + ) + public static SlidingWindowDataset create(Scope scope, Operand inputDataset, + Operand windowSize, Operand windowShift, Operand windowStride, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SlidingWindowDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(windowSize.asOutput()); opBuilder.addInput(windowShift.asOutput()); opBuilder.addInput(windowStride.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new SlidingWindowDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalSlidingWindowDataset"; - - private Output handle; - - private SlidingWindowDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 6964f134918..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,64 +27,123 @@ 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 { - /** - * Factory method to create a class wrapping a new SqlDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalSqlDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public SqlDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalSqlDataset operation. + * * @param scope current scope * @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 - * @param outputShapes + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of SqlDataset */ - @Endpoint(describeByClass = true) - public static SqlDataset create(Scope scope, Operand driverName, Operand dataSourceName, Operand query, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalSqlDataset", scope.makeOpName("SqlDataset")); + @Endpoint( + describeByClass = true + ) + public static SqlDataset create(Scope scope, Operand driverName, + Operand dataSourceName, Operand query, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SqlDataset"); opBuilder.addInput(driverName.asOutput()); opBuilder.addInput(dataSourceName.asOutput()); opBuilder.addInput(query.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new SqlDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalSqlDataset"; - - private Output handle; - - private SqlDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 b0443fd6b5d..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,59 +17,58 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.data.experimental.StatsAggregatorHandle} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "ExperimentalStatsAggregatorHandle"; + + private Output handle; + + @SuppressWarnings("unchecked") + public StatsAggregatorHandle(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new StatsAggregatorHandle operation. - * + * Factory method to create a class wrapping a new ExperimentalStatsAggregatorHandle operation. + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of StatsAggregatorHandle */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static StatsAggregatorHandle create(Scope scope, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("StatsAggregatorHandleV2", scope.makeOpName("StatsAggregatorHandle")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatsAggregatorHandle"); if (options != null) { for (Options opts : options) { if (opts.container != null) { @@ -82,41 +81,95 @@ public static StatsAggregatorHandle create(Scope scope, Options... options) { } return new StatsAggregatorHandle(opBuilder.build()); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * 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 handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatsAggregatorHandleV2"; - - private Output handle; - - private StatsAggregatorHandle(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.experimental.StatsAggregatorHandle} + */ + 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; + } + } + + @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/StatsAggregatorSetSummaryWriter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/StatsAggregatorSetSummaryWriter.java deleted file mode 100644 index 12a27ab77c7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/StatsAggregatorSetSummaryWriter.java +++ /dev/null @@ -1,56 +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.experimental; - -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; - -/** - * Set a summary_writer_interface to record statistics using given stats_aggregator. - */ -public final class StatsAggregatorSetSummaryWriter extends RawOp { - - /** - * Factory method to create a class wrapping a new StatsAggregatorSetSummaryWriter operation. - * - * @param scope current scope - * @param statsAggregator - * @param summary - * @return a new instance of StatsAggregatorSetSummaryWriter - */ - @Endpoint(describeByClass = true) - public static StatsAggregatorSetSummaryWriter create(Scope scope, Operand statsAggregator, Operand summary) { - OperationBuilder opBuilder = scope.env().opBuilder("StatsAggregatorSetSummaryWriter", scope.makeOpName("StatsAggregatorSetSummaryWriter")); - opBuilder.addInput(statsAggregator.asOutput()); - opBuilder.addInput(summary.asOutput()); - opBuilder = scope.apply(opBuilder); - return new StatsAggregatorSetSummaryWriter(opBuilder.build()); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatsAggregatorSetSummaryWriter"; - - private StatsAggregatorSetSummaryWriter(Operation operation) { - super(operation); - } -} 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 d259ccd5712..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,55 +17,89 @@ 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 { - /** - * Factory method to create a class wrapping a new StatsAggregatorSummary operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalStatsAggregatorSummary"; + + private Output summary; + + public StatsAggregatorSummary(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + summary = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalStatsAggregatorSummary operation. + * * @param scope current scope - * @param iterator + * @param iterator The iterator value * @return a new instance of StatsAggregatorSummary */ - @Endpoint(describeByClass = true) - public static StatsAggregatorSummary create(Scope scope, Operand iterator) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalStatsAggregatorSummary", scope.makeOpName("StatsAggregatorSummary")); + @Endpoint( + describeByClass = true + ) + public static StatsAggregatorSummary create(Scope scope, Operand iterator) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatsAggregatorSummary"); opBuilder.addInput(iterator.asOutput()); - opBuilder = scope.apply(opBuilder); return new StatsAggregatorSummary(opBuilder.build()); } - + /** + * Gets summary. + * + * @return summary. */ public Output summary() { return summary; } - + @Override public Output asOutput() { return summary; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalStatsAggregatorSummary"; - - private Output summary; - - private StatsAggregatorSummary(Operation operation) { - super(operation); - int outputIdx = 0; - summary = operation.output(outputIdx++); + + @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 new file mode 100644 index 00000000000..2d3097055fd --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/TakeWhileDataset.java @@ -0,0 +1,159 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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; +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 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}.
  • + *
+ */ +@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 + */ + public static final String OP_NAME = "ExperimentalTakeWhileDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public TakeWhileDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalTakeWhileDataset 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 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 + */ + @Endpoint( + describeByClass = true + ) + public static TakeWhileDataset create(Scope scope, Operand inputDataset, + Iterable> otherArguments, ConcreteFunction predicate, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TakeWhileDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInputList(Operands.asOutputs(otherArguments)); + 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); + return new TakeWhileDataset(opBuilder.build()); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + 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 fb2af7e60a7..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,61 +27,114 @@ 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 `input_dataset`. + * 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 { - /** - * Factory method to create a class wrapping a new ThreadPoolDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalThreadPoolDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ThreadPoolDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalThreadPoolDataset operation. + * * @param scope current scope - * @param inputDataset + * @param inputDataset The inputDataset value * @param threadPool A resource produced by the ThreadPoolHandle op. - * @param outputTypes - * @param outputShapes + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of ThreadPoolDataset */ - @Endpoint(describeByClass = true) - public static ThreadPoolDataset create(Scope scope, Operand inputDataset, Operand threadPool, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalThreadPoolDataset", scope.makeOpName("ThreadPoolDataset")); + @Endpoint( + describeByClass = true + ) + public static ThreadPoolDataset create(Scope scope, Operand inputDataset, + Operand threadPool, List> outputTypes, + List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ThreadPoolDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(threadPool.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new ThreadPoolDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalThreadPoolDataset"; - - private Output handle; - - private ThreadPoolDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 c378b9fcf76..2022bbba44d 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,74 +17,62 @@ 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 `input_dataset`. + * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.data.experimental.ThreadPoolHandle} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param maxIntraOpParallelism The maximum degree of parallelism to use within operations that execute on this - * threadpool. - */ - public Options maxIntraOpParallelism(Long maxIntraOpParallelism) { - this.maxIntraOpParallelism = maxIntraOpParallelism; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long maxIntraOpParallelism; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "ExperimentalThreadPoolHandle"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ThreadPoolHandle(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ThreadPoolHandle operation. - * + * Factory method to create a class wrapping a new ExperimentalThreadPoolHandle operation. + * * @param scope current scope * @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 attributes values + * @param options carries optional attribute values * @return a new instance of ThreadPoolHandle */ - @Endpoint(describeByClass = true) - public static ThreadPoolHandle create(Scope scope, Long numThreads, String displayName, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalThreadPoolHandle", scope.makeOpName("ThreadPoolHandle")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static ThreadPoolHandle create(Scope scope, Long numThreads, String displayName, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ThreadPoolHandle"); opBuilder.setAttr("num_threads", numThreads); opBuilder.setAttr("display_name", displayName); if (options != null) { @@ -102,51 +90,143 @@ public static ThreadPoolHandle create(Scope scope, Long numThreads, String displ } return new ThreadPoolHandle(opBuilder.build()); } - + /** + * Sets the maxIntraOpParallelism option. + * * @param maxIntraOpParallelism The maximum degree of parallelism to use within operations that execute on this * threadpool. + * @return this Options instance. */ public static Options maxIntraOpParallelism(Long maxIntraOpParallelism) { return new Options().maxIntraOpParallelism(maxIntraOpParallelism); } - + /** - * @param container + * Sets the container option. + * + * @param container The name of {@code container} should start with {@code '.'} or {@code letter} or {@code digit}, + * with ['-', '.', '/'] or {@code letter} or {@code digit} follows several times. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * A resource that can be consumed by one or more ExperimentalThreadPoolDataset - * ops. + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalThreadPoolHandle"; - - private Output handle; - - private ThreadPoolHandle(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.experimental.ThreadPoolHandle} + */ + public static class Options { + private Long maxIntraOpParallelism; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the maxIntraOpParallelism option. + * + * @param maxIntraOpParallelism The maximum degree of parallelism to use within operations that execute on this + * threadpool. + * @return this Options instance. + */ + public Options maxIntraOpParallelism(Long maxIntraOpParallelism) { + this.maxIntraOpParallelism = maxIntraOpParallelism; + return this; + } + + /** + * Sets the container option. + * + * @param container The name of {@code container} should start with {@code '.'} or {@code letter} or {@code digit}, + * with ['-', '.', '/'] or {@code letter} or {@code digit} follows several times. + * @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; + } + } + + @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. + */ + public final String displayName; + + /** + * The name of {@code container} should start with {@code '.'} or {@code letter} or {@code digit}, + * with ['-', '.', '/'] or {@code letter} or {@code digit} follows several times. + */ + 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 c00d3fe5470..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,59 +27,105 @@ 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 { - /** - * Factory method to create a class wrapping a new UnbatchDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalUnbatchDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public UnbatchDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalUnbatchDataset operation. + * * @param scope current scope - * @param inputDataset - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static UnbatchDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalUnbatchDataset", scope.makeOpName("UnbatchDataset")); + @Endpoint( + describeByClass = true + ) + public static UnbatchDataset create(Scope scope, Operand inputDataset, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UnbatchDataset"); opBuilder.addInput(inputDataset.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new UnbatchDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalUnbatchDataset"; - - private Output handle; - - private UnbatchDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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/UncompressElement.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/UncompressElement.java deleted file mode 100644 index 36e07fe069c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/UncompressElement.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.data.experimental; - -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import org.tensorflow.Operand; -import org.tensorflow.Operation; -import org.tensorflow.OperationBuilder; -import org.tensorflow.Output; -import org.tensorflow.ndarray.Shape; -import org.tensorflow.op.Operands; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.family.TType; - -/** - * Uncompresses a compressed dataset element. - */ -public final class UncompressElement extends RawOp implements Iterable> { - - /** - * Factory method to create a class wrapping a new UncompressElement operation. - * - * @param scope current scope - * @param compressed - * @param outputTypes - * @param outputShapes - * @return a new instance of UncompressElement - */ - @Endpoint(describeByClass = true) - public static UncompressElement create(Scope scope, Operand compressed, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("UncompressElement", scope.makeOpName("UncompressElement")); - opBuilder.addInput(compressed.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); - Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { - outputShapesArray[i] = outputShapes.get(i); - } - opBuilder.setAttr("output_shapes", outputShapesArray); - return new UncompressElement(opBuilder.build()); - } - - /** - */ - public List> components() { - return components; - } - - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { - return (Iterator) components.iterator(); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UncompressElement"; - - private List> components; - - private UncompressElement(Operation operation) { - super(operation); - int outputIdx = 0; - int componentsLength = operation.outputListLength("components"); - components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); - outputIdx += componentsLength; - } -} 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 6461c5afafa..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,59 +27,105 @@ 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 `input_dataset`. + * 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 { - /** - * Factory method to create a class wrapping a new UniqueDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalUniqueDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public UniqueDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalUniqueDataset operation. + * * @param scope current scope - * @param inputDataset - * @param outputTypes - * @param outputShapes + * @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(describeByClass = true) - public static UniqueDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalUniqueDataset", scope.makeOpName("UniqueDataset")); + @Endpoint( + describeByClass = true + ) + public static UniqueDataset create(Scope scope, Operand inputDataset, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UniqueDataset"); opBuilder.addInput(inputDataset.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new UniqueDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalUniqueDataset"; - - private Output handle; - - private UniqueDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + @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 a24bde53102..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,64 +17,109 @@ 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; /** * Checks a tensor for NaN, -Inf and +Inf values. - *

- * When run, reports an `InvalidArgument` error if `tensor` has any values - * that are not a number (NaN) or infinity (Inf). Otherwise, passes `tensor` as-is. - * Unlike CheckNumerics (V1), CheckNumericsV2 distinguishes -Inf and +Inf in the - * errors it throws. - * - * @param data type for {@code output()} output + * 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. */ +@OpMetadata( + opType = CheckNumerics.OP_NAME, + inputsClass = CheckNumerics.Inputs.class +) +@Operator( + group = "debugging" +) public final class CheckNumerics extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new CheckNumerics operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CheckNumericsV2"; + + private Output output; + + public CheckNumerics(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new CheckNumericsV2 operation. + * * @param scope current scope - * @param tensor + * @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 */ - @Endpoint(describeByClass = true) - public static CheckNumerics create(Scope scope, Operand tensor, String message) { - OperationBuilder opBuilder = scope.env().opBuilder("CheckNumericsV2", scope.makeOpName("CheckNumerics")); + @Endpoint( + describeByClass = true + ) + public static CheckNumerics create(Scope scope, Operand tensor, + String message) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CheckNumerics"); opBuilder.addInput(tensor.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("message", message); - return new CheckNumerics(opBuilder.build()); + return new CheckNumerics<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CheckNumericsV2"; - - private Output output; - - private CheckNumerics(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 f5357beefd9..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,61 +17,95 @@ 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.Operator; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Identity op for gradient debugging. - *

* 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 + */ + public static final String OP_NAME = "DebugGradientIdentity"; + + private Output output; + + public DebugGradientIdentity(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DebugGradientIdentity operation. - * + * * @param scope current scope - * @param input + * @param input The input value + * @param data type for {@code DebugGradientIdentity} output and operands * @return a new instance of DebugGradientIdentity */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DebugGradientIdentity create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("DebugGradientIdentity", scope.makeOpName("DebugGradientIdentity")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DebugGradientIdentity"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new DebugGradientIdentity(opBuilder.build()); + return new DebugGradientIdentity<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DebugGradientIdentity"; - - private Output output; - - private DebugGradientIdentity(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 6d980f76706..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,61 +17,96 @@ 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.Operator; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Identity op for gradient debugging. - *

* 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 + */ + public static final String OP_NAME = "DebugGradientRefIdentity"; + + private Output output; + + public DebugGradientRefIdentity(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DebugGradientRefIdentity operation. - * + * * @param scope current scope - * @param input + * @param input The input value + * @param data type for {@code DebugGradientRefIdentity} output and operands * @return a new instance of DebugGradientRefIdentity */ - @Endpoint(describeByClass = true) - public static DebugGradientRefIdentity create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("DebugGradientRefIdentity", scope.makeOpName("DebugGradientRefIdentity")); + @Endpoint( + describeByClass = true + ) + public static DebugGradientRefIdentity create(Scope scope, + Operand input) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DebugGradientRefIdentity"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new DebugGradientRefIdentity(opBuilder.build()); + return new DebugGradientRefIdentity<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DebugGradientRefIdentity"; - - private Output output; - - private DebugGradientRefIdentity(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 ea516aac2e6..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. @@ -17,226 +17,377 @@ package org.tensorflow.op.debugging; +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.Operator; +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 { - /** - * Optional attributes for {@link org.tensorflow.op.debugging.DebugIdentity} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tfdbgContextId A tfdbg-generated ID for the context that the op belongs to, - * e.g., a concrete compiled tf.function. - */ - public Options tfdbgContextId(String tfdbgContextId) { - this.tfdbgContextId = tfdbgContextId; - return this; - } - - /** - * @param opName Optional. Name of the op that the debug op is concerned with. - * Used only for single-tensor trace. - */ - public Options opName(String opName) { - this.opName = opName; - return this; - } - - /** - * @param outputSlot Optional. Output slot index of the tensor that the debug op - * is concerned with. Used only for single-tensor trace. - */ - public Options outputSlot(Long outputSlot) { - this.outputSlot = outputSlot; - return this; - } - - /** - * @param tensorDebugMode TensorDebugMode enum value. See debug_event.proto for details. - */ - public Options tensorDebugMode(Long tensorDebugMode) { - this.tensorDebugMode = tensorDebugMode; - return this; - } - - /** - * @param debugUrls List of URLs to debug targets, e.g., file:///foo/tfdbg_dump. - */ - public Options debugUrls(List debugUrls) { - this.debugUrls = debugUrls; - return this; - } - - /** - * @param circularBufferSize - */ - public Options circularBufferSize(Long circularBufferSize) { - this.circularBufferSize = circularBufferSize; - return this; - } - - /** - * @param tfdbgRunId - */ - public Options tfdbgRunId(String tfdbgRunId) { - this.tfdbgRunId = tfdbgRunId; - return this; - } - - private String tfdbgContextId; - private String opName; - private Long outputSlot; - private Long tensorDebugMode; - private List debugUrls; - private Long circularBufferSize; - private String tfdbgRunId; - - private Options() { - } + public static final String OP_NAME = "DebugIdentityV3"; + + private Output output; + + public DebugIdentity(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new DebugIdentity 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code DebugIdentityV3} output and operands * @return a new instance of DebugIdentity */ - @Endpoint(describeByClass = true) - public static DebugIdentity create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DebugIdentityV2", scope.makeOpName("DebugIdentity")); + @Endpoint( + describeByClass = true + ) + public static DebugIdentity create(Scope scope, Operand input, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DebugIdentity"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); 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.tensorName != null) { + opBuilder.setAttr("tensor_name", opts.tensorName); } - if (opts.opName != null) { - opBuilder.setAttr("op_name", opts.opName); + if (opts.ioOfNode != null) { + opBuilder.setAttr("io_of_node", opts.ioOfNode); } - if (opts.outputSlot != null) { - opBuilder.setAttr("output_slot", opts.outputSlot); + if (opts.isInput != null) { + opBuilder.setAttr("is_input", opts.isInput); } - if (opts.tensorDebugMode != null) { - opBuilder.setAttr("tensor_debug_mode", opts.tensorDebugMode); + if (opts.ioIndex != null) { + opBuilder.setAttr("io_index", opts.ioIndex); } if (opts.debugUrls != null) { String[] debugUrlsArray = new String[opts.debugUrls.size()]; - for (int i = 0; i < debugUrlsArray.length; ++i) { + for (int i = 0 ; i < debugUrlsArray.length ; i++) { debugUrlsArray[i] = opts.debugUrls.get(i); } 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); } } } - return new DebugIdentity(opBuilder.build()); + return new DebugIdentity<>(opBuilder.build()); } - + /** - * @param tfdbgContextId A tfdbg-generated ID for the context that the op belongs to, - * e.g., a concrete compiled tf.function. + * Sets the deviceName option. + * + * @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); } - + /** - * @param opName Optional. Name of the op that the debug op is concerned with. - * Used only for single-tensor trace. + * Sets the tensorName option. + * + * @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); } - + /** - * @param outputSlot Optional. Output slot index of the tensor that the debug op - * is concerned with. Used only for single-tensor trace. + * Sets the ioOfNode option. + * + * @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); } - + /** - * @param tensorDebugMode TensorDebugMode enum value. See debug_event.proto for details. + * Sets the isInput option. + * + * @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 ioIndex option. + * + * @param ioIndex The index of which the tensor is an input or output of the node. + * @return this Options instance. + */ + public static Options ioIndex(Long ioIndex) { + return new Options().ioIndex(ioIndex); + } + /** - * @param debugUrls List of URLs to debug targets, e.g., file:///foo/tfdbg_dump. + * Sets the debugUrls 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 debugUrls(List debugUrls) { return new Options().debugUrls(debugUrls); } - + /** - * @param circularBufferSize + * Sets the debugUrls 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); } - + /** - * @param tfdbgRunId + * Sets the gatedGrpc 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); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DebugIdentityV2"; - - private Output output; - - private DebugIdentity(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.debugging.DebugIdentity} + */ + public static class Options { + private String deviceName; + + private String tensorName; + + private String ioOfNode; + + private Boolean isInput; + + private Long ioIndex; + + private List debugUrls; + + private Boolean gatedGrpc; + + private Options() { + } + + /** + * Sets the deviceName option. + * + * @param deviceName Name of the device on which the tensor resides. + * @return this Options instance. + */ + public Options deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + /** + * Sets the tensorName option. + * + * @param tensorName Name of the input tensor. + * @return this Options instance. + */ + public Options tensorName(String tensorName) { + this.tensorName = tensorName; + return this; + } + + /** + * Sets the ioOfNode option. + * + * @param ioOfNode Name of the node of which the tensor is an input or output. + * @return this Options instance. + */ + public Options ioOfNode(String ioOfNode) { + this.ioOfNode = ioOfNode; + return this; + } + + /** + * Sets the isInput option. + * + * @param isInput If true, the tensor is an input of the node; otherwise the output. + * @return this Options instance. + */ + 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, grpc:://localhost:11011 + * @return this Options instance. + */ + public Options debugUrls(List debugUrls) { + this.debugUrls = debugUrls; + return this; + } + + /** + * Sets the debugUrls option. + * + * @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) { + this.debugUrls = Arrays.asList(debugUrls); + return this; + } + + /** + * Sets the gatedGrpc 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 gatedGrpc(Boolean gatedGrpc) { + this.gatedGrpc = gatedGrpc; + return this; + } + } + + @OpInputsMetadata( + outputsClass = DebugIdentity.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Input tensor, non-Reference type + */ + 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 0c3648fcc53..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. @@ -17,90 +17,60 @@ package org.tensorflow.op.debugging; +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.Operator; +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; /** * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.debugging.DebugNanCount} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param deviceName - */ - public Options deviceName(String deviceName) { - this.deviceName = deviceName; - return this; - } - - /** - * @param tensorName Name of the input tensor. - */ - public Options tensorName(String tensorName) { - this.tensorName = tensorName; - return this; - } - - /** - * @param debugUrls List of URLs to debug targets, e.g., - * file:///foo/tfdbg_dump, grpc:://localhost:11011. - */ - public Options debugUrls(List debugUrls) { - this.debugUrls = debugUrls; - return this; - } - - /** - * @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. - */ - public Options gatedGrpc(Boolean gatedGrpc) { - this.gatedGrpc = gatedGrpc; - return this; - } - - private String deviceName; - private String tensorName; - private List debugUrls; - private Boolean gatedGrpc; - - private Options() { - } + public static final String OP_NAME = "DebugNanCount"; + + private Output output; + + public DebugNanCount(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DebugNanCount operation. - * + * * @param scope current scope * @param input Input tensor, non-Reference type. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of DebugNanCount */ - @Endpoint(describeByClass = true) - public static DebugNanCount create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DebugNanCount", scope.makeOpName("DebugNanCount")); + @Endpoint( + describeByClass = true + ) + public static DebugNanCount create(Scope scope, Operand input, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DebugNanCount"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.deviceName != null) { @@ -111,7 +81,7 @@ public static DebugNanCount create(Scope scope, Operand input, } if (opts.debugUrls != null) { String[] debugUrlsArray = new String[opts.debugUrls.size()]; - for (int i = 0; i < debugUrlsArray.length; ++i) { + for (int i = 0 ; i < debugUrlsArray.length ; i++) { debugUrlsArray[i] = opts.debugUrls.get(i); } opBuilder.setAttr("debug_urls", debugUrlsArray); @@ -123,60 +93,205 @@ public static DebugNanCount create(Scope scope, Operand input, } return new DebugNanCount(opBuilder.build()); } - + /** - * @param deviceName + * Sets the deviceName option. + * + * @param deviceName the deviceName option + * @return this Options instance. */ public static Options deviceName(String deviceName) { return new Options().deviceName(deviceName); } - + /** + * Sets the tensorName option. + * * @param tensorName Name of the input tensor. + * @return this Options instance. */ public static Options tensorName(String tensorName) { return new Options().tensorName(tensorName); } - + /** + * Sets the debugUrls option. + * * @param debugUrls List of URLs to debug targets, e.g., - * file:///foo/tfdbg_dump, grpc:://localhost:11011. + * file:///foo/tfdbg_dump, grpc:://localhost:11011. + * @return this Options instance. */ public static Options debugUrls(List debugUrls) { return new Options().debugUrls(debugUrls); } - + + /** + * Sets the debugUrls 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 debugUrls(String... debugUrls) { + return new Options().debugUrls(debugUrls); + } + /** - * @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. + * Sets the gatedGrpc 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 gatedGrpc(Boolean gatedGrpc) { return new Options().gatedGrpc(gatedGrpc); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DebugNanCount"; - - private Output output; - - private DebugNanCount(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.debugging.DebugNanCount} + */ + public static class Options { + private String deviceName; + + private String tensorName; + + private List debugUrls; + + private Boolean gatedGrpc; + + private Options() { + } + + /** + * Sets the deviceName option. + * + * @param deviceName the deviceName option + * @return this Options instance. + */ + public Options deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + /** + * Sets the tensorName option. + * + * @param tensorName Name of the input tensor. + * @return this Options instance. + */ + public Options tensorName(String tensorName) { + this.tensorName = tensorName; + return this; + } + + /** + * Sets the debugUrls option. + * + * @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) { + this.debugUrls = debugUrls; + return this; + } + + /** + * Sets the debugUrls option. + * + * @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) { + this.debugUrls = Arrays.asList(debugUrls); + return this; + } + + /** + * Sets the gatedGrpc 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 gatedGrpc(Boolean gatedGrpc) { + this.gatedGrpc = 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 7482e821f72..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,125 +17,65 @@ 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.Operator; +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; /** * Debug Numeric Summary V2 Op. - *

* 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 { - /** - * Optional attributes for {@link org.tensorflow.op.debugging.DebugNumericsSummary} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tensorDebugMode 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 Options tensorDebugMode(Long tensorDebugMode) { - this.tensorDebugMode = tensorDebugMode; - return this; - } - - /** - * @param tensorId Optional. An integer identifier for the tensor being summarized by this op. - */ - public Options tensorId(Long tensorId) { - this.tensorId = tensorId; - return this; - } - - private Long tensorDebugMode; - private Long tensorId; - - private Options() { - } + public static final String OP_NAME = "DebugNumericSummaryV2"; + + private Output output; + + public DebugNumericsSummary(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new DebugNumericsSummary operation. - * + * Factory method to create a class wrapping a new DebugNumericSummaryV2 operation. + * * @param scope current scope * @param input Input tensor, to be summarized by the op. * @param outputDtype Optional. The type of the output. Can be float32 or float64 (default: float32). - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code DebugNumericSummaryV2} output and operands * @return a new instance of DebugNumericsSummary */ - @Endpoint(describeByClass = true) - public static DebugNumericsSummary create(Scope scope, Operand input, Class outputDtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DebugNumericSummaryV2", scope.makeOpName("DebugNumericsSummary")); + @Endpoint( + describeByClass = true + ) + public static DebugNumericsSummary create(Scope scope, + Operand input, Class outputDtype, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DebugNumericsSummary"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_dtype", Operands.toDataType(outputDtype)); if (options != null) { for (Options opts : options) { @@ -147,108 +87,271 @@ public static DebugNumericsSummary create(Scope scope, Op } } } - return new DebugNumericsSummary(opBuilder.build()); + return new DebugNumericsSummary<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new DebugNumericsSummary operation using default output types. - * + * Factory method to create a class wrapping a new DebugNumericSummaryV2 operation, with the default output types. + * * @param scope current scope * @param input Input tensor, to be summarized by the op. - * @param options carries optional attributes values - * @return a new instance of DebugNumericsSummary + * @param options carries optional attribute values + * @return a new instance of DebugNumericsSummary, with default output types */ - @Endpoint(describeByClass = true) - public static DebugNumericsSummary create(Scope scope, Operand input, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DebugNumericsSummary create(Scope scope, Operand input, + Options... options) { return create(scope, input, TFloat32.class, options); } - + /** + * Sets the tensorDebugMode option. + * * @param tensorDebugMode 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. + * 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. + * @return this Options instance. */ public static Options tensorDebugMode(Long tensorDebugMode) { return new Options().tensorDebugMode(tensorDebugMode); } - + /** + * Sets the tensorId option. + * * @param tensorId Optional. An integer identifier for the tensor being summarized by this op. + * @return this Options instance. */ public static Options tensorId(Long tensorId) { return new Options().tensorId(tensorId); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DebugNumericSummaryV2"; - - private Output output; - - private DebugNumericsSummary(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.debugging.DebugNumericsSummary} + */ + public static class Options { + private Long tensorDebugMode; + + private Long tensorId; + + private Options() { + } + + /** + * Sets the tensorDebugMode option. + * + * @param tensorDebugMode 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. + * @return this Options instance. + */ + public Options tensorDebugMode(Long tensorDebugMode) { + this.tensorDebugMode = tensorDebugMode; + return this; + } + + /** + * Sets the tensorId option. + * + * @param tensorId Optional. An integer identifier for the tensor being summarized by this op. + * @return this Options instance. + */ + public Options tensorId(Long tensorId) { + this.tensorId = 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 8eacb80357a..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,76 +17,131 @@ 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; /** * Outputs a tensor containing the reduction across all input tensors. - *

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

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

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 `num_devices` 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. * 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 + */ + public static final String OP_NAME = "NcclAllReduce"; + + private Output data; + + public NcclAllReduce(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + data = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NcclAllReduce operation. - * + * * @param scope current scope - * @param input - * @param reduction - * @param numDevices - * @param sharedName + * @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 */ - @Endpoint(describeByClass = true) - public static NcclAllReduce create(Scope scope, Operand input, String reduction, Long numDevices, String sharedName) { - OperationBuilder opBuilder = scope.env().opBuilder("NcclAllReduce", scope.makeOpName("NcclAllReduce")); + @Endpoint( + describeByClass = true + ) + public static NcclAllReduce create(Scope scope, Operand input, + String reduction, Long numDevices, String sharedName) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "NcclAllReduce"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("reduction", reduction); opBuilder.setAttr("num_devices", numDevices); opBuilder.setAttr("shared_name", sharedName); - return new NcclAllReduce(opBuilder.build()); + return new NcclAllReduce<>(opBuilder.build()); } - + /** + * Gets data. + * + * @return data. */ public Output data() { return data; } - + @Override public Output asOutput() { return data; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NcclAllReduce"; - - private Output data; - - private NcclAllReduce(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); + + @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 9a0557fb6e8..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,70 +17,112 @@ 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; /** - * Sends `input` to all devices that are connected to the output. - *

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

- * The graph should be constructed so that all ops connected to the output have a + * 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. + *

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 + */ + public static final String OP_NAME = "NcclBroadcast"; + + private Output output; + + public NcclBroadcast(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NcclBroadcast operation. - * + * * @param scope current scope - * @param input - * @param shape + * @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 */ - @Endpoint(describeByClass = true) - public static NcclBroadcast create(Scope scope, Operand input, Shape shape) { - OperationBuilder opBuilder = scope.env().opBuilder("NcclBroadcast", scope.makeOpName("NcclBroadcast")); + @Endpoint( + describeByClass = true + ) + public static NcclBroadcast create(Scope scope, Operand input, + Shape shape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "NcclBroadcast"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("shape", shape); - return new NcclBroadcast(opBuilder.build()); + return new NcclBroadcast<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NcclBroadcast"; - - private Output output; - - private NcclBroadcast(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 cc0c25b3c5a..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,69 +17,114 @@ 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; /** - * Reduces `input` from `num_devices` using `reduction` to a single device. - *

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

- * The graph should be constructed so that all inputs have a valid device + * 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 `num_devices` 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 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 + */ + public static final String OP_NAME = "NcclReduce"; + + private Output data; + + public NcclReduce(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + data = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NcclReduce operation. - * + * * @param scope current scope - * @param input - * @param reduction + * @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 */ - @Endpoint(describeByClass = true) - public static NcclReduce create(Scope scope, Iterable> input, String reduction) { - OperationBuilder opBuilder = scope.env().opBuilder("NcclReduce", scope.makeOpName("NcclReduce")); + @Endpoint( + describeByClass = true + ) + public static NcclReduce create(Scope scope, Iterable> input, + String reduction) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "NcclReduce"); opBuilder.addInputList(Operands.asOutputs(input)); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("reduction", reduction); - return new NcclReduce(opBuilder.build()); + return new NcclReduce<>(opBuilder.build()); } - + /** + * Gets data. + * + * @return data. */ public Output data() { return data; } - + @Override public Output asOutput() { return data; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NcclReduce"; - - private Output data; - - private NcclReduce(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); + + @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 90405452574..463a55959d4 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,109 +17,76 @@ 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; /** * 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) + *

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

- * Examples: - *

- * >>> tf.strings.as_string([3, 2]) - * - * >>> tf.strings.as_string([3.1415926, 2.71828], precision=2).numpy() + *

Examples: + *

+ *
+ *
+ *

tf.strings.as_string([3, 2]) + * <tf.Tensor: shape=(2,), dtype=string, numpy=array([b'3', b'2'], dtype=object)> + * tf.strings.as_string([3.1415926, 2.71828], precision=2).numpy() * array([b'3.14', b'2.72'], dtype=object) + *

+ *
+ *
*/ -@Operator(group = "dtypes") +@OpMetadata( + opType = AsString.OP_NAME, + inputsClass = AsString.Inputs.class +) +@Operator( + group = "dtypes" +) public final class AsString extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.dtypes.AsString} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param precision The post-decimal precision to use for floating point numbers. - * Only used if precision > -1. - */ - public Options precision(Long precision) { - this.precision = precision; - return this; - } - - /** - * @param scientific Use scientific notation for floating point numbers. - */ - public Options scientific(Boolean scientific) { - this.scientific = scientific; - return this; - } - - /** - * @param shortest Use shortest representation (either scientific or standard) for - * floating point numbers. - */ - public Options shortest(Boolean shortest) { - this.shortest = shortest; - return this; - } - - /** - * @param width Pad pre-decimal numbers to this width. - * Applies to both floating point and integer numbers. - * Only used if width > -1. - */ - public Options width(Long width) { - this.width = width; - return this; - } - - /** - * @param fill 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 Options fill(String fill) { - this.fill = fill; - return this; - } - - private Long precision; - private Boolean scientific; - private Boolean shortest; - private Long width; - private String fill; - - private Options() { - } + public static final String OP_NAME = "AsString"; + + private Output output; + + public AsString(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new AsString operation. - * + * * @param scope current scope - * @param input - * @param options carries optional attributes values + * @param input The input value + * @param options carries optional attribute values * @return a new instance of AsString */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static AsString create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("AsString", scope.makeOpName("AsString")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AsString"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.precision != null) { @@ -141,66 +108,214 @@ public static AsString create(Scope scope, Operand input, Optio } return new AsString(opBuilder.build()); } - + /** + * Sets the precision option. + * * @param precision The post-decimal precision to use for floating point numbers. - * Only used if precision > -1. + * Only used if precision > -1. + * @return this Options instance. */ public static Options precision(Long precision) { return new Options().precision(precision); } - + /** + * Sets the scientific option. + * * @param scientific Use scientific notation for floating point numbers. + * Can't be specified to {@code True} when {@code shortest} is set to {@code True}. + * @return this Options instance. */ public static Options scientific(Boolean scientific) { return new Options().scientific(scientific); } - + /** + * Sets the shortest option. + * * @param shortest Use shortest representation (either scientific or standard) for * floating point numbers. + * Can't be specified to {@code True} when {@code scientific} is set to {@code True}. + * @return this Options instance. */ public static Options shortest(Boolean shortest) { return new Options().shortest(shortest); } - + /** + * Sets the width option. + * * @param width Pad pre-decimal numbers to this width. * Applies to both floating point and integer numbers. - * Only used if width > -1. + * Only used if width > -1. + * @return this Options instance. */ public static Options width(Long width) { return new Options().width(width); } - + /** - * @param fill The value to pad if width > -1. If empty, pads with spaces. + * Sets the fill option. + * + * @param fill The value to pad if width > -1. If empty, pads with spaces. * Another typical value is '0'. String cannot be longer than 1 character. + * @return this Options instance. */ public static Options fill(String fill) { return new Options().fill(fill); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AsString"; - - private Output output; - - private AsString(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.dtypes.AsString} + */ + public static class Options { + private Long precision; + + private Boolean scientific; + + private Boolean shortest; + + private Long width; + + private String fill; + + private Options() { + } + + /** + * Sets the precision option. + * + * @param precision The post-decimal precision to use for floating point numbers. + * Only used if precision > -1. + * @return this Options instance. + */ + public Options precision(Long precision) { + this.precision = precision; + return this; + } + + /** + * Sets the scientific option. + * + * @param scientific Use scientific notation for floating point numbers. + * Can't be specified to {@code True} when {@code shortest} is set to {@code True}. + * @return this Options instance. + */ + public Options scientific(Boolean scientific) { + this.scientific = scientific; + return this; + } + + /** + * Sets the shortest option. + * + * @param shortest Use shortest representation (either scientific or standard) for + * floating point numbers. + * Can't be specified to {@code True} when {@code scientific} is set to {@code True}. + * @return this Options instance. + */ + public Options shortest(Boolean shortest) { + this.shortest = shortest; + return this; + } + + /** + * Sets the width option. + * + * @param width Pad pre-decimal numbers to this width. + * Applies to both floating point and integer numbers. + * Only used if width > -1. + * @return this Options instance. + */ + public Options width(Long width) { + this.width = width; + return this; + } + + /** + * Sets the fill option. + * + * @param fill The value to pad if width > -1. If empty, pads with spaces. + * Another typical value is '0'. String cannot be longer than 1 character. + * @return this Options instance. + */ + public Options fill(String fill) { + this.fill = 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. + * Can't be specified to {@code True} when {@code shortest} is set to {@code True}. + */ + public final boolean scientific; + + /** + * Use shortest representation (either scientific or standard) for + * floating point numbers. + * Can't be specified to {@code True} when {@code scientific} is set to {@code True}. + */ + 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 06fe5919afd..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,58 +17,64 @@ 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 */ -@Operator(group = "dtypes") +@OpMetadata( + opType = Cast.OP_NAME, + inputsClass = Cast.Inputs.class +) +@Operator( + group = "dtypes" +) public final class Cast extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.dtypes.Cast} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param Truncate - */ - public Options Truncate(Boolean Truncate) { - this.Truncate = Truncate; - return this; - } - - private Boolean Truncate; - - private Options() { - } + public static final String OP_NAME = "Cast"; + + private Output y; + + public Cast(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Cast operation. - * + * * @param scope current scope - * @param x - * @param DstT - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static Cast create(Scope scope, Operand x, Class DstT, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Cast", scope.makeOpName("Cast")); + @Endpoint( + describeByClass = true + ) + public static Cast create(Scope scope, Operand x, + Class DstT, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Cast"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("DstT", Operands.toDataType(DstT)); if (options != null) { for (Options opts : options) { @@ -77,35 +83,85 @@ public static Cast create(Scope scope, Operand(opBuilder.build()); + return new Cast<>(opBuilder.build()); } - + /** - * @param Truncate + * Sets the Truncate option. + * + * @param Truncate the Truncate option + * @return this Options instance. */ public static Options Truncate(Boolean Truncate) { return new Options().Truncate(Truncate); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Cast"; - - private Output y; - - private Cast(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.dtypes.Cast} + */ + public static class Options { + private Boolean Truncate; + + private Options() { + } + + /** + * Sets the Truncate option. + * + * @param Truncate the Truncate option + * @return this Options instance. + */ + public Options Truncate(Boolean Truncate) { + this.Truncate = 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 126d26f5945..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,79 +17,127 @@ 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; /** * Converts two real numbers to a complex number. - *

- * Given a tensor `real` representing the real part of a complex number, and a - * tensor `imag` representing the imaginary part of a complex number, this - * operation returns complex numbers elementwise of the form \\(a + bj\\), where - * a represents the `real` part and b represents the `imag` part. - *

- * The input tensors `real` and `imag` must have the same shape. - *

- * For example: - *

{@code
+ * Given a tensor {@code real} representing the real part of a complex number, and a
+ * tensor {@code imag} representing the imaginary part of a complex number, this
+ * operation returns complex numbers elementwise of the form \(a + bj\), where
+ * a represents the {@code real} part and b represents the {@code imag} part.
+ * 

The input tensors {@code real} and {@code imag} must have the same shape. + *

For example: + *

  * # tensor 'real' is [2.25, 3.25]
  * # 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 + * tf.complex(real, imag) ==> [[2.25 + 4.75j], [3.25 + 5.75j]] + *
*/ -@Operator(group = "dtypes") +@OpMetadata( + opType = Complex.OP_NAME, + inputsClass = Complex.Inputs.class +) +@Operator( + group = "dtypes" +) public final class Complex extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Complex"; + + private Output out; + + public Complex(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Complex operation. - * + * * @param scope current scope - * @param real - * @param imag - * @param Tout + * @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 */ - @Endpoint(describeByClass = true) - public static Complex create(Scope scope, Operand real, Operand imag, Class Tout) { - OperationBuilder opBuilder = scope.env().opBuilder("Complex", scope.makeOpName("Complex")); + @Endpoint( + describeByClass = true + ) + public static Complex create(Scope scope, Operand real, + Operand imag, Class Tout) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Complex"); opBuilder.addInput(real.asOutput()); opBuilder.addInput(imag.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tout", Operands.toDataType(Tout)); - return new Complex(opBuilder.build()); + return new Complex<>(opBuilder.build()); } - + /** + * Gets out. + * + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Complex"; - - private Output out; - - private Complex(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + @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 32b0e91eca4..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,69 +17,111 @@ 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; /** * 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 + *

    + *
  • + *

    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. */ +@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 + */ + public static final String OP_NAME = "ToBool"; + + private Output output; + + public ToBool(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ToBool operation. - * + * * @param scope current scope - * @param input + * @param input The input value * @return a new instance of ToBool */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ToBool create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("ToBool", scope.makeOpName("ToBool")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ToBool"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); return new ToBool(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ToBool"; - - private Output output; - - private ToBool(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 5991fee593d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesAggregateStats.java +++ /dev/null @@ -1,86 +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.op.annotation.Operator; -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 { - - /** - * 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.env().opBuilder("BoostedTreesAggregateStats", scope.makeOpName("BoostedTreesAggregateStats")); - opBuilder.addInput(nodeIds.asOutput()); - opBuilder.addInput(gradients.asOutput()); - opBuilder.addInput(hessians.asOutput()); - opBuilder.addInput(feature.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("max_splits", maxSplits); - opBuilder.setAttr("num_buckets", numBuckets); - return new BoostedTreesAggregateStats(opBuilder.build()); - } - - /** - * output Rank 4 Tensor (shape=[splits, feature_dimension, buckets, logits_dimension + hessian_dimension]) - * containing accumulated stats for each node, feature dimension and bucket. - */ - public Output statsSummary() { - return statsSummary; - } - - @Override - public Output asOutput() { - return statsSummary; - } - - /** 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++); - } -} 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 6bf473c044a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesBucketize.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 java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import org.tensorflow.Operand; -import org.tensorflow.Operation; -import org.tensorflow.OperationBuilder; -import org.tensorflow.Output; -import org.tensorflow.op.Operands; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.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> { - - /** - * 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.env().opBuilder("BoostedTreesBucketize", scope.makeOpName("BoostedTreesBucketize")); - opBuilder.addInputList(Operands.asOutputs(floatValues)); - opBuilder.addInputList(Operands.asOutputs(bucketBoundaries)); - opBuilder = scope.apply(opBuilder); - return new BoostedTreesBucketize(opBuilder.build()); - } - - /** - * int; List of Rank 1 Tensors each containing the bucketized values for a single feature. - */ - public List> buckets() { - return buckets; - } - - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { - return (Iterator) buckets.iterator(); - } - - /** 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; - } -} 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 757c198e1a3..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestFeatureSplit.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.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.op.annotation.Operator; -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 `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 { - - /** - * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesCalculateBestFeatureSplit} - */ - public static class Options { - - /** - * @param splitType A string indicating if this Op should perform inequality split or equality split. - */ - public Options splitType(String splitType) { - this.splitType = splitType; - return this; - } - - private String splitType; - - private Options() { - } - } - - /** - * 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 `stats_summary_list`. The nodes are iterated between the two nodes specified by the tensor, as like `for node_id in range(node_id_range[0], node_id_range[1])` (Note that the last index node_id_range[1] is exclusive). - * @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 attributes 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.env().opBuilder("BoostedTreesCalculateBestFeatureSplit", scope.makeOpName("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 = scope.apply(opBuilder); - 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()); - } - - /** - * @param splitType A string indicating if this Op should perform inequality split or equality split. - */ - public static Options splitType(String splitType) { - return new Options().splitType(splitType); - } - - /** - * 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. - */ - public Output nodeIds() { - return nodeIds; - } - - /** - * A Rank 1 tensors indicating the best gains for each feature to split for certain nodes. See above for details like shapes and sizes. - */ - public Output gains() { - return gains; - } - - /** - * 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. - */ - public Output featureDimensions() { - return featureDimensions; - } - - /** - * 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. - */ - public Output thresholds() { - return thresholds; - } - - /** - * 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. - */ - public Output leftNodeContribs() { - return leftNodeContribs; - } - - /** - * A Rank 2 tensors, with the same shape/conditions as left_node_contribs_list, but just that the value is for the right node. - */ - public Output rightNodeContribs() { - return rightNodeContribs; - } - - /** - * 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. - */ - public Output splitWithDefaultDirections() { - return splitWithDefaultDirections; - } - - /** 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++); - } -} 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 dee309bbc36..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestFeatureSplitV2.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.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.op.annotation.Operator; -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 `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 { - - /** - * 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 `stats_summary_list`. The nodes are iterated between the two nodes specified by the tensor, as like `for node_id in range(node_id_range[0], node_id_range[1])` (Note that the last index node_id_range[1] is exclusive). - * @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.env().opBuilder("BoostedTreesCalculateBestFeatureSplitV2", scope.makeOpName("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 = scope.apply(opBuilder); - opBuilder.setAttr("logits_dimension", logitsDimension); - return new BoostedTreesCalculateBestFeatureSplitV2(opBuilder.build()); - } - - /** - * 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. - */ - public Output nodeIds() { - return nodeIds; - } - - /** - * A Rank 1 tensor indicating the best gains for each feature to split for certain nodes. See above for details like shapes and sizes. - */ - public Output gains() { - return gains; - } - - /** - * A Rank 1 tensors indicating the best feature id for each node. See above for details like shapes and sizes. - */ - public Output featureIds() { - return featureIds; - } - - /** - * 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. - */ - public Output featureDimensions() { - return featureDimensions; - } - - /** - * 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. - */ - public Output thresholds() { - return thresholds; - } - - /** - * 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. - */ - public Output leftNodeContribs() { - return leftNodeContribs; - } - - /** - * A Rank 2 tensors, with the same shape/conditions as left_node_contribs_list, but just that the value is for the right node. - */ - public Output rightNodeContribs() { - return rightNodeContribs; - } - - /** - * 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. - */ - public Output splitWithDefaultDirections() { - return splitWithDefaultDirections; - } - - /** 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++); - } -} 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 fc5451604aa..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestGainsPerFeature.java +++ /dev/null @@ -1,139 +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.op.annotation.Operator; -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 `node_ids_list` for each feature, containing the list of nodes that this feature can be used to split. - *

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

- * The length of output lists are all of the same length, `num_features`. - * The output shapes are compatible in a way that the first dimension of all tensors of all lists are the same and equal to the number of possible split nodes for each feature. - */ -public final class BoostedTreesCalculateBestGainsPerFeature extends RawOp { - - /** - * 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 `stats_summary_list`. The nodes are iterated between the two nodes specified by the tensor, as like `for node_id in range(node_id_range[0], node_id_range[1])` (Note that the last index node_id_range[1] is exclusive). - * @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.env().opBuilder("BoostedTreesCalculateBestGainsPerFeature", scope.makeOpName("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 = scope.apply(opBuilder); - opBuilder.setAttr("max_splits", maxSplits); - return new BoostedTreesCalculateBestGainsPerFeature(opBuilder.build()); - } - - /** - * 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. - */ - public List> nodeIdsList() { - return nodeIdsList; - } - - /** - * 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. - */ - public List> gainsList() { - return gainsList; - } - - /** - * 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. - */ - public List> thresholdsList() { - return thresholdsList; - } - - /** - * 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. - */ - public List> leftNodeContribsList() { - return leftNodeContribsList; - } - - /** - * 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. - */ - public List> rightNodeContribsList() { - return rightNodeContribsList; - } - - /** 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; - } -} 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 d19d2e37da8..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCenterBias.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.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.op.annotation.Operator; -import org.tensorflow.types.TBool; -import org.tensorflow.types.TFloat32; - -/** - * 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 { - - /** - * 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.env().opBuilder("BoostedTreesCenterBias", scope.makeOpName("BoostedTreesCenterBias")); - opBuilder.addInput(treeEnsembleHandle.asOutput()); - opBuilder.addInput(meanGradients.asOutput()); - opBuilder.addInput(meanHessians.asOutput()); - opBuilder.addInput(l1.asOutput()); - opBuilder.addInput(l2.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BoostedTreesCenterBias(opBuilder.build()); - } - - /** - * Bool, whether to continue bias centering. - */ - public Output continueCentering() { - return continueCentering; - } - - @Override - public Output asOutput() { - return continueCentering; - } - - /** 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++); - } -} 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 530b49b4db2..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCreateEnsemble.java +++ /dev/null @@ -1,60 +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.op.annotation.Operator; -import org.tensorflow.types.TInt64; -import org.tensorflow.types.TString; - -/** - * Creates a tree ensemble model and returns a handle to it. - */ -public final class BoostedTreesCreateEnsemble extends RawOp { - - /** - * 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.env().opBuilder("BoostedTreesCreateEnsemble", scope.makeOpName("BoostedTreesCreateEnsemble")); - opBuilder.addInput(treeEnsembleHandle.asOutput()); - opBuilder.addInput(stampToken.asOutput()); - opBuilder.addInput(treeEnsembleSerialized.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BoostedTreesCreateEnsemble(opBuilder.build()); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesCreateEnsemble"; - - private BoostedTreesCreateEnsemble(Operation operation) { - super(operation); - } -} 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 f1983f2d01c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCreateQuantileStreamResource.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.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.op.annotation.Operator; -import org.tensorflow.types.TFloat32; -import org.tensorflow.types.TInt64; - -/** - * Create the Resource for Quantile Streams. - */ -public final class BoostedTreesCreateQuantileStreamResource extends RawOp { - - /** - * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesCreateQuantileStreamResource} - */ - public static class Options { - - /** - * @param maxElements int; The maximum number of data points that can be fed to the stream. - */ - public Options maxElements(Long maxElements) { - this.maxElements = maxElements; - return this; - } - - private Long maxElements; - - private Options() { - } - } - - /** - * 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 attributes 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.env().opBuilder("BoostedTreesCreateQuantileStreamResource", scope.makeOpName("BoostedTreesCreateQuantileStreamResource")); - opBuilder.addInput(quantileStreamResourceHandle.asOutput()); - opBuilder.addInput(epsilon.asOutput()); - opBuilder.addInput(numStreams.asOutput()); - opBuilder = scope.apply(opBuilder); - if (options != null) { - for (Options opts : options) { - if (opts.maxElements != null) { - opBuilder.setAttr("max_elements", opts.maxElements); - } - } - } - return new BoostedTreesCreateQuantileStreamResource(opBuilder.build()); - } - - /** - * @param maxElements int; The maximum number of data points that can be fed to the stream. - */ - public static Options maxElements(Long maxElements) { - return new Options().maxElements(maxElements); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesCreateQuantileStreamResource"; - - private BoostedTreesCreateQuantileStreamResource(Operation operation) { - super(operation); - } -} 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 269095b3297..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesDeserializeEnsemble.java +++ /dev/null @@ -1,62 +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.op.annotation.Operator; -import org.tensorflow.types.TInt64; -import org.tensorflow.types.TString; - -/** - * Deserializes a serialized tree ensemble config and replaces current tree - *

- * ensemble. - */ -public final class BoostedTreesDeserializeEnsemble extends RawOp { - - /** - * 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.env().opBuilder("BoostedTreesDeserializeEnsemble", scope.makeOpName("BoostedTreesDeserializeEnsemble")); - opBuilder.addInput(treeEnsembleHandle.asOutput()); - opBuilder.addInput(stampToken.asOutput()); - opBuilder.addInput(treeEnsembleSerialized.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BoostedTreesDeserializeEnsemble(opBuilder.build()); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesDeserializeEnsemble"; - - private BoostedTreesDeserializeEnsemble(Operation operation) { - super(operation); - } -} 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 33d537e65f2..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesEnsembleResourceHandleOp.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.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.op.annotation.Operator; -import org.tensorflow.types.family.TType; - -/** - * Creates a handle to a BoostedTreesEnsembleResource - */ -public final class BoostedTreesEnsembleResourceHandleOp extends RawOp implements Operand { - - /** - * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesEnsembleResourceHandleOp} - */ - public static class Options { - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new BoostedTreesEnsembleResourceHandleOp operation. - * - * @param scope current scope - * @param options carries optional attributes values - * @return a new instance of BoostedTreesEnsembleResourceHandleOp - */ - @Endpoint(describeByClass = true) - public static BoostedTreesEnsembleResourceHandleOp create(Scope scope, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesEnsembleResourceHandleOp", scope.makeOpName("BoostedTreesEnsembleResourceHandleOp")); - opBuilder = scope.apply(opBuilder); - 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()); - } - - /** - * @param container - */ - public static Options container(String container) { - return new Options().container(container); - } - - /** - * @param sharedName - */ - public static Options sharedName(String sharedName) { - return new Options().sharedName(sharedName); - } - - /** - */ - public Output resource() { - return resource; - } - - @Override - @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) resource; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesEnsembleResourceHandleOp"; - - private Output resource; - - private BoostedTreesEnsembleResourceHandleOp(Operation operation) { - super(operation); - int outputIdx = 0; - resource = operation.output(outputIdx++); - } -} 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 efc8b1d18b3..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesExampleDebugOutputs.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.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.op.annotation.Operator; -import org.tensorflow.types.TInt32; -import org.tensorflow.types.TString; - -/** - * 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 { - - /** - * Factory method to create a class wrapping a new BoostedTreesExampleDebugOutputs operation. - * - * @param scope current scope - * @param treeEnsembleHandle - * @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.env().opBuilder("BoostedTreesExampleDebugOutputs", scope.makeOpName("BoostedTreesExampleDebugOutputs")); - opBuilder.addInput(treeEnsembleHandle.asOutput()); - opBuilder.addInputList(Operands.asOutputs(bucketizedFeatures)); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("logits_dimension", logitsDimension); - return new BoostedTreesExampleDebugOutputs(opBuilder.build()); - } - - /** - * Output rank 1 Tensor containing a proto serialized as a string for each example. - */ - public Output examplesDebugOutputsSerialized() { - return examplesDebugOutputsSerialized; - } - - @Override - public Output asOutput() { - return examplesDebugOutputsSerialized; - } - - /** 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++); - } -} 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 4938265cc16..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesFlushQuantileSummaries.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.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.op.annotation.Operator; -import org.tensorflow.types.TFloat32; - -/** - * 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> { - - /** - * 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 - * @return a new instance of BoostedTreesFlushQuantileSummaries - */ - @Endpoint(describeByClass = true) - public static BoostedTreesFlushQuantileSummaries create(Scope scope, Operand quantileStreamResourceHandle, Long numFeatures) { - OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesFlushQuantileSummaries", scope.makeOpName("BoostedTreesFlushQuantileSummaries")); - opBuilder.addInput(quantileStreamResourceHandle.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("num_features", numFeatures); - return new BoostedTreesFlushQuantileSummaries(opBuilder.build()); - } - - /** - */ - public List> summaries() { - return summaries; - } - - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { - return (Iterator) summaries.iterator(); - } - - /** 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; - } -} 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 08f3aced676..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesGetEnsembleStates.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.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.op.annotation.Operator; -import org.tensorflow.types.TInt32; -import org.tensorflow.types.TInt64; - -/** - * Retrieves the tree ensemble resource stamp token, number of trees and growing statistics. - */ -public final class BoostedTreesGetEnsembleStates extends RawOp { - - /** - * 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.env().opBuilder("BoostedTreesGetEnsembleStates", scope.makeOpName("BoostedTreesGetEnsembleStates")); - opBuilder.addInput(treeEnsembleHandle.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BoostedTreesGetEnsembleStates(opBuilder.build()); - } - - /** - * Stamp token of the tree ensemble resource. - */ - public Output stampToken() { - return stampToken; - } - - /** - * The number of trees in the tree ensemble resource. - */ - public Output numTrees() { - return numTrees; - } - - /** - * The number of trees that were finished successfully. - */ - public Output numFinalizedTrees() { - return numFinalizedTrees; - } - - /** - * The number of layers we attempted to build (but not necessarily succeeded). - */ - public Output numAttemptedLayers() { - return numAttemptedLayers; - } - - /** - * Rank size 2 tensor that contains start and end ids of the nodes in the latest - * layer. - */ - public Output lastLayerNodesRange() { - return lastLayerNodesRange; - } - - /** 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++); - } -} 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 20c5aefea81..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesMakeQuantileSummaries.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.Operands; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.TFloat32; - -/** - * 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> { - - /** - * 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.env().opBuilder("BoostedTreesMakeQuantileSummaries", scope.makeOpName("BoostedTreesMakeQuantileSummaries")); - opBuilder.addInputList(Operands.asOutputs(floatValues)); - opBuilder.addInput(exampleWeights.asOutput()); - opBuilder.addInput(epsilon.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BoostedTreesMakeQuantileSummaries(opBuilder.build()); - } - - /** - * float; List of Rank 2 Tensors each containing the quantile summary - * (value, weight, min_rank, max_rank) of a single feature. - */ - public List> summaries() { - return summaries; - } - - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { - return (Iterator) summaries.iterator(); - } - - /** 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; - } -} 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 63c20cb03fe..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesMakeStatsSummary.java +++ /dev/null @@ -1,86 +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.op.annotation.Operator; -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 { - - /** - * 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.env().opBuilder("BoostedTreesMakeStatsSummary", scope.makeOpName("BoostedTreesMakeStatsSummary")); - opBuilder.addInput(nodeIds.asOutput()); - opBuilder.addInput(gradients.asOutput()); - opBuilder.addInput(hessians.asOutput()); - opBuilder.addInputList(Operands.asOutputs(bucketizedFeaturesList)); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("max_splits", maxSplits); - opBuilder.setAttr("num_buckets", numBuckets); - return new BoostedTreesMakeStatsSummary(opBuilder.build()); - } - - /** - * 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. - */ - public Output statsSummary() { - return statsSummary; - } - - @Override - public Output asOutput() { - return statsSummary; - } - - /** 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++); - } -} 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 c1363d21a6f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesPredict.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.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.op.annotation.Operator; -import org.tensorflow.types.TFloat32; -import org.tensorflow.types.TInt32; - -/** - * 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 { - - /** - * Factory method to create a class wrapping a new BoostedTreesPredict operation. - * - * @param scope current scope - * @param treeEnsembleHandle - * @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.env().opBuilder("BoostedTreesPredict", scope.makeOpName("BoostedTreesPredict")); - opBuilder.addInput(treeEnsembleHandle.asOutput()); - opBuilder.addInputList(Operands.asOutputs(bucketizedFeatures)); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("logits_dimension", logitsDimension); - return new BoostedTreesPredict(opBuilder.build()); - } - - /** - * Output rank 2 Tensor containing logits for each example. - */ - public Output logits() { - return logits; - } - - @Override - public Output asOutput() { - return logits; - } - - /** 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++); - } -} 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 d892cd3911e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceAddSummaries.java +++ /dev/null @@ -1,62 +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.op.annotation.Operator; -import org.tensorflow.types.TFloat32; - -/** - * 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 { - - /** - * 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.env().opBuilder("BoostedTreesQuantileStreamResourceAddSummaries", scope.makeOpName("BoostedTreesQuantileStreamResourceAddSummaries")); - opBuilder.addInput(quantileStreamResourceHandle.asOutput()); - opBuilder.addInputList(Operands.asOutputs(summaries)); - opBuilder = scope.apply(opBuilder); - return new BoostedTreesQuantileStreamResourceAddSummaries(opBuilder.build()); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesQuantileStreamResourceAddSummaries"; - - private BoostedTreesQuantileStreamResourceAddSummaries(Operation operation) { - super(operation); - } -} 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 600c960b82f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceDeserialize.java +++ /dev/null @@ -1,60 +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.op.annotation.Operator; -import org.tensorflow.types.TFloat32; - -/** - * 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 { - - /** - * 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.env().opBuilder("BoostedTreesQuantileStreamResourceDeserialize", scope.makeOpName("BoostedTreesQuantileStreamResourceDeserialize")); - opBuilder.addInput(quantileStreamResourceHandle.asOutput()); - opBuilder.addInputList(Operands.asOutputs(bucketBoundaries)); - opBuilder = scope.apply(opBuilder); - return new BoostedTreesQuantileStreamResourceDeserialize(opBuilder.build()); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesQuantileStreamResourceDeserialize"; - - private BoostedTreesQuantileStreamResourceDeserialize(Operation operation) { - super(operation); - } -} 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 e11545a2160..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceFlush.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.op.annotation.Operator; -import org.tensorflow.types.TInt64; - -/** - * 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 { - - /** - * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesQuantileStreamResourceFlush} - */ - public static class Options { - - /** - * @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. - */ - public Options generateQuantiles(Boolean generateQuantiles) { - this.generateQuantiles = generateQuantiles; - return this; - } - - private Boolean generateQuantiles; - - private Options() { - } - } - - /** - * 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 attributes 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.env().opBuilder("BoostedTreesQuantileStreamResourceFlush", scope.makeOpName("BoostedTreesQuantileStreamResourceFlush")); - opBuilder.addInput(quantileStreamResourceHandle.asOutput()); - opBuilder.addInput(numBuckets.asOutput()); - opBuilder = scope.apply(opBuilder); - if (options != null) { - for (Options opts : options) { - if (opts.generateQuantiles != null) { - opBuilder.setAttr("generate_quantiles", opts.generateQuantiles); - } - } - } - return new BoostedTreesQuantileStreamResourceFlush(opBuilder.build()); - } - - /** - * @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. - */ - public static Options generateQuantiles(Boolean generateQuantiles) { - return new Options().generateQuantiles(generateQuantiles); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesQuantileStreamResourceFlush"; - - private BoostedTreesQuantileStreamResourceFlush(Operation operation) { - super(operation); - } -} 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 e5692091bc9..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceGetBucketBoundaries.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.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.op.annotation.Operator; -import org.tensorflow.types.TFloat32; - -/** - * 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> { - - /** - * 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.env().opBuilder("BoostedTreesQuantileStreamResourceGetBucketBoundaries", scope.makeOpName("BoostedTreesQuantileStreamResourceGetBucketBoundaries")); - opBuilder.addInput(quantileStreamResourceHandle.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("num_features", numFeatures); - return new BoostedTreesQuantileStreamResourceGetBucketBoundaries(opBuilder.build()); - } - - /** - * float; List of Rank 1 Tensors each containing the bucket boundaries for a feature. - */ - public List> bucketBoundaries() { - return bucketBoundaries; - } - - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { - return (Iterator) bucketBoundaries.iterator(); - } - - /** 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; - } -} 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 cfc56887f64..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceHandleOp.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.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.op.annotation.Operator; -import org.tensorflow.types.family.TType; - -/** - * Creates a handle to a BoostedTreesQuantileStreamResource. - */ -public final class BoostedTreesQuantileStreamResourceHandleOp extends RawOp implements Operand { - - /** - * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesQuantileStreamResourceHandleOp} - */ - public static class Options { - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new BoostedTreesQuantileStreamResourceHandleOp operation. - * - * @param scope current scope - * @param options carries optional attributes values - * @return a new instance of BoostedTreesQuantileStreamResourceHandleOp - */ - @Endpoint(describeByClass = true) - public static BoostedTreesQuantileStreamResourceHandleOp create(Scope scope, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesQuantileStreamResourceHandleOp", scope.makeOpName("BoostedTreesQuantileStreamResourceHandleOp")); - opBuilder = scope.apply(opBuilder); - 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()); - } - - /** - * @param container - */ - public static Options container(String container) { - return new Options().container(container); - } - - /** - * @param sharedName - */ - public static Options sharedName(String sharedName) { - return new Options().sharedName(sharedName); - } - - /** - */ - public Output resource() { - return resource; - } - - @Override - @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) resource; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesQuantileStreamResourceHandleOp"; - - private Output resource; - - private BoostedTreesQuantileStreamResourceHandleOp(Operation operation) { - super(operation); - int outputIdx = 0; - resource = operation.output(outputIdx++); - } -} 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 475c0eded18..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSerializeEnsemble.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.op.annotation.Operator; -import org.tensorflow.types.TInt64; -import org.tensorflow.types.TString; - -/** - * Serializes the tree ensemble to a proto. - */ -public final class BoostedTreesSerializeEnsemble extends RawOp { - - /** - * 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.env().opBuilder("BoostedTreesSerializeEnsemble", scope.makeOpName("BoostedTreesSerializeEnsemble")); - opBuilder.addInput(treeEnsembleHandle.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BoostedTreesSerializeEnsemble(opBuilder.build()); - } - - /** - * Stamp token of the tree ensemble resource. - */ - public Output stampToken() { - return stampToken; - } - - /** - * Serialized proto of the ensemble. - */ - public Output treeEnsembleSerialized() { - return treeEnsembleSerialized; - } - - /** 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++); - } -} 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 7f1cdd96d82..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSparseAggregateStats.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.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.op.annotation.Operator; -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 { - - /** - * 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.env().opBuilder("BoostedTreesSparseAggregateStats", scope.makeOpName("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 = scope.apply(opBuilder); - opBuilder.setAttr("max_splits", maxSplits); - opBuilder.setAttr("num_buckets", numBuckets); - return new BoostedTreesSparseAggregateStats(opBuilder.build()); - } - - /** - * 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. - */ - public Output statsSummaryIndices() { - return statsSummaryIndices; - } - - /** - * output Rank 1 Tensor (shape=[number of non zero statistics]) - */ - public Output statsSummaryValues() { - return statsSummaryValues; - } - - /** - * 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. - */ - public Output statsSummaryShape() { - return statsSummaryShape; - } - - /** 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++); - } -} 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 40bdd797fa6..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSparseCalculateBestFeatureSplit.java +++ /dev/null @@ -1,184 +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.op.annotation.Operator; -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 `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 { - - /** - * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesSparseCalculateBestFeatureSplit} - */ - public static class Options { - - /** - * @param splitType A string indicating if this Op should perform inequality split or equality split. - */ - public Options splitType(String splitType) { - this.splitType = splitType; - return this; - } - - private String splitType; - - private Options() { - } - } - - /** - * 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 `stats_summary_list`. The nodes are iterated between the two nodes specified by the tensor, as like `for node_id in range(node_id_range[0], node_id_range[1])` (Note that the last index node_id_range[1] is exclusive). - * @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 attributes 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.env().opBuilder("BoostedTreesSparseCalculateBestFeatureSplit", scope.makeOpName("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 = scope.apply(opBuilder); - 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()); - } - - /** - * @param splitType A string indicating if this Op should perform inequality split or equality split. - */ - public static Options splitType(String splitType) { - return new Options().splitType(splitType); - } - - /** - * A Rank 1 tensor indicating possible node ids that can be split. - */ - public Output nodeIds() { - return nodeIds; - } - - /** - * A Rank 1 tensor indicating the best gains to split each node. - */ - public Output gains() { - return gains; - } - - /** - * A Rank 1 tensor indicating the best feature dimension for each feature to split for each node. - */ - public Output featureDimensions() { - return featureDimensions; - } - - /** - * A Rank 1 tensor indicating the bucket id to compare with (as a threshold) for split in each node. - */ - public Output thresholds() { - return thresholds; - } - - /** - * 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. - */ - public Output leftNodeContribs() { - return leftNodeContribs; - } - - /** - * A Rank 2 tensor, with the same shape/conditions as left_node_contribs_list, but just that the value is for the right node. - */ - public Output rightNodeContribs() { - return rightNodeContribs; - } - - /** - * 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. - */ - public Output splitWithDefaultDirections() { - return splitWithDefaultDirections; - } - - /** 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++); - } -} 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 3de7758a2d0..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesTrainingPredict.java +++ /dev/null @@ -1,104 +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.op.annotation.Operator; -import org.tensorflow.types.TFloat32; -import org.tensorflow.types.TInt32; - -/** - * 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 { - - /** - * Factory method to create a class wrapping a new BoostedTreesTrainingPredict operation. - * - * @param scope current scope - * @param treeEnsembleHandle - * @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.env().opBuilder("BoostedTreesTrainingPredict", scope.makeOpName("BoostedTreesTrainingPredict")); - opBuilder.addInput(treeEnsembleHandle.asOutput()); - opBuilder.addInput(cachedTreeIds.asOutput()); - opBuilder.addInput(cachedNodeIds.asOutput()); - opBuilder.addInputList(Operands.asOutputs(bucketizedFeatures)); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("logits_dimension", logitsDimension); - return new BoostedTreesTrainingPredict(opBuilder.build()); - } - - /** - * Rank 2 Tensor containing logits update (with respect to cached - * values stored) for each example. - */ - public Output partialLogits() { - return partialLogits; - } - - /** - * Rank 1 Tensor containing new tree ids for each example. - */ - public Output treeIds() { - return treeIds; - } - - /** - * Rank 1 Tensor containing new node ids in the new tree_ids. - */ - public Output nodeIds() { - return nodeIds; - } - - /** 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++); - } -} 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 99c818f679d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesUpdateEnsemble.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.op.Operands; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.TFloat32; -import org.tensorflow.types.TInt32; - -/** - * 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 { - - /** - * 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.env().opBuilder("BoostedTreesUpdateEnsemble", scope.makeOpName("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 = scope.apply(opBuilder); - opBuilder.setAttr("pruning_mode", pruningMode); - return new BoostedTreesUpdateEnsemble(opBuilder.build()); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesUpdateEnsemble"; - - private BoostedTreesUpdateEnsemble(Operation operation) { - super(operation); - } -} 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 1395258e233..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesUpdateEnsembleV2.java +++ /dev/null @@ -1,124 +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.op.annotation.Operator; -import org.tensorflow.types.TFloat32; -import org.tensorflow.types.TInt32; -import org.tensorflow.types.TString; - -/** - * 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 { - - /** - * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesUpdateEnsembleV2} - */ - public static class Options { - - /** - * @param logitsDimension scalar, dimension of the logits - */ - public Options logitsDimension(Long logitsDimension) { - this.logitsDimension = logitsDimension; - return this; - } - - private Long logitsDimension; - - private Options() { - } - } - - /** - * 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 attributes 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.env().opBuilder("BoostedTreesUpdateEnsembleV2", scope.makeOpName("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()); - opBuilder = scope.apply(opBuilder); - if (options != null) { - for (Options opts : options) { - if (opts.logitsDimension != null) { - opBuilder.setAttr("logits_dimension", opts.logitsDimension); - } - } - } - return new BoostedTreesUpdateEnsembleV2(opBuilder.build()); - } - - /** - * @param logitsDimension scalar, dimension of the logits - */ - public static Options logitsDimension(Long logitsDimension) { - return new Options().logitsDimension(logitsDimension); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesUpdateEnsembleV2"; - - private BoostedTreesUpdateEnsembleV2(Operation operation) { - super(operation); - } -} 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 d525478a12d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/IsBoostedTreesEnsembleInitialized.java +++ /dev/null @@ -1,72 +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.op.annotation.Operator; -import org.tensorflow.types.TBool; - -/** - * Checks whether a tree ensemble has been initialized. - */ -public final class IsBoostedTreesEnsembleInitialized extends RawOp implements Operand { - - /** - * 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.env().opBuilder("IsBoostedTreesEnsembleInitialized", scope.makeOpName("IsBoostedTreesEnsembleInitialized")); - opBuilder.addInput(treeEnsembleHandle.asOutput()); - opBuilder = scope.apply(opBuilder); - return new IsBoostedTreesEnsembleInitialized(opBuilder.build()); - } - - /** - * output boolean on whether it is initialized or not. - */ - public Output isInitialized() { - return isInitialized; - } - - @Override - public Output asOutput() { - return isInitialized; - } - - /** 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++); - } -} 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 63ec45e9504..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/IsBoostedTreesQuantileStreamResourceInitialized.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.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.op.annotation.Operator; -import org.tensorflow.types.TBool; - -/** - * 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 { - - /** - * 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.env().opBuilder("IsBoostedTreesQuantileStreamResourceInitialized", scope.makeOpName("IsBoostedTreesQuantileStreamResourceInitialized")); - opBuilder.addInput(quantileStreamResourceHandle.asOutput()); - opBuilder = scope.apply(opBuilder); - return new IsBoostedTreesQuantileStreamResourceInitialized(opBuilder.build()); - } - - /** - * bool; True if the resource is initialized, False otherwise. - */ - public Output isInitialized() { - return isInitialized; - } - - @Override - public Output asOutput() { - return isInitialized; - } - - /** 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++); - } -} 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 1c3eb4b86bc..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,72 +17,113 @@ 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; /** * Adjust the contrast of one or more images. - *

- * `images` is a tensor of at least 3 dimensions. The last 3 dimensions are - * interpreted as `[height, width, channels]`. The other dimensions only - * represent a collection of images, such as `[batch, height, width, channels].` - *

- * Contrast is adjusted independently for each channel of each image. - *

- * For each channel, the Op first computes the mean of the image pixels in the + * {@code images} is a tensor of at least 3 dimensions. The last 3 dimensions are + * interpreted as {@code [height, width, channels]}. The other dimensions only + * represent a collection of images, such as {@code [batch, height, width, channels].} + *

Contrast is adjusted independently for each channel of each image. + *

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 - * `(x - mean) * contrast_factor + mean`. - * - * @param data type for {@code output()} output + * {@code (x - mean) * contrast_factor + mean}. */ -@Operator(group = "image") +@OpMetadata( + opType = AdjustContrast.OP_NAME, + inputsClass = AdjustContrast.Inputs.class +) +@Operator( + group = "image" +) public final class AdjustContrast extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new AdjustContrast operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AdjustContrastv2"; + + private Output output; + + public AdjustContrast(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new AdjustContrastv2 operation. + * * @param scope current scope * @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 * @return a new instance of AdjustContrast */ - @Endpoint(describeByClass = true) - public static AdjustContrast create(Scope scope, Operand images, Operand contrastFactor) { - OperationBuilder opBuilder = scope.env().opBuilder("AdjustContrastv2", scope.makeOpName("AdjustContrast")); + @Endpoint( + describeByClass = true + ) + public static AdjustContrast create(Scope scope, Operand images, + Operand contrastFactor) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AdjustContrast"); opBuilder.addInput(images.asOutput()); opBuilder.addInput(contrastFactor.asOutput()); - opBuilder = scope.apply(opBuilder); - return new AdjustContrast(opBuilder.build()); + return new AdjustContrast<>(opBuilder.build()); } - + /** + * Gets output. * The contrast-adjusted image or images. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AdjustContrastv2"; - - private Output output; - - private AdjustContrast(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 fa9d0e9a50c..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,69 +17,111 @@ 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; /** * Adjust the hue of one or more images. - *

- * `images` is a tensor of at least 3 dimensions. The last dimension is + * {@code images} is a tensor of at least 3 dimensions. The last dimension is * interpreted as channels, and must be three. - *

- * The input image is considered in the RGB colorspace. Conceptually, the RGB + *

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 */ -@Operator(group = "image") +@OpMetadata( + opType = AdjustHue.OP_NAME, + inputsClass = AdjustHue.Inputs.class +) +@Operator( + group = "image" +) public final class AdjustHue extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AdjustHue"; + + private Output output; + + public AdjustHue(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new AdjustHue operation. - * + * * @param scope current scope * @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 * @return a new instance of AdjustHue */ - @Endpoint(describeByClass = true) - public static AdjustHue create(Scope scope, Operand images, Operand delta) { - OperationBuilder opBuilder = scope.env().opBuilder("AdjustHue", scope.makeOpName("AdjustHue")); + @Endpoint( + describeByClass = true + ) + public static AdjustHue create(Scope scope, Operand images, + Operand delta) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AdjustHue"); opBuilder.addInput(images.asOutput()); opBuilder.addInput(delta.asOutput()); - opBuilder = scope.apply(opBuilder); - return new AdjustHue(opBuilder.build()); + return new AdjustHue<>(opBuilder.build()); } - + /** + * Gets output. * The hue-adjusted image or images. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AdjustHue"; - - private Output output; - - private AdjustHue(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 5c023d89c6b..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,69 +17,111 @@ 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; /** * Adjust the saturation of one or more images. - *

- * `images` is a tensor of at least 3 dimensions. The last dimension is + * {@code images} is a tensor of at least 3 dimensions. The last dimension is * interpreted as channels, and must be three. - *

- * The input image is considered in the RGB colorspace. Conceptually, the RGB + *

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 */ -@Operator(group = "image") +@OpMetadata( + opType = AdjustSaturation.OP_NAME, + inputsClass = AdjustSaturation.Inputs.class +) +@Operator( + group = "image" +) public final class AdjustSaturation extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AdjustSaturation"; + + private Output output; + + public AdjustSaturation(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new AdjustSaturation operation. - * + * * @param scope current scope * @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 * @return a new instance of AdjustSaturation */ - @Endpoint(describeByClass = true) - public static AdjustSaturation create(Scope scope, Operand images, Operand scale) { - OperationBuilder opBuilder = scope.env().opBuilder("AdjustSaturation", scope.makeOpName("AdjustSaturation")); + @Endpoint( + describeByClass = true + ) + public static AdjustSaturation create(Scope scope, Operand images, + Operand scale) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AdjustSaturation"); opBuilder.addInput(images.asOutput()); opBuilder.addInput(scale.asOutput()); - opBuilder = scope.apply(opBuilder); - return new AdjustSaturation(opBuilder.build()); + return new AdjustSaturation<>(opBuilder.build()); } - + /** + * Gets output. * The hue-adjusted image or images. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AdjustSaturation"; - - private Output output; - - private AdjustSaturation(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 4b1b82f5585..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,20 +17,24 @@ 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; /** * Greedily selects a subset of bounding boxes in descending order of score, - *

* This operation performs non_max_suppression on the inputs per batch, across * all classes. * Prunes away boxes that have high intersection-over-union (IOU) overlap @@ -45,72 +49,70 @@ * The output of this operation is the final boxes, scores and classes tensor * returned after performing non_max_suppression. */ -@Operator(group = "image") +@OpMetadata( + opType = CombinedNonMaxSuppression.OP_NAME, + inputsClass = CombinedNonMaxSuppression.Inputs.class +) +@Operator( + group = "image" +) public final class CombinedNonMaxSuppression extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.image.CombinedNonMaxSuppression} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param padPerClass If false, the output nmsed boxes, scores and classes - * are padded/clipped to `max_total_size`. If true, the - * output nmsed boxes, scores and classes are padded to be of length - * `max_size_per_class`*`num_classes`, unless it exceeds `max_total_size` in - * which case it is clipped to `max_total_size`. Defaults to false. - */ - public Options padPerClass(Boolean padPerClass) { - this.padPerClass = padPerClass; - return this; - } - - /** - * @param clipBoxes 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 Options clipBoxes(Boolean clipBoxes) { - this.clipBoxes = clipBoxes; - return this; - } - - private Boolean padPerClass; - private Boolean clipBoxes; - - private Options() { - } + public static final String OP_NAME = "CombinedNonMaxSuppression"; + + private Output nmsedBoxes; + + private Output nmsedScores; + + private Output nmsedClasses; + + private Output validDetections; + + public CombinedNonMaxSuppression(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + nmsedBoxes = operation.output(outputIdx++); + nmsedScores = operation.output(outputIdx++); + nmsedClasses = operation.output(outputIdx++); + validDetections = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new CombinedNonMaxSuppression operation. - * + * * @param scope current scope - * @param boxes A 4-D float tensor of shape `[batch_size, num_boxes, q, 4]`. If `q` is 1 then - * same boxes are used for all classes otherwise, if `q` is equal to number of + * @param boxes 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. - * @param scores A 3-D float tensor of shape `[batch_size, num_boxes, num_classes]` + * @param scores 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). * @param maxOutputSizePerClass A scalar integer tensor representing the maximum number of * boxes to be selected by non max suppression per class - * @param maxTotalSize A scalar representing maximum number of boxes retained over all classes. + * @param maxTotalSize 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. * @param iouThreshold A 0-D float tensor representing the threshold for deciding whether * boxes overlap too much with respect to IOU. * @param scoreThreshold A 0-D float tensor representing the threshold for deciding when to remove * boxes based on score. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of CombinedNonMaxSuppression */ - @Endpoint(describeByClass = true) - public static CombinedNonMaxSuppression create(Scope scope, Operand boxes, Operand scores, Operand maxOutputSizePerClass, Operand maxTotalSize, Operand iouThreshold, Operand scoreThreshold, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("CombinedNonMaxSuppression", scope.makeOpName("CombinedNonMaxSuppression")); + @Endpoint( + describeByClass = true + ) + public static CombinedNonMaxSuppression create(Scope scope, Operand boxes, + Operand scores, Operand maxOutputSizePerClass, Operand maxTotalSize, + Operand iouThreshold, Operand scoreThreshold, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CombinedNonMaxSuppression"); opBuilder.addInput(boxes.asOutput()); opBuilder.addInput(scores.asOutput()); opBuilder.addInput(maxOutputSizePerClass.asOutput()); opBuilder.addInput(maxTotalSize.asOutput()); opBuilder.addInput(iouThreshold.asOutput()); opBuilder.addInput(scoreThreshold.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.padPerClass != null) { @@ -123,75 +125,184 @@ public static CombinedNonMaxSuppression create(Scope scope, Operand bo } return new CombinedNonMaxSuppression(opBuilder.build()); } - + /** + * Sets the padPerClass option. + * * @param padPerClass If false, the output nmsed boxes, scores and classes - * are padded/clipped to `max_total_size`. If true, the + * are padded/clipped to {@code max_total_size}. If true, the * output nmsed boxes, scores and classes are padded to be of length - * `max_size_per_class`*`num_classes`, unless it exceeds `max_total_size` in - * which case it is clipped to `max_total_size`. Defaults to false. + * {@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. + * @return this Options instance. */ public static Options padPerClass(Boolean padPerClass) { return new Options().padPerClass(padPerClass); } - + /** + * Sets the clipBoxes option. + * * @param clipBoxes 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. + * @return this Options instance. */ public static Options clipBoxes(Boolean clipBoxes) { return new Options().clipBoxes(clipBoxes); } - + /** + * Gets nmsedBoxes. * A [batch_size, max_detections, 4] float32 tensor * containing the non-max suppressed boxes. + * @return nmsedBoxes. */ public Output nmsedBoxes() { return nmsedBoxes; } - + /** + * Gets nmsedScores. * A [batch_size, max_detections] float32 tensor * containing the scores for the boxes. + * @return nmsedScores. */ public Output nmsedScores() { return nmsedScores; } - + /** + * Gets nmsedClasses. * A [batch_size, max_detections] float32 tensor * containing the classes for the boxes. + * @return nmsedClasses. */ public Output nmsedClasses() { return nmsedClasses; } - + /** + * Gets validDetections. * A [batch_size] int32 tensor indicating the number of * valid detections per batch item. Only the top num_detections[i] entries in * nms_boxes[i], nms_scores[i] and nms_class[i] are valid. The rest of the * entries are zero paddings. + * @return validDetections. */ public Output validDetections() { return validDetections; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CombinedNonMaxSuppression"; - - private Output nmsedBoxes; - private Output nmsedScores; - private Output nmsedClasses; - private Output validDetections; - - private CombinedNonMaxSuppression(Operation operation) { - super(operation); - int outputIdx = 0; - nmsedBoxes = operation.output(outputIdx++); - nmsedScores = operation.output(outputIdx++); - nmsedClasses = operation.output(outputIdx++); - validDetections = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.CombinedNonMaxSuppression} + */ + public static class Options { + private Boolean padPerClass; + + private Boolean clipBoxes; + + private Options() { + } + + /** + * Sets the padPerClass option. + * + * @param padPerClass 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. + * @return this Options instance. + */ + public Options padPerClass(Boolean padPerClass) { + this.padPerClass = padPerClass; + return this; + } + + /** + * Sets the clipBoxes option. + * + * @param clipBoxes 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. + * @return this Options instance. + */ + public Options clipBoxes(Boolean clipBoxes) { + this.clipBoxes = 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 3607c38dddf..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,103 +17,98 @@ 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; /** * Extracts crops from the input image tensor and resizes them. - *

* Extracts crops from the input image tensor and resizes them using bilinear * sampling or nearest neighbor sampling (possibly with aspect ratio change) to a - * common output size specified by `crop_size`. This is more general than the - * `crop_to_bounding_box` op which extracts a fixed size slice from the input image + * common output size specified by {@code crop_size}. This is more general than the + * {@code crop_to_bounding_box} op which extracts a fixed size slice from the input image * and does not allow resizing or aspect ratio change. - *

- * Returns a tensor with `crops` from the input `image` at positions defined at the - * bounding box locations in `boxes`. The cropped boxes are all resized (with + *

Returns a tensor with {@code crops} from the input {@code image} at positions defined at the + * bounding box locations in {@code boxes}. The cropped boxes are all resized (with * bilinear or nearest neighbor interpolation) to a fixed - * `size = [crop_height, crop_width]`. The result is a 4-D tensor - * `[num_boxes, crop_height, crop_width, depth]`. The resizing is corner aligned. - * In particular, if `boxes = [[0, 0, 1, 1]]`, the method will give identical - * results to using `tf.image.resize_bilinear()` or - * `tf.image.resize_nearest_neighbor()`(depends on the `method` argument) with - * `align_corners=True`. + * {@code size = [crop_height, crop_width]}. The result is a 4-D tensor + * {@code [num_boxes, crop_height, crop_width, depth]}. The resizing is corner aligned. + * In particular, if {@code boxes = [[0, 0, 1, 1]]}, the method will give identical + * results to using {@code tf.image.resize_bilinear()} or + * {@code tf.image.resize_nearest_neighbor()}(depends on the {@code method} argument) with + * {@code align_corners=True}. */ -@Operator(group = "image") +@OpMetadata( + opType = CropAndResize.OP_NAME, + inputsClass = CropAndResize.Inputs.class +) +@Operator( + group = "image" +) public final class CropAndResize extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.CropAndResize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param method A string specifying the sampling method for resizing. It can be either - * `"bilinear"` or `"nearest"` and default to `"bilinear"`. Currently two sampling - * methods are supported: Bilinear and Nearest Neighbor. - */ - public Options method(String method) { - this.method = method; - return this; - } - - /** - * @param extrapolationValue Value used for extrapolation, when applicable. - */ - public Options extrapolationValue(Float extrapolationValue) { - this.extrapolationValue = extrapolationValue; - return this; - } - - private String method; - private Float extrapolationValue; - - private Options() { - } + public static final String OP_NAME = "CropAndResize"; + + private Output crops; + + public CropAndResize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + crops = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new CropAndResize operation. - * + * * @param scope current scope - * @param image A 4-D tensor of shape `[batch, image_height, image_width, depth]`. - * Both `image_height` and `image_width` need to be positive. - * @param boxes A 2-D tensor of shape `[num_boxes, 4]`. The `i`-th row of the tensor - * specifies the coordinates of a box in the `box_ind[i]` image and is specified - * in normalized coordinates `[y1, x1, y2, x2]`. A normalized coordinate value of - * `y` is mapped to the image coordinate at `y * (image_height - 1)`, so as the - * `[0, 1]` interval of normalized image height is mapped to - * `[0, image_height - 1]` in image height coordinates. We do allow `y1` > `y2`, in + * @param image 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. + * @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 + * 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 `[0, 1]` range are allowed, in which case we use - * `extrapolation_value` to extrapolate the input image values. - * @param boxInd A 1-D tensor of shape `[num_boxes]` with int32 values in `[0, batch)`. - * The value of `box_ind[i]` specifies the image that the `i`-th box refers to. - * @param cropSize A 1-D tensor of 2 elements, `size = [crop_height, crop_width]`. All + * outside the {@code [0, 1]} range are allowed, in which case we use + * {@code extrapolation_value} to extrapolate the input image values. + * @param boxInd 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. + * @param cropSize 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 `crop_height` and `crop_width` need to be + * content is not preserved. Both {@code crop_height} and {@code crop_width} need to be * positive. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of CropAndResize */ - @Endpoint(describeByClass = true) - public static CropAndResize create(Scope scope, Operand image, Operand boxes, Operand boxInd, Operand cropSize, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("CropAndResize", scope.makeOpName("CropAndResize")); + @Endpoint( + describeByClass = true + ) + public static CropAndResize create(Scope scope, Operand image, + Operand boxes, Operand boxInd, Operand cropSize, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CropAndResize"); opBuilder.addInput(image.asOutput()); opBuilder.addInput(boxes.asOutput()); opBuilder.addInput(boxInd.asOutput()); opBuilder.addInput(cropSize.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.method != null) { @@ -126,43 +121,144 @@ public static CropAndResize create(Scope scope, Operand image } return new CropAndResize(opBuilder.build()); } - + /** + * Sets the method option. + * * @param method A string specifying the sampling method for resizing. It can be either - * `"bilinear"` or `"nearest"` and default to `"bilinear"`. Currently two sampling + * {@code "bilinear"} or {@code "nearest"} and default to {@code "bilinear"}. Currently two sampling * methods are supported: Bilinear and Nearest Neighbor. + * @return this Options instance. */ public static Options method(String method) { return new Options().method(method); } - + /** + * Sets the extrapolationValue option. + * * @param extrapolationValue Value used for extrapolation, when applicable. + * @return this Options instance. */ public static Options extrapolationValue(Float extrapolationValue) { return new Options().extrapolationValue(extrapolationValue); } - + /** - * A 4-D tensor of shape `[num_boxes, crop_height, crop_width, depth]`. + * Gets crops. + * A 4-D tensor of shape {@code [num_boxes, crop_height, crop_width, depth]}. + * @return crops. */ public Output crops() { return crops; } - + @Override public Output asOutput() { return crops; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CropAndResize"; - - private Output crops; - - private CropAndResize(Operation operation) { - super(operation); - int outputIdx = 0; - crops = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.CropAndResize} + */ + public static class Options { + private String method; + + private Float extrapolationValue; + + private Options() { + } + + /** + * Sets the method option. + * + * @param method 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. + * @return this Options instance. + */ + public Options method(String method) { + this.method = method; + return this; + } + + /** + * Sets the extrapolationValue option. + * + * @param extrapolationValue Value used for extrapolation, when applicable. + * @return this Options instance. + */ + public Options extrapolationValue(Float extrapolationValue) { + this.extrapolationValue = 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 a6b53c85a85..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,59 +38,56 @@ /** * Computes the gradient of the crop_and_resize op wrt the input boxes tensor. */ -@Operator(group = "image") +@OpMetadata( + opType = CropAndResizeGradBoxes.OP_NAME, + inputsClass = CropAndResizeGradBoxes.Inputs.class +) +@Operator( + group = "image" +) public final class CropAndResizeGradBoxes extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.CropAndResizeGradBoxes} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param method A string specifying the interpolation method. Only 'bilinear' is - * supported for now. - */ - public Options method(String method) { - this.method = method; - return this; - } - - private String method; - - private Options() { - } + public static final String OP_NAME = "CropAndResizeGradBoxes"; + + private Output output; + + public CropAndResizeGradBoxes(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new CropAndResizeGradBoxes operation. - * + * * @param scope current scope - * @param grads A 4-D tensor of shape `[num_boxes, crop_height, crop_width, depth]`. - * @param image A 4-D tensor of shape `[batch, image_height, image_width, depth]`. - * Both `image_height` and `image_width` need to be positive. - * @param boxes A 2-D tensor of shape `[num_boxes, 4]`. The `i`-th row of the tensor - * specifies the coordinates of a box in the `box_ind[i]` image and is specified - * in normalized coordinates `[y1, x1, y2, x2]`. A normalized coordinate value of - * `y` is mapped to the image coordinate at `y * (image_height - 1)`, so as the - * `[0, 1]` interval of normalized image height is mapped to - * `[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]` range are allowed, in which case we use - * `extrapolation_value` to extrapolate the input image values. - * @param boxInd A 1-D tensor of shape `[num_boxes]` with int32 values in `[0, batch)`. - * The value of `box_ind[i]` specifies the image that the `i`-th box refers to. - * @param options carries optional attributes values + * @param grads A 4-D tensor of shape {@code [num_boxes, crop_height, crop_width, depth]}. + * @param image 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. + * @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 + * 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. + * @param boxInd 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. + * @param options carries optional attribute values * @return a new instance of CropAndResizeGradBoxes */ - @Endpoint(describeByClass = true) - public static CropAndResizeGradBoxes create(Scope scope, Operand grads, Operand image, Operand boxes, Operand boxInd, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("CropAndResizeGradBoxes", scope.makeOpName("CropAndResizeGradBoxes")); + @Endpoint( + describeByClass = true + ) + public static CropAndResizeGradBoxes create(Scope scope, Operand grads, + Operand image, Operand boxes, Operand boxInd, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CropAndResizeGradBoxes"); opBuilder.addInput(grads.asOutput()); opBuilder.addInput(image.asOutput()); opBuilder.addInput(boxes.asOutput()); opBuilder.addInput(boxInd.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.method != null) { @@ -94,35 +97,105 @@ public static CropAndResizeGradBoxes create(Scope scope, Operand grads } return new CropAndResizeGradBoxes(opBuilder.build()); } - + /** + * Sets the method option. + * * @param method A string specifying the interpolation method. Only 'bilinear' is * supported for now. + * @return this Options instance. */ public static Options method(String method) { return new Options().method(method); } - + /** - * A 2-D tensor of shape `[num_boxes, 4]`. + * Gets output. + * A 2-D tensor of shape {@code [num_boxes, 4]}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CropAndResizeGradBoxes"; - - private Output output; - - private CropAndResizeGradBoxes(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.CropAndResizeGradBoxes} + */ + public static class Options { + private String method; + + private Options() { + } + + /** + * Sets the method option. + * + * @param method A string specifying the interpolation method. Only 'bilinear' is + * supported for now. + * @return this Options instance. + */ + public Options method(String method) { + this.method = 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 97cd59a6db6..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,79 +17,81 @@ 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 */ -@Operator(group = "image") +@OpMetadata( + opType = CropAndResizeGradImage.OP_NAME, + inputsClass = CropAndResizeGradImage.Inputs.class +) +@Operator( + group = "image" +) public final class CropAndResizeGradImage extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.CropAndResizeGradImage} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param method A string specifying the interpolation method. Only 'bilinear' is - * supported for now. - */ - public Options method(String method) { - this.method = method; - return this; - } - - private String method; - - private Options() { - } + public static final String OP_NAME = "CropAndResizeGradImage"; + + private Output output; + + public CropAndResizeGradImage(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new CropAndResizeGradImage operation. - * + * * @param scope current scope - * @param grads A 4-D tensor of shape `[num_boxes, crop_height, crop_width, depth]`. - * @param boxes A 2-D tensor of shape `[num_boxes, 4]`. The `i`-th row of the tensor - * specifies the coordinates of a box in the `box_ind[i]` image and is specified - * in normalized coordinates `[y1, x1, y2, x2]`. A normalized coordinate value of - * `y` is mapped to the image coordinate at `y * (image_height - 1)`, so as the - * `[0, 1]` interval of normalized image height is mapped to - * `[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]` range are allowed, in which case we use - * `extrapolation_value` to extrapolate the input image values. - * @param boxInd A 1-D tensor of shape `[num_boxes]` with int32 values in `[0, batch)`. - * The value of `box_ind[i]` specifies the image that the `i`-th box refers to. - * @param imageSize A 1-D tensor with value `[batch, image_height, image_width, depth]` - * containing the original image size. Both `image_height` and `image_width` need + * @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 + * 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. + * @param boxInd 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. + * @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 - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static CropAndResizeGradImage create(Scope scope, Operand grads, Operand boxes, Operand boxInd, Operand imageSize, Class T, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("CropAndResizeGradImage", scope.makeOpName("CropAndResizeGradImage")); + @Endpoint( + describeByClass = true + ) + public static CropAndResizeGradImage create(Scope scope, + Operand grads, Operand boxes, Operand boxInd, + Operand imageSize, Class T, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CropAndResizeGradImage"); opBuilder.addInput(grads.asOutput()); opBuilder.addInput(boxes.asOutput()); opBuilder.addInput(boxInd.asOutput()); opBuilder.addInput(imageSize.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("T", Operands.toDataType(T)); if (options != null) { for (Options opts : options) { @@ -98,37 +100,108 @@ public static CropAndResizeGradImage create(Scope scope, } } } - return new CropAndResizeGradImage(opBuilder.build()); + return new CropAndResizeGradImage<>(opBuilder.build()); } - + /** + * Sets the method option. + * * @param method A string specifying the interpolation method. Only 'bilinear' is * supported for now. + * @return this Options instance. */ public static Options method(String method) { return new Options().method(method); } - + /** - * A 4-D tensor of shape `[batch, image_height, image_width, depth]`. + * Gets output. + * A 4-D tensor of shape {@code [batch, image_height, image_width, depth]}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CropAndResizeGradImage"; - - private Output output; - - private CropAndResizeGradImage(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.CropAndResizeGradImage} + */ + public static class Options { + private String method; + + private Options() { + } + + /** + * Sets the method option. + * + * @param method A string specifying the interpolation method. Only 'bilinear' is + * supported for now. + * @return this Options instance. + */ + public Options method(String method) { + this.method = 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 cebf06eb326..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; @@ -31,121 +36,60 @@ /** * Decode and Crop a JPEG-encoded image to a uint8 tensor. - *

- * The attr `channels` indicates the desired number of color channels for the + * The attr {@code channels} indicates the desired number of color channels for the * decoded image. - *

- * Accepted values are: + *

Accepted values are: *

    - *
  • - * 0: Use the number of channels in the JPEG-encoded image. - *
  • - *
  • - * 1: output a grayscale image. - *
  • - *
  • - * 3: output an RGB image. - *
  • + *
  • 0: Use the number of channels in the JPEG-encoded image.
  • + *
  • 1: output a grayscale image.
  • + *
  • 3: output an RGB image.
  • *
- * If needed, the JPEG-encoded image is transformed to match the requested number + *

If needed, the JPEG-encoded image is transformed to match the requested number * of color channels. - *

- * The attr `ratio` allows downscaling the image by an integer factor during + *

The attr {@code ratio} allows downscaling the image by an integer factor during * decoding. Allowed values are: 1, 2, 4, and 8. This is much faster than * downscaling the image later. - *

- * It is equivalent to a combination of decode and crop, but much faster by only + *

It is equivalent to a combination of decode and crop, but much faster by only * decoding partial jpeg image. */ -@Operator(group = "image") +@OpMetadata( + opType = DecodeAndCropJpeg.OP_NAME, + inputsClass = DecodeAndCropJpeg.Inputs.class +) +@Operator( + group = "image" +) public final class DecodeAndCropJpeg extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.DecodeAndCropJpeg} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param channels Number of color channels for the decoded image. - */ - public Options channels(Long channels) { - this.channels = channels; - return this; - } - - /** - * @param ratio Downscaling ratio. - */ - public Options ratio(Long ratio) { - this.ratio = ratio; - return this; - } - - /** - * @param fancyUpscaling If true use a slower but nicer upscaling of the - * chroma planes (yuv420/422 only). - */ - public Options fancyUpscaling(Boolean fancyUpscaling) { - this.fancyUpscaling = fancyUpscaling; - return this; - } - - /** - * @param tryRecoverTruncated If true try to recover an image from truncated input. - */ - public Options tryRecoverTruncated(Boolean tryRecoverTruncated) { - this.tryRecoverTruncated = tryRecoverTruncated; - return this; - } - - /** - * @param acceptableFraction The minimum required fraction of lines before a truncated - * input is accepted. - */ - public Options acceptableFraction(Float acceptableFraction) { - this.acceptableFraction = acceptableFraction; - return this; - } - - /** - * @param dctMethod 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 Options dctMethod(String dctMethod) { - this.dctMethod = dctMethod; - return this; - } - - private Long channels; - private Long ratio; - private Boolean fancyUpscaling; - private Boolean tryRecoverTruncated; - private Float acceptableFraction; - private String dctMethod; - - private Options() { - } + public static final String OP_NAME = "DecodeAndCropJpeg"; + + private Output image; + + public DecodeAndCropJpeg(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + image = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DecodeAndCropJpeg operation. - * + * * @param scope current scope * @param contents 0-D. The JPEG-encoded image. * @param cropWindow 1-D. The crop window: [crop_y, crop_x, crop_height, crop_width]. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of DecodeAndCropJpeg */ - @Endpoint(describeByClass = true) - public static DecodeAndCropJpeg create(Scope scope, Operand contents, Operand cropWindow, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DecodeAndCropJpeg", scope.makeOpName("DecodeAndCropJpeg")); + @Endpoint( + describeByClass = true + ) + public static DecodeAndCropJpeg create(Scope scope, Operand contents, + Operand cropWindow, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DecodeAndCropJpeg"); opBuilder.addInput(contents.asOutput()); opBuilder.addInput(cropWindow.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.channels != null) { @@ -170,76 +114,243 @@ public static DecodeAndCropJpeg create(Scope scope, Operand contents, O } return new DecodeAndCropJpeg(opBuilder.build()); } - + /** + * 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); } - + /** + * Sets the ratio option. + * * @param ratio Downscaling ratio. + * @return this Options instance. */ public static Options ratio(Long ratio) { return new Options().ratio(ratio); } - + /** + * Sets the fancyUpscaling option. + * * @param fancyUpscaling If true use a slower but nicer upscaling of the * chroma planes (yuv420/422 only). + * @return this Options instance. */ public static Options fancyUpscaling(Boolean fancyUpscaling) { return new Options().fancyUpscaling(fancyUpscaling); } - + /** + * Sets the tryRecoverTruncated option. + * * @param tryRecoverTruncated If true try to recover an image from truncated input. + * @return this Options instance. */ public static Options tryRecoverTruncated(Boolean tryRecoverTruncated) { return new Options().tryRecoverTruncated(tryRecoverTruncated); } - + /** + * Sets the acceptableFraction option. + * * @param acceptableFraction The minimum required fraction of lines before a truncated * input is accepted. + * @return this Options instance. */ public static Options acceptableFraction(Float acceptableFraction) { return new Options().acceptableFraction(acceptableFraction); } - + /** + * Sets the dctMethod option. + * * @param dctMethod 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 + * 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.) + * @return this Options instance. */ public static Options dctMethod(String dctMethod) { return new Options().dctMethod(dctMethod); } - + /** - * 3-D with shape `[height, width, channels]`.. + * Gets image. + * 3-D with shape {@code [height, width, channels]}.. + * @return image. */ public Output image() { return image; } - + @Override public Output asOutput() { return image; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeAndCropJpeg"; - - private Output image; - - private DecodeAndCropJpeg(Operation operation) { - super(operation); - int outputIdx = 0; - image = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.DecodeAndCropJpeg} + */ + public static class Options { + private Long channels; + + private Long ratio; + + private Boolean fancyUpscaling; + + private Boolean tryRecoverTruncated; + + private Float acceptableFraction; + + private String dctMethod; + + 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; + } + + /** + * Sets the ratio option. + * + * @param ratio Downscaling ratio. + * @return this Options instance. + */ + public Options ratio(Long ratio) { + this.ratio = ratio; + return this; + } + + /** + * Sets the fancyUpscaling option. + * + * @param fancyUpscaling If true use a slower but nicer upscaling of the + * chroma planes (yuv420/422 only). + * @return this Options instance. + */ + public Options fancyUpscaling(Boolean fancyUpscaling) { + this.fancyUpscaling = fancyUpscaling; + return this; + } + + /** + * Sets the tryRecoverTruncated option. + * + * @param tryRecoverTruncated If true try to recover an image from truncated input. + * @return this Options instance. + */ + public Options tryRecoverTruncated(Boolean tryRecoverTruncated) { + this.tryRecoverTruncated = tryRecoverTruncated; + return this; + } + + /** + * Sets the acceptableFraction option. + * + * @param acceptableFraction The minimum required fraction of lines before a truncated + * input is accepted. + * @return this Options instance. + */ + public Options acceptableFraction(Float acceptableFraction) { + this.acceptableFraction = acceptableFraction; + return this; + } + + /** + * Sets the dctMethod option. + * + * @param dctMethod 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.) + * @return this Options instance. + */ + public Options dctMethod(String dctMethod) { + this.dctMethod = 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 72f6920b650..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,69 +17,68 @@ 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; /** * Decode the first frame of a BMP-encoded image to a uint8 tensor. - *

- * The attr `channels` indicates the desired number of color channels for the + * The attr {@code channels} indicates the desired number of color channels for the * decoded image. - *

- * Accepted values are: + *

Accepted values are: *

    - *
  • - * 0: Use the number of channels in the BMP-encoded image. - *
  • - *
  • - * 3: output an RGB image. - *
  • - *
  • - * 4: output an RGBA image. + *
  • 0: Use the number of channels in the BMP-encoded image.
  • + *
  • 3: output an RGB image.
  • + *
  • 4: output an RGBA image.
  • + *
*/ -@Operator(group = "image") +@OpMetadata( + opType = DecodeBmp.OP_NAME, + inputsClass = DecodeBmp.Inputs.class +) +@Operator( + group = "image" +) public final class DecodeBmp extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.DecodeBmp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param channels - */ - public Options channels(Long channels) { - this.channels = channels; - return this; - } - - private Long channels; - - private Options() { - } + public static final String OP_NAME = "DecodeBmp"; + + private Output image; + + public DecodeBmp(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + image = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DecodeBmp operation. - * + * * @param scope current scope * @param contents 0-D. The BMP-encoded image. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of DecodeBmp */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DecodeBmp create(Scope scope, Operand contents, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DecodeBmp", scope.makeOpName("DecodeBmp")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DecodeBmp"); opBuilder.addInput(contents.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.channels != null) { @@ -89,34 +88,71 @@ public static DecodeBmp create(Scope scope, Operand contents, Options.. } return new DecodeBmp(opBuilder.build()); } - + /** - * @param channels + * Sets the channels option. + * + * @param channels the channels option + * @return this Options instance. */ public static Options channels(Long channels) { return new Options().channels(channels); } - + /** - * 3-D with shape `[height, width, channels]`. RGB order + * Gets image. + * 3-D with shape {@code [height, width, channels]}. RGB order + * @return image. */ public Output image() { return image; } - + @Override public Output asOutput() { return image; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeBmp"; - - private Output image; - - private DecodeBmp(Operation operation) { - super(operation); - int outputIdx = 0; - image = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.DecodeBmp} + */ + public static class Options { + private Long channels; + + private Options() { + } + + /** + * Sets the channels option. + * + * @param channels the channels option + * @return this Options instance. + */ + public Options channels(Long channels) { + this.channels = 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 93f5f6116f3..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,67 +17,97 @@ 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; /** * Decode the frame(s) of a GIF-encoded image to a uint8 tensor. - *

* GIF images with frame or transparency compression are not supported. * On Linux and MacOS systems, convert animated GIFs from compressed to * uncompressed by running: - *

- * convert $src.gif -coalesce $dst.gif - *

- * This op also supports decoding JPEGs and PNGs, though it is cleaner to use - * `tf.io.decode_image`. + *

+ * convert $src.gif -coalesce $dst.gif
+ * 
+ *

This op also supports decoding JPEGs and PNGs, though it is cleaner to use + * {@code tf.io.decode_image}. */ -@Operator(group = "image") +@OpMetadata( + opType = DecodeGif.OP_NAME, + inputsClass = DecodeGif.Inputs.class +) +@Operator( + group = "image" +) public final class DecodeGif extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DecodeGif"; + + private Output image; + + public DecodeGif(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + image = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DecodeGif operation. - * + * * @param scope current scope * @param contents 0-D. The GIF-encoded image. * @return a new instance of DecodeGif */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DecodeGif create(Scope scope, Operand contents) { - OperationBuilder opBuilder = scope.env().opBuilder("DecodeGif", scope.makeOpName("DecodeGif")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DecodeGif"); opBuilder.addInput(contents.asOutput()); - opBuilder = scope.apply(opBuilder); return new DecodeGif(opBuilder.build()); } - + /** - * 4-D with shape `[num_frames, height, width, 3]`. RGB channel order. + * Gets image. + * 4-D with shape {@code [num_frames, height, width, 3]}. RGB channel order. + * @return image. */ public Output image() { return image; } - + @Override public Output asOutput() { return image; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeGif"; - - private Output image; - - private DecodeGif(Operation operation) { - super(operation); - int outputIdx = 0; - image = operation.output(outputIdx++); + + @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 2f307368b9b..ced9e2198c5 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,90 +17,82 @@ 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 - * appropriate operation to convert the input bytes string into a Tensor of type - * dtype. - *

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

- * NOTE: If the first frame of an animated GIF does not occupy the entire + * Function for decode_bmp, decode_gif, decode_jpeg, decode_jxl, decode_webp, and decode_png. + * Detects whether an image is a BMP, GIF, JPEG, JPEG XL, WebP, or PNG, and + * performs the appropriate operation to convert the input bytes string into a + * Tensor of type dtype. + *

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 */ -@Operator(group = "image") +@OpMetadata( + opType = DecodeImage.OP_NAME, + inputsClass = DecodeImage.Inputs.class +) +@Operator( + group = "image" +) public final class DecodeImage extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.DecodeImage} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param channels Number of color channels for the decoded image. - */ - public Options channels(Long channels) { - this.channels = channels; - return this; - } - - /** - * @param expandAnimations Controls the output shape of the returned op. If True, the returned op will - * produce a 3-D tensor for PNG, JPEG, and BMP files; and a 4-D tensor for all - * GIFs, whether animated or not. If, False, the returned op will produce a 3-D - * tensor for all file types and will truncate animated GIFs to the first frame. - */ - public Options expandAnimations(Boolean expandAnimations) { - this.expandAnimations = expandAnimations; - return this; - } - - private Long channels; - private Boolean expandAnimations; - - private Options() { - } + public static final String OP_NAME = "DecodeImage"; + + private Output image; + + public DecodeImage(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + image = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DecodeImage operation. - * + * * @param scope current scope * @param contents 0-D. The encoded image bytes. * @param dtype The desired DType of the returned Tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code DecodeImage} output and operands * @return a new instance of DecodeImage */ - @Endpoint(describeByClass = true) - public static DecodeImage create(Scope scope, Operand contents, Class dtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DecodeImage", scope.makeOpName("DecodeImage")); + @Endpoint( + describeByClass = true + ) + public static DecodeImage create(Scope scope, Operand contents, + Class dtype, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DecodeImage"); opBuilder.addInput(contents.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); if (options != null) { for (Options opts : options) { @@ -112,60 +104,137 @@ public static DecodeImage create(Scope scope, Operand(opBuilder.build()); + return new DecodeImage<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new DecodeImage operation using default output types. - * + * Factory method to create a class wrapping a new DecodeImage operation, with the default output types. + * * @param scope current scope * @param contents 0-D. The encoded image bytes. - * @param options carries optional attributes values - * @return a new instance of DecodeImage + * @param options carries optional attribute values + * @return a new instance of DecodeImage, with default output types */ - @Endpoint(describeByClass = true) - public static DecodeImage create(Scope scope, Operand contents, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DecodeImage 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); } - + /** - * @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. + * 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, JPEG XL, 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) { return new Options().expandAnimations(expandAnimations); } - + /** - * 3-D with shape `[height, width, channels]` or 4-D with shape - * `[frame, height, width, channels]`.. + * Gets image. + * 3-D with shape {@code [height, width, channels]} or 4-D with shape + * {@code [frame, height, width, channels]}.. + * @return image. */ public Output image() { return image; } - + @Override public Output asOutput() { return image; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeImage"; - - private Output image; - - private DecodeImage(Operation operation) { - super(operation); - int outputIdx = 0; - image = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.DecodeImage} + */ + public static class Options { + private Long channels; + + private Boolean expandAnimations; + + 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; + } + + /** + * 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, JPEG XL, 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) { + this.expandAnimations = 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, JPEG XL, 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 0c2298f12b6..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,132 +17,75 @@ 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; /** * Decode a JPEG-encoded image to a uint8 tensor. - *

- * The attr `channels` indicates the desired number of color channels for the + * The attr {@code channels} indicates the desired number of color channels for the * decoded image. - *

- * Accepted values are: + *

Accepted values are: *

    - *
  • - * 0: Use the number of channels in the JPEG-encoded image. - *
  • - *
  • - * 1: output a grayscale image. - *
  • - *
  • - * 3: output an RGB image. - *
  • + *
  • 0: Use the number of channels in the JPEG-encoded image.
  • + *
  • 1: output a grayscale image.
  • + *
  • 3: output an RGB image.
  • *
- * If needed, the JPEG-encoded image is transformed to match the requested number + *

If needed, the JPEG-encoded image is transformed to match the requested number * of color channels. - *

- * The attr `ratio` allows downscaling the image by an integer factor during + *

The attr {@code ratio} allows downscaling the image by an integer factor during * decoding. Allowed values are: 1, 2, 4, and 8. This is much faster than * downscaling the image later. - *

- * This op also supports decoding PNGs and non-animated GIFs since the interface is - * the same, though it is cleaner to use `tf.io.decode_image`. + *

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}. */ -@Operator(group = "image") +@OpMetadata( + opType = DecodeJpeg.OP_NAME, + inputsClass = DecodeJpeg.Inputs.class +) +@Operator( + group = "image" +) public final class DecodeJpeg extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.DecodeJpeg} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param channels Number of color channels for the decoded image. - */ - public Options channels(Long channels) { - this.channels = channels; - return this; - } - - /** - * @param ratio Downscaling ratio. - */ - public Options ratio(Long ratio) { - this.ratio = ratio; - return this; - } - - /** - * @param fancyUpscaling If true use a slower but nicer upscaling of the - * chroma planes (yuv420/422 only). - */ - public Options fancyUpscaling(Boolean fancyUpscaling) { - this.fancyUpscaling = fancyUpscaling; - return this; - } - - /** - * @param tryRecoverTruncated If true try to recover an image from truncated input. - */ - public Options tryRecoverTruncated(Boolean tryRecoverTruncated) { - this.tryRecoverTruncated = tryRecoverTruncated; - return this; - } - - /** - * @param acceptableFraction The minimum required fraction of lines before a truncated - * input is accepted. - */ - public Options acceptableFraction(Float acceptableFraction) { - this.acceptableFraction = acceptableFraction; - return this; - } - - /** - * @param dctMethod 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 Options dctMethod(String dctMethod) { - this.dctMethod = dctMethod; - return this; - } - - private Long channels; - private Long ratio; - private Boolean fancyUpscaling; - private Boolean tryRecoverTruncated; - private Float acceptableFraction; - private String dctMethod; - - private Options() { - } + public static final String OP_NAME = "DecodeJpeg"; + + private Output image; + + public DecodeJpeg(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + image = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DecodeJpeg operation. - * + * * @param scope current scope * @param contents 0-D. The JPEG-encoded image. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of DecodeJpeg */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DecodeJpeg create(Scope scope, Operand contents, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DecodeJpeg", scope.makeOpName("DecodeJpeg")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DecodeJpeg"); opBuilder.addInput(contents.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.channels != null) { @@ -167,76 +110,237 @@ public static DecodeJpeg create(Scope scope, Operand contents, Options. } return new DecodeJpeg(opBuilder.build()); } - + /** + * 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); } - + /** + * Sets the ratio option. + * * @param ratio Downscaling ratio. + * @return this Options instance. */ public static Options ratio(Long ratio) { return new Options().ratio(ratio); } - + /** + * Sets the fancyUpscaling option. + * * @param fancyUpscaling If true use a slower but nicer upscaling of the * chroma planes (yuv420/422 only). + * @return this Options instance. */ public static Options fancyUpscaling(Boolean fancyUpscaling) { return new Options().fancyUpscaling(fancyUpscaling); } - + /** + * Sets the tryRecoverTruncated option. + * * @param tryRecoverTruncated If true try to recover an image from truncated input. + * @return this Options instance. */ public static Options tryRecoverTruncated(Boolean tryRecoverTruncated) { return new Options().tryRecoverTruncated(tryRecoverTruncated); } - + /** + * Sets the acceptableFraction option. + * * @param acceptableFraction The minimum required fraction of lines before a truncated * input is accepted. + * @return this Options instance. */ public static Options acceptableFraction(Float acceptableFraction) { return new Options().acceptableFraction(acceptableFraction); } - + /** + * Sets the dctMethod option. + * * @param dctMethod 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 + * 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.) + * @return this Options instance. */ public static Options dctMethod(String dctMethod) { return new Options().dctMethod(dctMethod); } - + /** - * 3-D with shape `[height, width, channels]`.. + * Gets image. + * 3-D with shape {@code [height, width, channels]}.. + * @return image. */ public Output image() { return image; } - + @Override public Output asOutput() { return image; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeJpeg"; - - private Output image; - - private DecodeJpeg(Operation operation) { - super(operation); - int outputIdx = 0; - image = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.DecodeJpeg} + */ + public static class Options { + private Long channels; + + private Long ratio; + + private Boolean fancyUpscaling; + + private Boolean tryRecoverTruncated; + + private Float acceptableFraction; + + private String dctMethod; + + 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; + } + + /** + * Sets the ratio option. + * + * @param ratio Downscaling ratio. + * @return this Options instance. + */ + public Options ratio(Long ratio) { + this.ratio = ratio; + return this; + } + + /** + * Sets the fancyUpscaling option. + * + * @param fancyUpscaling If true use a slower but nicer upscaling of the + * chroma planes (yuv420/422 only). + * @return this Options instance. + */ + public Options fancyUpscaling(Boolean fancyUpscaling) { + this.fancyUpscaling = fancyUpscaling; + return this; + } + + /** + * Sets the tryRecoverTruncated option. + * + * @param tryRecoverTruncated If true try to recover an image from truncated input. + * @return this Options instance. + */ + public Options tryRecoverTruncated(Boolean tryRecoverTruncated) { + this.tryRecoverTruncated = tryRecoverTruncated; + return this; + } + + /** + * Sets the acceptableFraction option. + * + * @param acceptableFraction The minimum required fraction of lines before a truncated + * input is accepted. + * @return this Options instance. + */ + public Options acceptableFraction(Float acceptableFraction) { + this.acceptableFraction = acceptableFraction; + return this; + } + + /** + * Sets the dctMethod option. + * + * @param dctMethod 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.) + * @return this Options instance. + */ + public Options dctMethod(String dctMethod) { + this.dctMethod = 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 c2eb543f629..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,84 +17,79 @@ 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 PNG-encoded image to a uint8 or uint16 tensor. - *

- * The attr `channels` indicates the desired number of color channels for the + * The attr {@code channels} indicates the desired number of color channels for the * decoded image. - *

- * Accepted values are: + *

Accepted values are: *

    - *
  • - * 0: Use the number of channels in the PNG-encoded image. - *
  • - *
  • - * 1: output a grayscale image. - *
  • - *
  • - * 3: output an RGB image. - *
  • - *
  • - * 4: output an RGBA image. - *
  • + *
  • 0: Use the number of channels in the PNG-encoded image.
  • + *
  • 1: output a grayscale image.
  • + *
  • 3: output an RGB image.
  • + *
  • 4: output an RGBA image.
  • *
- * If needed, the PNG-encoded image is transformed to match the requested number + *

If needed, the PNG-encoded image is transformed to match the requested number * 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 `tf.io.decode_image`. - * - * @param data type for {@code image()} output + *

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}. */ -@Operator(group = "image") +@OpMetadata( + opType = DecodePng.OP_NAME, + inputsClass = DecodePng.Inputs.class +) +@Operator( + group = "image" +) public final class DecodePng extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.DecodePng} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param channels Number of color channels for the decoded image. - */ - public Options channels(Long channels) { - this.channels = channels; - return this; - } - - private Long channels; - - private Options() { - } + public static final String OP_NAME = "DecodePng"; + + private Output image; + + public DecodePng(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + image = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DecodePng operation. - * + * * @param scope current scope * @param contents 0-D. The PNG-encoded image. - * @param dtype - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static DecodePng create(Scope scope, Operand contents, Class dtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DecodePng", scope.makeOpName("DecodePng")); + @Endpoint( + describeByClass = true + ) + public static DecodePng create(Scope scope, Operand contents, + Class dtype, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DecodePng"); opBuilder.addInput(contents.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); if (options != null) { for (Options opts : options) { @@ -103,49 +98,95 @@ public static DecodePng create(Scope scope, Operand(opBuilder.build()); + return new DecodePng<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new DecodePng operation using default output types. - * + * Factory method to create a class wrapping a new DecodePng operation, with the default output types. + * * @param scope current scope * @param contents 0-D. The PNG-encoded image. - * @param options carries optional attributes values - * @return a new instance of DecodePng + * @param options carries optional attribute values + * @return a new instance of DecodePng, with default output types */ - @Endpoint(describeByClass = true) - public static DecodePng create(Scope scope, Operand contents, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DecodePng 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); } - + /** - * 3-D with shape `[height, width, channels]`. + * Gets image. + * 3-D with shape {@code [height, width, channels]}. + * @return image. */ public Output image() { return image; } - + @Override public Output asOutput() { return image; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodePng"; - - private Output image; - - private DecodePng(Operation operation) { - super(operation); - int outputIdx = 0; - image = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.DecodePng} + */ + 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 = 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 5204c603b31..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,78 +17,126 @@ 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; /** * Draw bounding boxes on a batch of images. - *

- * Outputs a copy of `images` but draws on top of the pixels zero or more bounding - * boxes specified by the locations in `boxes`. The coordinates of the each - * bounding box in `boxes` are encoded as `[y_min, x_min, y_max, x_max]`. The - * bounding box coordinates are floats in `[0.0, 1.0]` relative to the width and + * Outputs a copy of {@code images} but draws on top of the pixels zero or more bounding + * boxes specified by the locations in {@code boxes}. The coordinates of the each + * bounding box in {@code boxes} are encoded as {@code [y_min, x_min, y_max, x_max]}. The + * bounding box coordinates are floats in {@code [0.0, 1.0]} relative to the width and * height of the underlying image. - *

- * For example, if an image is 100 x 200 pixels (height x width) and the bounding - * box is `[0.1, 0.2, 0.5, 0.9]`, the upper-left and bottom-right coordinates of - * the bounding box will be `(40, 10)` to `(100, 50)` (in (x,y) coordinates). - *

- * Parts of the bounding box may fall outside the image. - * - * @param data type for {@code output()} output + *

For example, if an image is 100 x 200 pixels (height x width) and the bounding + * 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. */ -@Operator(group = "image") +@OpMetadata( + opType = DrawBoundingBoxes.OP_NAME, + inputsClass = DrawBoundingBoxes.Inputs.class +) +@Operator( + group = "image" +) public final class DrawBoundingBoxes extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new DrawBoundingBoxes operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DrawBoundingBoxesV2"; + + private Output output; + + public DrawBoundingBoxes(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new DrawBoundingBoxesV2 operation. + * * @param scope current scope - * @param images 4-D with shape `[batch, height, width, depth]`. A batch of images. - * @param boxes 3-D with shape `[batch, num_bounding_boxes, 4]` containing bounding + * @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. * @param colors 2-D. A list of RGBA colors to cycle through for the boxes. + * @param data type for {@code DrawBoundingBoxesV2} output and operands * @return a new instance of DrawBoundingBoxes */ - @Endpoint(describeByClass = true) - public static DrawBoundingBoxes create(Scope scope, Operand images, Operand boxes, Operand colors) { - OperationBuilder opBuilder = scope.env().opBuilder("DrawBoundingBoxesV2", scope.makeOpName("DrawBoundingBoxes")); + @Endpoint( + describeByClass = true + ) + public static DrawBoundingBoxes create(Scope scope, Operand images, + Operand boxes, Operand colors) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DrawBoundingBoxes"); opBuilder.addInput(images.asOutput()); opBuilder.addInput(boxes.asOutput()); opBuilder.addInput(colors.asOutput()); - opBuilder = scope.apply(opBuilder); - return new DrawBoundingBoxes(opBuilder.build()); + return new DrawBoundingBoxes<>(opBuilder.build()); } - + /** - * 4-D with the same shape as `images`. The batch of input images with + * Gets output. + * 4-D with the same shape as {@code images}. The batch of input images with * bounding boxes drawn on the images. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DrawBoundingBoxesV2"; - - private Output output; - - private DrawBoundingBoxes(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 ae29290d8a5..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,154 +17,76 @@ 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; /** * JPEG-encode an image. - *

- * `image` is a 3-D uint8 Tensor of shape `[height, width, channels]`. - *

- * The attr `format` can be used to override the color format of the encoded + * {@code image} is a 3-D uint8 Tensor of shape {@code [height, width, channels]}. + *

The attr {@code format} can be used to override the color format of the encoded * output. Values can be: *

    - *
  • - * `''`: Use a default format based on the number of channels in the image. - *
  • - *
  • - * `grayscale`: Output a grayscale JPEG image. The `channels` dimension - * of `image` must be 1. - *
  • - *
  • - * `rgb`: Output an RGB JPEG image. The `channels` dimension - * of `image` must be 3. - *
  • + *
  • {@code ''}: Use a default format based on the number of channels in the image.
  • + *
  • {@code grayscale}: Output a grayscale JPEG image. The {@code channels} dimension + * of {@code image} must be 1.
  • + *
  • {@code rgb}: Output an RGB JPEG image. The {@code channels} dimension + * of {@code image} must be 3.
  • *
- * If `format` is not specified or is the empty string, a default format is picked - * in function of the number of channels in `image`: + *

If {@code format} is not specified or is the empty string, a default format is picked + * in function of the number of channels in {@code image}: *

    - *
  • - * 1: Output a grayscale image. - *
  • - *
  • - * 3: Output an RGB image. + *
  • 1: Output a grayscale image.
  • + *
  • 3: Output an RGB image.
  • + *
*/ -@Operator(group = "image") +@OpMetadata( + opType = EncodeJpeg.OP_NAME, + inputsClass = EncodeJpeg.Inputs.class +) +@Operator( + group = "image" +) public final class EncodeJpeg extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.EncodeJpeg} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param format Per pixel image format. - */ - public Options format(String format) { - this.format = format; - return this; - } - - /** - * @param quality Quality of the compression from 0 to 100 (higher is better and slower). - */ - public Options quality(Long quality) { - this.quality = quality; - return this; - } - - /** - * @param progressive If True, create a JPEG that loads progressively (coarse to fine). - */ - public Options progressive(Boolean progressive) { - this.progressive = progressive; - return this; - } - - /** - * @param optimizeSize If True, spend CPU/RAM to reduce size with no quality change. - */ - public Options optimizeSize(Boolean optimizeSize) { - this.optimizeSize = optimizeSize; - return this; - } - - /** - * @param chromaDownsampling See http://en.wikipedia.org/wiki/Chroma_subsampling. - */ - public Options chromaDownsampling(Boolean chromaDownsampling) { - this.chromaDownsampling = chromaDownsampling; - return this; - } - - /** - * @param densityUnit Unit used to specify `x_density` and `y_density`: - * pixels per inch (`'in'`) or centimeter (`'cm'`). - */ - public Options densityUnit(String densityUnit) { - this.densityUnit = densityUnit; - return this; - } - - /** - * @param xDensity Horizontal pixels per density unit. - */ - public Options xDensity(Long xDensity) { - this.xDensity = xDensity; - return this; - } - - /** - * @param yDensity Vertical pixels per density unit. - */ - public Options yDensity(Long yDensity) { - this.yDensity = yDensity; - return this; - } - - /** - * @param xmpMetadata If not empty, embed this XMP metadata in the image header. - */ - public Options xmpMetadata(String xmpMetadata) { - this.xmpMetadata = xmpMetadata; - return this; - } - - private String format; - private Long quality; - private Boolean progressive; - private Boolean optimizeSize; - private Boolean chromaDownsampling; - private String densityUnit; - private Long xDensity; - private Long yDensity; - private String xmpMetadata; - - private Options() { - } + public static final String OP_NAME = "EncodeJpeg"; + + private Output contents; + + public EncodeJpeg(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + contents = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new EncodeJpeg operation. - * + * * @param scope current scope - * @param image 3-D with shape `[height, width, channels]`. - * @param options carries optional attributes values + * @param image 3-D with shape {@code [height, width, channels]}. + * @param options carries optional attribute values * @return a new instance of EncodeJpeg */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static EncodeJpeg create(Scope scope, Operand image, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("EncodeJpeg", scope.makeOpName("EncodeJpeg")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "EncodeJpeg"); opBuilder.addInput(image.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.format != null) { @@ -198,91 +120,306 @@ public static EncodeJpeg create(Scope scope, Operand image, Options... o } return new EncodeJpeg(opBuilder.build()); } - + /** + * Sets the format option. + * * @param format Per pixel image format. + * @return this Options instance. */ public static Options format(String format) { return new Options().format(format); } - + /** + * Sets the quality option. + * * @param quality Quality of the compression from 0 to 100 (higher is better and slower). + * @return this Options instance. */ public static Options quality(Long quality) { return new Options().quality(quality); } - + /** + * Sets the progressive option. + * * @param progressive If True, create a JPEG that loads progressively (coarse to fine). + * @return this Options instance. */ public static Options progressive(Boolean progressive) { return new Options().progressive(progressive); } - + /** + * Sets the optimizeSize option. + * * @param optimizeSize If True, spend CPU/RAM to reduce size with no quality change. + * @return this Options instance. */ public static Options optimizeSize(Boolean optimizeSize) { return new Options().optimizeSize(optimizeSize); } - + /** + * Sets the chromaDownsampling option. + * * @param chromaDownsampling See http://en.wikipedia.org/wiki/Chroma_subsampling. + * @return this Options instance. */ public static Options chromaDownsampling(Boolean chromaDownsampling) { return new Options().chromaDownsampling(chromaDownsampling); } - + /** - * @param densityUnit Unit used to specify `x_density` and `y_density`: - * pixels per inch (`'in'`) or centimeter (`'cm'`). + * Sets the densityUnit option. + * + * @param densityUnit Unit used to specify {@code x_density} and {@code y_density}: + * pixels per inch ({@code 'in'}) or centimeter ({@code 'cm'}). + * @return this Options instance. */ public static Options densityUnit(String densityUnit) { return new Options().densityUnit(densityUnit); } - + /** + * Sets the xDensity option. + * * @param xDensity Horizontal pixels per density unit. + * @return this Options instance. */ public static Options xDensity(Long xDensity) { return new Options().xDensity(xDensity); } - + /** + * Sets the yDensity option. + * * @param yDensity Vertical pixels per density unit. + * @return this Options instance. */ public static Options yDensity(Long yDensity) { return new Options().yDensity(yDensity); } - + /** + * Sets the xmpMetadata option. + * * @param xmpMetadata If not empty, embed this XMP metadata in the image header. + * @return this Options instance. */ public static Options xmpMetadata(String xmpMetadata) { return new Options().xmpMetadata(xmpMetadata); } - + /** + * Gets contents. * 0-D. JPEG-encoded image. + * @return contents. */ public Output contents() { return contents; } - + @Override public Output asOutput() { return contents; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EncodeJpeg"; - - private Output contents; - - private EncodeJpeg(Operation operation) { - super(operation); - int outputIdx = 0; - contents = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.EncodeJpeg} + */ + public static class Options { + private String format; + + private Long quality; + + private Boolean progressive; + + private Boolean optimizeSize; + + private Boolean chromaDownsampling; + + private String densityUnit; + + private Long xDensity; + + private Long yDensity; + + private String xmpMetadata; + + private Options() { + } + + /** + * Sets the format option. + * + * @param format Per pixel image format. + * @return this Options instance. + */ + public Options format(String format) { + this.format = format; + return this; + } + + /** + * Sets the quality option. + * + * @param quality Quality of the compression from 0 to 100 (higher is better and slower). + * @return this Options instance. + */ + public Options quality(Long quality) { + this.quality = quality; + return this; + } + + /** + * Sets the progressive option. + * + * @param progressive If True, create a JPEG that loads progressively (coarse to fine). + * @return this Options instance. + */ + public Options progressive(Boolean progressive) { + this.progressive = progressive; + return this; + } + + /** + * Sets the optimizeSize option. + * + * @param optimizeSize If True, spend CPU/RAM to reduce size with no quality change. + * @return this Options instance. + */ + public Options optimizeSize(Boolean optimizeSize) { + this.optimizeSize = optimizeSize; + return this; + } + + /** + * Sets the chromaDownsampling option. + * + * @param chromaDownsampling See http://en.wikipedia.org/wiki/Chroma_subsampling. + * @return this Options instance. + */ + public Options chromaDownsampling(Boolean chromaDownsampling) { + this.chromaDownsampling = chromaDownsampling; + return this; + } + + /** + * Sets the densityUnit option. + * + * @param densityUnit Unit used to specify {@code x_density} and {@code y_density}: + * pixels per inch ({@code 'in'}) or centimeter ({@code 'cm'}). + * @return this Options instance. + */ + public Options densityUnit(String densityUnit) { + this.densityUnit = densityUnit; + return this; + } + + /** + * Sets the xDensity option. + * + * @param xDensity Horizontal pixels per density unit. + * @return this Options instance. + */ + public Options xDensity(Long xDensity) { + this.xDensity = xDensity; + return this; + } + + /** + * Sets the yDensity option. + * + * @param yDensity Vertical pixels per density unit. + * @return this Options instance. + */ + public Options yDensity(Long yDensity) { + this.yDensity = yDensity; + return this; + } + + /** + * Sets the xmpMetadata option. + * + * @param xmpMetadata If not empty, embed this XMP metadata in the image header. + * @return this Options instance. + */ + public Options xmpMetadata(String xmpMetadata) { + this.xmpMetadata = 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 cbd80e29413..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; @@ -31,51 +36,82 @@ /** * JPEG encode input image with provided compression quality. - *

- * `image` is a 3-D uint8 Tensor of shape `[height, width, channels]`. - * `quality` is an int32 jpeg compression quality value between 0 and 100. - * + * {@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. */ -@Operator(group = "image") +@OpMetadata( + opType = EncodeJpegVariableQuality.OP_NAME, + inputsClass = EncodeJpegVariableQuality.Inputs.class +) +@Operator( + group = "image" +) public final class EncodeJpegVariableQuality extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "EncodeJpegVariableQuality"; + + private Output contents; + + public EncodeJpegVariableQuality(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + contents = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new EncodeJpegVariableQuality operation. - * + * * @param scope current scope * @param images Images to adjust. At least 3-D. * @param quality An int quality to encode to. * @return a new instance of EncodeJpegVariableQuality */ - @Endpoint(describeByClass = true) - public static EncodeJpegVariableQuality create(Scope scope, Operand images, Operand quality) { - OperationBuilder opBuilder = scope.env().opBuilder("EncodeJpegVariableQuality", scope.makeOpName("EncodeJpegVariableQuality")); + @Endpoint( + describeByClass = true + ) + public static EncodeJpegVariableQuality create(Scope scope, Operand images, + Operand quality) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "EncodeJpegVariableQuality"); opBuilder.addInput(images.asOutput()); opBuilder.addInput(quality.asOutput()); - opBuilder = scope.apply(opBuilder); return new EncodeJpegVariableQuality(opBuilder.build()); } - + /** + * Gets contents. * 0-D. JPEG-encoded image. + * @return contents. */ public Output contents() { return contents; } - + @Override public Output asOutput() { return contents; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EncodeJpegVariableQuality"; - - private Output contents; - - private EncodeJpegVariableQuality(Operation operation) { - super(operation); - int outputIdx = 0; - contents = operation.output(outputIdx++); + + @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 7d998947efe..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,75 +17,73 @@ 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; /** * PNG-encode an image. - *

- * `image` is a 3-D uint8 or uint16 Tensor of shape `[height, width, channels]` - * where `channels` is: + * {@code image} is a 3-D uint8 or uint16 Tensor of shape {@code [height, width, channels]} + * where {@code channels} is: *

    - *
  • - * 1: for grayscale. - *
  • - *
  • - * 2: for grayscale + alpha. - *
  • - *
  • - * 3: for RGB. - *
  • - *
  • - * 4: for RGBA. - *
  • + *
  • 1: for grayscale.
  • + *
  • 2: for grayscale + alpha.
  • + *
  • 3: for RGB.
  • + *
  • 4: for RGBA.
  • *
- * The ZLIB compression level, `compression`, can be -1 for the PNG-encoder + *

The ZLIB compression level, {@code compression}, can be -1 for the PNG-encoder * default or a value from 0 to 9. 9 is the highest compression level, generating * the smallest output, but is slower. */ -@Operator(group = "image") +@OpMetadata( + opType = EncodePng.OP_NAME, + inputsClass = EncodePng.Inputs.class +) +@Operator( + group = "image" +) public final class EncodePng extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.EncodePng} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param compression Compression level. - */ - public Options compression(Long compression) { - this.compression = compression; - return this; - } - - private Long compression; - - private Options() { - } + public static final String OP_NAME = "EncodePng"; + + private Output contents; + + public EncodePng(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + contents = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new EncodePng operation. - * + * * @param scope current scope - * @param image 3-D with shape `[height, width, channels]`. - * @param options carries optional attributes values + * @param image 3-D with shape {@code [height, width, channels]}. + * @param options carries optional attribute values * @return a new instance of EncodePng */ - @Endpoint(describeByClass = true) - public static EncodePng create(Scope scope, Operand image, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("EncodePng", scope.makeOpName("EncodePng")); + @Endpoint( + describeByClass = true + ) + public static EncodePng create(Scope scope, Operand image, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "EncodePng"); opBuilder.addInput(image.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.compression != null) { @@ -95,34 +93,77 @@ public static EncodePng create(Scope scope, Operand image, Op } return new EncodePng(opBuilder.build()); } - + /** + * Sets the compression option. + * * @param compression Compression level. + * @return this Options instance. */ public static Options compression(Long compression) { return new Options().compression(compression); } - + /** + * Gets contents. * 0-D. PNG-encoded image. + * @return contents. */ public Output contents() { return contents; } - + @Override public Output asOutput() { return contents; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EncodePng"; - - private Output contents; - - private EncodePng(Operation operation) { - super(operation); - int outputIdx = 0; - contents = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.EncodePng} + */ + public static class Options { + private Long compression; + + private Options() { + } + + /** + * Sets the compression option. + * + * @param compression Compression level. + * @return this Options instance. + */ + public Options compression(Long compression) { + this.compression = 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 36a3c904689..ee9c2316946 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,121 +17,87 @@ 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; /** * Extracts a glimpse from the input tensor. - *

* Returns a set of windows called glimpses extracted at location - * `offsets` from the input tensor. If the windows only partially + * {@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 `[batch_size, glimpse_height, - * glimpse_width, channels]`. The channels and batch dimensions are the + *

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 `size` parameter. - *

- * The argument `normalized` and `centered` controls how the windows are built: + * 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. + *
  • 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.
  • + *
*/ +@OpMetadata( + opType = ExtractGlimpse.OP_NAME, + inputsClass = ExtractGlimpse.Inputs.class +) +@Operator( + group = "image" +) public final class ExtractGlimpse extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.ExtractGlimpse} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param centered 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 Options centered(Boolean centered) { - this.centered = centered; - return this; - } - - /** - * @param normalized indicates if the offset coordinates are normalized. - */ - public Options normalized(Boolean normalized) { - this.normalized = normalized; - return this; - } - - /** - * @param uniformNoise indicates if the noise should be generated using a - * uniform distribution or a Gaussian distribution. - */ - public Options uniformNoise(Boolean uniformNoise) { - this.uniformNoise = uniformNoise; - return this; - } - - /** - * @param noise indicates if the noise should `uniform`, `gaussian`, or - * `zero`. The default is `uniform` which means the the noise type - * will be decided by `uniform_noise`. - */ - public Options noise(String noise) { - this.noise = noise; - return this; - } - - private Boolean centered; - private Boolean normalized; - private Boolean uniformNoise; - private String noise; - - private Options() { - } + public static final String OP_NAME = "ExtractGlimpseV2"; + + private Output glimpse; + + public ExtractGlimpse(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + glimpse = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ExtractGlimpse operation. - * + * Factory method to create a class wrapping a new ExtractGlimpseV2 operation. + * * @param scope current scope - * @param input A 4-D float tensor of shape `[batch_size, height, width, channels]`. - * @param size A 1-D tensor of 2 elements containing the size of the glimpses + * @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 `[batch_size, 2]` containing + * @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 attributes values + * @param options carries optional attribute values * @return a new instance of ExtractGlimpse */ - @Endpoint(describeByClass = true) - public static ExtractGlimpse create(Scope scope, Operand input, Operand size, Operand offsets, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ExtractGlimpseV2", scope.makeOpName("ExtractGlimpse")); + @Endpoint( + describeByClass = true + ) + public static ExtractGlimpse create(Scope scope, Operand input, + Operand sizeOutput, Operand offsets, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ExtractGlimpse"); opBuilder.addInput(input.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder.addInput(offsets.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.centered != null) { @@ -150,62 +116,194 @@ public static ExtractGlimpse create(Scope scope, Operand input, Operan } return new ExtractGlimpse(opBuilder.build()); } - + /** + * Sets the centered option. + * * @param centered 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. + * @return this Options instance. */ public static Options centered(Boolean centered) { return new Options().centered(centered); } - + /** + * Sets the normalized option. + * * @param normalized indicates if the offset coordinates are normalized. + * @return this Options instance. */ public static Options normalized(Boolean normalized) { return new Options().normalized(normalized); } - + /** + * Sets the uniformNoise option. + * * @param uniformNoise indicates if the noise should be generated using a * uniform distribution or a Gaussian distribution. + * It should not be {@code True} when {@code noise} is not {@code uniform}. + * @return this Options instance. */ public static Options uniformNoise(Boolean uniformNoise) { return new Options().uniformNoise(uniformNoise); } - + /** - * @param noise indicates if the noise should `uniform`, `gaussian`, or - * `zero`. The default is `uniform` which means the the noise type - * will be decided by `uniform_noise`. + * Sets the noise option. + * + * @param noise 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}. + * @return this Options instance. */ public static Options noise(String noise) { return new Options().noise(noise); } - + /** - * A tensor representing the glimpses `[batch_size, - * glimpse_height, glimpse_width, channels]`. + * Gets glimpse. + * A tensor representing the glimpses {@code [batch_size, glimpse_height, glimpse_width, channels]}. + * @return glimpse. */ public Output glimpse() { return glimpse; } - + @Override public Output asOutput() { return glimpse; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExtractGlimpseV2"; - - private Output glimpse; - - private ExtractGlimpse(Operation operation) { - super(operation); - int outputIdx = 0; - glimpse = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ExtractGlimpse} + */ + public static class Options { + private Boolean centered; + + private Boolean normalized; + + private Boolean uniformNoise; + + private String noise; + + private Options() { + } + + /** + * Sets the centered option. + * + * @param centered 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. + * @return this Options instance. + */ + public Options centered(Boolean centered) { + this.centered = centered; + return this; + } + + /** + * Sets the normalized option. + * + * @param normalized indicates if the offset coordinates are normalized. + * @return this Options instance. + */ + public Options normalized(Boolean normalized) { + this.normalized = normalized; + return this; + } + + /** + * Sets the uniformNoise option. + * + * @param uniformNoise indicates if the noise should be generated using a + * uniform distribution or a Gaussian distribution. + * It should not be {@code True} when {@code noise} is not {@code uniform}. + * @return this Options instance. + */ + public Options uniformNoise(Boolean uniformNoise) { + this.uniformNoise = uniformNoise; + return this; + } + + /** + * Sets the noise option. + * + * @param noise 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}. + * @return this Options instance. + */ + public Options noise(String noise) { + this.noise = 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. + * It should not be {@code True} when {@code noise} is not {@code uniform}. + */ + 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 24707b85233..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,89 +17,156 @@ 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 `patches` from `images` and put them in the "depth" output dimension. - * - * @param data type for {@code patches()} output + * Extract {@code patches} from {@code images} and put them in the "depth" output dimension. */ -@Operator(group = "image") +@OpMetadata( + opType = ExtractImagePatches.OP_NAME, + inputsClass = ExtractImagePatches.Inputs.class +) +@Operator( + group = "image" +) public final class ExtractImagePatches extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExtractImagePatches"; + + private Output patches; + + public ExtractImagePatches(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + patches = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ExtractImagePatches operation. - * + * * @param scope current scope - * @param images 4-D Tensor with shape `[batch, in_rows, in_cols, depth]`. - * @param ksizes The size of the sliding window for each dimension of `images`. + * @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 - * the images. Must be: `[1, stride_rows, stride_cols, 1]`. - * @param rates Must be: `[1, rate_rows, rate_cols, 1]`. This is the + * the images. Must be: {@code [1, stride_rows, stride_cols, 1]}. + * @param rates 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 - * `patch_sizes_eff = patch_sizes + (patch_sizes - 1) * (rates - 1)`, followed by - * subsampling them spatially by a factor of `rates`. This is equivalent to - * `rate` in dilated (a.k.a. Atrous) convolutions. + * {@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. * @param padding The type of padding algorithm to use. + * @param data type for {@code ExtractImagePatches} output and operands * @return a new instance of ExtractImagePatches */ - @Endpoint(describeByClass = true) - public static ExtractImagePatches create(Scope scope, Operand images, List ksizes, List strides, List rates, String padding) { - OperationBuilder opBuilder = scope.env().opBuilder("ExtractImagePatches", scope.makeOpName("ExtractImagePatches")); + @Endpoint( + describeByClass = true + ) + public static ExtractImagePatches create(Scope scope, Operand images, + List ksizes, List strides, List rates, String padding) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ExtractImagePatches"); opBuilder.addInput(images.asOutput()); - opBuilder = scope.apply(opBuilder); long[] ksizesArray = new long[ksizes.size()]; - for (int i = 0; i < ksizesArray.length; ++i) { + for (int i = 0 ; i < ksizesArray.length ; i++) { ksizesArray[i] = ksizes.get(i); } opBuilder.setAttr("ksizes", ksizesArray); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); long[] ratesArray = new long[rates.size()]; - for (int i = 0; i < ratesArray.length; ++i) { + for (int i = 0 ; i < ratesArray.length ; i++) { ratesArray[i] = rates.get(i); } opBuilder.setAttr("rates", ratesArray); opBuilder.setAttr("padding", padding); - return new ExtractImagePatches(opBuilder.build()); + return new ExtractImagePatches<>(opBuilder.build()); } - + /** - * 4-D Tensor with shape `[batch, out_rows, out_cols, ksize_rows * - * ksize_cols * depth]` containing image patches with size - * `ksize_rows x ksize_cols x depth` vectorized in the "depth" dimension. Note - * `out_rows` and `out_cols` are the dimensions of the output patches. + * Gets patches. + * 4-D Tensor with shape {@code [batch, out_rows, out_cols, ksize_rows * ksize_cols * depth]} containing image patches with size + * {@code ksize_rows x ksize_cols x depth} vectorized in the "depth" dimension. Note + * {@code out_rows} and {@code out_cols} are the dimensions of the output patches. + * @return patches. */ public Output patches() { return patches; } - + @Override public Output asOutput() { return patches; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExtractImagePatches"; - - private Output patches; - - private ExtractImagePatches(Operation operation) { - super(operation); - int outputIdx = 0; - patches = operation.output(outputIdx++); + + @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 bb12cb5cb1a..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,79 +17,119 @@ 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; /** * 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 imageShape()} output */ -@Operator(group = "image") +@OpMetadata( + opType = ExtractJpegShape.OP_NAME, + inputsClass = ExtractJpegShape.Inputs.class +) +@Operator( + group = "image" +) public final class ExtractJpegShape extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExtractJpegShape"; + + private Output imageShape; + + public ExtractJpegShape(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + imageShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ExtractJpegShape operation. - * + * * @param scope current scope * @param contents 0-D. The JPEG-encoded image. * @param outputType (Optional) The output type of the operation (int32 or int64). * Defaults to int32. + * @param data type for {@code ExtractJpegShape} output and operands * @return a new instance of ExtractJpegShape */ - @Endpoint(describeByClass = true) - public static ExtractJpegShape create(Scope scope, Operand contents, Class outputType) { - OperationBuilder opBuilder = scope.env().opBuilder("ExtractJpegShape", scope.makeOpName("ExtractJpegShape")); + @Endpoint( + describeByClass = true + ) + public static ExtractJpegShape create(Scope scope, + Operand contents, Class outputType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ExtractJpegShape"); opBuilder.addInput(contents.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_type", Operands.toDataType(outputType)); - return new ExtractJpegShape(opBuilder.build()); + return new ExtractJpegShape<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new ExtractJpegShape operation using default output types. - * + * Factory method to create a class wrapping a new ExtractJpegShape operation, with the default output types. + * * @param scope current scope * @param contents 0-D. The JPEG-encoded image. - * @return a new instance of ExtractJpegShape + * @return a new instance of ExtractJpegShape, with default output types */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ExtractJpegShape create(Scope scope, Operand contents) { return create(scope, contents, TInt32.class); } - + /** + * Gets imageShape. * 1-D. The image shape with format [height, width, channels]. + * @return imageShape. */ public Output imageShape() { return imageShape; } - + @Override public Output asOutput() { return imageShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExtractJpegShape"; - - private Output imageShape; - - private ExtractJpegShape(Operation operation) { - super(operation); - int outputIdx = 0; - imageShape = operation.output(outputIdx++); + + @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 52a693a5061..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,71 +17,85 @@ 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; /** * 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. + *

+ *   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.
+ * 
*/ +@OpMetadata( + opType = GenerateBoundingBoxProposals.OP_NAME, + inputsClass = GenerateBoundingBoxProposals.Inputs.class +) +@Operator( + group = "image" +) public final class GenerateBoundingBoxProposals extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.image.GenerateBoundingBoxProposals} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param postNmsTopn An integer. Maximum number of rois in the output. - */ - public Options postNmsTopn(Long postNmsTopn) { - this.postNmsTopn = postNmsTopn; - return this; - } - - private Long postNmsTopn; - - private Options() { - } + public static final String OP_NAME = "GenerateBoundingBoxProposals"; + + private Output rois; + + private Output roiProbabilities; + + public GenerateBoundingBoxProposals(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + rois = operation.output(outputIdx++); + roiProbabilities = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new GenerateBoundingBoxProposals operation. - * + * * @param scope current scope - * @param scores A 4-D float tensor of shape `[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 `[num_images, height, width, 4 x num_anchors]`. encoding boxes with respec to each anchor. + * @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 `[num_images, 5]` containing image information Height, Width, Scale. - * @param anchors A 2-D float tensor of shape `[num_anchors, 4]` describing the anchor boxes. Boxes are formatted in the form [y1, x1, y2, x2]. + * @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 attributes values + * @param options carries optional attribute values * @return a new instance of GenerateBoundingBoxProposals */ - @Endpoint(describeByClass = true) - public static GenerateBoundingBoxProposals create(Scope scope, Operand scores, Operand bboxDeltas, Operand imageInfo, Operand anchors, Operand nmsThreshold, Operand preNmsTopn, Operand minSize, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("GenerateBoundingBoxProposals", scope.makeOpName("GenerateBoundingBoxProposals")); + @Endpoint( + describeByClass = true + ) + public static GenerateBoundingBoxProposals create(Scope scope, Operand scores, + Operand bboxDeltas, Operand imageInfo, Operand anchors, + Operand nmsThreshold, Operand preNmsTopn, Operand minSize, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GenerateBoundingBoxProposals"); opBuilder.addInput(scores.asOutput()); opBuilder.addInput(bboxDeltas.asOutput()); opBuilder.addInput(imageInfo.asOutput()); @@ -89,7 +103,6 @@ public static GenerateBoundingBoxProposals create(Scope scope, Operand opBuilder.addInput(nmsThreshold.asOutput()); opBuilder.addInput(preNmsTopn.asOutput()); opBuilder.addInput(minSize.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.postNmsTopn != null) { @@ -99,40 +112,114 @@ public static GenerateBoundingBoxProposals create(Scope scope, Operand } return new GenerateBoundingBoxProposals(opBuilder.build()); } - + /** + * Sets the postNmsTopn option. + * * @param postNmsTopn An integer. Maximum number of rois in the output. + * @return this Options instance. */ public static Options postNmsTopn(Long postNmsTopn) { return new Options().postNmsTopn(postNmsTopn); } - + /** - * A 3-D float tensor of shape `[num_images,post_nms_topn,4]` representing the selected + * Gets rois. + * A 3-D float tensor of shape {@code [num_images,post_nms_topn,4]} representing the selected * region of interest boxes. Sorted in descending order in scores. + * @return rois. */ public Output rois() { return rois; } - + /** - * A 2-D float tensor of shape `[num_images, post_nms_topn]` representing the score of the - * region of interest box in `rois` tensor at the same index. + * Gets roiProbabilities. + * A 2-D float tensor of shape {@code [num_images, post_nms_topn]} representing the score of the + * region of interest box in {@code rois} tensor at the same index. + * @return roiProbabilities. */ public Output roiProbabilities() { return roiProbabilities; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "GenerateBoundingBoxProposals"; - - private Output rois; - private Output roiProbabilities; - - private GenerateBoundingBoxProposals(Operation operation) { - super(operation); - int outputIdx = 0; - rois = operation.output(outputIdx++); - roiProbabilities = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.GenerateBoundingBoxProposals} + */ + public static class Options { + private Long postNmsTopn; + + private Options() { + } + + /** + * Sets the postNmsTopn option. + * + * @param postNmsTopn An integer. Maximum number of rois in the output. + * @return this Options instance. + */ + public Options postNmsTopn(Long postNmsTopn) { + this.postNmsTopn = 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 7934480bad9..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,65 +17,100 @@ 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; /** * Convert one or more images from HSV to RGB. - *

- * Outputs a tensor of the same shape as the `images` tensor, containing the RGB - * value of the pixels. The output is only well defined if the value in `images` - * are in `[0,1]`. - *

- * See `rgb_to_hsv` for a description of the HSV encoding. - * - * @param data type for {@code output()} output + * Outputs a tensor of the same shape as the {@code images} tensor, containing the RGB + * 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. */ -@Operator(group = "image") +@OpMetadata( + opType = HsvToRgb.OP_NAME, + inputsClass = HsvToRgb.Inputs.class +) +@Operator( + group = "image" +) public final class HsvToRgb extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new HsvToRgb operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "HSVToRGB"; + + private Output output; + + public HsvToRgb(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new HSVToRGB operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static HsvToRgb create(Scope scope, Operand images) { - OperationBuilder opBuilder = scope.env().opBuilder("HSVToRGB", scope.makeOpName("HsvToRgb")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "HsvToRgb"); opBuilder.addInput(images.asOutput()); - opBuilder = scope.apply(opBuilder); - return new HsvToRgb(opBuilder.build()); + return new HsvToRgb<>(opBuilder.build()); } - + /** - * `images` converted to RGB. + * Gets output. + * {@code images} converted to RGB. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "HSVToRGB"; - - private Output output; - - private HsvToRgb(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 5fd57e44754..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,70 +17,77 @@ 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; /** * Applies the given transform to each of the images. - *

- * If one row of `transforms` is `[a0, a1, a2, b0, b1, b2, c0, c1]`, then it maps - * the output point `(x, y)` to a transformed input point - * `(x', y') = ((a0 x + a1 y + a2) / k, (b0 x + b1 y + b2) / k)`, where - * `k = c0 x + c1 y + 1`. If the transformed point lays outside of the input + * 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 data type for {@code transformedImages()} output */ +@OpMetadata( + opType = ImageProjectiveTransformV2.OP_NAME, + inputsClass = ImageProjectiveTransformV2.Inputs.class +) +@Operator( + group = "image" +) public final class ImageProjectiveTransformV2 extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.ImageProjectiveTransformV2} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param fillMode Fill mode, "REFLECT", "WRAP", or "CONSTANT". - */ - public Options fillMode(String fillMode) { - this.fillMode = fillMode; - return this; - } - - private String fillMode; - - private Options() { - } + public static final String OP_NAME = "ImageProjectiveTransformV2"; + + private Output transformedImages; + + public ImageProjectiveTransformV2(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + transformedImages = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ImageProjectiveTransformV2 operation. - * + * * @param scope current scope - * @param images 4-D with shape `[batch, height, width, channels]`. - * @param transforms 2-D Tensor, `[batch, 8]` or `[1, 8]` matrix, where each row corresponds to a 3 x 3 + * @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 attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static ImageProjectiveTransformV2 create(Scope scope, Operand images, Operand transforms, Operand outputShape, String interpolation, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ImageProjectiveTransformV2", scope.makeOpName("ImageProjectiveTransformV2")); + @Endpoint( + describeByClass = true + ) + public static ImageProjectiveTransformV2 create(Scope scope, + Operand images, Operand transforms, Operand outputShape, + String interpolation, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ImageProjectiveTransformV2"); opBuilder.addInput(images.asOutput()); opBuilder.addInput(transforms.asOutput()); opBuilder.addInput(outputShape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("interpolation", interpolation); if (options != null) { for (Options opts : options) { @@ -89,37 +96,100 @@ public static ImageProjectiveTransformV2 create(Scope sco } } } - return new ImageProjectiveTransformV2(opBuilder.build()); + return new ImageProjectiveTransformV2<>(opBuilder.build()); } - + /** - * @param fillMode Fill mode, "REFLECT", "WRAP", or "CONSTANT". + * Sets the fillMode option. + * + * @param fillMode Fill mode, "REFLECT", "WRAP", or "CONSTANT". + * @return this Options instance. */ public static Options fillMode(String fillMode) { return new Options().fillMode(fillMode); } - + /** + * Gets transformedImages. * 4-D with shape - * `[batch, new_height, new_width, channels]`. + * {@code [batch, new_height, new_width, channels]}. + * @return transformedImages. */ public Output transformedImages() { return transformedImages; } - + @Override public Output asOutput() { return transformedImages; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ImageProjectiveTransformV2"; - - private Output transformedImages; - - private ImageProjectiveTransformV2(Operation operation) { - super(operation); - int outputIdx = 0; - transformedImages = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ImageProjectiveTransformV2} + */ + public static class Options { + private String fillMode; + + private Options() { + } + + /** + * Sets the fillMode option. + * + * @param fillMode Fill mode, "REFLECT", "WRAP", or "CONSTANT". + * @return this Options instance. + */ + public Options fillMode(String fillMode) { + this.fillMode = 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 2b4de22d4d4..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,72 +17,79 @@ 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; /** * Applies the given transform to each of the images. - *

- * If one row of `transforms` is `[a0, a1, a2, b0, b1, b2, c0, c1]`, then it maps - * the output point `(x, y)` to a transformed input point - * `(x', y') = ((a0 x + a1 y + a2) / k, (b0 x + b1 y + b2) / k)`, where - * `k = c0 x + c1 y + 1`. If the transformed point lays outside of the input + * 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 data type for {@code transformedImages()} output */ +@OpMetadata( + opType = ImageProjectiveTransformV3.OP_NAME, + inputsClass = ImageProjectiveTransformV3.Inputs.class +) +@Operator( + group = "image" +) public final class ImageProjectiveTransformV3 extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.ImageProjectiveTransformV3} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param fillMode Fill mode, "REFLECT", "WRAP", or "CONSTANT". - */ - public Options fillMode(String fillMode) { - this.fillMode = fillMode; - return this; - } - - private String fillMode; - - private Options() { - } + public static final String OP_NAME = "ImageProjectiveTransformV3"; + + private Output transformedImages; + + public ImageProjectiveTransformV3(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + transformedImages = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ImageProjectiveTransformV3 operation. - * + * * @param scope current scope - * @param images 4-D with shape `[batch, height, width, channels]`. - * @param transforms 2-D Tensor, `[batch, 8]` or `[1, 8]` matrix, where each row corresponds to a 3 x 3 + * @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 attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static ImageProjectiveTransformV3 create(Scope scope, Operand images, Operand transforms, Operand outputShape, Operand fillValue, String interpolation, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ImageProjectiveTransformV3", scope.makeOpName("ImageProjectiveTransformV3")); + @Endpoint( + describeByClass = true + ) + public static ImageProjectiveTransformV3 create(Scope scope, + Operand images, Operand transforms, Operand outputShape, + Operand fillValue, String interpolation, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ImageProjectiveTransformV3"); opBuilder.addInput(images.asOutput()); opBuilder.addInput(transforms.asOutput()); opBuilder.addInput(outputShape.asOutput()); opBuilder.addInput(fillValue.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("interpolation", interpolation); if (options != null) { for (Options opts : options) { @@ -91,37 +98,106 @@ public static ImageProjectiveTransformV3 create(Scope sco } } } - return new ImageProjectiveTransformV3(opBuilder.build()); + return new ImageProjectiveTransformV3<>(opBuilder.build()); } - + /** - * @param fillMode Fill mode, "REFLECT", "WRAP", or "CONSTANT". + * Sets the fillMode option. + * + * @param fillMode Fill mode, "REFLECT", "WRAP", "CONSTANT", or "NEAREST". + * @return this Options instance. */ public static Options fillMode(String fillMode) { return new Options().fillMode(fillMode); } - + /** + * Gets transformedImages. * 4-D with shape - * `[batch, new_height, new_width, channels]`. + * {@code [batch, new_height, new_width, channels]}. + * @return transformedImages. */ public Output transformedImages() { return transformedImages; } - + @Override public Output asOutput() { return transformedImages; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ImageProjectiveTransformV3"; - - private Output transformedImages; - - private ImageProjectiveTransformV3(Operation operation) { - super(operation); - int outputIdx = 0; - transformedImages = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ImageProjectiveTransformV3} + */ + public static class Options { + private String fillMode; + + private Options() { + } + + /** + * Sets the fillMode option. + * + * @param fillMode Fill mode, "REFLECT", "WRAP", "CONSTANT", or "NEAREST". + * @return this Options instance. + */ + public Options fillMode(String fillMode) { + this.fillMode = 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 b33577f2e32..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,29 +17,55 @@ 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; /** * 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. */ +@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 + */ + public static final String OP_NAME = "NearestNeighbors"; + + private Output nearestCenterIndices; + + private Output nearestCenterDistances; + + public NearestNeighbors(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + nearestCenterIndices = operation.output(outputIdx++); + nearestCenterDistances = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NearestNeighbors operation. - * + * * @param scope current scope * @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. @@ -47,42 +73,64 @@ public final class NearestNeighbors extends RawOp { * only m centers are returned. * @return a new instance of NearestNeighbors */ - @Endpoint(describeByClass = true) - public static NearestNeighbors create(Scope scope, Operand points, Operand centers, Operand k) { - OperationBuilder opBuilder = scope.env().opBuilder("NearestNeighbors", scope.makeOpName("NearestNeighbors")); + @Endpoint( + describeByClass = true + ) + public static NearestNeighbors create(Scope scope, Operand points, + Operand centers, Operand k) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "NearestNeighbors"); opBuilder.addInput(points.asOutput()); opBuilder.addInput(centers.asOutput()); opBuilder.addInput(k.asOutput()); - opBuilder = scope.apply(opBuilder); return new NearestNeighbors(opBuilder.build()); } - + /** + * Gets nearestCenterIndices. * Matrix of shape (n, min(m, k)). Each row contains the indices of the centers * closest to the corresponding point, ordered by increasing distance. + * @return nearestCenterIndices. */ public Output nearestCenterIndices() { return nearestCenterIndices; } - + /** + * Gets nearestCenterDistances. * Matrix of shape (n, min(m, k)). Each row contains the squared L2 distance to the * corresponding center in nearest_center_indices. + * @return nearestCenterDistances. */ public Output nearestCenterDistances() { return nearestCenterDistances; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NearestNeighbors"; - - private Output nearestCenterIndices; - private Output nearestCenterDistances; - - private NearestNeighbors(Operation operation) { - super(operation); - int outputIdx = 0; - nearestCenterIndices = operation.output(outputIdx++); - nearestCenterDistances = operation.output(outputIdx++); + + @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 0f2e983f786..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,23 +17,28 @@ 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; /** * Greedily selects a subset of bounding boxes in descending order of score, - *

* pruning away boxes that have high intersection-over-union (IOU) overlap * with previously selected boxes. Bounding boxes with score less than - * `score_threshold` are removed. Bounding boxes are supplied as + * {@code score_threshold} are removed. Bounding boxes are supplied as * [y1, x1, y2, x2], where (y1, x1) and (y2, x2) are the coordinates of any * diagonal pair of box corners and the coordinates can be provided as normalized * (i.e., lying in the interval [0, 1]) or absolute. Note that this algorithm @@ -44,47 +49,49 @@ * The output of this operation is a set of integers indexing into the input * collection of bounding boxes representing the selected boxes. The bounding * box coordinates corresponding to the selected indices can then be obtained - * using the `tf.gather operation`. For example: - * selected_indices = tf.image.non_max_suppression_v2( - * boxes, scores, max_output_size, iou_threshold, score_threshold) - * selected_boxes = tf.gather(boxes, selected_indices) + * using the {@code tf.gather operation}. For example: + * selected_indices = tf.image.non_max_suppression_v2( + * boxes, scores, max_output_size, iou_threshold, score_threshold) + * selected_boxes = tf.gather(boxes, selected_indices) * This op also supports a Soft-NMS (with Gaussian weighting) mode (c.f. * Bodla et al, https://arxiv.org/abs/1704.04503) where boxes reduce the score * of other overlapping boxes instead of directly causing them to be pruned. - * To enable this Soft-NMS mode, set the `soft_nms_sigma` parameter to be + * To enable this Soft-NMS mode, set the {@code soft_nms_sigma} parameter to be * larger than 0. - * - * @param data type for {@code selectedScores()} output */ -@Operator(group = "image") +@OpMetadata( + opType = NonMaxSuppression.OP_NAME, + inputsClass = NonMaxSuppression.Inputs.class +) +@Operator( + group = "image" +) public final class NonMaxSuppression extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.image.NonMaxSuppression} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param padToMaxOutputSize If true, the output `selected_indices` is padded to be of length - * `max_output_size`. Defaults to false. - */ - public Options padToMaxOutputSize(Boolean padToMaxOutputSize) { - this.padToMaxOutputSize = padToMaxOutputSize; - return this; - } - - private Boolean padToMaxOutputSize; - - private Options() { - } + public static final String OP_NAME = "NonMaxSuppressionV5"; + + private Output selectedIndices; + + private Output selectedScores; + + private Output validOutputs; + + public NonMaxSuppression(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + selectedIndices = operation.output(outputIdx++); + selectedScores = operation.output(outputIdx++); + validOutputs = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new NonMaxSuppression operation. - * + * Factory method to create a class wrapping a new NonMaxSuppressionV5 operation. + * * @param scope current scope - * @param boxes A 2-D float tensor of shape `[num_boxes, 4]`. - * @param scores A 1-D float tensor of shape `[num_boxes]` representing a single + * @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). * @param maxOutputSize A scalar integer tensor representing the maximum number of * boxes to be selected by non max suppression. @@ -93,21 +100,25 @@ private Options() { * @param scoreThreshold A 0-D float tensor representing the threshold for deciding when to remove * boxes based on score. * @param softNmsSigma 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 `soft_nms_sigma=0.0` (which + * 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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code NonMaxSuppressionV5} output and operands * @return a new instance of NonMaxSuppression */ - @Endpoint(describeByClass = true) - public static NonMaxSuppression create(Scope scope, Operand boxes, Operand scores, Operand maxOutputSize, Operand iouThreshold, Operand scoreThreshold, Operand softNmsSigma, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("NonMaxSuppressionV5", scope.makeOpName("NonMaxSuppression")); + @Endpoint( + describeByClass = true + ) + public static NonMaxSuppression create(Scope scope, Operand boxes, + Operand scores, Operand maxOutputSize, Operand iouThreshold, + Operand scoreThreshold, Operand softNmsSigma, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "NonMaxSuppression"); opBuilder.addInput(boxes.asOutput()); opBuilder.addInput(scores.asOutput()); opBuilder.addInput(maxOutputSize.asOutput()); opBuilder.addInput(iouThreshold.asOutput()); opBuilder.addInput(scoreThreshold.asOutput()); opBuilder.addInput(softNmsSigma.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.padToMaxOutputSize != null) { @@ -115,55 +126,136 @@ public static NonMaxSuppression create(Scope scope, Opera } } } - return new NonMaxSuppression(opBuilder.build()); + return new NonMaxSuppression<>(opBuilder.build()); } - + /** - * @param padToMaxOutputSize If true, the output `selected_indices` is padded to be of length - * `max_output_size`. Defaults to false. + * Sets the padToMaxOutputSize option. + * + * @param padToMaxOutputSize If true, the output {@code selected_indices} is padded to be of length + * {@code max_output_size}. Defaults to false. + * @return this Options instance. */ public static Options padToMaxOutputSize(Boolean padToMaxOutputSize) { return new Options().padToMaxOutputSize(padToMaxOutputSize); } - + /** - * A 1-D integer tensor of shape `[M]` representing the selected - * indices from the boxes tensor, where `M <= max_output_size`. + * Gets selectedIndices. + * A 1-D integer tensor of shape {@code [M]} representing the selected + * indices from the boxes tensor, where {@code M <= max_output_size}. + * @return selectedIndices. */ public Output selectedIndices() { return selectedIndices; } - + /** - * A 1-D float tensor of shape `[M]` representing the corresponding - * scores for each selected box, where `M <= max_output_size`. Scores only differ + * Gets selectedScores. + * A 1-D float tensor of shape {@code [M]} representing the corresponding + * scores for each selected box, where {@code M <= max_output_size}. Scores only differ * from corresponding input scores when using Soft NMS (i.e. when - * `soft_nms_sigma>0`) + * {@code soft_nms_sigma>0}) + * @return selectedScores. */ public Output selectedScores() { return selectedScores; } - + /** + * Gets validOutputs. * A 0-D integer tensor representing the number of valid elements in - * `selected_indices`, with the valid elements appearing first. + * {@code selected_indices}, with the valid elements appearing first. + * @return validOutputs. */ public Output validOutputs() { return validOutputs; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NonMaxSuppressionV5"; - - private Output selectedIndices; - private Output selectedScores; - private Output validOutputs; - - private NonMaxSuppression(Operation operation) { - super(operation); - int outputIdx = 0; - selectedIndices = operation.output(outputIdx++); - selectedScores = operation.output(outputIdx++); - validOutputs = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.NonMaxSuppression} + */ + public static class Options { + private Boolean padToMaxOutputSize; + + private Options() { + } + + /** + * Sets the padToMaxOutputSize option. + * + * @param padToMaxOutputSize If true, the output {@code selected_indices} is padded to be of length + * {@code max_output_size}. Defaults to false. + * @return this Options instance. + */ + public Options padToMaxOutputSize(Boolean padToMaxOutputSize) { + this.padToMaxOutputSize = 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 892f9d9bb8b..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,45 +17,65 @@ 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; /** * Greedily selects a subset of bounding boxes in descending order of score, - *

* pruning away boxes that have high overlaps * with previously selected boxes. Bounding boxes with score less than - * `score_threshold` are removed. N-by-n overlap values are supplied as square matrix, + * {@code score_threshold} are removed. N-by-n overlap values are supplied as square matrix, * which allows for defining a custom overlap criterium (eg. intersection over union, * intersection over area, etc.). - *

- * The output of this operation is a set of integers indexing into the input + *

The output of this operation is a set of integers indexing into the input * collection of bounding boxes representing the selected boxes. The bounding * box coordinates corresponding to the selected indices can then be obtained - * using the `tf.gather operation`. For example: - *

- * selected_indices = tf.image.non_max_suppression_with_overlaps( - * overlaps, scores, max_output_size, overlap_threshold, score_threshold) - * selected_boxes = tf.gather(boxes, selected_indices) + * using the {@code tf.gather operation}. For example: + *

selected_indices = tf.image.non_max_suppression_with_overlaps( + * overlaps, scores, max_output_size, overlap_threshold, score_threshold) + * selected_boxes = tf.gather(boxes, selected_indices) */ -@Operator(group = "image") +@OpMetadata( + opType = NonMaxSuppressionWithOverlaps.OP_NAME, + inputsClass = NonMaxSuppressionWithOverlaps.Inputs.class +) +@Operator( + group = "image" +) public final class NonMaxSuppressionWithOverlaps extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "NonMaxSuppressionWithOverlaps"; + + private Output selectedIndices; + + public NonMaxSuppressionWithOverlaps(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + selectedIndices = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NonMaxSuppressionWithOverlaps operation. - * + * * @param scope current scope - * @param overlaps A 2-D float tensor of shape `[num_boxes, num_boxes]` representing + * @param overlaps A 2-D float tensor of shape {@code [num_boxes, num_boxes]} representing * the n-by-n box overlap values. - * @param scores A 1-D float tensor of shape `[num_boxes]` representing a single + * @param scores A 1-D float tensor of shape {@code [num_boxes]} representing a single * score corresponding to each box (each row of boxes). * @param maxOutputSize A scalar integer tensor representing the maximum number of * boxes to be selected by non max suppression. @@ -65,39 +85,78 @@ public final class NonMaxSuppressionWithOverlaps extends RawOp implements Operan * boxes based on score. * @return a new instance of NonMaxSuppressionWithOverlaps */ - @Endpoint(describeByClass = true) - public static NonMaxSuppressionWithOverlaps create(Scope scope, Operand overlaps, Operand scores, Operand maxOutputSize, Operand overlapThreshold, Operand scoreThreshold) { - OperationBuilder opBuilder = scope.env().opBuilder("NonMaxSuppressionWithOverlaps", scope.makeOpName("NonMaxSuppressionWithOverlaps")); + @Endpoint( + describeByClass = true + ) + public static NonMaxSuppressionWithOverlaps create(Scope scope, Operand overlaps, + Operand scores, Operand maxOutputSize, Operand overlapThreshold, + Operand scoreThreshold) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "NonMaxSuppressionWithOverlaps"); opBuilder.addInput(overlaps.asOutput()); opBuilder.addInput(scores.asOutput()); opBuilder.addInput(maxOutputSize.asOutput()); opBuilder.addInput(overlapThreshold.asOutput()); opBuilder.addInput(scoreThreshold.asOutput()); - opBuilder = scope.apply(opBuilder); return new NonMaxSuppressionWithOverlaps(opBuilder.build()); } - + /** - * A 1-D integer tensor of shape `[M]` representing the selected - * indices from the boxes tensor, where `M <= max_output_size`. + * Gets selectedIndices. + * A 1-D integer tensor of shape {@code [M]} representing the selected + * indices from the boxes tensor, where {@code M <= max_output_size}. + * @return selectedIndices. */ public Output selectedIndices() { return selectedIndices; } - + @Override public Output asOutput() { return selectedIndices; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NonMaxSuppressionWithOverlaps"; - - private Output selectedIndices; - - private NonMaxSuppressionWithOverlaps(Operation operation) { - super(operation); - int outputIdx = 0; - selectedIndices = operation.output(outputIdx++); + + @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 b024a697062..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,77 +17,79 @@ 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.TType; +import org.tensorflow.types.family.TNumber; /** - * Resize quantized `images` to `size` using quantized bilinear interpolation. - *

+ * 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 resizedImages()} output */ -@Operator(group = "image") -public final class QuantizedResizeBilinear extends RawOp { - +@OpMetadata( + opType = QuantizedResizeBilinear.OP_NAME, + inputsClass = QuantizedResizeBilinear.Inputs.class +) +@Operator( + group = "image" +) +public final class QuantizedResizeBilinear extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.image.QuantizedResizeBilinear} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param alignCorners 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 Options alignCorners(Boolean alignCorners) { - this.alignCorners = alignCorners; - return this; - } - - /** - * @param halfPixelCenters - */ - public Options halfPixelCenters(Boolean halfPixelCenters) { - this.halfPixelCenters = halfPixelCenters; - return this; - } - - private Boolean alignCorners; - private Boolean halfPixelCenters; - - private Options() { - } + public static final String OP_NAME = "QuantizedResizeBilinear"; + + private Output resizedImages; + + private Output outMin; + + private Output outMax; + + public QuantizedResizeBilinear(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + resizedImages = operation.output(outputIdx++); + outMin = operation.output(outputIdx++); + outMax = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedResizeBilinear operation. - * + * * @param scope current scope - * @param images 4-D with shape `[batch, height, width, channels]`. - * @param size = A 1-D int32 Tensor of 2 elements: `new_height, new_width`. The + * @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 - * @param max - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedResizeBilinear create(Scope scope, Operand images, Operand size, Operand min, Operand max, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedResizeBilinear", scope.makeOpName("QuantizedResizeBilinear")); + @Endpoint( + describeByClass = true + ) + public static QuantizedResizeBilinear create(Scope scope, + Operand images, Operand sizeOutput, Operand min, Operand max, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedResizeBilinear"); opBuilder.addInput(images.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder.addInput(min.asOutput()); opBuilder.addInput(max.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.alignCorners != null) { @@ -98,56 +100,144 @@ public static QuantizedResizeBilinear create(Scope scope, O } } } - return new QuantizedResizeBilinear(opBuilder.build()); + return new QuantizedResizeBilinear<>(opBuilder.build()); } - + /** + * Sets the alignCorners option. + * * @param alignCorners 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. + * @return this Options instance. */ public static Options alignCorners(Boolean alignCorners) { return new Options().alignCorners(alignCorners); } - + /** - * @param halfPixelCenters + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. */ public static Options halfPixelCenters(Boolean halfPixelCenters) { return new Options().halfPixelCenters(halfPixelCenters); } - + /** + * Gets resizedImages. * 4-D with shape - * `[batch, new_height, new_width, channels]`. + * {@code [batch, new_height, new_width, channels]}. + * @return resizedImages. */ public Output resizedImages() { return resizedImages; } - + /** + * Gets outMin. + * + * @return outMin. */ public Output outMin() { return outMin; } - + /** + * Gets outMax. + * + * @return outMax. */ public Output outMax() { return outMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedResizeBilinear"; - - private Output resizedImages; - private Output outMin; - private Output outMax; - - private QuantizedResizeBilinear(Operation operation) { - super(operation); - int outputIdx = 0; - resizedImages = operation.output(outputIdx++); - outMin = operation.output(outputIdx++); - outMax = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.QuantizedResizeBilinear} + */ + public static class Options { + private Boolean alignCorners; + + private Boolean halfPixelCenters; + + private Options() { + } + + /** + * Sets the alignCorners option. + * + * @param alignCorners 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. + * @return this Options instance. + */ + public Options alignCorners(Boolean alignCorners) { + this.alignCorners = alignCorners; + return this; + } + + /** + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. + */ + public Options halfPixelCenters(Boolean halfPixelCenters) { + this.halfPixelCenters = 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 133c38eaaa3..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,77 +17,70 @@ 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; /** - * Randomly crop `image`. - *

- * `size` is a 1-D int64 tensor with 2 elements representing the crop height and + * Randomly crop {@code image}. + * {@code size} is a 1-D int64 tensor with 2 elements representing the crop height and * width. The values must be non negative. - *

- * This Op picks a random location in `image` and crops a `height` by `width` + *

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 */ -@Operator(group = "image") +@OpMetadata( + opType = RandomCrop.OP_NAME, + inputsClass = RandomCrop.Inputs.class +) +@Operator( + group = "image" +) public final class RandomCrop extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.RandomCrop} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 An second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "RandomCrop"; + + private Output output; + + public RandomCrop(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RandomCrop operation. - * + * * @param scope current scope - * @param image 3-D of shape `[height, width, channels]`. - * @param size 1-D of length 2 containing: `crop_height`, `crop_width`.. - * @param options carries optional attributes values + * @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 + * @param data type for {@code RandomCrop} output and operands * @return a new instance of RandomCrop */ - @Endpoint(describeByClass = true) - public static RandomCrop create(Scope scope, Operand image, Operand size, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RandomCrop", scope.makeOpName("RandomCrop")); + @Endpoint( + describeByClass = true + ) + public static RandomCrop create(Scope scope, Operand image, + Operand sizeOutput, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RandomCrop"); opBuilder.addInput(image.asOutput()); - opBuilder.addInput(size.asOutput()); - opBuilder = scope.apply(opBuilder); + opBuilder.addInput(sizeOutput.asOutput()); if (options != null) { for (Options opts : options) { if (opts.seed != null) { @@ -98,45 +91,120 @@ public static RandomCrop create(Scope scope, Operand i } } } - return new RandomCrop(opBuilder.build()); + return new RandomCrop<>(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); } - + /** - * 3-D of shape `[crop_height, crop_width, channels].` + * Gets output. + * 3-D of shape {@code [crop_height, crop_width, channels].} + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RandomCrop"; - - private Output output; - - private RandomCrop(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.RandomCrop} + */ + 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 = 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 d030c1192b7..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,72 +17,75 @@ 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; /** - * Resize `images` to `size` using area interpolation. - *

+ * Resize {@code images} to {@code size} using area interpolation. * Input images can be of different types but output images are always float. - *

- * The range of pixel values for the output image might be slightly different + *

The range of pixel values for the output image might be slightly different * from the range for the input image because of limited numerical precision. - * To guarantee an output range, for example `[0.0, 1.0]`, apply - * `tf.clip_by_value` to the output. - *

- * Each output pixel is computed by first transforming the pixel's footprint into + * To guarantee an output range, for example {@code [0.0, 1.0]}, apply + * {@code tf.clip_by_value} to the output. + *

Each output pixel is computed by first transforming the pixel's footprint into * the input tensor and then averaging the pixels that intersect the footprint. An * 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. */ -@Operator(group = "image") +@OpMetadata( + opType = ResizeArea.OP_NAME, + inputsClass = ResizeArea.Inputs.class +) +@Operator( + group = "image" +) public final class ResizeArea extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.ResizeArea} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param alignCorners 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 Options alignCorners(Boolean alignCorners) { - this.alignCorners = alignCorners; - return this; - } - - private Boolean alignCorners; - - private Options() { - } + public static final String OP_NAME = "ResizeArea"; + + private Output resizedImages; + + public ResizeArea(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + resizedImages = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ResizeArea operation. - * + * * @param scope current scope - * @param images 4-D with shape `[batch, height, width, channels]`. - * @param size = A 1-D int32 Tensor of 2 elements: `new_height, new_width`. The + * @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 options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ResizeArea */ - @Endpoint(describeByClass = true) - public static ResizeArea create(Scope scope, Operand images, Operand size, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResizeArea", scope.makeOpName("ResizeArea")); + @Endpoint( + describeByClass = true + ) + public static ResizeArea create(Scope scope, Operand images, + Operand sizeOutput, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResizeArea"); opBuilder.addInput(images.asOutput()); - opBuilder.addInput(size.asOutput()); - opBuilder = scope.apply(opBuilder); + opBuilder.addInput(sizeOutput.asOutput()); if (options != null) { for (Options opts : options) { if (opts.alignCorners != null) { @@ -92,36 +95,88 @@ public static ResizeArea create(Scope scope, Operand images, } return new ResizeArea(opBuilder.build()); } - + /** + * Sets the alignCorners option. + * * @param alignCorners 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. + * @return this Options instance. */ public static Options alignCorners(Boolean alignCorners) { return new Options().alignCorners(alignCorners); } - + /** + * Gets resizedImages. * 4-D with shape - * `[batch, new_height, new_width, channels]`. + * {@code [batch, new_height, new_width, channels]}. + * @return resizedImages. */ public Output resizedImages() { return resizedImages; } - + @Override public Output asOutput() { return resizedImages; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResizeArea"; - - private Output resizedImages; - - private ResizeArea(Operation operation) { - super(operation); - int outputIdx = 0; - resizedImages = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ResizeArea} + */ + public static class Options { + private Boolean alignCorners; + + private Options() { + } + + /** + * Sets the alignCorners option. + * + * @param alignCorners 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. + * @return this Options instance. + */ + public Options alignCorners(Boolean alignCorners) { + this.alignCorners = 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 dc6b33e3dc1..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,71 +17,67 @@ 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; /** - * Resize `images` to `size` using bicubic interpolation. - *

+ * Resize {@code images} to {@code size} using bicubic interpolation. * Input images can be of different types but output images are always float. */ -@Operator(group = "image") +@OpMetadata( + opType = ResizeBicubic.OP_NAME, + inputsClass = ResizeBicubic.Inputs.class +) +@Operator( + group = "image" +) public final class ResizeBicubic extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.ResizeBicubic} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param alignCorners 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 Options alignCorners(Boolean alignCorners) { - this.alignCorners = alignCorners; - return this; - } - - /** - * @param halfPixelCenters - */ - public Options halfPixelCenters(Boolean halfPixelCenters) { - this.halfPixelCenters = halfPixelCenters; - return this; - } - - private Boolean alignCorners; - private Boolean halfPixelCenters; - - private Options() { - } + public static final String OP_NAME = "ResizeBicubic"; + + private Output resizedImages; + + public ResizeBicubic(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + resizedImages = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ResizeBicubic operation. - * + * * @param scope current scope - * @param images 4-D with shape `[batch, height, width, channels]`. - * @param size = A 1-D int32 Tensor of 2 elements: `new_height, new_width`. The + * @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 options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ResizeBicubic */ - @Endpoint(describeByClass = true) - public static ResizeBicubic create(Scope scope, Operand images, Operand size, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResizeBicubic", scope.makeOpName("ResizeBicubic")); + @Endpoint( + describeByClass = true + ) + public static ResizeBicubic create(Scope scope, Operand images, + Operand sizeOutput, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResizeBicubic"); opBuilder.addInput(images.asOutput()); - opBuilder.addInput(size.asOutput()); - opBuilder = scope.apply(opBuilder); + opBuilder.addInput(sizeOutput.asOutput()); if (options != null) { for (Options opts : options) { if (opts.alignCorners != null) { @@ -94,43 +90,117 @@ public static ResizeBicubic create(Scope scope, Operand image } return new ResizeBicubic(opBuilder.build()); } - + /** + * Sets the alignCorners option. + * * @param alignCorners 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. + * @return this Options instance. */ public static Options alignCorners(Boolean alignCorners) { return new Options().alignCorners(alignCorners); } - + /** - * @param halfPixelCenters + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. */ public static Options halfPixelCenters(Boolean halfPixelCenters) { return new Options().halfPixelCenters(halfPixelCenters); } - + /** + * Gets resizedImages. * 4-D with shape - * `[batch, new_height, new_width, channels]`. + * {@code [batch, new_height, new_width, channels]}. + * @return resizedImages. */ public Output resizedImages() { return resizedImages; } - + @Override public Output asOutput() { return resizedImages; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResizeBicubic"; - - private Output resizedImages; - - private ResizeBicubic(Operation operation) { - super(operation); - int outputIdx = 0; - resizedImages = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ResizeBicubic} + */ + public static class Options { + private Boolean alignCorners; + + private Boolean halfPixelCenters; + + private Options() { + } + + /** + * Sets the alignCorners option. + * + * @param alignCorners 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. + * @return this Options instance. + */ + public Options alignCorners(Boolean alignCorners) { + this.alignCorners = alignCorners; + return this; + } + + /** + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. + */ + public Options halfPixelCenters(Boolean halfPixelCenters) { + this.halfPixelCenters = 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 e5526a769f3..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,69 +17,66 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.image.ResizeBicubicGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param alignCorners If true, the centers of the 4 corner pixels of the input and grad tensors are - * aligned. Defaults to false. - */ - public Options alignCorners(Boolean alignCorners) { - this.alignCorners = alignCorners; - return this; - } - - /** - * @param halfPixelCenters - */ - public Options halfPixelCenters(Boolean halfPixelCenters) { - this.halfPixelCenters = halfPixelCenters; - return this; - } - - private Boolean alignCorners; - private Boolean halfPixelCenters; - - private Options() { - } + public static final String OP_NAME = "ResizeBicubicGrad"; + + private Output output; + + public ResizeBicubicGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ResizeBicubicGrad operation. - * + * * @param scope current scope - * @param grads 4-D with shape `[batch, height, width, channels]`. - * @param originalImage 4-D with shape `[batch, orig_height, orig_width, channels]`, + * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code ResizeBicubicGrad} output and operands * @return a new instance of ResizeBicubicGrad */ - @Endpoint(describeByClass = true) - public static ResizeBicubicGrad create(Scope scope, Operand grads, Operand originalImage, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResizeBicubicGrad", scope.makeOpName("ResizeBicubicGrad")); + @Endpoint( + describeByClass = true + ) + public static ResizeBicubicGrad create(Scope scope, + Operand grads, Operand originalImage, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResizeBicubicGrad"); opBuilder.addInput(grads.asOutput()); opBuilder.addInput(originalImage.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.alignCorners != null) { @@ -90,46 +87,120 @@ public static ResizeBicubicGrad create(Scope scope, Opera } } } - return new ResizeBicubicGrad(opBuilder.build()); + return new ResizeBicubicGrad<>(opBuilder.build()); } - + /** + * Sets the alignCorners option. + * * @param alignCorners If true, the centers of the 4 corner pixels of the input and grad tensors are * aligned. Defaults to false. + * @return this Options instance. */ public static Options alignCorners(Boolean alignCorners) { return new Options().alignCorners(alignCorners); } - + /** - * @param halfPixelCenters + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. */ public static Options halfPixelCenters(Boolean halfPixelCenters) { return new Options().halfPixelCenters(halfPixelCenters); } - + /** - * 4-D with shape `[batch, orig_height, orig_width, channels]`. + * Gets output. + * 4-D with shape {@code [batch, orig_height, orig_width, channels]}. * Gradients with respect to the input image. Input image must have been * float or double. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResizeBicubicGrad"; - - private Output output; - - private ResizeBicubicGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ResizeBicubicGrad} + */ + public static class Options { + private Boolean alignCorners; + + private Boolean halfPixelCenters; + + private Options() { + } + + /** + * Sets the alignCorners option. + * + * @param alignCorners If true, the centers of the 4 corner pixels of the input and grad tensors are + * aligned. Defaults to false. + * @return this Options instance. + */ + public Options alignCorners(Boolean alignCorners) { + this.alignCorners = alignCorners; + return this; + } + + /** + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. + */ + public Options halfPixelCenters(Boolean halfPixelCenters) { + this.halfPixelCenters = 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 aaf561156e2..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,71 +17,67 @@ 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; /** - * Resize `images` to `size` using bilinear interpolation. - *

+ * Resize {@code images} to {@code size} using bilinear interpolation. * Input images can be of different types but output images are always float. */ -@Operator(group = "image") +@OpMetadata( + opType = ResizeBilinear.OP_NAME, + inputsClass = ResizeBilinear.Inputs.class +) +@Operator( + group = "image" +) public final class ResizeBilinear extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.ResizeBilinear} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param alignCorners 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 Options alignCorners(Boolean alignCorners) { - this.alignCorners = alignCorners; - return this; - } - - /** - * @param halfPixelCenters - */ - public Options halfPixelCenters(Boolean halfPixelCenters) { - this.halfPixelCenters = halfPixelCenters; - return this; - } - - private Boolean alignCorners; - private Boolean halfPixelCenters; - - private Options() { - } + public static final String OP_NAME = "ResizeBilinear"; + + private Output resizedImages; + + public ResizeBilinear(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + resizedImages = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ResizeBilinear operation. - * + * * @param scope current scope - * @param images 4-D with shape `[batch, height, width, channels]`. - * @param size = A 1-D int32 Tensor of 2 elements: `new_height, new_width`. The + * @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 options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ResizeBilinear */ - @Endpoint(describeByClass = true) - public static ResizeBilinear create(Scope scope, Operand images, Operand size, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResizeBilinear", scope.makeOpName("ResizeBilinear")); + @Endpoint( + describeByClass = true + ) + public static ResizeBilinear create(Scope scope, Operand images, + Operand sizeOutput, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResizeBilinear"); opBuilder.addInput(images.asOutput()); - opBuilder.addInput(size.asOutput()); - opBuilder = scope.apply(opBuilder); + opBuilder.addInput(sizeOutput.asOutput()); if (options != null) { for (Options opts : options) { if (opts.alignCorners != null) { @@ -94,43 +90,117 @@ public static ResizeBilinear create(Scope scope, Operand imag } return new ResizeBilinear(opBuilder.build()); } - + /** + * Sets the alignCorners option. + * * @param alignCorners 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. + * @return this Options instance. */ public static Options alignCorners(Boolean alignCorners) { return new Options().alignCorners(alignCorners); } - + /** - * @param halfPixelCenters + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. */ public static Options halfPixelCenters(Boolean halfPixelCenters) { return new Options().halfPixelCenters(halfPixelCenters); } - + /** + * Gets resizedImages. * 4-D with shape - * `[batch, new_height, new_width, channels]`. + * {@code [batch, new_height, new_width, channels]}. + * @return resizedImages. */ public Output resizedImages() { return resizedImages; } - + @Override public Output asOutput() { return resizedImages; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResizeBilinear"; - - private Output resizedImages; - - private ResizeBilinear(Operation operation) { - super(operation); - int outputIdx = 0; - resizedImages = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ResizeBilinear} + */ + public static class Options { + private Boolean alignCorners; + + private Boolean halfPixelCenters; + + private Options() { + } + + /** + * Sets the alignCorners option. + * + * @param alignCorners 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. + * @return this Options instance. + */ + public Options alignCorners(Boolean alignCorners) { + this.alignCorners = alignCorners; + return this; + } + + /** + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. + */ + public Options halfPixelCenters(Boolean halfPixelCenters) { + this.halfPixelCenters = 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 38c20992da0..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,69 +17,66 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.image.ResizeBilinearGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param alignCorners If true, the centers of the 4 corner pixels of the input and grad tensors are - * aligned. Defaults to false. - */ - public Options alignCorners(Boolean alignCorners) { - this.alignCorners = alignCorners; - return this; - } - - /** - * @param halfPixelCenters - */ - public Options halfPixelCenters(Boolean halfPixelCenters) { - this.halfPixelCenters = halfPixelCenters; - return this; - } - - private Boolean alignCorners; - private Boolean halfPixelCenters; - - private Options() { - } + public static final String OP_NAME = "ResizeBilinearGrad"; + + private Output output; + + public ResizeBilinearGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ResizeBilinearGrad operation. - * + * * @param scope current scope - * @param grads 4-D with shape `[batch, height, width, channels]`. - * @param originalImage 4-D with shape `[batch, orig_height, orig_width, channels]`, + * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code ResizeBilinearGrad} output and operands * @return a new instance of ResizeBilinearGrad */ - @Endpoint(describeByClass = true) - public static ResizeBilinearGrad create(Scope scope, Operand grads, Operand originalImage, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResizeBilinearGrad", scope.makeOpName("ResizeBilinearGrad")); + @Endpoint( + describeByClass = true + ) + public static ResizeBilinearGrad create(Scope scope, + Operand grads, Operand originalImage, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResizeBilinearGrad"); opBuilder.addInput(grads.asOutput()); opBuilder.addInput(originalImage.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.alignCorners != null) { @@ -90,46 +87,120 @@ public static ResizeBilinearGrad create(Scope scope, Oper } } } - return new ResizeBilinearGrad(opBuilder.build()); + return new ResizeBilinearGrad<>(opBuilder.build()); } - + /** + * Sets the alignCorners option. + * * @param alignCorners If true, the centers of the 4 corner pixels of the input and grad tensors are * aligned. Defaults to false. + * @return this Options instance. */ public static Options alignCorners(Boolean alignCorners) { return new Options().alignCorners(alignCorners); } - + /** - * @param halfPixelCenters + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. */ public static Options halfPixelCenters(Boolean halfPixelCenters) { return new Options().halfPixelCenters(halfPixelCenters); } - + /** - * 4-D with shape `[batch, orig_height, orig_width, channels]`. + * Gets output. + * 4-D with shape {@code [batch, orig_height, orig_width, channels]}. * Gradients with respect to the input image. Input image must have been * float or double. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResizeBilinearGrad"; - - private Output output; - - private ResizeBilinearGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ResizeBilinearGrad} + */ + public static class Options { + private Boolean alignCorners; + + private Boolean halfPixelCenters; + + private Options() { + } + + /** + * Sets the alignCorners option. + * + * @param alignCorners If true, the centers of the 4 corner pixels of the input and grad tensors are + * aligned. Defaults to false. + * @return this Options instance. + */ + public Options alignCorners(Boolean alignCorners) { + this.alignCorners = alignCorners; + return this; + } + + /** + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. + */ + public Options halfPixelCenters(Boolean halfPixelCenters) { + this.halfPixelCenters = 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 3e4763c692c..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,70 +17,66 @@ 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 `images` to `size` using nearest neighbor interpolation. - * - * @param data type for {@code resizedImages()} output + * Resize {@code images} to {@code size} using nearest neighbor interpolation. */ -@Operator(group = "image") +@OpMetadata( + opType = ResizeNearestNeighbor.OP_NAME, + inputsClass = ResizeNearestNeighbor.Inputs.class +) +@Operator( + group = "image" +) public final class ResizeNearestNeighbor extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.ResizeNearestNeighbor} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param alignCorners 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 Options alignCorners(Boolean alignCorners) { - this.alignCorners = alignCorners; - return this; - } - - /** - * @param halfPixelCenters - */ - public Options halfPixelCenters(Boolean halfPixelCenters) { - this.halfPixelCenters = halfPixelCenters; - return this; - } - - private Boolean alignCorners; - private Boolean halfPixelCenters; - - private Options() { - } + public static final String OP_NAME = "ResizeNearestNeighbor"; + + private Output resizedImages; + + public ResizeNearestNeighbor(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + resizedImages = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ResizeNearestNeighbor operation. - * + * * @param scope current scope - * @param images 4-D with shape `[batch, height, width, channels]`. - * @param size = A 1-D int32 Tensor of 2 elements: `new_height, new_width`. The + * @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 options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResizeNearestNeighbor} output and operands * @return a new instance of ResizeNearestNeighbor */ - @Endpoint(describeByClass = true) - public static ResizeNearestNeighbor create(Scope scope, Operand images, Operand size, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResizeNearestNeighbor", scope.makeOpName("ResizeNearestNeighbor")); + @Endpoint( + describeByClass = true + ) + public static ResizeNearestNeighbor create(Scope scope, Operand images, + Operand sizeOutput, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResizeNearestNeighbor"); opBuilder.addInput(images.asOutput()); - opBuilder.addInput(size.asOutput()); - opBuilder = scope.apply(opBuilder); + opBuilder.addInput(sizeOutput.asOutput()); if (options != null) { for (Options opts : options) { if (opts.alignCorners != null) { @@ -91,45 +87,119 @@ public static ResizeNearestNeighbor create(Scope scope, O } } } - return new ResizeNearestNeighbor(opBuilder.build()); + return new ResizeNearestNeighbor<>(opBuilder.build()); } - + /** + * Sets the alignCorners option. + * * @param alignCorners 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. + * @return this Options instance. */ public static Options alignCorners(Boolean alignCorners) { return new Options().alignCorners(alignCorners); } - + /** - * @param halfPixelCenters + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. */ public static Options halfPixelCenters(Boolean halfPixelCenters) { return new Options().halfPixelCenters(halfPixelCenters); } - + /** + * Gets resizedImages. * 4-D with shape - * `[batch, new_height, new_width, channels]`. + * {@code [batch, new_height, new_width, channels]}. + * @return resizedImages. */ public Output resizedImages() { return resizedImages; } - + @Override public Output asOutput() { return resizedImages; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResizeNearestNeighbor"; - - private Output resizedImages; - - private ResizeNearestNeighbor(Operation operation) { - super(operation); - int outputIdx = 0; - resizedImages = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ResizeNearestNeighbor} + */ + public static class Options { + private Boolean alignCorners; + + private Boolean halfPixelCenters; + + private Options() { + } + + /** + * Sets the alignCorners option. + * + * @param alignCorners 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. + * @return this Options instance. + */ + public Options alignCorners(Boolean alignCorners) { + this.alignCorners = alignCorners; + return this; + } + + /** + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. + */ + public Options halfPixelCenters(Boolean halfPixelCenters) { + this.halfPixelCenters = 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 c3d2dd10e2a..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,69 +17,66 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.image.ResizeNearestNeighborGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param alignCorners If true, the centers of the 4 corner pixels of the input and grad tensors are - * aligned. Defaults to false. - */ - public Options alignCorners(Boolean alignCorners) { - this.alignCorners = alignCorners; - return this; - } - - /** - * @param halfPixelCenters - */ - public Options halfPixelCenters(Boolean halfPixelCenters) { - this.halfPixelCenters = halfPixelCenters; - return this; - } - - private Boolean alignCorners; - private Boolean halfPixelCenters; - - private Options() { - } + public static final String OP_NAME = "ResizeNearestNeighborGrad"; + + private Output output; + + public ResizeNearestNeighborGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ResizeNearestNeighborGrad operation. - * + * * @param scope current scope - * @param grads 4-D with shape `[batch, height, width, channels]`. - * @param size = A 1-D int32 Tensor of 2 elements: `orig_height, orig_width`. The + * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code ResizeNearestNeighborGrad} output and operands * @return a new instance of ResizeNearestNeighborGrad */ - @Endpoint(describeByClass = true) - public static ResizeNearestNeighborGrad create(Scope scope, Operand grads, Operand size, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResizeNearestNeighborGrad", scope.makeOpName("ResizeNearestNeighborGrad")); + @Endpoint( + describeByClass = true + ) + public static ResizeNearestNeighborGrad create(Scope scope, + Operand grads, Operand sizeOutput, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResizeNearestNeighborGrad"); opBuilder.addInput(grads.asOutput()); - opBuilder.addInput(size.asOutput()); - opBuilder = scope.apply(opBuilder); + opBuilder.addInput(sizeOutput.asOutput()); if (options != null) { for (Options opts : options) { if (opts.alignCorners != null) { @@ -90,45 +87,119 @@ public static ResizeNearestNeighborGrad create(Scope scop } } } - return new ResizeNearestNeighborGrad(opBuilder.build()); + return new ResizeNearestNeighborGrad<>(opBuilder.build()); } - + /** + * Sets the alignCorners option. + * * @param alignCorners If true, the centers of the 4 corner pixels of the input and grad tensors are * aligned. Defaults to false. + * @return this Options instance. */ public static Options alignCorners(Boolean alignCorners) { return new Options().alignCorners(alignCorners); } - + /** - * @param halfPixelCenters + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. */ public static Options halfPixelCenters(Boolean halfPixelCenters) { return new Options().halfPixelCenters(halfPixelCenters); } - + /** - * 4-D with shape `[batch, orig_height, orig_width, channels]`. Gradients + * Gets output. + * 4-D with shape {@code [batch, orig_height, orig_width, channels]}. Gradients * with respect to the input image. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResizeNearestNeighborGrad"; - - private Output output; - - private ResizeNearestNeighborGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ResizeNearestNeighborGrad} + */ + public static class Options { + private Boolean alignCorners; + + private Boolean halfPixelCenters; + + private Options() { + } + + /** + * Sets the alignCorners option. + * + * @param alignCorners If true, the centers of the 4 corner pixels of the input and grad tensors are + * aligned. Defaults to false. + * @return this Options instance. + */ + public Options alignCorners(Boolean alignCorners) { + this.alignCorners = alignCorners; + return this; + } + + /** + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. + */ + public Options halfPixelCenters(Boolean halfPixelCenters) { + this.halfPixelCenters = 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 2746052a7b0..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,79 +17,117 @@ 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; /** * Converts one or more images from RGB to HSV. - *

- * Outputs a tensor of the same shape as the `images` tensor, containing the HSV - * value of the pixels. The output is only well defined if the value in `images` - * are in `[0,1]`. - *

- * `output[..., 0]` contains hue, `output[..., 1]` contains saturation, and - * `output[..., 2]` contains value. All HSV values are in `[0,1]`. A hue of 0 + * Outputs a tensor of the same shape as the {@code images} tensor, containing the HSV + * value of the pixels. The output is only well defined if the value in {@code images} + * are in {@code [0,1]}. + *

{@code output[..., 0]} contains hue, {@code output[..., 1]} contains saturation, and + * {@code output[..., 2]} contains value. All HSV values are in {@code [0,1]}. A hue of 0 * corresponds to pure red, hue 1/3 is pure green, and 2/3 is pure blue. - *

- * Usage Example: - *

- * >>> blue_image = tf.stack([ + *

Usage Example: + *

+ *
+ *
+ *

blue_image = tf.stack([ * ... tf.zeros([5,5]), * ... tf.zeros([5,5]), * ... tf.ones([5,5])], * ... axis=-1) - * >>> blue_hsv_image = tf.image.rgb_to_hsv(blue_image) - * >>> blue_hsv_image[0,0].numpy() + * blue_hsv_image = tf.image.rgb_to_hsv(blue_image) + * blue_hsv_image[0,0].numpy() * array([0.6666667, 1. , 1. ], dtype=float32) - * - * - * @param data type for {@code output()} output + *

+ *
+ *
*/ -@Operator(group = "image") +@OpMetadata( + opType = RgbToHsv.OP_NAME, + inputsClass = RgbToHsv.Inputs.class +) +@Operator( + group = "image" +) public final class RgbToHsv extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new RgbToHsv operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RGBToHSV"; + + private Output output; + + public RgbToHsv(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new RGBToHSV operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static RgbToHsv create(Scope scope, Operand images) { - OperationBuilder opBuilder = scope.env().opBuilder("RGBToHSV", scope.makeOpName("RgbToHsv")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RgbToHsv"); opBuilder.addInput(images.asOutput()); - opBuilder = scope.apply(opBuilder); - return new RgbToHsv(opBuilder.build()); + return new RgbToHsv<>(opBuilder.build()); } - + /** - * `images` converted to HSV. + * Gets output. + * {@code images} converted to HSV. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RGBToHSV"; - - private Output output; - - private RgbToHsv(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 78a37b37dc2..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. @@ -17,156 +17,112 @@ 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.TFloat32; import org.tensorflow.types.family.TNumber; /** * Generate a single randomly distorted bounding box for an image. - *

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

- * The output of this Op is a single bounding box that may be used to crop the - * original image. The output is returned as 3 tensors: `begin`, `size` and - * `bboxes`. The first 2 tensors can be fed directly into `tf.slice` to crop the - * image. The latter may be supplied to `tf.image.draw_bounding_boxes` to visualize + * its content, i.e. data augmentation. This Op outputs a randomly distorted + * localization of an object, i.e. bounding box, given an {@code image_size}, + * {@code bounding_boxes} and a series of constraints. + *

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

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

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

- * For example, - *

{@code
+ * 

For example, + *

  *     # Generate a single distorted bounding box.
  *     begin, size, bbox_for_draw = tf.image.sample_distorted_bounding_box(
  *         tf.shape(image),
  *         bounding_boxes=bounding_boxes)
- * 
+ *
  *     # Draw the bounding box in an image summary.
  *     image_with_box = tf.image.draw_bounding_boxes(tf.expand_dims(image, 0),
  *                                                   bbox_for_draw)
  *     tf.summary.image('images_with_box', image_with_box)
- * 
+ *
  *     # Employ the bounding box to distort the image.
  *     distorted_image = tf.slice(image, begin, size)
- * }
- * Note that if no bounding box information is available, setting - * `use_image_if_no_bounding_boxes = true` will assume there is a single implicit - * bounding box covering the whole image. If `use_image_if_no_bounding_boxes` is + *
+ *

Note that if no bounding box information is available, setting + * {@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 */ -@Operator(group = "image") +@OpMetadata( + opType = SampleDistortedBoundingBox.OP_NAME, + inputsClass = SampleDistortedBoundingBox.Inputs.class +) +@Operator( + group = "image" +) public final class SampleDistortedBoundingBox extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.image.SampleDistortedBoundingBox} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param seed If either `seed` or `seed2` are set to non-zero, the random number - * generator is seeded by the given `seed`. Otherwise, it is seeded by a random - * seed. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 A second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - /** - * @param aspectRatioRange The cropped area of the image must have an aspect ratio = - * width / height within this range. - */ - public Options aspectRatioRange(List aspectRatioRange) { - this.aspectRatioRange = aspectRatioRange; - return this; - } - - /** - * @param areaRange The cropped area of the image must contain a fraction of the - * supplied image within this range. - */ - public Options areaRange(List areaRange) { - this.areaRange = areaRange; - return this; - } - - /** - * @param maxAttempts Number of attempts at generating a cropped region of the image - * of the specified constraints. After `max_attempts` failures, return the entire - * image. - */ - public Options maxAttempts(Long maxAttempts) { - this.maxAttempts = maxAttempts; - return this; - } - - /** - * @param useImageIfNoBoundingBoxes Controls behavior if no bounding boxes supplied. - * If true, assume an implicit bounding box covering the whole input. If false, - * raise an error. - */ - public Options useImageIfNoBoundingBoxes(Boolean useImageIfNoBoundingBoxes) { - this.useImageIfNoBoundingBoxes = useImageIfNoBoundingBoxes; - return this; - } - - private Long seed; - private Long seed2; - private List aspectRatioRange; - private List areaRange; - private Long maxAttempts; - private Boolean useImageIfNoBoundingBoxes; - - private Options() { - } + public static final String OP_NAME = "SampleDistortedBoundingBoxV2"; + + private Output begin; + + private Output sizeOutput; + + private Output bboxes; + + public SampleDistortedBoundingBox(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + begin = operation.output(outputIdx++); + sizeOutput = operation.output(outputIdx++); + bboxes = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new SampleDistortedBoundingBox operation. - * + * Factory method to create a class wrapping a new SampleDistortedBoundingBoxV2 operation. + * * @param scope current scope - * @param imageSize 1-D, containing `[height, width, channels]`. - * @param boundingBoxes 3-D with shape `[batch, N, 4]` describing the N bounding boxes + * @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. * @param minObjectCovered The cropped area of the image must contain at least this * fraction of any bounding box supplied. The value of this parameter should be * non-negative. In the case of 0, the cropped area does not need to overlap * any of the bounding boxes supplied. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SampleDistortedBoundingBoxV2} output and operands * @return a new instance of SampleDistortedBoundingBox */ - @Endpoint(describeByClass = true) - public static SampleDistortedBoundingBox create(Scope scope, Operand imageSize, Operand boundingBoxes, Operand minObjectCovered, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SampleDistortedBoundingBoxV2", scope.makeOpName("SampleDistortedBoundingBox")); + @Endpoint( + describeByClass = true + ) + public static SampleDistortedBoundingBox create(Scope scope, + Operand imageSize, Operand boundingBoxes, Operand minObjectCovered, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SampleDistortedBoundingBox"); opBuilder.addInput(imageSize.asOutput()); opBuilder.addInput(boundingBoxes.asOutput()); opBuilder.addInput(minObjectCovered.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.seed != null) { @@ -177,14 +133,14 @@ public static SampleDistortedBoundingBox create(Scope sco } if (opts.aspectRatioRange != null) { float[] aspectRatioRangeArray = new float[opts.aspectRatioRange.size()]; - for (int i = 0; i < aspectRatioRangeArray.length; ++i) { + for (int i = 0 ; i < aspectRatioRangeArray.length ; i++) { aspectRatioRangeArray[i] = opts.aspectRatioRange.get(i); } opBuilder.setAttr("aspect_ratio_range", aspectRatioRangeArray); } if (opts.areaRange != null) { float[] areaRangeArray = new float[opts.areaRange.size()]; - for (int i = 0; i < areaRangeArray.length; ++i) { + for (int i = 0 ; i < areaRangeArray.length ; i++) { areaRangeArray[i] = opts.areaRange.get(i); } opBuilder.setAttr("area_range", areaRangeArray); @@ -197,95 +153,326 @@ public static SampleDistortedBoundingBox create(Scope sco } } } - return new SampleDistortedBoundingBox(opBuilder.build()); + return new SampleDistortedBoundingBox<>(opBuilder.build()); } - + /** - * @param seed If either `seed` or `seed2` are set to non-zero, the random number - * generator is seeded by the given `seed`. Otherwise, it is seeded by a random + * Sets the seed option. + * + * @param seed 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. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** + * Sets the aspectRatioRange option. + * * @param aspectRatioRange The cropped area of the image must have an aspect ratio = * width / height within this range. + * @return this Options instance. */ public static Options aspectRatioRange(List aspectRatioRange) { return new Options().aspectRatioRange(aspectRatioRange); } - + + /** + * Sets the aspectRatioRange option. + * + * @param aspectRatioRange The cropped area of the image must have an aspect ratio = + * width / height within this range. + * @return this Options instance. + */ + public static Options aspectRatioRange(Float... aspectRatioRange) { + return new Options().aspectRatioRange(aspectRatioRange); + } + /** + * Sets the areaRange option. + * * @param areaRange The cropped area of the image must contain a fraction of the * supplied image within this range. + * @return this Options instance. */ public static Options areaRange(List areaRange) { return new Options().areaRange(areaRange); } - + /** + * Sets the areaRange option. + * + * @param areaRange The cropped area of the image must contain a fraction of the + * supplied image within this range. + * @return this Options instance. + */ + public static Options areaRange(Float... areaRange) { + return new Options().areaRange(areaRange); + } + + /** + * Sets the maxAttempts option. + * * @param maxAttempts Number of attempts at generating a cropped region of the image - * of the specified constraints. After `max_attempts` failures, return the entire + * of the specified constraints. After {@code max_attempts} failures, return the entire * image. + * @return this Options instance. */ public static Options maxAttempts(Long maxAttempts) { return new Options().maxAttempts(maxAttempts); } - + /** + * Sets the useImageIfNoBoundingBoxes option. + * * @param useImageIfNoBoundingBoxes Controls behavior if no bounding boxes supplied. * If true, assume an implicit bounding box covering the whole input. If false, * raise an error. + * @return this Options instance. */ public static Options useImageIfNoBoundingBoxes(Boolean useImageIfNoBoundingBoxes) { return new Options().useImageIfNoBoundingBoxes(useImageIfNoBoundingBoxes); } - + /** - * 1-D, containing `[offset_height, offset_width, 0]`. Provide as input to - * `tf.slice`. + * Gets begin. + * 1-D, containing {@code [offset_height, offset_width, 0]}. Provide as input to + * {@code tf.slice}. + * @return begin. */ public Output begin() { return begin; } - + /** - * 1-D, containing `[target_height, target_width, -1]`. Provide as input to - * `tf.slice`. + * Gets sizeOutput. + * 1-D, containing {@code [target_height, target_width, -1]}. Provide as input to + * {@code tf.slice}. + * @return sizeOutput. */ - public Output size() { - return size; + public Output sizeOutput() { + return sizeOutput; } - + /** - * 3-D with shape `[1, 1, 4]` containing the distorted bounding box. - * Provide as input to `tf.image.draw_bounding_boxes`. + * Gets bboxes. + * 3-D with shape {@code [1, 1, 4]} containing the distorted bounding box. + * Provide as input to {@code tf.image.draw_bounding_boxes}. + * @return bboxes. */ public Output bboxes() { return bboxes; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SampleDistortedBoundingBoxV2"; - - private Output begin; - private Output size; - private Output bboxes; - - private SampleDistortedBoundingBox(Operation operation) { - super(operation); - int outputIdx = 0; - begin = operation.output(outputIdx++); - size = operation.output(outputIdx++); - bboxes = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.SampleDistortedBoundingBox} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private List aspectRatioRange; + + private List areaRange; + + private Long maxAttempts; + + private Boolean useImageIfNoBoundingBoxes; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed 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. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } + + /** + * Sets the aspectRatioRange option. + * + * @param aspectRatioRange The cropped area of the image must have an aspect ratio = + * width / height within this range. + * @return this Options instance. + */ + public Options aspectRatioRange(List aspectRatioRange) { + this.aspectRatioRange = aspectRatioRange; + return this; + } + + /** + * Sets the aspectRatioRange option. + * + * @param aspectRatioRange The cropped area of the image must have an aspect ratio = + * width / height within this range. + * @return this Options instance. + */ + public Options aspectRatioRange(Float... aspectRatioRange) { + this.aspectRatioRange = Arrays.asList(aspectRatioRange); + return this; + } + + /** + * Sets the areaRange option. + * + * @param areaRange The cropped area of the image must contain a fraction of the + * supplied image within this range. + * @return this Options instance. + */ + public Options areaRange(List areaRange) { + this.areaRange = areaRange; + return this; + } + + /** + * Sets the areaRange option. + * + * @param areaRange The cropped area of the image must contain a fraction of the + * supplied image within this range. + * @return this Options instance. + */ + public Options areaRange(Float... areaRange) { + this.areaRange = Arrays.asList(areaRange); + return this; + } + + /** + * Sets the maxAttempts option. + * + * @param maxAttempts Number of attempts at generating a cropped region of the image + * of the specified constraints. After {@code max_attempts} failures, return the entire + * image. + * @return this Options instance. + */ + public Options maxAttempts(Long maxAttempts) { + this.maxAttempts = maxAttempts; + return this; + } + + /** + * Sets the useImageIfNoBoundingBoxes option. + * + * @param useImageIfNoBoundingBoxes Controls behavior if no bounding boxes supplied. + * If true, assume an implicit bounding box covering the whole input. If false, + * raise an error. + * @return this Options instance. + */ + public Options useImageIfNoBoundingBoxes(Boolean useImageIfNoBoundingBoxes) { + this.useImageIfNoBoundingBoxes = 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 7c728f587c4..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,70 +17,70 @@ 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; /** + * The ScaleAndTranslate operation */ -@Operator(group = "image") +@OpMetadata( + opType = ScaleAndTranslate.OP_NAME, + inputsClass = ScaleAndTranslate.Inputs.class +) +@Operator( + group = "image" +) public final class ScaleAndTranslate extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.ScaleAndTranslate} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param kernelType - */ - public Options kernelType(String kernelType) { - this.kernelType = kernelType; - return this; - } - - /** - * @param antialias - */ - public Options antialias(Boolean antialias) { - this.antialias = antialias; - return this; - } - - private String kernelType; - private Boolean antialias; - - private Options() { - } + public static final String OP_NAME = "ScaleAndTranslate"; + + private Output resizedImages; + + public ScaleAndTranslate(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + resizedImages = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScaleAndTranslate operation. - * + * * @param scope current scope - * @param images - * @param size - * @param scale - * @param translation - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static ScaleAndTranslate create(Scope scope, Operand images, Operand size, Operand scale, Operand translation, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ScaleAndTranslate", scope.makeOpName("ScaleAndTranslate")); + @Endpoint( + describeByClass = true + ) + public static ScaleAndTranslate create(Scope scope, Operand images, + Operand sizeOutput, Operand scale, Operand translation, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ScaleAndTranslate"); opBuilder.addInput(images.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder.addInput(scale.asOutput()); opBuilder.addInput(translation.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.kernelType != null) { @@ -93,40 +93,124 @@ public static ScaleAndTranslate create(Scope scope, Operand i } return new ScaleAndTranslate(opBuilder.build()); } - + /** - * @param kernelType + * Sets the kernelType option. + * + * @param kernelType the kernelType option + * @return this Options instance. */ public static Options kernelType(String kernelType) { return new Options().kernelType(kernelType); } - + /** - * @param antialias + * Sets the antialias option. + * + * @param antialias the antialias option + * @return this Options instance. */ public static Options antialias(Boolean antialias) { return new Options().antialias(antialias); } - + /** + * Gets resizedImages. + * + * @return resizedImages. */ public Output resizedImages() { return resizedImages; } - + @Override public Output asOutput() { return resizedImages; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScaleAndTranslate"; - - private Output resizedImages; - - private ScaleAndTranslate(Operation operation) { - super(operation); - int outputIdx = 0; - resizedImages = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ScaleAndTranslate} + */ + public static class Options { + private String kernelType; + + private Boolean antialias; + + private Options() { + } + + /** + * Sets the kernelType option. + * + * @param kernelType the kernelType option + * @return this Options instance. + */ + public Options kernelType(String kernelType) { + this.kernelType = kernelType; + return this; + } + + /** + * Sets the antialias option. + * + * @param antialias the antialias option + * @return this Options instance. + */ + public Options antialias(Boolean antialias) { + this.antialias = 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 b6f55d1d159..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,69 +17,70 @@ 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; /** - * @param data type for {@code output()} output + * The ScaleAndTranslateGrad operation */ +@OpMetadata( + opType = ScaleAndTranslateGrad.OP_NAME, + inputsClass = ScaleAndTranslateGrad.Inputs.class +) +@Operator( + group = "image" +) public final class ScaleAndTranslateGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.ScaleAndTranslateGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param kernelType - */ - public Options kernelType(String kernelType) { - this.kernelType = kernelType; - return this; - } - - /** - * @param antialias - */ - public Options antialias(Boolean antialias) { - this.antialias = antialias; - return this; - } - - private String kernelType; - private Boolean antialias; - - private Options() { - } + public static final String OP_NAME = "ScaleAndTranslateGrad"; + + private Output output; + + public ScaleAndTranslateGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScaleAndTranslateGrad operation. - * + * * @param scope current scope - * @param grads - * @param originalImage - * @param scale - * @param translation - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static ScaleAndTranslateGrad create(Scope scope, Operand grads, Operand originalImage, Operand scale, Operand translation, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ScaleAndTranslateGrad", scope.makeOpName("ScaleAndTranslateGrad")); + @Endpoint( + describeByClass = true + ) + public static ScaleAndTranslateGrad create(Scope scope, Operand grads, + Operand originalImage, Operand scale, Operand translation, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ScaleAndTranslateGrad"); opBuilder.addInput(grads.asOutput()); opBuilder.addInput(originalImage.asOutput()); opBuilder.addInput(scale.asOutput()); opBuilder.addInput(translation.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.kernelType != null) { @@ -90,42 +91,126 @@ public static ScaleAndTranslateGrad create(Scope scope, O } } } - return new ScaleAndTranslateGrad(opBuilder.build()); + return new ScaleAndTranslateGrad<>(opBuilder.build()); } - + /** - * @param kernelType + * Sets the kernelType option. + * + * @param kernelType the kernelType option + * @return this Options instance. */ public static Options kernelType(String kernelType) { return new Options().kernelType(kernelType); } - + /** - * @param antialias + * Sets the antialias option. + * + * @param antialias the antialias option + * @return this Options instance. */ public static Options antialias(Boolean antialias) { return new Options().antialias(antialias); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScaleAndTranslateGrad"; - - private Output output; - - private ScaleAndTranslateGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ScaleAndTranslateGrad} + */ + public static class Options { + private String kernelType; + + private Boolean antialias; + + private Options() { + } + + /** + * Sets the kernelType option. + * + * @param kernelType the kernelType option + * @return this Options instance. + */ + public Options kernelType(String kernelType) { + this.kernelType = kernelType; + return this; + } + + /** + * Sets the antialias option. + * + * @param antialias the antialias option + * @return this Options instance. + */ + public Options antialias(Boolean antialias) { + this.antialias = 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 725592351ae..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. @@ -17,173 +17,152 @@ 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.TFloat32; import org.tensorflow.types.family.TNumber; /** * Generate a randomly distorted bounding box for an image deterministically. - *

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

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

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

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

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

- * The output of this Op is guaranteed to be the same given the same `seed` and is + *

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

- * Example usage: - *

- * >>> image = np.array([[[1], [2], [3]], [[4], [5], [6]], [[7], [8], [9]]]) - * >>> bbox = tf.constant( + * seed settings (e.g. {@code tf.random.set_seed}). + *

Example usage: + *

+ *
+ *
+ *

image = np.array([[[1], [2], [3]], [[4], [5], [6]], [[7], [8], [9]]]) + * bbox = tf.constant( * ... [0.0, 0.0, 1.0, 1.0], dtype=tf.float32, shape=[1, 1, 4]) - * >>> seed = (1, 2) - * >>> # Generate a single distorted bounding box. - * >>> bbox_begin, bbox_size, bbox_draw = ( + * seed = (1, 2) + * Generate a single distorted bounding box.
+ *

bbox_begin, bbox_size, bbox_draw = ( * ... tf.image.stateless_sample_distorted_bounding_box( * ... tf.shape(image), bounding_boxes=bbox, seed=seed)) - * >>> # Employ the bounding box to distort the image. - * >>> tf.slice(image, bbox_begin, bbox_size) - * Employ the bounding box to distort the image.
+ *

tf.slice(image, bbox_begin, bbox_size) + * <tf.Tensor: shape=(2, 2, 1), dtype=int64, numpy= * array([[[1], - * [2]], - * [[4], - * [5]]])> - * >>> # Draw the bounding box in an image summary. - * >>> colors = np.array([[1.0, 0.0, 0.0], [0.0, 0.0, 1.0]]) - * >>> tf.image.draw_bounding_boxes( + * [2]], + * [[4], + * [5]]])> + * Draw the bounding box in an image summary.
+ *

colors = np.array([[1.0, 0.0, 0.0], [0.0, 0.0, 1.0]]) + * tf.image.draw_bounding_boxes( * ... tf.expand_dims(tf.cast(image, tf.float32),0), bbox_draw, colors) - * - *

- * Note that if no bounding box information is available, setting - * `use_image_if_no_bounding_boxes = true` will assume there is a single implicit - * bounding box covering the whole image. If `use_image_if_no_bounding_boxes` is + * [1.], + * [3.]], + * [[1.], + * [1.], + * [6.]], + * [[7.], + * [8.], + * [9.]]]], dtype=float32)> + *

+ *
+ *
+ *

Note that if no bounding box information is available, setting + * {@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 */ -@Operator(group = "image") +@OpMetadata( + opType = StatelessSampleDistortedBoundingBox.OP_NAME, + inputsClass = StatelessSampleDistortedBoundingBox.Inputs.class +) +@Operator( + group = "image" +) public final class StatelessSampleDistortedBoundingBox extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.image.StatelessSampleDistortedBoundingBox} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param aspectRatioRange The cropped area of the image must have an aspect ratio = - * width / height within this range. - */ - public Options aspectRatioRange(List aspectRatioRange) { - this.aspectRatioRange = aspectRatioRange; - return this; - } - - /** - * @param areaRange The cropped area of the image must contain a fraction of the - * supplied image within this range. - */ - public Options areaRange(List areaRange) { - this.areaRange = areaRange; - return this; - } - - /** - * @param maxAttempts Number of attempts at generating a cropped region of the image - * of the specified constraints. After `max_attempts` failures, return the entire - * image. - */ - public Options maxAttempts(Long maxAttempts) { - this.maxAttempts = maxAttempts; - return this; - } - - /** - * @param useImageIfNoBoundingBoxes Controls behavior if no bounding boxes supplied. - * If true, assume an implicit bounding box covering the whole input. If false, - * raise an error. - */ - public Options useImageIfNoBoundingBoxes(Boolean useImageIfNoBoundingBoxes) { - this.useImageIfNoBoundingBoxes = useImageIfNoBoundingBoxes; - return this; - } - - private List aspectRatioRange; - private List areaRange; - private Long maxAttempts; - private Boolean useImageIfNoBoundingBoxes; - - private Options() { - } + public static final String OP_NAME = "StatelessSampleDistortedBoundingBox"; + + private Output begin; + + private Output sizeOutput; + + private Output bboxes; + + public StatelessSampleDistortedBoundingBox(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + begin = operation.output(outputIdx++); + sizeOutput = operation.output(outputIdx++); + bboxes = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new StatelessSampleDistortedBoundingBox operation. - * + * * @param scope current scope - * @param imageSize 1-D, containing `[height, width, channels]`. - * @param boundingBoxes 3-D with shape `[batch, N, 4]` describing the N bounding boxes + * @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. * @param minObjectCovered The cropped area of the image must contain at least this * fraction of any bounding box supplied. The value of this parameter should be * non-negative. In the case of 0, the cropped area does not need to overlap * any of the bounding boxes supplied. - * @param seed 1-D with shape `[2]`. The seed to the random number generator. Must have dtype - * `int32` or `int64`. (When using XLA, only `int32` is allowed.) - * @param options carries optional attributes values + * @param seed 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.) + * @param options carries optional attribute values + * @param data type for {@code StatelessSampleDistortedBoundingBox} output and operands * @return a new instance of StatelessSampleDistortedBoundingBox */ - @Endpoint(describeByClass = true) - public static StatelessSampleDistortedBoundingBox create(Scope scope, Operand imageSize, Operand boundingBoxes, Operand minObjectCovered, Operand seed, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("StatelessSampleDistortedBoundingBox", scope.makeOpName("StatelessSampleDistortedBoundingBox")); + @Endpoint( + describeByClass = true + ) + public static StatelessSampleDistortedBoundingBox create(Scope scope, + Operand imageSize, Operand boundingBoxes, Operand minObjectCovered, + Operand seed, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessSampleDistortedBoundingBox"); opBuilder.addInput(imageSize.asOutput()); opBuilder.addInput(boundingBoxes.asOutput()); opBuilder.addInput(minObjectCovered.asOutput()); opBuilder.addInput(seed.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.aspectRatioRange != null) { float[] aspectRatioRangeArray = new float[opts.aspectRatioRange.size()]; - for (int i = 0; i < aspectRatioRangeArray.length; ++i) { + for (int i = 0 ; i < aspectRatioRangeArray.length ; i++) { aspectRatioRangeArray[i] = opts.aspectRatioRange.get(i); } opBuilder.setAttr("aspect_ratio_range", aspectRatioRangeArray); } if (opts.areaRange != null) { float[] areaRangeArray = new float[opts.areaRange.size()]; - for (int i = 0; i < areaRangeArray.length; ++i) { + for (int i = 0 ; i < areaRangeArray.length ; i++) { areaRangeArray[i] = opts.areaRange.get(i); } opBuilder.setAttr("area_range", areaRangeArray); @@ -196,79 +175,275 @@ public static StatelessSampleDistortedBoundingBox create( } } } - return new StatelessSampleDistortedBoundingBox(opBuilder.build()); + return new StatelessSampleDistortedBoundingBox<>(opBuilder.build()); } - + /** + * Sets the aspectRatioRange option. + * * @param aspectRatioRange The cropped area of the image must have an aspect ratio = * width / height within this range. + * @return this Options instance. */ public static Options aspectRatioRange(List aspectRatioRange) { return new Options().aspectRatioRange(aspectRatioRange); } - + /** + * Sets the aspectRatioRange option. + * + * @param aspectRatioRange The cropped area of the image must have an aspect ratio = + * width / height within this range. + * @return this Options instance. + */ + public static Options aspectRatioRange(Float... aspectRatioRange) { + return new Options().aspectRatioRange(aspectRatioRange); + } + + /** + * Sets the areaRange option. + * * @param areaRange The cropped area of the image must contain a fraction of the * supplied image within this range. + * @return this Options instance. */ public static Options areaRange(List areaRange) { return new Options().areaRange(areaRange); } - + + /** + * Sets the areaRange option. + * + * @param areaRange The cropped area of the image must contain a fraction of the + * supplied image within this range. + * @return this Options instance. + */ + public static Options areaRange(Float... areaRange) { + return new Options().areaRange(areaRange); + } + /** + * Sets the maxAttempts option. + * * @param maxAttempts Number of attempts at generating a cropped region of the image - * of the specified constraints. After `max_attempts` failures, return the entire + * of the specified constraints. After {@code max_attempts} failures, return the entire * image. + * @return this Options instance. */ public static Options maxAttempts(Long maxAttempts) { return new Options().maxAttempts(maxAttempts); } - + /** + * Sets the useImageIfNoBoundingBoxes option. + * * @param useImageIfNoBoundingBoxes Controls behavior if no bounding boxes supplied. * If true, assume an implicit bounding box covering the whole input. If false, * raise an error. + * @return this Options instance. */ public static Options useImageIfNoBoundingBoxes(Boolean useImageIfNoBoundingBoxes) { return new Options().useImageIfNoBoundingBoxes(useImageIfNoBoundingBoxes); } - + /** - * 1-D, containing `[offset_height, offset_width, 0]`. Provide as input to - * `tf.slice`. + * Gets begin. + * 1-D, containing {@code [offset_height, offset_width, 0]}. Provide as input to + * {@code tf.slice}. + * @return begin. */ public Output begin() { return begin; } - + /** - * 1-D, containing `[target_height, target_width, -1]`. Provide as input to - * `tf.slice`. + * Gets sizeOutput. + * 1-D, containing {@code [target_height, target_width, -1]}. Provide as input to + * {@code tf.slice}. + * @return sizeOutput. */ - public Output size() { - return size; + public Output sizeOutput() { + return sizeOutput; } - + /** - * 3-D with shape `[1, 1, 4]` containing the distorted bounding box. - * Provide as input to `tf.image.draw_bounding_boxes`. + * Gets bboxes. + * 3-D with shape {@code [1, 1, 4]} containing the distorted bounding box. + * Provide as input to {@code tf.image.draw_bounding_boxes}. + * @return bboxes. */ public Output bboxes() { return bboxes; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessSampleDistortedBoundingBox"; - - private Output begin; - private Output size; - private Output bboxes; - - private StatelessSampleDistortedBoundingBox(Operation operation) { - super(operation); - int outputIdx = 0; - begin = operation.output(outputIdx++); - size = operation.output(outputIdx++); - bboxes = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.StatelessSampleDistortedBoundingBox} + */ + public static class Options { + private List aspectRatioRange; + + private List areaRange; + + private Long maxAttempts; + + private Boolean useImageIfNoBoundingBoxes; + + private Options() { + } + + /** + * Sets the aspectRatioRange option. + * + * @param aspectRatioRange The cropped area of the image must have an aspect ratio = + * width / height within this range. + * @return this Options instance. + */ + public Options aspectRatioRange(List aspectRatioRange) { + this.aspectRatioRange = aspectRatioRange; + return this; + } + + /** + * Sets the aspectRatioRange option. + * + * @param aspectRatioRange The cropped area of the image must have an aspect ratio = + * width / height within this range. + * @return this Options instance. + */ + public Options aspectRatioRange(Float... aspectRatioRange) { + this.aspectRatioRange = Arrays.asList(aspectRatioRange); + return this; + } + + /** + * Sets the areaRange option. + * + * @param areaRange The cropped area of the image must contain a fraction of the + * supplied image within this range. + * @return this Options instance. + */ + public Options areaRange(List areaRange) { + this.areaRange = areaRange; + return this; + } + + /** + * Sets the areaRange option. + * + * @param areaRange The cropped area of the image must contain a fraction of the + * supplied image within this range. + * @return this Options instance. + */ + public Options areaRange(Float... areaRange) { + this.areaRange = Arrays.asList(areaRange); + return this; + } + + /** + * Sets the maxAttempts option. + * + * @param maxAttempts Number of attempts at generating a cropped region of the image + * of the specified constraints. After {@code max_attempts} failures, return the entire + * image. + * @return this Options instance. + */ + public Options maxAttempts(Long maxAttempts) { + this.maxAttempts = maxAttempts; + return this; + } + + /** + * Sets the useImageIfNoBoundingBoxes option. + * + * @param useImageIfNoBoundingBoxes Controls behavior if no bounding boxes supplied. + * If true, assume an implicit bounding box covering the whole input. If false, + * raise an error. + * @return this Options instance. + */ + public Options useImageIfNoBoundingBoxes(Boolean useImageIfNoBoundingBoxes) { + this.useImageIfNoBoundingBoxes = 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 f0034bcc93b..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,60 +17,91 @@ 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 /. */ -@Operator(group = "io") +@OpMetadata( + opType = DecodeBase64.OP_NAME, + inputsClass = DecodeBase64.Inputs.class +) +@Operator( + group = "io" +) public final class DecodeBase64 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DecodeBase64"; + + private Output output; + + public DecodeBase64(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DecodeBase64 operation. - * + * * @param scope current scope * @param input Base64 strings to decode. * @return a new instance of DecodeBase64 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DecodeBase64 create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("DecodeBase64", scope.makeOpName("DecodeBase64")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DecodeBase64"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); return new DecodeBase64(opBuilder.build()); } - + /** + * Gets output. * Decoded strings. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeBase64"; - - private Output output; - - private DecodeBase64(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 15fc51ba32c..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,62 +17,64 @@ 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; /** * Decompress strings. - *

- * This op decompresses each element of the `bytes` input `Tensor`, which - * is assumed to be compressed using the given `compression_type`. - *

- * The `output` is a string `Tensor` of the same shape as `bytes`, + * This op decompresses each element of the {@code bytes} input {@code Tensor}, which + * is assumed to be compressed using the given {@code compression_type}. + *

The {@code output} is a string {@code Tensor} of the same shape as {@code bytes}, * each element containing the decompressed data from the corresponding - * element in `bytes`. + * element in {@code bytes}. */ -@Operator(group = "io") +@OpMetadata( + opType = DecodeCompressed.OP_NAME, + inputsClass = DecodeCompressed.Inputs.class +) +@Operator( + group = "io" +) public final class DecodeCompressed extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.DecodeCompressed} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param compressionType A scalar containing either (i) the empty string (no - * compression), (ii) "ZLIB", or (iii) "GZIP". - */ - public Options compressionType(String compressionType) { - this.compressionType = compressionType; - return this; - } - - private String compressionType; - - private Options() { - } + public static final String OP_NAME = "DecodeCompressed"; + + private Output output; + + public DecodeCompressed(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DecodeCompressed operation. - * + * * @param scope current scope * @param bytes A Tensor of string which is compressed. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of DecodeCompressed */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DecodeCompressed create(Scope scope, Operand bytes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DecodeCompressed", scope.makeOpName("DecodeCompressed")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DecodeCompressed"); opBuilder.addInput(bytes.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.compressionType != null) { @@ -82,36 +84,75 @@ public static DecodeCompressed create(Scope scope, Operand bytes, Optio } return new DecodeCompressed(opBuilder.build()); } - + /** + * Sets the compressionType option. + * * @param compressionType A scalar containing either (i) the empty string (no - * compression), (ii) "ZLIB", or (iii) "GZIP". + * compression), (ii) "ZLIB", or (iii) "GZIP". + * @return this Options instance. */ public static Options compressionType(String compressionType) { return new Options().compressionType(compressionType); } - + /** - * A Tensor with the same shape as input `bytes`, uncompressed + * Gets output. + * A Tensor with the same shape as input {@code bytes}, uncompressed * from bytes. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeCompressed"; - - private Output output; - - private DecodeCompressed(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.DecodeCompressed} + */ + public static class Options { + private String compressionType; + + private Options() { + } + + /** + * Sets the compressionType option. + * + * @param compressionType A scalar containing either (i) the empty string (no + * compression), (ii) "ZLIB", or (iii) "GZIP". + * @return this Options instance. + */ + public Options compressionType(String compressionType) { + this.compressionType = 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 ad79410ddba..a6c00ac6e3c 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,94 +20,73 @@ 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; /** * Convert CSV records to tensors. Each column maps to one tensor. - *

* RFC 4180 format is expected for the CSV records. * (https://tools.ietf.org/html/rfc4180) * Note that we allow leading and trailing spaces with int or float field. */ -@Operator(group = "io") +@OpMetadata( + opType = DecodeCsv.OP_NAME, + inputsClass = DecodeCsv.Inputs.class +) +@Operator( + group = "io" +) public final class DecodeCsv extends RawOp implements Iterable> { - /** - * Optional attributes for {@link org.tensorflow.op.io.DecodeCsv} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param fieldDelim char delimiter to separate fields in a record. - */ - public Options fieldDelim(String fieldDelim) { - this.fieldDelim = fieldDelim; - return this; - } - - /** - * @param useQuoteDelim If false, treats double quotation marks as regular - * characters inside of the string fields (ignoring RFC 4180, Section 2, - * Bullet 5). - */ - public Options useQuoteDelim(Boolean useQuoteDelim) { - this.useQuoteDelim = useQuoteDelim; - return this; - } - - /** - * @param naValue Additional string to recognize as NA/NaN. - */ - public Options naValue(String naValue) { - this.naValue = naValue; - return this; - } - - /** - * @param selectCols - */ - public Options selectCols(List selectCols) { - this.selectCols = selectCols; - return this; - } - - private String fieldDelim; - private Boolean useQuoteDelim; - private String naValue; - private List selectCols; - - private Options() { - } + public static final String OP_NAME = "DecodeCSV"; + + private List> output; + + @SuppressWarnings("unchecked") + public DecodeCsv(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 DecodeCsv operation. - * + * Factory method to create a class wrapping a new DecodeCSV operation. + * * @param scope current scope * @param records Each string is a record/row in the csv and all records should have * the same format. * @param recordDefaults 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. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of DecodeCsv */ - @Endpoint(describeByClass = true) - public static DecodeCsv create(Scope scope, Operand records, Iterable> recordDefaults, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DecodeCSV", scope.makeOpName("DecodeCsv")); + @Endpoint( + describeByClass = true + ) + public static DecodeCsv create(Scope scope, Operand records, + Iterable> recordDefaults, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DecodeCsv"); opBuilder.addInput(records.asOutput()); opBuilder.addInputList(Operands.asOutputs(recordDefaults)); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.fieldDelim != null) { @@ -121,7 +100,7 @@ public static DecodeCsv create(Scope scope, Operand records, Iterable records, Iterable selectCols) { return new Options().selectCols(selectCols); } - + /** + * Sets the selectCols option. + * + * @param selectCols Optional sorted list of column indices to select. If specified, + * only this subset of columns will be parsed and returned. + * It only works on {@code records} except for {@code record_defaults}. + * @return this Options instance. + */ + public static Options selectCols(Long... selectCols) { + return new Options().selectCols(selectCols); + } + + /** + * Gets output. * Each tensor will have the same shape as records. + * @return output. */ public List> output() { return output; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) output.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeCSV"; - - private List> output; - - private DecodeCsv(Operation operation) { - super(operation); - int outputIdx = 0; - int outputLength = operation.outputListLength("output"); - output = Arrays.asList(operation.outputList(outputIdx, outputLength)); - outputIdx += outputLength; + + /** + * Optional attributes for {@link org.tensorflow.op.io.DecodeCsv} + */ + public static class Options { + private String fieldDelim; + + private Boolean useQuoteDelim; + + private String naValue; + + private List selectCols; + + private Options() { + } + + /** + * Sets the fieldDelim option. + * + * @param fieldDelim char delimiter to separate fields in a record. + * @return this Options instance. + */ + public Options fieldDelim(String fieldDelim) { + this.fieldDelim = fieldDelim; + return this; + } + + /** + * Sets the useQuoteDelim option. + * + * @param useQuoteDelim If false, treats double quotation marks as regular + * characters inside of the string fields (ignoring RFC 4180, Section 2, + * Bullet 5). + * @return this Options instance. + */ + public Options useQuoteDelim(Boolean useQuoteDelim) { + this.useQuoteDelim = useQuoteDelim; + return this; + } + + /** + * Sets the naValue option. + * + * @param naValue Additional string to recognize as NA/NaN. + * @return this Options instance. + */ + public Options naValue(String naValue) { + this.naValue = naValue; + return this; + } + + /** + * Sets the selectCols option. + * + * @param selectCols Optional sorted list of column indices to select. If specified, + * only this subset of columns will be parsed and returned. + * It only works on {@code records} except for {@code record_defaults}. + * @return this Options instance. + */ + public Options selectCols(List selectCols) { + this.selectCols = selectCols; + return this; + } + + /** + * Sets the selectCols option. + * + * @param selectCols Optional sorted list of column indices to select. If specified, + * only this subset of columns will be parsed and returned. + * It only works on {@code records} except for {@code record_defaults}. + * @return this Options instance. + */ + public Options selectCols(Long... selectCols) { + this.selectCols = Arrays.asList(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; + + /** + * Optional sorted list of column indices to select. If specified, + * only this subset of columns will be parsed and returned. + * It only works on {@code records} except for {@code record_defaults}. + */ + 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 7f2292f4c9a..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,66 +17,98 @@ 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; /** * Convert JSON-encoded Example records to binary protocol buffer strings. - *

- * This op translates a tensor containing Example records, encoded using - * the [standard JSON - * mapping](https://developers.google.com/protocol-buffers/docs/proto3#json), - * into a tensor containing the same records encoded as binary protocol - * buffers. The resulting tensor can then be fed to any of the other - * Example-parsing ops. + * Note: This is not a general purpose JSON parsing op. + *

This op converts JSON-serialized + * {@code tf.train.Example} (created with {@code json_format.MessageToJson}, following the + * standard JSON mapping ) + * to a binary-serialized {@code tf.train.Example} (equivalent to + * {@code Example.SerializeToString()}) suitable for conversion to tensors with + * {@code tf.io.parse_example}. */ -@Operator(group = "io") +@OpMetadata( + opType = DecodeJsonExample.OP_NAME, + inputsClass = DecodeJsonExample.Inputs.class +) +@Operator( + group = "io" +) public final class DecodeJsonExample extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new DecodeJsonExample operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DecodeJSONExample"; + + private Output binaryExamples; + + public DecodeJsonExample(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + binaryExamples = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new DecodeJSONExample operation. + * * @param scope current scope * @param jsonExamples Each string is a JSON object serialized according to the JSON * mapping of the Example proto. * @return a new instance of DecodeJsonExample */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DecodeJsonExample create(Scope scope, Operand jsonExamples) { - OperationBuilder opBuilder = scope.env().opBuilder("DecodeJSONExample", scope.makeOpName("DecodeJsonExample")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DecodeJsonExample"); opBuilder.addInput(jsonExamples.asOutput()); - opBuilder = scope.apply(opBuilder); return new DecodeJsonExample(opBuilder.build()); } - + /** + * Gets binaryExamples. * Each string is a binary Example protocol buffer corresponding - * to the respective element of `json_examples`. + * to the respective element of {@code json_examples}. + * @return binaryExamples. */ public Output binaryExamples() { return binaryExamples; } - + @Override public Output asOutput() { return binaryExamples; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeJSONExample"; - - private Output binaryExamples; - - private DecodeJsonExample(Operation operation) { - super(operation); - int outputIdx = 0; - binaryExamples = operation.output(outputIdx++); + + @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 ca41464e1b3..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,64 +17,70 @@ 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 */ -@Operator(group = "io") +@OpMetadata( + opType = DecodePaddedRaw.OP_NAME, + inputsClass = DecodePaddedRaw.Inputs.class +) +@Operator( + group = "io" +) public final class DecodePaddedRaw extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.DecodePaddedRaw} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param littleEndian Whether the input `input_bytes` is in little-endian order. Ignored for - * `out_type` values that are stored in a single byte, like `uint8` - */ - public Options littleEndian(Boolean littleEndian) { - this.littleEndian = littleEndian; - return this; - } - - private Boolean littleEndian; - - private Options() { - } + public static final String OP_NAME = "DecodePaddedRaw"; + + private Output output; + + public DecodePaddedRaw(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DecodePaddedRaw operation. - * + * * @param scope current scope * @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 - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static DecodePaddedRaw create(Scope scope, Operand inputBytes, Operand fixedLength, Class outType, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DecodePaddedRaw", scope.makeOpName("DecodePaddedRaw")); + @Endpoint( + describeByClass = true + ) + public static DecodePaddedRaw create(Scope scope, + Operand inputBytes, Operand fixedLength, Class outType, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DecodePaddedRaw"); opBuilder.addInput(inputBytes.asOutput()); opBuilder.addInput(fixedLength.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); if (options != null) { for (Options opts : options) { @@ -83,39 +89,91 @@ public static DecodePaddedRaw create(Scope scope, Operand } } } - return new DecodePaddedRaw(opBuilder.build()); + return new DecodePaddedRaw<>(opBuilder.build()); } - + /** - * @param littleEndian Whether the input `input_bytes` is in little-endian order. Ignored for - * `out_type` values that are stored in a single byte, like `uint8` + * Sets the littleEndian option. + * + * @param littleEndian 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} + * @return this Options instance. */ public static Options littleEndian(Boolean littleEndian) { return new Options().littleEndian(littleEndian); } - + /** - * A Tensor with one more dimension than the input `bytes`. The added dimension - * will have size equal to the length of the elements of `bytes` divided by the - * number of bytes to represent `out_type`. + * Gets output. + * A Tensor with one more dimension than the input {@code bytes}. The added dimension + * will have size equal to the length of the elements of {@code bytes} divided by the + * number of bytes to represent {@code out_type}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodePaddedRaw"; - - private Output output; - - private DecodePaddedRaw(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.DecodePaddedRaw} + */ + public static class Options { + private Boolean littleEndian; + + private Options() { + } + + /** + * Sets the littleEndian option. + * + * @param littleEndian 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} + * @return this Options instance. + */ + public Options littleEndian(Boolean littleEndian) { + this.littleEndian = 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 5ef7da94d51..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,61 +17,65 @@ 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 */ -@Operator(group = "io") +@OpMetadata( + opType = DecodeRaw.OP_NAME, + inputsClass = DecodeRaw.Inputs.class +) +@Operator( + group = "io" +) public final class DecodeRaw extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.DecodeRaw} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param littleEndian Whether the input `bytes` are in little-endian order. - * Ignored for `out_type` values that are stored in a single byte like - * `uint8`. - */ - public Options littleEndian(Boolean littleEndian) { - this.littleEndian = littleEndian; - return this; - } - - private Boolean littleEndian; - - private Options() { - } + public static final String OP_NAME = "DecodeRaw"; + + private Output output; + + public DecodeRaw(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DecodeRaw operation. - * + * * @param scope current scope * @param bytes All the elements must have the same length. - * @param outType - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static DecodeRaw create(Scope scope, Operand bytes, Class outType, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DecodeRaw", scope.makeOpName("DecodeRaw")); + @Endpoint( + describeByClass = true + ) + public static DecodeRaw create(Scope scope, Operand bytes, + Class outType, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DecodeRaw"); opBuilder.addInput(bytes.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); if (options != null) { for (Options opts : options) { @@ -80,40 +84,87 @@ public static DecodeRaw create(Scope scope, Operand(opBuilder.build()); + return new DecodeRaw<>(opBuilder.build()); } - + /** - * @param littleEndian Whether the input `bytes` are in little-endian order. - * Ignored for `out_type` values that are stored in a single byte like - * `uint8`. + * Sets the littleEndian option. + * + * @param littleEndian 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}. + * @return this Options instance. */ public static Options littleEndian(Boolean littleEndian) { return new Options().littleEndian(littleEndian); } - + /** - * A Tensor with one more dimension than the input `bytes`. The + * Gets output. + * A Tensor with one more dimension than the input {@code bytes}. The * added dimension will have size equal to the length of the elements - * of `bytes` divided by the number of bytes to represent `out_type`. + * of {@code bytes} divided by the number of bytes to represent {@code out_type}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeRaw"; - - private Output output; - - private DecodeRaw(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.DecodeRaw} + */ + public static class Options { + private Boolean littleEndian; + + private Options() { + } + + /** + * Sets the littleEndian option. + * + * @param littleEndian 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}. + * @return this Options instance. + */ + public Options littleEndian(Boolean littleEndian) { + this.littleEndian = 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 9d2e496e50e..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,117 +17,162 @@ 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; /** - * Deserialize and concatenate `SparseTensors` from a serialized minibatch. - *

- * The input `serialized_sparse` must be a string matrix of shape `[N x 3]` where - * `N` is the minibatch size and the rows correspond to packed outputs of - * `SerializeSparse`. The ranks of the original `SparseTensor` objects - * must all match. When the final `SparseTensor` is created, it has rank one - * higher than the ranks of the incoming `SparseTensor` objects + * Deserialize and concatenate {@code SparseTensors} from a serialized minibatch. + * The input {@code serialized_sparse} must be a string matrix of shape {@code [N x 3]} where + * {@code N} is the minibatch size and the rows correspond to packed outputs of + * {@code SerializeSparse}. The ranks of the original {@code SparseTensor} objects + * must all match. When the final {@code SparseTensor} is created, it has rank one + * higher than the ranks of the incoming {@code SparseTensor} objects * (they have been concatenated along a new row dimension). - *

- * The output `SparseTensor` object's shape values for all dimensions but the - * first are the max across the input `SparseTensor` objects' shape values - * for the corresponding dimensions. Its first shape value is `N`, the minibatch + *

The output {@code SparseTensor} object's shape values for all dimensions but the + * first are the max across the input {@code SparseTensor} objects' shape values + * for the corresponding dimensions. Its first shape value is {@code N}, the minibatch * size. - *

- * The input `SparseTensor` objects' indices are assumed ordered in + *

The input {@code SparseTensor} objects' indices are assumed ordered in * standard lexicographic order. If this is not the case, after this - * step run `SparseReorder` to restore index ordering. - *

- * For example, if the serialized input is a `[2 x 3]` matrix representing two - * original `SparseTensor` objects: - *

- * index = [ 0] - * [10] - * [20] - * values = [1, 2, 3] - * shape = [50] - *

- * and - *

- * index = [ 2] - * [10] - * values = [4, 5] - * shape = [30] - *

- * then the final deserialized `SparseTensor` will be: - *

- * index = [0 0] - * [0 10] - * [0 20] - * [1 2] - * [1 10] - * values = [1, 2, 3, 4, 5] - * shape = [2 50] - * - * @param data type for {@code sparseValues()} output + * step run {@code SparseReorder} to restore index ordering. + *

For example, if the serialized input is a {@code [2 x 3]} matrix representing two + * original {@code SparseTensor} objects: + *

+ * index = [ 0]
+ *         [10]
+ *         [20]
+ * values = [1, 2, 3]
+ * shape = [50]
+ * 
+ *

and + *

+ * index = [ 2]
+ *         [10]
+ * values = [4, 5]
+ * shape = [30]
+ * 
+ *

then the final deserialized {@code SparseTensor} will be: + *

+ * index = [0  0]
+ *         [0 10]
+ *         [0 20]
+ *         [1  2]
+ *         [1 10]
+ * values = [1, 2, 3, 4, 5]
+ * shape = [2 50]
+ * 
*/ -@Operator(group = "io") +@OpMetadata( + opType = DeserializeManySparse.OP_NAME, + inputsClass = DeserializeManySparse.Inputs.class +) +@Operator( + group = "io" +) public final class DeserializeManySparse extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DeserializeManySparse"; + + private Output sparseIndices; + + private Output sparseValues; + + private Output sparseShape; + + public DeserializeManySparse(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + sparseIndices = operation.output(outputIdx++); + sparseValues = operation.output(outputIdx++); + sparseShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DeserializeManySparse operation. - * + * * @param scope current scope - * @param serializedSparse 2-D, The `N` serialized `SparseTensor` objects. + * @param serializedSparse 2-D, The {@code N} serialized {@code SparseTensor} objects. * Must have 3 columns. - * @param dtype The `dtype` of the serialized `SparseTensor` objects. + * @param dtype The {@code dtype} of the serialized {@code SparseTensor} objects. + * @param data type for {@code DeserializeManySparse} output and operands * @return a new instance of DeserializeManySparse */ - @Endpoint(describeByClass = true) - public static DeserializeManySparse create(Scope scope, Operand serializedSparse, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("DeserializeManySparse", scope.makeOpName("DeserializeManySparse")); + @Endpoint( + describeByClass = true + ) + public static DeserializeManySparse create(Scope scope, + Operand serializedSparse, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DeserializeManySparse"); opBuilder.addInput(serializedSparse.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new DeserializeManySparse(opBuilder.build()); + return new DeserializeManySparse<>(opBuilder.build()); } - + /** + * Gets sparseIndices. + * + * @return sparseIndices. */ public Output sparseIndices() { return sparseIndices; } - + /** + * Gets sparseValues. + * + * @return sparseValues. */ public Output sparseValues() { return sparseValues; } - + /** + * Gets sparseShape. + * + * @return sparseShape. */ public Output sparseShape() { return sparseShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DeserializeManySparse"; - - private Output sparseIndices; - private Output sparseValues; - private Output sparseShape; - - private DeserializeManySparse(Operation operation) { - super(operation); - int outputIdx = 0; - sparseIndices = operation.output(outputIdx++); - sparseValues = operation.output(outputIdx++); - sparseShape = operation.output(outputIdx++); + + @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 2955fea0773..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,61 +17,64 @@ 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 /. + *

Web-safe means that the encoder uses - and _ instead of + and /. */ -@Operator(group = "io") +@OpMetadata( + opType = EncodeBase64.OP_NAME, + inputsClass = EncodeBase64.Inputs.class +) +@Operator( + group = "io" +) public final class EncodeBase64 extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.EncodeBase64} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param pad Bool whether padding is applied at the ends. - */ - public Options pad(Boolean pad) { - this.pad = pad; - return this; - } - - private Boolean pad; - - private Options() { - } + public static final String OP_NAME = "EncodeBase64"; + + private Output output; + + public EncodeBase64(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new EncodeBase64 operation. - * + * * @param scope current scope * @param input Strings to be encoded. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of EncodeBase64 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static EncodeBase64 create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("EncodeBase64", scope.makeOpName("EncodeBase64")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "EncodeBase64"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.pad != null) { @@ -81,34 +84,71 @@ public static EncodeBase64 create(Scope scope, Operand input, Options.. } return new EncodeBase64(opBuilder.build()); } - + /** + * Sets the pad option. + * * @param pad Bool whether padding is applied at the ends. + * @return this Options instance. */ public static Options pad(Boolean pad) { return new Options().pad(pad); } - + /** + * Gets output. * Input strings encoded in base64. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EncodeBase64"; - - private Output output; - - private EncodeBase64(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.EncodeBase64} + */ + public static class Options { + private Boolean pad; + + private Options() { + } + + /** + * Sets the pad option. + * + * @param pad Bool whether padding is applied at the ends. + * @return this Options instance. + */ + public Options pad(Boolean pad) { + this.pad = 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 0559fbddbf1..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. @@ -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,87 +27,60 @@ 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. */ -@Operator(group = "io") +@OpMetadata( + opType = FifoQueue.OP_NAME, + inputsClass = FifoQueue.Inputs.class +) +@Operator( + group = "io" +) public final class FifoQueue extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.FifoQueue} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param shapes 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 Options shapes(List shapes) { - this.shapes = shapes; - return this; - } - - /** - * @param capacity The upper bound on the number of elements in this queue. - * Negative numbers mean no limit. - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param container If non-empty, this queue is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this queue will be shared under the given name - * across multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private List shapes; - private Long capacity; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "FIFOQueueV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + public FifoQueue(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new FifoQueue operation. - * + * Factory method to create a class wrapping a new FIFOQueueV2 operation. + * * @param scope current scope * @param componentTypes The type of each component in a value. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of FifoQueue */ - @Endpoint(describeByClass = true) - public static FifoQueue create(Scope scope, List> componentTypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("FIFOQueueV2", scope.makeOpName("FifoQueue")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static FifoQueue create(Scope scope, List> componentTypes, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FifoQueue"); opBuilder.setAttr("component_types", Operands.toDataTypes(componentTypes)); if (options != null) { for (Options opts : options) { if (opts.shapes != null) { Shape[] shapesArray = new Shape[opts.shapes.size()]; - for (int i = 0; i < shapesArray.length; ++i) { + for (int i = 0 ; i < shapesArray.length ; i++) { shapesArray[i] = opts.shapes.get(i); } opBuilder.setAttr("shapes", shapesArray); @@ -123,62 +98,204 @@ public static FifoQueue create(Scope scope, List> compone } return new FifoQueue(opBuilder.build()); } - + /** + * Sets the shapes option. + * * @param shapes 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. + * @return this Options instance. */ public static Options shapes(List shapes) { return new Options().shapes(shapes); } - + + /** + * Sets the shapes option. + * + * @param shapes 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. + * @return this Options instance. + */ + public static Options shapes(Shape... shapes) { + return new Options().shapes(shapes); + } + /** + * Sets the capacity option. + * * @param capacity The upper bound on the number of elements in this queue. * Negative numbers mean no limit. + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** + * Sets the container option. + * * @param container If non-empty, this queue is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this queue will be shared under the given name * across multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets handle. * The handle to the queue. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FIFOQueueV2"; - - private Output handle; - - private FifoQueue(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.FifoQueue} + */ + public static class Options { + private List shapes; + + private Long capacity; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the shapes option. + * + * @param shapes 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. + * @return this Options instance. + */ + public Options shapes(List shapes) { + this.shapes = shapes; + return this; + } + + /** + * Sets the shapes option. + * + * @param shapes 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. + * @return this Options instance. + */ + public Options shapes(Shape... shapes) { + this.shapes = Arrays.asList(shapes); + return this; + } + + /** + * Sets the capacity option. + * + * @param capacity The upper bound on the number of elements in this queue. + * Negative numbers mean no limit. + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the container option. + * + * @param container If non-empty, this queue is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this queue will be shared under the given name + * across multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = 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 8859fe0448d..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,102 +17,59 @@ 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. */ -@Operator(group = "io") +@OpMetadata( + opType = FixedLengthRecordReader.OP_NAME, + inputsClass = FixedLengthRecordReader.Inputs.class +) +@Operator( + group = "io" +) public final class FixedLengthRecordReader extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.FixedLengthRecordReader} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param headerBytes Number of bytes in the header, defaults to 0. - */ - public Options headerBytes(Long headerBytes) { - this.headerBytes = headerBytes; - return this; - } - - /** - * @param footerBytes Number of bytes in the footer, defaults to 0. - */ - public Options footerBytes(Long footerBytes) { - this.footerBytes = footerBytes; - return this; - } - - /** - * @param hopBytes Number of bytes to hop before each read. Default of 0 means using - * record_bytes. - */ - public Options hopBytes(Long hopBytes) { - this.hopBytes = hopBytes; - return this; - } - - /** - * @param container If non-empty, this reader is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this reader is named in the given bucket - * with this shared_name. Otherwise, the node name is used instead. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param encoding The type of encoding for the file. Currently ZLIB and GZIP - * are supported. Defaults to none. - */ - public Options encoding(String encoding) { - this.encoding = encoding; - return this; - } - - private Long headerBytes; - private Long footerBytes; - private Long hopBytes; - private String container; - private String sharedName; - private String encoding; - - private Options() { - } + public static final String OP_NAME = "FixedLengthRecordReaderV2"; + + private Output readerHandle; + + @SuppressWarnings("unchecked") + public FixedLengthRecordReader(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + readerHandle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new FixedLengthRecordReader operation. - * + * Factory method to create a class wrapping a new FixedLengthRecordReaderV2 operation. + * * @param scope current scope * @param recordBytes Number of bytes in the record. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of FixedLengthRecordReader */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static FixedLengthRecordReader create(Scope scope, Long recordBytes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("FixedLengthRecordReaderV2", scope.makeOpName("FixedLengthRecordReader")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FixedLengthRecordReader"); opBuilder.setAttr("record_bytes", recordBytes); if (options != null) { for (Options opts : options) { @@ -138,74 +95,229 @@ public static FixedLengthRecordReader create(Scope scope, Long recordBytes, Opti } return new FixedLengthRecordReader(opBuilder.build()); } - + /** + * Sets the headerBytes option. + * * @param headerBytes Number of bytes in the header, defaults to 0. + * @return this Options instance. */ public static Options headerBytes(Long headerBytes) { return new Options().headerBytes(headerBytes); } - + /** + * Sets the footerBytes option. + * * @param footerBytes Number of bytes in the footer, defaults to 0. + * @return this Options instance. */ public static Options footerBytes(Long footerBytes) { return new Options().footerBytes(footerBytes); } - + /** + * Sets the hopBytes option. + * * @param hopBytes Number of bytes to hop before each read. Default of 0 means using * record_bytes. + * @return this Options instance. */ public static Options hopBytes(Long hopBytes) { return new Options().hopBytes(hopBytes); } - + /** + * Sets the container option. + * * @param container If non-empty, this reader is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this reader is named in the given bucket * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Sets the encoding option. + * * @param encoding The type of encoding for the file. Currently ZLIB and GZIP * are supported. Defaults to none. + * @return this Options instance. */ public static Options encoding(String encoding) { return new Options().encoding(encoding); } - + /** + * Gets readerHandle. * The handle to reference the Reader. + * @return readerHandle. */ - public Output readerHandle() { + public Output readerHandle() { return readerHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) readerHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FixedLengthRecordReaderV2"; - - private Output readerHandle; - - private FixedLengthRecordReader(Operation operation) { - super(operation); - int outputIdx = 0; - readerHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.FixedLengthRecordReader} + */ + public static class Options { + private Long headerBytes; + + private Long footerBytes; + + private Long hopBytes; + + private String container; + + private String sharedName; + + private String encoding; + + private Options() { + } + + /** + * Sets the headerBytes option. + * + * @param headerBytes Number of bytes in the header, defaults to 0. + * @return this Options instance. + */ + public Options headerBytes(Long headerBytes) { + this.headerBytes = headerBytes; + return this; + } + + /** + * Sets the footerBytes option. + * + * @param footerBytes Number of bytes in the footer, defaults to 0. + * @return this Options instance. + */ + public Options footerBytes(Long footerBytes) { + this.footerBytes = footerBytes; + return this; + } + + /** + * Sets the hopBytes option. + * + * @param hopBytes Number of bytes to hop before each read. Default of 0 means using + * record_bytes. + * @return this Options instance. + */ + public Options hopBytes(Long hopBytes) { + this.hopBytes = hopBytes; + return this; + } + + /** + * Sets the container option. + * + * @param container If non-empty, this reader is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this reader is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the encoding option. + * + * @param encoding The type of encoding for the file. Currently ZLIB and GZIP + * are supported. Defaults to none. + * @return this Options instance. + */ + public Options encoding(String encoding) { + this.encoding = 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 6426ea2bd43..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,66 +17,60 @@ 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 queued work as both the key and value. - *

* To use, enqueue strings in a Queue. ReaderRead will take the front * work string and output (work, work). */ -@Operator(group = "io") +@OpMetadata( + opType = IdentityReader.OP_NAME, + inputsClass = IdentityReader.Inputs.class +) +@Operator( + group = "io" +) public final class IdentityReader extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.IdentityReader} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this reader is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this reader is named in the given bucket - * with this shared_name. Otherwise, the node name is used instead. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "IdentityReaderV2"; + + private Output readerHandle; + + @SuppressWarnings("unchecked") + public IdentityReader(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + readerHandle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new IdentityReader operation. - * + * Factory method to create a class wrapping a new IdentityReaderV2 operation. + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of IdentityReader */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static IdentityReader create(Scope scope, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("IdentityReaderV2", scope.makeOpName("IdentityReader")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IdentityReader"); if (options != null) { for (Options opts : options) { if (opts.container != null) { @@ -89,44 +83,101 @@ public static IdentityReader create(Scope scope, Options... options) { } return new IdentityReader(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this reader is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this reader is named in the given bucket * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets readerHandle. * The handle to reference the Reader. + * @return readerHandle. */ - public Output readerHandle() { + public Output readerHandle() { return readerHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) readerHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IdentityReaderV2"; - - private Output readerHandle; - - private IdentityReader(Operation operation) { - super(operation); - int outputIdx = 0; - readerHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.IdentityReader} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this reader is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this reader is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = 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 e37786733e2..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,63 +17,57 @@ 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. */ -@Operator(group = "io") +@OpMetadata( + opType = LmdbReader.OP_NAME, + inputsClass = LmdbReader.Inputs.class +) +@Operator( + group = "io" +) public final class LmdbReader extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.LmdbReader} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this reader is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this reader is named in the given bucket - * with this shared_name. Otherwise, the node name is used instead. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "LMDBReader"; + + private Output readerHandle; + + public LmdbReader(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + readerHandle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new LmdbReader operation. - * + * Factory method to create a class wrapping a new LMDBReader operation. + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of LmdbReader */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static LmdbReader create(Scope scope, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("LMDBReader", scope.makeOpName("LmdbReader")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LmdbReader"); if (options != null) { for (Options opts : options) { if (opts.container != null) { @@ -86,43 +80,100 @@ public static LmdbReader create(Scope scope, Options... options) { } return new LmdbReader(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this reader is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this reader is named in the given bucket * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets readerHandle. * The handle to reference the Reader. + * @return readerHandle. */ public Output readerHandle() { return readerHandle; } - + @Override public Output asOutput() { return readerHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LMDBReader"; - - private Output readerHandle; - - private LmdbReader(Operation operation) { - super(operation); - int outputIdx = 0; - readerHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.LmdbReader} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this reader is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this reader is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = 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 48c19fdc3b0..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,61 +17,91 @@ 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; /** * Returns the set of files matching one or more glob patterns. - *

* Note that this routine only supports wildcard characters in the * basename portion of the pattern, not in the directory portion. * Note also that the order of filenames returned is deterministic. */ -@Operator(group = "io") +@OpMetadata( + opType = MatchingFiles.OP_NAME, + inputsClass = MatchingFiles.Inputs.class +) +@Operator( + group = "io" +) public final class MatchingFiles extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MatchingFiles"; + + private Output filenames; + + public MatchingFiles(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + filenames = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MatchingFiles operation. - * + * * @param scope current scope * @param pattern Shell wildcard pattern(s). Scalar or vector of type string. * @return a new instance of MatchingFiles */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static MatchingFiles create(Scope scope, Operand pattern) { - OperationBuilder opBuilder = scope.env().opBuilder("MatchingFiles", scope.makeOpName("MatchingFiles")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MatchingFiles"); opBuilder.addInput(pattern.asOutput()); - opBuilder = scope.apply(opBuilder); return new MatchingFiles(opBuilder.build()); } - + /** + * Gets filenames. * A vector of matching filenames. + * @return filenames. */ public Output filenames() { return filenames; } - + @Override public Output asOutput() { return filenames; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatchingFiles"; - - private Output filenames; - - private MatchingFiles(Operation operation) { - super(operation); - int outputIdx = 0; - filenames = operation.output(outputIdx++); + + @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 691e35140ca..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. @@ -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,95 +27,63 @@ 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. - *

* Variable-size shapes are allowed by setting the corresponding shape dimensions * 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. */ -@Operator(group = "io") +@OpMetadata( + opType = PaddingFifoQueue.OP_NAME, + inputsClass = PaddingFifoQueue.Inputs.class +) +@Operator( + group = "io" +) public final class PaddingFifoQueue extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.PaddingFifoQueue} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param shapes 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 Options shapes(List shapes) { - this.shapes = shapes; - return this; - } - - /** - * @param capacity The upper bound on the number of elements in this queue. - * Negative numbers mean no limit. - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param container If non-empty, this queue is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this queue will be shared under the given name - * across multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private List shapes; - private Long capacity; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "PaddingFIFOQueueV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + public PaddingFifoQueue(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new PaddingFifoQueue operation. - * + * Factory method to create a class wrapping a new PaddingFIFOQueueV2 operation. + * * @param scope current scope * @param componentTypes The type of each component in a value. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of PaddingFifoQueue */ - @Endpoint(describeByClass = true) - public static PaddingFifoQueue create(Scope scope, List> componentTypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("PaddingFIFOQueueV2", scope.makeOpName("PaddingFifoQueue")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static PaddingFifoQueue create(Scope scope, List> componentTypes, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "PaddingFifoQueue"); opBuilder.setAttr("component_types", Operands.toDataTypes(componentTypes)); if (options != null) { for (Options opts : options) { if (opts.shapes != null) { Shape[] shapesArray = new Shape[opts.shapes.size()]; - for (int i = 0; i < shapesArray.length; ++i) { + for (int i = 0 ; i < shapesArray.length ; i++) { shapesArray[i] = opts.shapes.get(i); } opBuilder.setAttr("shapes", shapesArray); @@ -131,8 +101,10 @@ public static PaddingFifoQueue create(Scope scope, List> } return new PaddingFifoQueue(opBuilder.build()); } - + /** + * Sets the shapes option. + * * @param shapes 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 @@ -141,56 +113,212 @@ public static PaddingFifoQueue create(Scope scope, List> * 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. + * @return this Options instance. */ public static Options shapes(List shapes) { return new Options().shapes(shapes); } - + /** + * Sets the shapes option. + * + * @param shapes 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. + * @return this Options instance. + */ + public static Options shapes(Shape... shapes) { + return new Options().shapes(shapes); + } + + /** + * Sets the capacity option. + * * @param capacity The upper bound on the number of elements in this queue. * Negative numbers mean no limit. + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** + * Sets the container option. + * * @param container If non-empty, this queue is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this queue will be shared under the given name * across multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets handle. * The handle to the queue. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "PaddingFIFOQueueV2"; - - private Output handle; - - private PaddingFifoQueue(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.PaddingFifoQueue} + */ + public static class Options { + private List shapes; + + private Long capacity; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the shapes option. + * + * @param shapes 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. + * @return this Options instance. + */ + public Options shapes(List shapes) { + this.shapes = shapes; + return this; + } + + /** + * Sets the shapes option. + * + * @param shapes 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. + * @return this Options instance. + */ + public Options shapes(Shape... shapes) { + this.shapes = Arrays.asList(shapes); + return this; + } + + /** + * Sets the capacity option. + * + * @param capacity The upper bound on the number of elements in this queue. + * Negative numbers mean no limit. + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the container option. + * + * @param container If non-empty, this queue is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this queue will be shared under the given name + * across multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = 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 bdd66a0a62a..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,28 +42,74 @@ /** * Transforms a vector of tf.Example protos (as strings) into typed tensors. */ -@Operator(group = "io") +@OpMetadata( + opType = ParseExample.OP_NAME, + inputsClass = ParseExample.Inputs.class +) +@Operator( + group = "io" +) public final class ParseExample extends RawOp { - /** - * Factory method to create a class wrapping a new ParseExample operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ParseExampleV2"; + + private List> sparseIndices; + + private List> sparseValues; + + private List> sparseShapes; + + private List> denseValues; + + private List> raggedValues; + + private List> raggedRowSplits; + + @SuppressWarnings("unchecked") + 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)); + outputIdx += sparseIndicesLength; + int sparseValuesLength = operation.outputListLength("sparse_values"); + sparseValues = Arrays.asList(operation.outputList(outputIdx, sparseValuesLength)); + outputIdx += sparseValuesLength; + int sparseShapesLength = operation.outputListLength("sparse_shapes"); + sparseShapes = Arrays.asList((Output[]) operation.outputList(outputIdx, sparseShapesLength)); + outputIdx += sparseShapesLength; + int denseValuesLength = operation.outputListLength("dense_values"); + denseValues = Arrays.asList(operation.outputList(outputIdx, denseValuesLength)); + outputIdx += denseValuesLength; + int raggedValuesLength = operation.outputListLength("ragged_values"); + raggedValues = Arrays.asList(operation.outputList(outputIdx, raggedValuesLength)); + outputIdx += raggedValuesLength; + int raggedRowSplitsLength = operation.outputListLength("ragged_row_splits"); + raggedRowSplits = Arrays.asList(operation.outputList(outputIdx, raggedRowSplitsLength)); + outputIdx += raggedRowSplitsLength; + } + + /** + * Factory method to create a class wrapping a new ParseExampleV2 operation. + * * @param scope current scope * @param serialized A scalar or vector containing binary serialized Example protos. * @param names A tensor containing the names of the serialized protos. - * Corresponds 1:1 with the `serialized` tensor. + * 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". + * If non-empty, this tensor must have the same shape as "serialized". * @param sparseKeys Vector of strings. * The keys expected in the Examples' features associated with sparse values. * @param denseKeys Vector of strings. * The keys expected in the Examples' features associated with dense values. * @param raggedKeys Vector of strings. * The keys expected in the Examples' features associated with ragged values. - * @param denseDefaults A list of Tensors (some may be empty). Corresponds 1:1 with `dense_keys`. + * @param denseDefaults 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. @@ -69,19 +120,19 @@ public final class ParseExample extends RawOp { * feature), dense_defaults[j] must contain a single element: * the padding element. * @param numSparse The number of sparse keys. - * @param sparseTypes A list of `num_sparse` types; the data types of data in each Feature + * @param sparseTypes 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). - * @param raggedValueTypes A list of `num_ragged` types; the data types of data in each Feature - * given in ragged_keys (where `num_ragged = sparse_keys.size()`). + * @param raggedValueTypes 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). - * @param raggedSplitTypes A list of `num_ragged` types; the data types of row_splits in each Feature - * given in ragged_keys (where `num_ragged = sparse_keys.size()`). + * @param raggedSplitTypes 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. - * @param denseShapes A list of `num_dense` shapes; the shapes of data in each Feature - * given in dense_keys (where `num_dense = dense_keys.size()`). + * @param denseShapes 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 @@ -96,95 +147,201 @@ public final class ParseExample extends RawOp { * scalar element along the second dimension. * @return a new instance of ParseExample */ - @Endpoint(describeByClass = true) - public static ParseExample create(Scope scope, Operand serialized, Operand names, Operand sparseKeys, Operand denseKeys, Operand raggedKeys, Iterable> denseDefaults, Long numSparse, List> sparseTypes, List> raggedValueTypes, List> raggedSplitTypes, List denseShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ParseExampleV2", scope.makeOpName("ParseExample")); + @Endpoint( + describeByClass = true + ) + public static ParseExample create(Scope scope, Operand serialized, + Operand names, Operand sparseKeys, Operand denseKeys, + Operand raggedKeys, Iterable> denseDefaults, Long numSparse, + List> sparseTypes, List> raggedValueTypes, + List> raggedSplitTypes, List denseShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ParseExample"); opBuilder.addInput(serialized.asOutput()); opBuilder.addInput(names.asOutput()); opBuilder.addInput(sparseKeys.asOutput()); opBuilder.addInput(denseKeys.asOutput()); opBuilder.addInput(raggedKeys.asOutput()); opBuilder.addInputList(Operands.asOutputs(denseDefaults)); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_sparse", numSparse); opBuilder.setAttr("sparse_types", Operands.toDataTypes(sparseTypes)); opBuilder.setAttr("ragged_value_types", Operands.toDataTypes(raggedValueTypes)); opBuilder.setAttr("ragged_split_types", Operands.toDataTypes(raggedSplitTypes)); Shape[] denseShapesArray = new Shape[denseShapes.size()]; - for (int i = 0; i < denseShapesArray.length; ++i) { + for (int i = 0 ; i < denseShapesArray.length ; i++) { denseShapesArray[i] = denseShapes.get(i); } opBuilder.setAttr("dense_shapes", denseShapesArray); return new ParseExample(opBuilder.build()); } - + /** + * Gets sparseIndices. + * + * @return sparseIndices. */ public List> sparseIndices() { return sparseIndices; } - + /** + * Gets sparseValues. + * + * @return sparseValues. */ public List> sparseValues() { return sparseValues; } - + /** + * Gets sparseShapes. + * + * @return sparseShapes. */ public List> sparseShapes() { return sparseShapes; } - + /** + * Gets denseValues. + * + * @return denseValues. */ public List> denseValues() { return denseValues; } - + /** + * Gets raggedValues. + * + * @return raggedValues. */ public List> raggedValues() { return raggedValues; } - + /** + * Gets raggedRowSplits. + * + * @return raggedRowSplits. */ public List> raggedRowSplits() { return raggedRowSplits; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ParseExampleV2"; - - private List> sparseIndices; - private List> sparseValues; - private List> sparseShapes; - private List> denseValues; - private List> raggedValues; - private List> raggedRowSplits; - - @SuppressWarnings("unchecked") - private ParseExample(Operation operation) { - super(operation); - int outputIdx = 0; - int sparseIndicesLength = operation.outputListLength("sparse_indices"); - sparseIndices = Arrays.asList((Output[])operation.outputList(outputIdx, sparseIndicesLength)); - outputIdx += sparseIndicesLength; - int sparseValuesLength = operation.outputListLength("sparse_values"); - sparseValues = Arrays.asList(operation.outputList(outputIdx, sparseValuesLength)); - outputIdx += sparseValuesLength; - int sparseShapesLength = operation.outputListLength("sparse_shapes"); - sparseShapes = Arrays.asList((Output[])operation.outputList(outputIdx, sparseShapesLength)); - outputIdx += sparseShapesLength; - int denseValuesLength = operation.outputListLength("dense_values"); - denseValues = Arrays.asList(operation.outputList(outputIdx, denseValuesLength)); - outputIdx += denseValuesLength; - int raggedValuesLength = operation.outputListLength("ragged_values"); - raggedValues = Arrays.asList(operation.outputList(outputIdx, raggedValuesLength)); - outputIdx += raggedValuesLength; - int raggedRowSplitsLength = operation.outputListLength("ragged_row_splits"); - raggedRowSplits = Arrays.asList(operation.outputList(outputIdx, raggedRowSplitsLength)); - outputIdx += raggedRowSplitsLength; + + @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 b4c9479d7c7..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,75 +44,98 @@ * Transforms a vector of tf.io.SequenceExample protos (as strings) into * typed tensors. */ -@Operator(group = "io") +@OpMetadata( + opType = ParseSequenceExample.OP_NAME, + inputsClass = ParseSequenceExample.Inputs.class +) +@Operator( + group = "io" +) public final class ParseSequenceExample extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.io.ParseSequenceExample} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param NcontextSparse - */ - public Options NcontextSparse(Long NcontextSparse) { - this.NcontextSparse = NcontextSparse; - return this; - } - - /** - * @param contextDenseShapes 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 Options contextDenseShapes(List contextDenseShapes) { - this.contextDenseShapes = contextDenseShapes; - return this; - } - - /** - * @param NfeatureListSparse - */ - public Options NfeatureListSparse(Long NfeatureListSparse) { - this.NfeatureListSparse = NfeatureListSparse; - return this; - } - - /** - * @param NfeatureListDense - */ - public Options NfeatureListDense(Long NfeatureListDense) { - this.NfeatureListDense = NfeatureListDense; - return this; - } - - /** - * @param featureListDenseShapes 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 Options featureListDenseShapes(List featureListDenseShapes) { - this.featureListDenseShapes = featureListDenseShapes; - return this; - } - - private Long NcontextSparse; - private List contextDenseShapes; - private Long NfeatureListSparse; - private Long NfeatureListDense; - private List featureListDenseShapes; - - private Options() { - } + public static final String OP_NAME = "ParseSequenceExampleV2"; + + private List> contextSparseIndices; + + private List> contextSparseValues; + + private List> contextSparseShapes; + + private List> contextDenseValues; + + private List> contextRaggedValues; + + private List> contextRaggedRowSplits; + + private List> featureListSparseIndices; + + private List> featureListSparseValues; + + private List> featureListSparseShapes; + + private List> featureListDenseValues; + + private List> featureListDenseLengths; + + private List> featureListRaggedValues; + + private List> featureListRaggedOuterSplits; + + private List> featureListRaggedInnerSplits; + + @SuppressWarnings("unchecked") + 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)); + outputIdx += contextSparseIndicesLength; + int contextSparseValuesLength = operation.outputListLength("context_sparse_values"); + contextSparseValues = Arrays.asList(operation.outputList(outputIdx, contextSparseValuesLength)); + outputIdx += contextSparseValuesLength; + int contextSparseShapesLength = operation.outputListLength("context_sparse_shapes"); + contextSparseShapes = Arrays.asList((Output[]) operation.outputList(outputIdx, contextSparseShapesLength)); + outputIdx += contextSparseShapesLength; + int contextDenseValuesLength = operation.outputListLength("context_dense_values"); + contextDenseValues = Arrays.asList(operation.outputList(outputIdx, contextDenseValuesLength)); + outputIdx += contextDenseValuesLength; + int contextRaggedValuesLength = operation.outputListLength("context_ragged_values"); + contextRaggedValues = Arrays.asList(operation.outputList(outputIdx, contextRaggedValuesLength)); + outputIdx += contextRaggedValuesLength; + int contextRaggedRowSplitsLength = operation.outputListLength("context_ragged_row_splits"); + contextRaggedRowSplits = Arrays.asList(operation.outputList(outputIdx, contextRaggedRowSplitsLength)); + outputIdx += contextRaggedRowSplitsLength; + int featureListSparseIndicesLength = operation.outputListLength("feature_list_sparse_indices"); + featureListSparseIndices = Arrays.asList((Output[]) operation.outputList(outputIdx, featureListSparseIndicesLength)); + outputIdx += featureListSparseIndicesLength; + int featureListSparseValuesLength = operation.outputListLength("feature_list_sparse_values"); + featureListSparseValues = Arrays.asList(operation.outputList(outputIdx, featureListSparseValuesLength)); + outputIdx += featureListSparseValuesLength; + int featureListSparseShapesLength = operation.outputListLength("feature_list_sparse_shapes"); + featureListSparseShapes = Arrays.asList((Output[]) operation.outputList(outputIdx, featureListSparseShapesLength)); + outputIdx += featureListSparseShapesLength; + int featureListDenseValuesLength = operation.outputListLength("feature_list_dense_values"); + featureListDenseValues = Arrays.asList(operation.outputList(outputIdx, featureListDenseValuesLength)); + outputIdx += featureListDenseValuesLength; + int featureListDenseLengthsLength = operation.outputListLength("feature_list_dense_lengths"); + featureListDenseLengths = Arrays.asList((Output[]) operation.outputList(outputIdx, featureListDenseLengthsLength)); + outputIdx += featureListDenseLengthsLength; + int featureListRaggedValuesLength = operation.outputListLength("feature_list_ragged_values"); + featureListRaggedValues = Arrays.asList(operation.outputList(outputIdx, featureListRaggedValuesLength)); + outputIdx += featureListRaggedValuesLength; + int featureListRaggedOuterSplitsLength = operation.outputListLength("feature_list_ragged_outer_splits"); + featureListRaggedOuterSplits = Arrays.asList(operation.outputList(outputIdx, featureListRaggedOuterSplitsLength)); + outputIdx += featureListRaggedOuterSplitsLength; + int featureListRaggedInnerSplitsLength = operation.outputListLength("feature_list_ragged_inner_splits"); + featureListRaggedInnerSplits = Arrays.asList(operation.outputList(outputIdx, featureListRaggedInnerSplitsLength)); + outputIdx += featureListRaggedInnerSplitsLength; } - + /** - * Factory method to create a class wrapping a new ParseSequenceExample operation. - * + * Factory method to create a class wrapping a new ParseSequenceExampleV2 operation. + * * @param scope current scope * @param serialized A scalar or vector containing binary serialized SequenceExample protos. * @param debugName A scalar or vector containing the names of the serialized protos. @@ -142,19 +170,32 @@ private Options() { * 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 + * @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), * DT_INT64 (Int64List), and DT_STRING (BytesList). * @param featureListRaggedValueTypes RaggedTensor.value dtypes for the ragged FeatureList features. * @param featureListRaggedSplitTypes RaggedTensor.row_split dtypes for the ragged FeatureList features. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ParseSequenceExample */ - @Endpoint(describeByClass = true) - public static ParseSequenceExample create(Scope scope, Operand serialized, Operand debugName, Operand contextSparseKeys, Operand contextDenseKeys, Operand contextRaggedKeys, Operand featureListSparseKeys, Operand featureListDenseKeys, Operand featureListRaggedKeys, Operand featureListDenseMissingAssumedEmpty, Iterable> contextDenseDefaults, List> contextSparseTypes, List> contextRaggedValueTypes, List> contextRaggedSplitTypes, List> featureListDenseTypes, List> featureListSparseTypes, List> featureListRaggedValueTypes, List> featureListRaggedSplitTypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ParseSequenceExampleV2", scope.makeOpName("ParseSequenceExample")); + @Endpoint( + describeByClass = true + ) + public static ParseSequenceExample create(Scope scope, Operand serialized, + Operand debugName, Operand contextSparseKeys, + Operand contextDenseKeys, Operand contextRaggedKeys, + Operand featureListSparseKeys, Operand featureListDenseKeys, + Operand featureListRaggedKeys, Operand featureListDenseMissingAssumedEmpty, + Iterable> contextDenseDefaults, List> contextSparseTypes, + List> contextRaggedValueTypes, + List> contextRaggedSplitTypes, + List> featureListDenseTypes, + List> featureListSparseTypes, + List> featureListRaggedValueTypes, + List> featureListRaggedSplitTypes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ParseSequenceExample"); opBuilder.addInput(serialized.asOutput()); opBuilder.addInput(debugName.asOutput()); opBuilder.addInput(contextSparseKeys.asOutput()); @@ -165,7 +206,6 @@ public static ParseSequenceExample create(Scope scope, Operand serializ opBuilder.addInput(featureListRaggedKeys.asOutput()); opBuilder.addInput(featureListDenseMissingAssumedEmpty.asOutput()); opBuilder.addInputList(Operands.asOutputs(contextDenseDefaults)); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("context_sparse_types", Operands.toDataTypes(contextSparseTypes)); opBuilder.setAttr("context_ragged_value_types", Operands.toDataTypes(contextRaggedValueTypes)); opBuilder.setAttr("context_ragged_split_types", Operands.toDataTypes(contextRaggedSplitTypes)); @@ -180,7 +220,7 @@ public static ParseSequenceExample create(Scope scope, Operand serializ } if (opts.contextDenseShapes != null) { Shape[] contextDenseShapesArray = new Shape[opts.contextDenseShapes.size()]; - for (int i = 0; i < contextDenseShapesArray.length; ++i) { + for (int i = 0 ; i < contextDenseShapesArray.length ; i++) { contextDenseShapesArray[i] = opts.contextDenseShapes.get(i); } opBuilder.setAttr("context_dense_shapes", contextDenseShapesArray); @@ -193,7 +233,7 @@ public static ParseSequenceExample create(Scope scope, Operand serializ } if (opts.featureListDenseShapes != null) { Shape[] featureListDenseShapesArray = new Shape[opts.featureListDenseShapes.size()]; - for (int i = 0; i < featureListDenseShapesArray.length; ++i) { + for (int i = 0 ; i < featureListDenseShapesArray.length ; i++) { featureListDenseShapesArray[i] = opts.featureListDenseShapes.get(i); } opBuilder.setAttr("feature_list_dense_shapes", featureListDenseShapesArray); @@ -202,197 +242,490 @@ public static ParseSequenceExample create(Scope scope, Operand serializ } return new ParseSequenceExample(opBuilder.build()); } - + /** - * @param NcontextSparse + * Sets the NcontextSparse option. + * + * @param NcontextSparse the NcontextSparse option + * @return this Options instance. */ public static Options NcontextSparse(Long NcontextSparse) { return new Options().NcontextSparse(NcontextSparse); } - + /** + * Sets the contextDenseShapes option. + * * @param contextDenseShapes 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]. + * @return this Options instance. */ public static Options contextDenseShapes(List contextDenseShapes) { return new Options().contextDenseShapes(contextDenseShapes); } - + /** - * @param NfeatureListSparse + * Sets the contextDenseShapes option. + * + * @param contextDenseShapes 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]. + * @return this Options instance. + */ + public static Options contextDenseShapes(Shape... contextDenseShapes) { + return new Options().contextDenseShapes(contextDenseShapes); + } + + /** + * Sets the NfeatureListSparse option. + * + * @param NfeatureListSparse the NfeatureListSparse option + * @return this Options instance. */ public static Options NfeatureListSparse(Long NfeatureListSparse) { return new Options().NfeatureListSparse(NfeatureListSparse); } - + /** - * @param NfeatureListDense + * Sets the NfeatureListDense option. + * + * @param NfeatureListDense the NfeatureListDense option + * @return this Options instance. */ public static Options NfeatureListDense(Long NfeatureListDense) { return new Options().NfeatureListDense(NfeatureListDense); } - + /** + * Sets the featureListDenseShapes option. + * * @param featureListDenseShapes 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(). + * @return this Options instance. */ public static Options featureListDenseShapes(List featureListDenseShapes) { return new Options().featureListDenseShapes(featureListDenseShapes); } - + /** + * Sets the featureListDenseShapes option. + * + * @param featureListDenseShapes 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(). + * @return this Options instance. + */ + public static Options featureListDenseShapes(Shape... featureListDenseShapes) { + return new Options().featureListDenseShapes(featureListDenseShapes); + } + + /** + * Gets contextSparseIndices. + * + * @return contextSparseIndices. */ public List> contextSparseIndices() { return contextSparseIndices; } - + /** + * Gets contextSparseValues. + * + * @return contextSparseValues. */ public List> contextSparseValues() { return contextSparseValues; } - + /** + * Gets contextSparseShapes. + * + * @return contextSparseShapes. */ public List> contextSparseShapes() { return contextSparseShapes; } - + /** + * Gets contextDenseValues. + * + * @return contextDenseValues. */ public List> contextDenseValues() { return contextDenseValues; } - + /** + * Gets contextRaggedValues. + * + * @return contextRaggedValues. */ public List> contextRaggedValues() { return contextRaggedValues; } - + /** + * Gets contextRaggedRowSplits. + * + * @return contextRaggedRowSplits. */ public List> contextRaggedRowSplits() { return contextRaggedRowSplits; } - + /** + * Gets featureListSparseIndices. + * + * @return featureListSparseIndices. */ public List> featureListSparseIndices() { return featureListSparseIndices; } - + /** + * Gets featureListSparseValues. + * + * @return featureListSparseValues. */ public List> featureListSparseValues() { return featureListSparseValues; } - + /** + * Gets featureListSparseShapes. + * + * @return featureListSparseShapes. */ public List> featureListSparseShapes() { return featureListSparseShapes; } - + /** + * Gets featureListDenseValues. + * + * @return featureListDenseValues. */ public List> featureListDenseValues() { return featureListDenseValues; } - + /** + * Gets featureListDenseLengths. + * + * @return featureListDenseLengths. */ public List> featureListDenseLengths() { return featureListDenseLengths; } - + /** + * Gets featureListRaggedValues. + * + * @return featureListRaggedValues. */ public List> featureListRaggedValues() { return featureListRaggedValues; } - + /** + * Gets featureListRaggedOuterSplits. + * + * @return featureListRaggedOuterSplits. */ public List> featureListRaggedOuterSplits() { return featureListRaggedOuterSplits; } - + /** + * Gets featureListRaggedInnerSplits. + * + * @return featureListRaggedInnerSplits. */ public List> featureListRaggedInnerSplits() { return featureListRaggedInnerSplits; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ParseSequenceExampleV2"; - - private List> contextSparseIndices; - private List> contextSparseValues; - private List> contextSparseShapes; - private List> contextDenseValues; - private List> contextRaggedValues; - private List> contextRaggedRowSplits; - private List> featureListSparseIndices; - private List> featureListSparseValues; - private List> featureListSparseShapes; - private List> featureListDenseValues; - private List> featureListDenseLengths; - private List> featureListRaggedValues; - private List> featureListRaggedOuterSplits; - private List> featureListRaggedInnerSplits; - - @SuppressWarnings("unchecked") - private ParseSequenceExample(Operation operation) { - super(operation); - int outputIdx = 0; - int contextSparseIndicesLength = operation.outputListLength("context_sparse_indices"); - contextSparseIndices = Arrays.asList((Output[])operation.outputList(outputIdx, contextSparseIndicesLength)); - outputIdx += contextSparseIndicesLength; - int contextSparseValuesLength = operation.outputListLength("context_sparse_values"); - contextSparseValues = Arrays.asList(operation.outputList(outputIdx, contextSparseValuesLength)); - outputIdx += contextSparseValuesLength; - int contextSparseShapesLength = operation.outputListLength("context_sparse_shapes"); - contextSparseShapes = Arrays.asList((Output[])operation.outputList(outputIdx, contextSparseShapesLength)); - outputIdx += contextSparseShapesLength; - int contextDenseValuesLength = operation.outputListLength("context_dense_values"); - contextDenseValues = Arrays.asList(operation.outputList(outputIdx, contextDenseValuesLength)); - outputIdx += contextDenseValuesLength; - int contextRaggedValuesLength = operation.outputListLength("context_ragged_values"); - contextRaggedValues = Arrays.asList(operation.outputList(outputIdx, contextRaggedValuesLength)); - outputIdx += contextRaggedValuesLength; - int contextRaggedRowSplitsLength = operation.outputListLength("context_ragged_row_splits"); - contextRaggedRowSplits = Arrays.asList(operation.outputList(outputIdx, contextRaggedRowSplitsLength)); - outputIdx += contextRaggedRowSplitsLength; - int featureListSparseIndicesLength = operation.outputListLength("feature_list_sparse_indices"); - featureListSparseIndices = Arrays.asList((Output[])operation.outputList(outputIdx, featureListSparseIndicesLength)); - outputIdx += featureListSparseIndicesLength; - int featureListSparseValuesLength = operation.outputListLength("feature_list_sparse_values"); - featureListSparseValues = Arrays.asList(operation.outputList(outputIdx, featureListSparseValuesLength)); - outputIdx += featureListSparseValuesLength; - int featureListSparseShapesLength = operation.outputListLength("feature_list_sparse_shapes"); - featureListSparseShapes = Arrays.asList((Output[])operation.outputList(outputIdx, featureListSparseShapesLength)); - outputIdx += featureListSparseShapesLength; - int featureListDenseValuesLength = operation.outputListLength("feature_list_dense_values"); - featureListDenseValues = Arrays.asList(operation.outputList(outputIdx, featureListDenseValuesLength)); - outputIdx += featureListDenseValuesLength; - int featureListDenseLengthsLength = operation.outputListLength("feature_list_dense_lengths"); - featureListDenseLengths = Arrays.asList((Output[])operation.outputList(outputIdx, featureListDenseLengthsLength)); - outputIdx += featureListDenseLengthsLength; - int featureListRaggedValuesLength = operation.outputListLength("feature_list_ragged_values"); - featureListRaggedValues = Arrays.asList(operation.outputList(outputIdx, featureListRaggedValuesLength)); - outputIdx += featureListRaggedValuesLength; - int featureListRaggedOuterSplitsLength = operation.outputListLength("feature_list_ragged_outer_splits"); - featureListRaggedOuterSplits = Arrays.asList(operation.outputList(outputIdx, featureListRaggedOuterSplitsLength)); - outputIdx += featureListRaggedOuterSplitsLength; - int featureListRaggedInnerSplitsLength = operation.outputListLength("feature_list_ragged_inner_splits"); - featureListRaggedInnerSplits = Arrays.asList(operation.outputList(outputIdx, featureListRaggedInnerSplitsLength)); - outputIdx += featureListRaggedInnerSplitsLength; + + /** + * Optional attributes for {@link org.tensorflow.op.io.ParseSequenceExample} + */ + public static class Options { + private Long NcontextSparse; + + private List contextDenseShapes; + + private Long NfeatureListSparse; + + private Long NfeatureListDense; + + private List featureListDenseShapes; + + private Options() { + } + + /** + * Sets the NcontextSparse option. + * + * @param NcontextSparse the NcontextSparse option + * @return this Options instance. + */ + public Options NcontextSparse(Long NcontextSparse) { + this.NcontextSparse = NcontextSparse; + return this; + } + + /** + * Sets the contextDenseShapes option. + * + * @param contextDenseShapes 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]. + * @return this Options instance. + */ + public Options contextDenseShapes(List contextDenseShapes) { + this.contextDenseShapes = contextDenseShapes; + return this; + } + + /** + * Sets the contextDenseShapes option. + * + * @param contextDenseShapes 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]. + * @return this Options instance. + */ + public Options contextDenseShapes(Shape... contextDenseShapes) { + this.contextDenseShapes = Arrays.asList(contextDenseShapes); + return this; + } + + /** + * Sets the NfeatureListSparse option. + * + * @param NfeatureListSparse the NfeatureListSparse option + * @return this Options instance. + */ + public Options NfeatureListSparse(Long NfeatureListSparse) { + this.NfeatureListSparse = NfeatureListSparse; + return this; + } + + /** + * Sets the NfeatureListDense option. + * + * @param NfeatureListDense the NfeatureListDense option + * @return this Options instance. + */ + public Options NfeatureListDense(Long NfeatureListDense) { + this.NfeatureListDense = NfeatureListDense; + return this; + } + + /** + * Sets the featureListDenseShapes option. + * + * @param featureListDenseShapes 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(). + * @return this Options instance. + */ + public Options featureListDenseShapes(List featureListDenseShapes) { + this.featureListDenseShapes = featureListDenseShapes; + return this; + } + + /** + * Sets the featureListDenseShapes option. + * + * @param featureListDenseShapes 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(). + * @return this Options instance. + */ + public Options featureListDenseShapes(Shape... featureListDenseShapes) { + this.featureListDenseShapes = Arrays.asList(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 f860fec4dc4..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,16 +41,52 @@ /** * Transforms a tf.Example proto (as a string) into typed tensors. */ -@Operator(group = "io") +@OpMetadata( + opType = ParseSingleExample.OP_NAME, + inputsClass = ParseSingleExample.Inputs.class +) +@Operator( + group = "io" +) public final class ParseSingleExample extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ParseSingleExample"; + + private List> sparseIndices; + + private List> sparseValues; + + private List> sparseShapes; + + private List> denseValues; + + @SuppressWarnings("unchecked") + 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)); + outputIdx += sparseIndicesLength; + int sparseValuesLength = operation.outputListLength("sparse_values"); + sparseValues = Arrays.asList(operation.outputList(outputIdx, sparseValuesLength)); + outputIdx += sparseValuesLength; + int sparseShapesLength = operation.outputListLength("sparse_shapes"); + sparseShapes = Arrays.asList((Output[]) operation.outputList(outputIdx, sparseShapesLength)); + outputIdx += sparseShapesLength; + int denseValuesLength = operation.outputListLength("dense_values"); + denseValues = Arrays.asList(operation.outputList(outputIdx, denseValuesLength)); + outputIdx += denseValuesLength; + } + /** * Factory method to create a class wrapping a new ParseSingleExample operation. - * + * * @param scope current scope * @param serialized A vector containing a batch of binary serialized Example protos. * @param denseDefaults A list of Tensors (some may be empty), whose length matches - * the length of `dense_keys`. dense_defaults[j] provides default values + * 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. @@ -55,17 +96,17 @@ public final class ParseSingleExample extends RawOp { * feature), dense_defaults[j] must contain a single element: * the padding element. * @param numSparse The number of sparse features to be parsed from the example. This - * must match the lengths of `sparse_keys` and `sparse_types`. - * @param sparseKeys A list of `num_sparse` strings. + * must match the lengths of {@code sparse_keys} and {@code sparse_types}. + * @param sparseKeys A list of {@code num_sparse} strings. * The keys expected in the Examples' features associated with sparse values. * @param denseKeys The keys expected in the Examples' features associated with dense * values. - * @param sparseTypes A list of `num_sparse` types; the data types of data in each + * @param sparseTypes 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). * @param denseShapes The shapes of data in each Feature given in dense_keys. - * The length of this list must match the length of `dense_keys`. The + * 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] @@ -75,79 +116,147 @@ public final class ParseSingleExample extends RawOp { * D1 * .... * DN, in the input. * @return a new instance of ParseSingleExample */ - @Endpoint(describeByClass = true) - public static ParseSingleExample create(Scope scope, Operand serialized, Iterable> denseDefaults, Long numSparse, List sparseKeys, List denseKeys, List> sparseTypes, List denseShapes) { - OperationBuilder opBuilder = scope.env().opBuilder("ParseSingleExample", scope.makeOpName("ParseSingleExample")); + @Endpoint( + describeByClass = true + ) + public static ParseSingleExample create(Scope scope, Operand serialized, + Iterable> denseDefaults, Long numSparse, List sparseKeys, + List denseKeys, List> sparseTypes, List denseShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ParseSingleExample"); opBuilder.addInput(serialized.asOutput()); opBuilder.addInputList(Operands.asOutputs(denseDefaults)); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_sparse", numSparse); String[] sparseKeysArray = new String[sparseKeys.size()]; - for (int i = 0; i < sparseKeysArray.length; ++i) { + for (int i = 0 ; i < sparseKeysArray.length ; i++) { sparseKeysArray[i] = sparseKeys.get(i); } opBuilder.setAttr("sparse_keys", sparseKeysArray); String[] denseKeysArray = new String[denseKeys.size()]; - for (int i = 0; i < denseKeysArray.length; ++i) { + for (int i = 0 ; i < denseKeysArray.length ; i++) { denseKeysArray[i] = denseKeys.get(i); } opBuilder.setAttr("dense_keys", denseKeysArray); opBuilder.setAttr("sparse_types", Operands.toDataTypes(sparseTypes)); Shape[] denseShapesArray = new Shape[denseShapes.size()]; - for (int i = 0; i < denseShapesArray.length; ++i) { + for (int i = 0 ; i < denseShapesArray.length ; i++) { denseShapesArray[i] = denseShapes.get(i); } opBuilder.setAttr("dense_shapes", denseShapesArray); return new ParseSingleExample(opBuilder.build()); } - + /** + * Gets sparseIndices. + * + * @return sparseIndices. */ public List> sparseIndices() { return sparseIndices; } - + /** + * Gets sparseValues. + * + * @return sparseValues. */ public List> sparseValues() { return sparseValues; } - + /** + * Gets sparseShapes. + * + * @return sparseShapes. */ public List> sparseShapes() { return sparseShapes; } - + /** + * Gets denseValues. + * + * @return denseValues. */ public List> denseValues() { return denseValues; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ParseSingleExample"; - - private List> sparseIndices; - private List> sparseValues; - private List> sparseShapes; - private List> denseValues; - - @SuppressWarnings("unchecked") - private ParseSingleExample(Operation operation) { - super(operation); - int outputIdx = 0; - int sparseIndicesLength = operation.outputListLength("sparse_indices"); - sparseIndices = Arrays.asList((Output[])operation.outputList(outputIdx, sparseIndicesLength)); - outputIdx += sparseIndicesLength; - int sparseValuesLength = operation.outputListLength("sparse_values"); - sparseValues = Arrays.asList(operation.outputList(outputIdx, sparseValuesLength)); - outputIdx += sparseValuesLength; - int sparseShapesLength = operation.outputListLength("sparse_shapes"); - sparseShapes = Arrays.asList((Output[])operation.outputList(outputIdx, sparseShapesLength)); - outputIdx += sparseShapesLength; - int denseValuesLength = operation.outputListLength("dense_values"); - denseValues = Arrays.asList(operation.outputList(outputIdx, denseValuesLength)); - outputIdx += denseValuesLength; + + @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 b54be0324b9..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,48 +41,68 @@ /** * Transforms a scalar brain.SequenceExample proto (as strings) into typed tensors. */ -@Operator(group = "io") +@OpMetadata( + opType = ParseSingleSequenceExample.OP_NAME, + inputsClass = ParseSingleSequenceExample.Inputs.class +) +@Operator( + group = "io" +) public final class ParseSingleSequenceExample extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.io.ParseSingleSequenceExample} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param contextDenseShapes 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 Options contextDenseShapes(List contextDenseShapes) { - this.contextDenseShapes = contextDenseShapes; - return this; - } - - /** - * @param featureListDenseShapes 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 Options featureListDenseShapes(List featureListDenseShapes) { - this.featureListDenseShapes = featureListDenseShapes; - return this; - } - - private List contextDenseShapes; - private List featureListDenseShapes; - - private Options() { - } + public static final String OP_NAME = "ParseSingleSequenceExample"; + + private List> contextSparseIndices; + + private List> contextSparseValues; + + private List> contextSparseShapes; + + private List> contextDenseValues; + + private List> featureListSparseIndices; + + private List> featureListSparseValues; + + private List> featureListSparseShapes; + + private List> featureListDenseValues; + + @SuppressWarnings("unchecked") + 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)); + outputIdx += contextSparseIndicesLength; + int contextSparseValuesLength = operation.outputListLength("context_sparse_values"); + contextSparseValues = Arrays.asList(operation.outputList(outputIdx, contextSparseValuesLength)); + outputIdx += contextSparseValuesLength; + int contextSparseShapesLength = operation.outputListLength("context_sparse_shapes"); + contextSparseShapes = Arrays.asList((Output[]) operation.outputList(outputIdx, contextSparseShapesLength)); + outputIdx += contextSparseShapesLength; + int contextDenseValuesLength = operation.outputListLength("context_dense_values"); + contextDenseValues = Arrays.asList(operation.outputList(outputIdx, contextDenseValuesLength)); + outputIdx += contextDenseValuesLength; + int featureListSparseIndicesLength = operation.outputListLength("feature_list_sparse_indices"); + featureListSparseIndices = Arrays.asList((Output[]) operation.outputList(outputIdx, featureListSparseIndicesLength)); + outputIdx += featureListSparseIndicesLength; + int featureListSparseValuesLength = operation.outputListLength("feature_list_sparse_values"); + featureListSparseValues = Arrays.asList(operation.outputList(outputIdx, featureListSparseValuesLength)); + outputIdx += featureListSparseValuesLength; + int featureListSparseShapesLength = operation.outputListLength("feature_list_sparse_shapes"); + featureListSparseShapes = Arrays.asList((Output[]) operation.outputList(outputIdx, featureListSparseShapesLength)); + outputIdx += featureListSparseShapesLength; + int featureListDenseValuesLength = operation.outputListLength("feature_list_dense_values"); + featureListDenseValues = Arrays.asList(operation.outputList(outputIdx, featureListDenseValuesLength)); + outputIdx += featureListDenseValuesLength; } - + /** * Factory method to create a class wrapping a new ParseSingleSequenceExample operation. - * + * * @param scope current scope * @param serialized A scalar containing a binary serialized SequenceExample proto. * @param featureListDenseMissingAssumedEmpty A vector listing the @@ -113,17 +138,26 @@ private Options() { * each context Feature given in context_sparse_keys. * Currently the ParseSingleSequenceExample supports DT_FLOAT (FloatList), * DT_INT64 (Int64List), and DT_STRING (BytesList). - * @param featureListDenseTypes + * @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), * DT_INT64 (Int64List), and DT_STRING (BytesList). - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ParseSingleSequenceExample */ - @Endpoint(describeByClass = true) - public static ParseSingleSequenceExample create(Scope scope, Operand serialized, Operand featureListDenseMissingAssumedEmpty, Iterable> contextSparseKeys, Iterable> contextDenseKeys, Iterable> featureListSparseKeys, Iterable> featureListDenseKeys, Iterable> contextDenseDefaults, Operand debugName, List> contextSparseTypes, List> featureListDenseTypes, List> featureListSparseTypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ParseSingleSequenceExample", scope.makeOpName("ParseSingleSequenceExample")); + @Endpoint( + describeByClass = true + ) + public static ParseSingleSequenceExample create(Scope scope, Operand serialized, + Operand featureListDenseMissingAssumedEmpty, + Iterable> contextSparseKeys, Iterable> contextDenseKeys, + Iterable> featureListSparseKeys, + Iterable> featureListDenseKeys, Iterable> contextDenseDefaults, + Operand debugName, List> contextSparseTypes, + List> featureListDenseTypes, + List> featureListSparseTypes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ParseSingleSequenceExample"); opBuilder.addInput(serialized.asOutput()); opBuilder.addInput(featureListDenseMissingAssumedEmpty.asOutput()); opBuilder.addInputList(Operands.asOutputs(contextSparseKeys)); @@ -132,22 +166,33 @@ public static ParseSingleSequenceExample create(Scope scope, Operand se opBuilder.addInputList(Operands.asOutputs(featureListDenseKeys)); opBuilder.addInputList(Operands.asOutputs(contextDenseDefaults)); opBuilder.addInput(debugName.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("context_sparse_types", Operands.toDataTypes(contextSparseTypes)); opBuilder.setAttr("feature_list_dense_types", Operands.toDataTypes(featureListDenseTypes)); opBuilder.setAttr("feature_list_sparse_types", Operands.toDataTypes(featureListSparseTypes)); if (options != null) { for (Options opts : options) { + if (opts.NcontextSparse != null) { + opBuilder.setAttr("Ncontext_sparse", opts.NcontextSparse); + } + if (opts.NcontextDense != null) { + opBuilder.setAttr("Ncontext_dense", opts.NcontextDense); + } + if (opts.NfeatureListSparse != null) { + opBuilder.setAttr("Nfeature_list_sparse", opts.NfeatureListSparse); + } + if (opts.NfeatureListDense != null) { + opBuilder.setAttr("Nfeature_list_dense", opts.NfeatureListDense); + } if (opts.contextDenseShapes != null) { Shape[] contextDenseShapesArray = new Shape[opts.contextDenseShapes.size()]; - for (int i = 0; i < contextDenseShapesArray.length; ++i) { + for (int i = 0 ; i < contextDenseShapesArray.length ; i++) { contextDenseShapesArray[i] = opts.contextDenseShapes.get(i); } opBuilder.setAttr("context_dense_shapes", contextDenseShapesArray); } if (opts.featureListDenseShapes != null) { Shape[] featureListDenseShapesArray = new Shape[opts.featureListDenseShapes.size()]; - for (int i = 0; i < featureListDenseShapesArray.length; ++i) { + for (int i = 0 ; i < featureListDenseShapesArray.length ; i++) { featureListDenseShapesArray[i] = opts.featureListDenseShapes.get(i); } opBuilder.setAttr("feature_list_dense_shapes", featureListDenseShapesArray); @@ -156,116 +201,436 @@ public static ParseSingleSequenceExample create(Scope scope, Operand se } return new ParseSingleSequenceExample(opBuilder.build()); } - + + /** + * Sets the NcontextSparse option. + * + * @param NcontextSparse the NcontextSparse option + * @return this Options instance. + */ + public static Options NcontextSparse(Long NcontextSparse) { + return new Options().NcontextSparse(NcontextSparse); + } + + /** + * Sets the NcontextDense option. + * + * @param NcontextDense the NcontextDense option + * @return this Options instance. + */ + public static Options NcontextDense(Long NcontextDense) { + return new Options().NcontextDense(NcontextDense); + } + /** + * Sets the NfeatureListSparse option. + * + * @param NfeatureListSparse the NfeatureListSparse option + * @return this Options instance. + */ + public static Options NfeatureListSparse(Long NfeatureListSparse) { + return new Options().NfeatureListSparse(NfeatureListSparse); + } + + /** + * Sets the NfeatureListDense option. + * + * @param NfeatureListDense the NfeatureListDense option + * @return this Options instance. + */ + public static Options NfeatureListDense(Long NfeatureListDense) { + return new Options().NfeatureListDense(NfeatureListDense); + } + + /** + * Sets the contextDenseShapes option. + * * @param contextDenseShapes 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]. + * @return this Options instance. */ public static Options contextDenseShapes(List contextDenseShapes) { return new Options().contextDenseShapes(contextDenseShapes); } - + /** + * Sets the contextDenseShapes option. + * + * @param contextDenseShapes 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]. + * @return this Options instance. + */ + public static Options contextDenseShapes(Shape... contextDenseShapes) { + return new Options().contextDenseShapes(contextDenseShapes); + } + + /** + * Sets the featureListDenseShapes option. + * * @param featureListDenseShapes 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(). + * @return this Options instance. */ public static Options featureListDenseShapes(List featureListDenseShapes) { return new Options().featureListDenseShapes(featureListDenseShapes); } - + + /** + * Sets the featureListDenseShapes option. + * + * @param featureListDenseShapes 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(). + * @return this Options instance. + */ + public static Options featureListDenseShapes(Shape... featureListDenseShapes) { + return new Options().featureListDenseShapes(featureListDenseShapes); + } + /** + * Gets contextSparseIndices. + * + * @return contextSparseIndices. */ public List> contextSparseIndices() { return contextSparseIndices; } - + /** + * Gets contextSparseValues. + * + * @return contextSparseValues. */ public List> contextSparseValues() { return contextSparseValues; } - + /** + * Gets contextSparseShapes. + * + * @return contextSparseShapes. */ public List> contextSparseShapes() { return contextSparseShapes; } - + /** + * Gets contextDenseValues. + * + * @return contextDenseValues. */ public List> contextDenseValues() { return contextDenseValues; } - + /** + * Gets featureListSparseIndices. + * + * @return featureListSparseIndices. */ public List> featureListSparseIndices() { return featureListSparseIndices; } - + /** + * Gets featureListSparseValues. + * + * @return featureListSparseValues. */ public List> featureListSparseValues() { return featureListSparseValues; } - + /** + * Gets featureListSparseShapes. + * + * @return featureListSparseShapes. */ public List> featureListSparseShapes() { return featureListSparseShapes; } - + /** + * Gets featureListDenseValues. + * + * @return featureListDenseValues. */ public List> featureListDenseValues() { return featureListDenseValues; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ParseSingleSequenceExample"; - - private List> contextSparseIndices; - private List> contextSparseValues; - private List> contextSparseShapes; - private List> contextDenseValues; - private List> featureListSparseIndices; - private List> featureListSparseValues; - private List> featureListSparseShapes; - private List> featureListDenseValues; - - @SuppressWarnings("unchecked") - private ParseSingleSequenceExample(Operation operation) { - super(operation); - int outputIdx = 0; - int contextSparseIndicesLength = operation.outputListLength("context_sparse_indices"); - contextSparseIndices = Arrays.asList((Output[])operation.outputList(outputIdx, contextSparseIndicesLength)); - outputIdx += contextSparseIndicesLength; - int contextSparseValuesLength = operation.outputListLength("context_sparse_values"); - contextSparseValues = Arrays.asList(operation.outputList(outputIdx, contextSparseValuesLength)); - outputIdx += contextSparseValuesLength; - int contextSparseShapesLength = operation.outputListLength("context_sparse_shapes"); - contextSparseShapes = Arrays.asList((Output[])operation.outputList(outputIdx, contextSparseShapesLength)); - outputIdx += contextSparseShapesLength; - int contextDenseValuesLength = operation.outputListLength("context_dense_values"); - contextDenseValues = Arrays.asList(operation.outputList(outputIdx, contextDenseValuesLength)); - outputIdx += contextDenseValuesLength; - int featureListSparseIndicesLength = operation.outputListLength("feature_list_sparse_indices"); - featureListSparseIndices = Arrays.asList((Output[])operation.outputList(outputIdx, featureListSparseIndicesLength)); - outputIdx += featureListSparseIndicesLength; - int featureListSparseValuesLength = operation.outputListLength("feature_list_sparse_values"); - featureListSparseValues = Arrays.asList(operation.outputList(outputIdx, featureListSparseValuesLength)); - outputIdx += featureListSparseValuesLength; - int featureListSparseShapesLength = operation.outputListLength("feature_list_sparse_shapes"); - featureListSparseShapes = Arrays.asList((Output[])operation.outputList(outputIdx, featureListSparseShapesLength)); - outputIdx += featureListSparseShapesLength; - int featureListDenseValuesLength = operation.outputListLength("feature_list_dense_values"); - featureListDenseValues = Arrays.asList(operation.outputList(outputIdx, featureListDenseValuesLength)); - outputIdx += featureListDenseValuesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.io.ParseSingleSequenceExample} + */ + public static class Options { + private Long NcontextSparse; + + private Long NcontextDense; + + private Long NfeatureListSparse; + + private Long NfeatureListDense; + + private List contextDenseShapes; + + private List featureListDenseShapes; + + private Options() { + } + + /** + * Sets the NcontextSparse option. + * + * @param NcontextSparse the NcontextSparse option + * @return this Options instance. + */ + public Options NcontextSparse(Long NcontextSparse) { + this.NcontextSparse = NcontextSparse; + return this; + } + + /** + * Sets the NcontextDense option. + * + * @param NcontextDense the NcontextDense option + * @return this Options instance. + */ + public Options NcontextDense(Long NcontextDense) { + this.NcontextDense = NcontextDense; + return this; + } + + /** + * Sets the NfeatureListSparse option. + * + * @param NfeatureListSparse the NfeatureListSparse option + * @return this Options instance. + */ + public Options NfeatureListSparse(Long NfeatureListSparse) { + this.NfeatureListSparse = NfeatureListSparse; + return this; + } + + /** + * Sets the NfeatureListDense option. + * + * @param NfeatureListDense the NfeatureListDense option + * @return this Options instance. + */ + public Options NfeatureListDense(Long NfeatureListDense) { + this.NfeatureListDense = NfeatureListDense; + return this; + } + + /** + * Sets the contextDenseShapes option. + * + * @param contextDenseShapes 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]. + * @return this Options instance. + */ + public Options contextDenseShapes(List contextDenseShapes) { + this.contextDenseShapes = contextDenseShapes; + return this; + } + + /** + * Sets the contextDenseShapes option. + * + * @param contextDenseShapes 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]. + * @return this Options instance. + */ + public Options contextDenseShapes(Shape... contextDenseShapes) { + this.contextDenseShapes = Arrays.asList(contextDenseShapes); + return this; + } + + /** + * Sets the featureListDenseShapes option. + * + * @param featureListDenseShapes 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(). + * @return this Options instance. + */ + public Options featureListDenseShapes(List featureListDenseShapes) { + this.featureListDenseShapes = featureListDenseShapes; + return this; + } + + /** + * Sets the featureListDenseShapes option. + * + * @param featureListDenseShapes 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(). + * @return this Options instance. + */ + public Options featureListDenseShapes(Shape... featureListDenseShapes) { + this.featureListDenseShapes = Arrays.asList(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 9af89bdcd2d..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,64 +17,103 @@ 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 */ -@Operator(group = "io") +@OpMetadata( + opType = ParseTensor.OP_NAME, + inputsClass = ParseTensor.Inputs.class +) +@Operator( + group = "io" +) public final class ParseTensor extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ParseTensor"; + + private Output output; + + public ParseTensor(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ParseTensor operation. - * + * * @param scope current scope * @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. + * @param data type for {@code ParseTensor} output and operands * @return a new instance of ParseTensor */ - @Endpoint(describeByClass = true) - public static ParseTensor create(Scope scope, Operand serialized, Class outType) { - OperationBuilder opBuilder = scope.env().opBuilder("ParseTensor", scope.makeOpName("ParseTensor")); + @Endpoint( + describeByClass = true + ) + public static ParseTensor create(Scope scope, Operand serialized, + Class outType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ParseTensor"); opBuilder.addInput(serialized.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new ParseTensor(opBuilder.build()); + return new ParseTensor<>(opBuilder.build()); } - + /** - * A Tensor of type `out_type`. + * Gets output. + * A Tensor of type {@code out_type}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ParseTensor"; - - private Output output; - - private ParseTensor(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 9decf07b572..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,82 +27,66 @@ 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 sorted by the first component value. - *

* Note that the PriorityQueue requires the first component of any element * to be a scalar int64, in addition to the other elements declared by * component_types. Therefore calls to Enqueue and EnqueueMany (resp. Dequeue * and DequeueMany) on a PriorityQueue will all require (resp. output) one extra * entry in their input (resp. output) lists. */ -@Operator(group = "io") +@OpMetadata( + opType = PriorityQueue.OP_NAME, + inputsClass = PriorityQueue.Inputs.class +) +@Operator( + group = "io" +) public final class PriorityQueue extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.PriorityQueue} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity The upper bound on the number of elements in this queue. - * Negative numbers mean no limit. - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param container If non-empty, this queue is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this queue will be shared under the given name - * across multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "PriorityQueueV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + public PriorityQueue(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new PriorityQueue operation. - * + * Factory method to create a class wrapping a new PriorityQueueV2 operation. + * * @param scope current scope * @param componentTypes The type of each component in a value. * @param shapes 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. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of PriorityQueue */ - @Endpoint(describeByClass = true) - public static PriorityQueue create(Scope scope, List> componentTypes, List shapes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("PriorityQueueV2", scope.makeOpName("PriorityQueue")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static PriorityQueue create(Scope scope, List> componentTypes, + List shapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "PriorityQueue"); opBuilder.setAttr("component_types", Operands.toDataTypes(componentTypes)); Shape[] shapesArray = new Shape[shapes.size()]; - for (int i = 0; i < shapesArray.length; ++i) { + for (int i = 0 ; i < shapesArray.length ; i++) { shapesArray[i] = shapes.get(i); } opBuilder.setAttr("shapes", shapesArray); @@ -119,52 +105,148 @@ public static PriorityQueue create(Scope scope, List> com } return new PriorityQueue(opBuilder.build()); } - + /** + * Sets the capacity option. + * * @param capacity The upper bound on the number of elements in this queue. * Negative numbers mean no limit. + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** + * Sets the container option. + * * @param container If non-empty, this queue is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this queue will be shared under the given name * across multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets handle. * The handle to the queue. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "PriorityQueueV2"; - - private Output handle; - - private PriorityQueue(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.PriorityQueue} + */ + public static class Options { + private Long capacity; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity The upper bound on the number of elements in this queue. + * Negative numbers mean no limit. + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the container option. + * + * @param container If non-empty, this queue is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this queue will be shared under the given name + * across multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = 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 a21003d455e..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,59 +17,60 @@ 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; /** * Closes the given queue. - *

* This operation signals that no more elements will be enqueued in the * given queue. Subsequent Enqueue(Many) operations will fail. * Subsequent Dequeue(Many) operations will continue to succeed if * sufficient elements remain in the queue. Subsequent Dequeue(Many) * operations that would block will fail immediately. */ -@Operator(group = "io") +@OpMetadata( + opType = QueueClose.OP_NAME, + inputsClass = QueueClose.Inputs.class +) +@Operator( + group = "io" +) public final class QueueClose extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.io.QueueClose} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param cancelPendingEnqueues If true, all pending enqueue requests that are - * blocked on the given queue will be canceled. - */ - public Options cancelPendingEnqueues(Boolean cancelPendingEnqueues) { - this.cancelPendingEnqueues = cancelPendingEnqueues; - return this; - } - - private Boolean cancelPendingEnqueues; - - private Options() { - } + public static final String OP_NAME = "QueueCloseV2"; + + public QueueClose(Operation operation) { + super(operation, OP_NAME); } - + /** - * Factory method to create a class wrapping a new QueueClose operation. - * + * Factory method to create a class wrapping a new QueueCloseV2 operation. + * * @param scope current scope * @param handle The handle to a queue. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of QueueClose */ - @Endpoint(describeByClass = true) - public static QueueClose create(Scope scope, Operand handle, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QueueCloseV2", scope.makeOpName("QueueClose")); + @Endpoint( + describeByClass = true + ) + public static QueueClose create(Scope scope, Operand handle, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QueueClose"); opBuilder.addInput(handle.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.cancelPendingEnqueues != null) { @@ -79,19 +80,60 @@ public static QueueClose create(Scope scope, Operand handle, Options... optio } return new QueueClose(opBuilder.build()); } - + /** + * Sets the cancelPendingEnqueues option. + * * @param cancelPendingEnqueues If true, all pending enqueue requests that are * blocked on the given queue will be canceled. + * @return this Options instance. */ public static Options cancelPendingEnqueues(Boolean cancelPendingEnqueues) { return new Options().cancelPendingEnqueues(cancelPendingEnqueues); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QueueCloseV2"; - - private QueueClose(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.io.QueueClose} + */ + public static class Options { + private Boolean cancelPendingEnqueues; + + private Options() { + } + + /** + * Sets the cancelPendingEnqueues option. + * + * @param cancelPendingEnqueues If true, all pending enqueue requests that are + * blocked on the given queue will be canceled. + * @return this Options instance. + */ + public Options cancelPendingEnqueues(Boolean cancelPendingEnqueues) { + this.cancelPendingEnqueues = 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 b4d4bb71aaf..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,65 +20,70 @@ 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; /** * Dequeues a tuple of one or more tensors from the given queue. - *

* This operation has k outputs, where k is the number of components * in the tuples stored in the given queue, and output i is the ith * component of the dequeued tuple. - *

- * N.B. If the queue is empty, this operation will block until an element + *

N.B. If the queue is empty, this operation will block until an element * has been dequeued (or 'timeout_ms' elapses, if specified). */ -@Operator(group = "io") +@OpMetadata( + opType = QueueDequeue.OP_NAME, + inputsClass = QueueDequeue.Inputs.class +) +@Operator( + group = "io" +) public final class QueueDequeue extends RawOp implements Iterable> { - /** - * Optional attributes for {@link org.tensorflow.op.io.QueueDequeue} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param timeoutMs If the queue is empty, this operation will block for up to - * timeout_ms milliseconds. - * Note: This option is not supported yet. - */ - public Options timeoutMs(Long timeoutMs) { - this.timeoutMs = timeoutMs; - return this; - } - - private Long timeoutMs; - - private Options() { - } + public static final String OP_NAME = "QueueDequeueV2"; + + private List> components; + + @SuppressWarnings("unchecked") + public QueueDequeue(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 QueueDequeue operation. - * + * Factory method to create a class wrapping a new QueueDequeueV2 operation. + * * @param scope current scope * @param handle The handle to a queue. * @param componentTypes The type of each component in a tuple. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of QueueDequeue */ - @Endpoint(describeByClass = true) - public static QueueDequeue create(Scope scope, Operand handle, List> componentTypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QueueDequeueV2", scope.makeOpName("QueueDequeue")); + @Endpoint( + describeByClass = true + ) + public static QueueDequeue create(Scope scope, Operand handle, + List> componentTypes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QueueDequeue"); opBuilder.addInput(handle.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("component_types", Operands.toDataTypes(componentTypes)); if (options != null) { for (Options opts : options) { @@ -89,39 +94,84 @@ public static QueueDequeue create(Scope scope, Operand handle, List> components() { return components; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) components.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QueueDequeueV2"; - - private List> components; - - private QueueDequeue(Operation operation) { - super(operation); - int outputIdx = 0; - int componentsLength = operation.outputListLength("components"); - components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); - outputIdx += componentsLength; + + /** + * Optional attributes for {@link org.tensorflow.op.io.QueueDequeue} + */ + public static class Options { + private Long timeoutMs; + + private Options() { + } + + /** + * Sets the timeoutMs option. + * + * @param timeoutMs If the queue is empty, this operation will block for up to + * timeout_ms milliseconds. + * Note: This option is not supported yet. + * @return this Options instance. + */ + public Options timeoutMs(Long timeoutMs) { + this.timeoutMs = 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 1ef3426f354..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,75 +20,78 @@ 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; /** - * Dequeues `n` tuples of one or more tensors from the given queue. - *

- * If the queue is closed and there are fewer than `n` elements, then an + * Dequeues {@code n} tuples of one or more tensors from the given queue. + * If the queue is closed and there are fewer than {@code n} elements, then an * OutOfRange error is returned. - *

- * This operation concatenates queue-element component tensors along the + *

This operation concatenates queue-element component tensors along the * 0th dimension to make a single component tensor. All of the components - * in the dequeued tuple will have size `n` in the 0th dimension. - *

- * This operation has `k` outputs, where `k` is the number of components in - * the tuples stored in the given queue, and output `i` is the ith + * in the dequeued tuple will have size {@code n} in the 0th dimension. + *

This operation has {@code k} outputs, where {@code k} is the number of components in + * the tuples stored in the given queue, and output {@code i} is the ith * component of the dequeued tuple. - *

- * N.B. If the queue is empty, this operation will block until `n` elements + *

N.B. If the queue is empty, this operation will block until {@code n} elements * have been dequeued (or 'timeout_ms' elapses, if specified). */ -@Operator(group = "io") +@OpMetadata( + opType = QueueDequeueMany.OP_NAME, + inputsClass = QueueDequeueMany.Inputs.class +) +@Operator( + group = "io" +) public final class QueueDequeueMany extends RawOp implements Iterable> { - /** - * Optional attributes for {@link org.tensorflow.op.io.QueueDequeueMany} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param timeoutMs 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 Options timeoutMs(Long timeoutMs) { - this.timeoutMs = timeoutMs; - return this; - } - - private Long timeoutMs; - - private Options() { - } + public static final String OP_NAME = "QueueDequeueManyV2"; + + private List> components; + + @SuppressWarnings("unchecked") + public QueueDequeueMany(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 QueueDequeueMany operation. - * + * Factory method to create a class wrapping a new QueueDequeueManyV2 operation. + * * @param scope current scope * @param handle The handle to a queue. * @param n The number of tuples to dequeue. * @param componentTypes The type of each component in a tuple. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of QueueDequeueMany */ - @Endpoint(describeByClass = true) - public static QueueDequeueMany create(Scope scope, Operand handle, Operand n, List> componentTypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QueueDequeueManyV2", scope.makeOpName("QueueDequeueMany")); + @Endpoint( + describeByClass = true + ) + public static QueueDequeueMany create(Scope scope, Operand handle, + Operand n, List> componentTypes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QueueDequeueMany"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(n.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("component_types", Operands.toDataTypes(componentTypes)); if (options != null) { for (Options opts : options) { @@ -99,39 +102,90 @@ public static QueueDequeueMany create(Scope scope, Operand handle, Operand> components() { return components; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) components.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QueueDequeueManyV2"; - - private List> components; - - private QueueDequeueMany(Operation operation) { - super(operation); - int outputIdx = 0; - int componentsLength = operation.outputListLength("components"); - components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); - outputIdx += componentsLength; + + /** + * Optional attributes for {@link org.tensorflow.op.io.QueueDequeueMany} + */ + public static class Options { + private Long timeoutMs; + + private Options() { + } + + /** + * Sets the timeoutMs option. + * + * @param timeoutMs 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. + * @return this Options instance. + */ + public Options timeoutMs(Long timeoutMs) { + this.timeoutMs = 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 53516d87ed5..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,79 +20,82 @@ 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; /** - * Dequeues `n` tuples of one or more tensors from the given queue. - *

+ * Dequeues {@code n} tuples of one or more tensors from the given queue. * This operation is not supported by all queues. If a queue does not support * DequeueUpTo, then an Unimplemented error is returned. - *

- * If the queue is closed and there are more than 0 but less than `n` + *

If the queue is closed and there are more than 0 but less than {@code n} * elements remaining, then instead of returning an OutOfRange error like - * QueueDequeueMany, less than `n` elements are returned immediately. If + * QueueDequeueMany, less than {@code n} elements are returned immediately. If * the queue is closed and there are 0 elements left in the queue, then * an OutOfRange error is returned just like in QueueDequeueMany. * Otherwise the behavior is identical to QueueDequeueMany: - *

- * This operation concatenates queue-element component tensors along the + *

This operation concatenates queue-element component tensors along the * 0th dimension to make a single component tensor. All of the components * in the dequeued tuple will have size n in the 0th dimension. - *

- * This operation has `k` outputs, where `k` is the number of components in - * the tuples stored in the given queue, and output `i` is the ith + *

This operation has {@code k} outputs, where {@code k} is the number of components in + * the tuples stored in the given queue, and output {@code i} is the ith * component of the dequeued tuple. */ -@Operator(group = "io") +@OpMetadata( + opType = QueueDequeueUpTo.OP_NAME, + inputsClass = QueueDequeueUpTo.Inputs.class +) +@Operator( + group = "io" +) public final class QueueDequeueUpTo extends RawOp implements Iterable> { - /** - * Optional attributes for {@link org.tensorflow.op.io.QueueDequeueUpTo} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param timeoutMs 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 Options timeoutMs(Long timeoutMs) { - this.timeoutMs = timeoutMs; - return this; - } - - private Long timeoutMs; - - private Options() { - } + public static final String OP_NAME = "QueueDequeueUpToV2"; + + private List> components; + + @SuppressWarnings("unchecked") + public QueueDequeueUpTo(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 QueueDequeueUpTo operation. - * + * Factory method to create a class wrapping a new QueueDequeueUpToV2 operation. + * * @param scope current scope * @param handle The handle to a queue. * @param n The number of tuples to dequeue. * @param componentTypes The type of each component in a tuple. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of QueueDequeueUpTo */ - @Endpoint(describeByClass = true) - public static QueueDequeueUpTo create(Scope scope, Operand handle, Operand n, List> componentTypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QueueDequeueUpToV2", scope.makeOpName("QueueDequeueUpTo")); + @Endpoint( + describeByClass = true + ) + public static QueueDequeueUpTo create(Scope scope, Operand handle, + Operand n, List> componentTypes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QueueDequeueUpTo"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(n.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("component_types", Operands.toDataTypes(componentTypes)); if (options != null) { for (Options opts : options) { @@ -103,39 +106,90 @@ public static QueueDequeueUpTo create(Scope scope, Operand handle, Operand> components() { return components; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) components.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QueueDequeueUpToV2"; - - private List> components; - - private QueueDequeueUpTo(Operation operation) { - super(operation); - int outputIdx = 0; - int componentsLength = operation.outputListLength("components"); - components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); - outputIdx += componentsLength; + + /** + * Optional attributes for {@link org.tensorflow.op.io.QueueDequeueUpTo} + */ + public static class Options { + private Long timeoutMs; + + private Options() { + } + + /** + * Sets the timeoutMs option. + * + * @param timeoutMs 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. + * @return this Options instance. + */ + public Options timeoutMs(Long timeoutMs) { + this.timeoutMs = 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 8a8648d69fe..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,63 +17,63 @@ 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; /** * Enqueues a tuple of one or more tensors in the given queue. - *

* The components input has k elements, which correspond to the components of * tuples stored in the given queue. - *

- * N.B. If the queue is full, this operation will block until the given + *

N.B. If the queue is full, this operation will block until the given * element has been enqueued (or 'timeout_ms' elapses, if specified). */ -@Operator(group = "io") +@OpMetadata( + opType = QueueEnqueue.OP_NAME, + inputsClass = QueueEnqueue.Inputs.class +) +@Operator( + group = "io" +) public final class QueueEnqueue extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.io.QueueEnqueue} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param timeoutMs If the queue is full, this operation will block for up to - * timeout_ms milliseconds. - * Note: This option is not supported yet. - */ - public Options timeoutMs(Long timeoutMs) { - this.timeoutMs = timeoutMs; - return this; - } - - private Long timeoutMs; - - private Options() { - } + public static final String OP_NAME = "QueueEnqueueV2"; + + public QueueEnqueue(Operation operation) { + super(operation, OP_NAME); } - + /** - * Factory method to create a class wrapping a new QueueEnqueue operation. - * + * Factory method to create a class wrapping a new QueueEnqueueV2 operation. + * * @param scope current scope * @param handle The handle to a queue. * @param components One or more tensors from which the enqueued tensors should be taken. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of QueueEnqueue */ - @Endpoint(describeByClass = true) - public static QueueEnqueue create(Scope scope, Operand handle, Iterable> components, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QueueEnqueueV2", scope.makeOpName("QueueEnqueue")); + @Endpoint( + describeByClass = true + ) + public static QueueEnqueue create(Scope scope, Operand handle, + Iterable> components, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QueueEnqueue"); opBuilder.addInput(handle.asOutput()); opBuilder.addInputList(Operands.asOutputs(components)); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.timeoutMs != null) { @@ -83,20 +83,77 @@ public static QueueEnqueue create(Scope scope, Operand handle, Iterable { + /** + * 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 eed2c112326..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,68 +17,67 @@ 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; /** * Enqueues zero or more tuples of one or more tensors in the given queue. - *

* This operation slices each component tensor along the 0th dimension to * make multiple queue elements. All of the tuple components must have the * same size in the 0th dimension. - *

- * The components input has k elements, which correspond to the components of + *

The components input has k elements, which correspond to the components of * tuples stored in the given queue. - *

- * N.B. If the queue is full, this operation will block until the given + *

N.B. If the queue is full, this operation will block until the given * elements have been enqueued (or 'timeout_ms' elapses, if specified). */ -@Operator(group = "io") +@OpMetadata( + opType = QueueEnqueueMany.OP_NAME, + inputsClass = QueueEnqueueMany.Inputs.class +) +@Operator( + group = "io" +) public final class QueueEnqueueMany extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.io.QueueEnqueueMany} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param timeoutMs If the queue is too full, this operation will block for up - * to timeout_ms milliseconds. - * Note: This option is not supported yet. - */ - public Options timeoutMs(Long timeoutMs) { - this.timeoutMs = timeoutMs; - return this; - } - - private Long timeoutMs; - - private Options() { - } + public static final String OP_NAME = "QueueEnqueueManyV2"; + + public QueueEnqueueMany(Operation operation) { + super(operation, OP_NAME); } - + /** - * Factory method to create a class wrapping a new QueueEnqueueMany operation. - * + * Factory method to create a class wrapping a new QueueEnqueueManyV2 operation. + * * @param scope current scope * @param handle The handle to a queue. * @param components One or more tensors from which the enqueued tensors should * be taken. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of QueueEnqueueMany */ - @Endpoint(describeByClass = true) - public static QueueEnqueueMany create(Scope scope, Operand handle, Iterable> components, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QueueEnqueueManyV2", scope.makeOpName("QueueEnqueueMany")); + @Endpoint( + describeByClass = true + ) + public static QueueEnqueueMany create(Scope scope, Operand handle, + Iterable> components, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QueueEnqueueMany"); opBuilder.addInput(handle.asOutput()); opBuilder.addInputList(Operands.asOutputs(components)); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.timeoutMs != null) { @@ -88,20 +87,78 @@ public static QueueEnqueueMany create(Scope scope, Operand handle, Iterable { + /** + * 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 f8e2d27bd26..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,59 +17,91 @@ 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; /** * Returns true if queue is closed. - *

* This operation returns true if the queue is closed and false if the queue * is open. */ -@Operator(group = "io") +@OpMetadata( + opType = QueueIsClosed.OP_NAME, + inputsClass = QueueIsClosed.Inputs.class +) +@Operator( + group = "io" +) public final class QueueIsClosed extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new QueueIsClosed operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QueueIsClosedV2"; + + private Output isClosed; + + public QueueIsClosed(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + isClosed = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new QueueIsClosedV2 operation. + * * @param scope current scope * @param handle The handle to a queue. * @return a new instance of QueueIsClosed */ - @Endpoint(describeByClass = true) - public static QueueIsClosed create(Scope scope, Operand handle) { - OperationBuilder opBuilder = scope.env().opBuilder("QueueIsClosedV2", scope.makeOpName("QueueIsClosed")); + @Endpoint( + describeByClass = true + ) + public static QueueIsClosed create(Scope scope, Operand handle) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QueueIsClosed"); opBuilder.addInput(handle.asOutput()); - opBuilder = scope.apply(opBuilder); return new QueueIsClosed(opBuilder.build()); } - + /** + * Gets isClosed. + * + * @return isClosed. */ public Output isClosed() { return isClosed; } - + @Override public Output asOutput() { return isClosed; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QueueIsClosedV2"; - - private Output isClosed; - - private QueueIsClosed(Operation operation) { - super(operation); - int outputIdx = 0; - isClosed = operation.output(outputIdx++); + + @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 99982e6acf7..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,57 +17,89 @@ 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; /** * Computes the number of elements in the given queue. */ -@Operator(group = "io") +@OpMetadata( + opType = QueueSize.OP_NAME, + inputsClass = QueueSize.Inputs.class +) +@Operator( + group = "io" +) public final class QueueSize extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new QueueSize operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QueueSizeV2"; + + private Output output; + + public QueueSize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new QueueSizeV2 operation. + * * @param scope current scope * @param handle The handle to a queue. * @return a new instance of QueueSize */ - @Endpoint(describeByClass = true) - public static QueueSize create(Scope scope, Operand handle) { - OperationBuilder opBuilder = scope.env().opBuilder("QueueSizeV2", scope.makeOpName("QueueSize")); + @Endpoint( + describeByClass = true + ) + public static QueueSize create(Scope scope, Operand handle) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QueueSize"); opBuilder.addInput(handle.asOutput()); - opBuilder = scope.apply(opBuilder); return new QueueSize(opBuilder.build()); } - + /** + * Gets output. * The number of elements in the given queue. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QueueSizeV2"; - - private Output output; - - private QueueSize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 9ce330cb960..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. @@ -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,117 +27,60 @@ 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. */ -@Operator(group = "io") +@OpMetadata( + opType = RandomShuffleQueue.OP_NAME, + inputsClass = RandomShuffleQueue.Inputs.class +) +@Operator( + group = "io" +) public final class RandomShuffleQueue extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.RandomShuffleQueue} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param shapes 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 Options shapes(List shapes) { - this.shapes = shapes; - return this; - } - - /** - * @param capacity The upper bound on the number of elements in this queue. - * Negative numbers mean no limit. - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param minAfterDequeue 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 Options minAfterDequeue(Long minAfterDequeue) { - this.minAfterDequeue = minAfterDequeue; - return this; - } - - /** - * @param seed 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 Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 A second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - /** - * @param container If non-empty, this queue is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this queue will be shared under the given name - * across multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private List shapes; - private Long capacity; - private Long minAfterDequeue; - private Long seed; - private Long seed2; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "RandomShuffleQueueV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + public RandomShuffleQueue(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new RandomShuffleQueue operation. - * + * Factory method to create a class wrapping a new RandomShuffleQueueV2 operation. + * * @param scope current scope * @param componentTypes The type of each component in a value. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of RandomShuffleQueue */ - @Endpoint(describeByClass = true) - public static RandomShuffleQueue create(Scope scope, List> componentTypes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RandomShuffleQueueV2", scope.makeOpName("RandomShuffleQueue")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static RandomShuffleQueue create(Scope scope, List> componentTypes, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RandomShuffleQueue"); opBuilder.setAttr("component_types", Operands.toDataTypes(componentTypes)); if (options != null) { for (Options opts : options) { if (opts.shapes != null) { Shape[] shapesArray = new Shape[opts.shapes.size()]; - for (int i = 0; i < shapesArray.length; ++i) { + for (int i = 0 ; i < shapesArray.length ; i++) { shapesArray[i] = opts.shapes.get(i); } opBuilder.setAttr("shapes", shapesArray); @@ -162,86 +107,300 @@ public static RandomShuffleQueue create(Scope scope, List } return new RandomShuffleQueue(opBuilder.build()); } - + /** + * Sets the shapes option. + * * @param shapes 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. + * @return this Options instance. */ public static Options shapes(List shapes) { return new Options().shapes(shapes); } - + /** + * Sets the shapes option. + * + * @param shapes 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. + * @return this Options instance. + */ + public static Options shapes(Shape... shapes) { + return new Options().shapes(shapes); + } + + /** + * Sets the capacity option. + * * @param capacity The upper bound on the number of elements in this queue. * Negative numbers mean no limit. + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** + * Sets the minAfterDequeue option. + * * @param minAfterDequeue 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. + * @return this Options instance. */ public static Options minAfterDequeue(Long minAfterDequeue) { return new Options().minAfterDequeue(minAfterDequeue); } - + /** + * Sets the seed option. + * * @param seed 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. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** + * Sets the container option. + * * @param container If non-empty, this queue is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this queue will be shared under the given name * across multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets handle. * The handle to the queue. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RandomShuffleQueueV2"; - - private Output handle; - - private RandomShuffleQueue(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.RandomShuffleQueue} + */ + public static class Options { + private List shapes; + + private Long capacity; + + private Long minAfterDequeue; + + private Long seed; + + private Long seed2; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the shapes option. + * + * @param shapes 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. + * @return this Options instance. + */ + public Options shapes(List shapes) { + this.shapes = shapes; + return this; + } + + /** + * Sets the shapes option. + * + * @param shapes 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. + * @return this Options instance. + */ + public Options shapes(Shape... shapes) { + this.shapes = Arrays.asList(shapes); + return this; + } + + /** + * Sets the capacity option. + * + * @param capacity The upper bound on the number of elements in this queue. + * Negative numbers mean no limit. + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the minAfterDequeue option. + * + * @param minAfterDequeue 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. + * @return this Options instance. + */ + public Options minAfterDequeue(Long minAfterDequeue) { + this.minAfterDequeue = minAfterDequeue; + return this; + } + + /** + * Sets the seed option. + * + * @param seed 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. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } + + /** + * Sets the container option. + * + * @param container If non-empty, this queue is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this queue will be shared under the given name + * across multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = 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 c908b2e2732..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,56 +17,88 @@ 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. */ -@Operator(group = "io") +@OpMetadata( + opType = ReadFile.OP_NAME, + inputsClass = ReadFile.Inputs.class +) +@Operator( + group = "io" +) public final class ReadFile extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReadFile"; + + private Output contents; + + public ReadFile(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + contents = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ReadFile operation. - * + * * @param scope current scope - * @param filename + * @param filename The filename value * @return a new instance of ReadFile */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ReadFile create(Scope scope, Operand filename) { - OperationBuilder opBuilder = scope.env().opBuilder("ReadFile", scope.makeOpName("ReadFile")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReadFile"); opBuilder.addInput(filename.asOutput()); - opBuilder = scope.apply(opBuilder); return new ReadFile(opBuilder.build()); } - + /** + * Gets contents. + * + * @return contents. */ public Output contents() { return contents; } - + @Override public Output asOutput() { return contents; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReadFile"; - - private Output contents; - - private ReadFile(Operation operation) { - super(operation); - int outputIdx = 0; - contents = operation.output(outputIdx++); + + @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 88821648f1a..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,59 +17,92 @@ 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; /** * Returns the number of records this Reader has produced. - *

* This is the same as the number of ReaderRead executions that have * succeeded. */ -@Operator(group = "io") +@OpMetadata( + opType = ReaderNumRecordsProduced.OP_NAME, + inputsClass = ReaderNumRecordsProduced.Inputs.class +) +@Operator( + group = "io" +) public final class ReaderNumRecordsProduced extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new ReaderNumRecordsProduced operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReaderNumRecordsProducedV2"; + + private Output recordsProduced; + + public ReaderNumRecordsProduced(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + recordsProduced = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ReaderNumRecordsProducedV2 operation. + * * @param scope current scope * @param readerHandle Handle to a Reader. * @return a new instance of ReaderNumRecordsProduced */ - @Endpoint(describeByClass = true) - public static ReaderNumRecordsProduced create(Scope scope, Operand readerHandle) { - OperationBuilder opBuilder = scope.env().opBuilder("ReaderNumRecordsProducedV2", scope.makeOpName("ReaderNumRecordsProduced")); + @Endpoint( + describeByClass = true + ) + public static ReaderNumRecordsProduced create(Scope scope, + Operand readerHandle) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReaderNumRecordsProduced"); opBuilder.addInput(readerHandle.asOutput()); - opBuilder = scope.apply(opBuilder); return new ReaderNumRecordsProduced(opBuilder.build()); } - + /** + * Gets recordsProduced. + * + * @return recordsProduced. */ public Output recordsProduced() { return recordsProduced; } - + @Override public Output asOutput() { return recordsProduced; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReaderNumRecordsProducedV2"; - - private Output recordsProduced; - - private ReaderNumRecordsProduced(Operation operation) { - super(operation); - int outputIdx = 0; - recordsProduced = operation.output(outputIdx++); + + @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 6830d06fac9..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,56 +17,90 @@ 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; /** * Returns the number of work units this Reader has finished processing. */ -@Operator(group = "io") +@OpMetadata( + opType = ReaderNumWorkUnitsCompleted.OP_NAME, + inputsClass = ReaderNumWorkUnitsCompleted.Inputs.class +) +@Operator( + group = "io" +) public final class ReaderNumWorkUnitsCompleted extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new ReaderNumWorkUnitsCompleted operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReaderNumWorkUnitsCompletedV2"; + + private Output unitsCompleted; + + public ReaderNumWorkUnitsCompleted(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + unitsCompleted = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ReaderNumWorkUnitsCompletedV2 operation. + * * @param scope current scope * @param readerHandle Handle to a Reader. * @return a new instance of ReaderNumWorkUnitsCompleted */ - @Endpoint(describeByClass = true) - public static ReaderNumWorkUnitsCompleted create(Scope scope, Operand readerHandle) { - OperationBuilder opBuilder = scope.env().opBuilder("ReaderNumWorkUnitsCompletedV2", scope.makeOpName("ReaderNumWorkUnitsCompleted")); + @Endpoint( + describeByClass = true + ) + public static ReaderNumWorkUnitsCompleted create(Scope scope, + Operand readerHandle) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReaderNumWorkUnitsCompleted"); opBuilder.addInput(readerHandle.asOutput()); - opBuilder = scope.apply(opBuilder); return new ReaderNumWorkUnitsCompleted(opBuilder.build()); } - + /** + * Gets unitsCompleted. + * + * @return unitsCompleted. */ public Output unitsCompleted() { return unitsCompleted; } - + @Override public Output asOutput() { return unitsCompleted; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReaderNumWorkUnitsCompletedV2"; - - private Output unitsCompleted; - - private ReaderNumWorkUnitsCompleted(Operation operation) { - super(operation); - int outputIdx = 0; - unitsCompleted = operation.output(outputIdx++); + + @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 fbb416f3e19..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,67 +17,108 @@ 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; /** * Returns the next record (key, value pair) produced by a Reader. - *

* Will dequeue from the input queue if necessary (e.g. when the * Reader needs to start reading from a new file since it has finished * with the previous file). */ -@Operator(group = "io") +@OpMetadata( + opType = ReaderRead.OP_NAME, + inputsClass = ReaderRead.Inputs.class +) +@Operator( + group = "io" +) public final class ReaderRead extends RawOp { - /** - * Factory method to create a class wrapping a new ReaderRead operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReaderReadV2"; + + private Output key; + + private Output value; + + public ReaderRead(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + key = operation.output(outputIdx++); + value = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ReaderReadV2 operation. + * * @param scope current scope * @param readerHandle Handle to a Reader. * @param queueHandle Handle to a Queue, with string work items. * @return a new instance of ReaderRead */ - @Endpoint(describeByClass = true) - public static ReaderRead create(Scope scope, Operand readerHandle, Operand queueHandle) { - OperationBuilder opBuilder = scope.env().opBuilder("ReaderReadV2", scope.makeOpName("ReaderRead")); + @Endpoint( + describeByClass = true + ) + public static ReaderRead create(Scope scope, Operand readerHandle, + Operand queueHandle) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReaderRead"); opBuilder.addInput(readerHandle.asOutput()); opBuilder.addInput(queueHandle.asOutput()); - opBuilder = scope.apply(opBuilder); return new ReaderRead(opBuilder.build()); } - + /** + * Gets key. * A scalar. + * @return key. */ public Output key() { return key; } - + /** + * Gets value. * A scalar. + * @return value. */ public Output value() { return value; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReaderReadV2"; - - private Output key; - private Output value; - - private ReaderRead(Operation operation) { - super(operation); - int outputIdx = 0; - key = operation.output(outputIdx++); - value = operation.output(outputIdx++); + + @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 af7dd21f04a..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,71 +17,118 @@ 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; +import org.tensorflow.types.family.TType; /** - * Returns up to `num_records` (key, value) pairs produced by a Reader. - *

+ * Returns up to {@code num_records} (key, value) pairs produced by a Reader. * Will dequeue from the input queue if necessary (e.g. when the * Reader needs to start reading from a new file since it has finished * with the previous file). - * It may return less than `num_records` even before the last batch. + * It may return less than {@code num_records} even before the last batch. */ -@Operator(group = "io") +@OpMetadata( + opType = ReaderReadUpTo.OP_NAME, + inputsClass = ReaderReadUpTo.Inputs.class +) +@Operator( + group = "io" +) public final class ReaderReadUpTo extends RawOp { - /** - * Factory method to create a class wrapping a new ReaderReadUpTo operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReaderReadUpToV2"; + + private Output keys; + + private Output values; + + public ReaderReadUpTo(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + keys = operation.output(outputIdx++); + values = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ReaderReadUpToV2 operation. + * * @param scope current scope - * @param readerHandle Handle to a `Reader`. - * @param queueHandle Handle to a `Queue`, with string work items. - * @param numRecords number of records to read from `Reader`. + * @param readerHandle Handle to a {@code Reader}. + * @param queueHandle Handle to a {@code Queue}, with string work items. + * @param numRecords number of records to read from {@code Reader}. * @return a new instance of ReaderReadUpTo */ - @Endpoint(describeByClass = true) - public static ReaderReadUpTo create(Scope scope, Operand readerHandle, Operand queueHandle, Operand numRecords) { - OperationBuilder opBuilder = scope.env().opBuilder("ReaderReadUpToV2", scope.makeOpName("ReaderReadUpTo")); + @Endpoint( + describeByClass = true + ) + public static ReaderReadUpTo create(Scope scope, Operand readerHandle, + Operand queueHandle, Operand numRecords) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReaderReadUpTo"); opBuilder.addInput(readerHandle.asOutput()); opBuilder.addInput(queueHandle.asOutput()); opBuilder.addInput(numRecords.asOutput()); - opBuilder = scope.apply(opBuilder); return new ReaderReadUpTo(opBuilder.build()); } - + /** + * Gets keys. * A 1-D tensor. + * @return keys. */ public Output keys() { return keys; } - + /** + * Gets values. * A 1-D tensor. + * @return values. */ public Output values() { return values; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReaderReadUpToV2"; - - private Output keys; - private Output values; - - private ReaderReadUpTo(Operation operation) { - super(operation); - int outputIdx = 0; - keys = operation.output(outputIdx++); - values = operation.output(outputIdx++); + + @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 d8ef0859679..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,39 +17,69 @@ 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. */ -@Operator(group = "io") +@OpMetadata( + opType = ReaderReset.OP_NAME, + inputsClass = ReaderReset.Inputs.class +) +@Operator( + group = "io" +) public final class ReaderReset extends RawOp { - /** - * Factory method to create a class wrapping a new ReaderReset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReaderResetV2"; + + public ReaderReset(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new ReaderResetV2 operation. + * * @param scope current scope * @param readerHandle Handle to a Reader. * @return a new instance of ReaderReset */ - @Endpoint(describeByClass = true) - public static ReaderReset create(Scope scope, Operand readerHandle) { - OperationBuilder opBuilder = scope.env().opBuilder("ReaderResetV2", scope.makeOpName("ReaderReset")); + @Endpoint( + describeByClass = true + ) + public static ReaderReset create(Scope scope, Operand readerHandle) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReaderReset"); opBuilder.addInput(readerHandle.asOutput()); - opBuilder = scope.apply(opBuilder); return new ReaderReset(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReaderResetV2"; - - private ReaderReset(Operation operation) { - super(operation); + + @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 93fee46a5e8..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,46 +17,83 @@ 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; /** * Restore a reader to a previously saved state. - *

* Not all Readers support being restored, so this can produce an * Unimplemented error. */ -@Operator(group = "io") +@OpMetadata( + opType = ReaderRestoreState.OP_NAME, + inputsClass = ReaderRestoreState.Inputs.class +) +@Operator( + group = "io" +) public final class ReaderRestoreState extends RawOp { - /** - * Factory method to create a class wrapping a new ReaderRestoreState operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReaderRestoreStateV2"; + + public ReaderRestoreState(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new ReaderRestoreStateV2 operation. + * * @param scope current scope * @param readerHandle Handle to a Reader. * @param state Result of a ReaderSerializeState of a Reader with type * matching reader_handle. * @return a new instance of ReaderRestoreState */ - @Endpoint(describeByClass = true) - public static ReaderRestoreState create(Scope scope, Operand readerHandle, Operand state) { - OperationBuilder opBuilder = scope.env().opBuilder("ReaderRestoreStateV2", scope.makeOpName("ReaderRestoreState")); + @Endpoint( + describeByClass = true + ) + public static ReaderRestoreState create(Scope scope, Operand readerHandle, + Operand state) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReaderRestoreState"); opBuilder.addInput(readerHandle.asOutput()); opBuilder.addInput(state.asOutput()); - opBuilder = scope.apply(opBuilder); return new ReaderRestoreState(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReaderRestoreStateV2"; - - private ReaderRestoreState(Operation operation) { - super(operation); + + @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 c70831e6e03..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,59 +17,91 @@ 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; /** * Produce a string tensor that encodes the state of a Reader. - *

* Not all Readers support being serialized, so this can produce an * Unimplemented error. */ -@Operator(group = "io") +@OpMetadata( + opType = ReaderSerializeState.OP_NAME, + inputsClass = ReaderSerializeState.Inputs.class +) +@Operator( + group = "io" +) public final class ReaderSerializeState extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new ReaderSerializeState operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReaderSerializeStateV2"; + + private Output state; + + public ReaderSerializeState(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + state = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ReaderSerializeStateV2 operation. + * * @param scope current scope * @param readerHandle Handle to a Reader. * @return a new instance of ReaderSerializeState */ - @Endpoint(describeByClass = true) - public static ReaderSerializeState create(Scope scope, Operand readerHandle) { - OperationBuilder opBuilder = scope.env().opBuilder("ReaderSerializeStateV2", scope.makeOpName("ReaderSerializeState")); + @Endpoint( + describeByClass = true + ) + public static ReaderSerializeState create(Scope scope, Operand readerHandle) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReaderSerializeState"); opBuilder.addInput(readerHandle.asOutput()); - opBuilder = scope.apply(opBuilder); return new ReaderSerializeState(opBuilder.build()); } - + /** + * Gets state. + * + * @return state. */ public Output state() { return state; } - + @Override public Output asOutput() { return state; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReaderSerializeStateV2"; - - private Output state; - - private ReaderSerializeState(Operation operation) { - super(operation); - int outputIdx = 0; - state = operation.output(outputIdx++); + + @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 1d839e16c3e..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,90 +17,150 @@ 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 an `N`-minibatch `SparseTensor` into an `[N, 3]` `Tensor` object. - *

- * The `SparseTensor` must have rank `R` greater than 1, and the first dimension - * is treated as the minibatch dimension. Elements of the `SparseTensor` + * Serialize an {@code N}-minibatch {@code SparseTensor} into an {@code [N, 3]} {@code Tensor} object. + * The {@code SparseTensor} must have rank {@code R} greater than 1, and the first dimension + * is treated as the minibatch dimension. Elements of the {@code SparseTensor} * must be sorted in increasing order of this first dimension. The serialized - * `SparseTensor` objects going into each row of `serialized_sparse` will have - * rank `R-1`. - *

- * The minibatch size `N` is extracted from `sparse_shape[0]`. - * - * @param data type for {@code serializedSparse()} output + * {@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]}. */ -@Operator(group = "io") +@OpMetadata( + opType = SerializeManySparse.OP_NAME, + inputsClass = SerializeManySparse.Inputs.class +) +@Operator( + group = "io" +) public final class SerializeManySparse extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SerializeManySparse"; + + private Output serializedSparse; + + public SerializeManySparse(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + serializedSparse = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SerializeManySparse operation. - * + * * @param scope current scope - * @param sparseIndices 2-D. The `indices` of the minibatch `SparseTensor`. - * @param sparseValues 1-D. The `values` of the minibatch `SparseTensor`. - * @param sparseShape 1-D. The `shape` of the minibatch `SparseTensor`. - * @param outType The `dtype` to use for serialization; the supported types are `string` - * (default) and `variant`. + * @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}. + * @param outType The {@code dtype} to use for serialization; the supported types are {@code string} + * (default) and {@code variant}. + * @param data type for {@code SerializeManySparse} output and operands * @return a new instance of SerializeManySparse */ - @Endpoint(describeByClass = true) - public static SerializeManySparse create(Scope scope, Operand sparseIndices, Operand sparseValues, Operand sparseShape, Class outType) { - OperationBuilder opBuilder = scope.env().opBuilder("SerializeManySparse", scope.makeOpName("SerializeManySparse")); + @Endpoint( + describeByClass = true + ) + public static SerializeManySparse create(Scope scope, + Operand sparseIndices, Operand sparseValues, + Operand sparseShape, Class outType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SerializeManySparse"); opBuilder.addInput(sparseIndices.asOutput()); opBuilder.addInput(sparseValues.asOutput()); opBuilder.addInput(sparseShape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new SerializeManySparse(opBuilder.build()); + return new SerializeManySparse<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new SerializeManySparse operation using default output types. - * + * Factory method to create a class wrapping a new SerializeManySparse operation, with the default output types. + * * @param scope current scope - * @param sparseIndices 2-D. The `indices` of the minibatch `SparseTensor`. - * @param sparseValues 1-D. The `values` of the minibatch `SparseTensor`. - * @param sparseShape 1-D. The `shape` of the minibatch `SparseTensor`. - * @return a new instance of SerializeManySparse + * @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}. + * @return a new instance of SerializeManySparse, with default output types */ - @Endpoint(describeByClass = true) - public static SerializeManySparse create(Scope scope, Operand sparseIndices, Operand sparseValues, Operand sparseShape) { + @Endpoint( + describeByClass = true + ) + public static SerializeManySparse create(Scope scope, Operand sparseIndices, + Operand sparseValues, Operand sparseShape) { return create(scope, sparseIndices, sparseValues, sparseShape, TString.class); } - + /** + * Gets serializedSparse. + * + * @return serializedSparse. */ public Output serializedSparse() { return serializedSparse; } - + @Override public Output asOutput() { return serializedSparse; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SerializeManySparse"; - - private Output serializedSparse; - - private SerializeManySparse(Operation operation) { - super(operation); - int outputIdx = 0; - serializedSparse = operation.output(outputIdx++); + + @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 fea3e5c424e..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,82 +17,144 @@ 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 `SparseTensor` into a `[3]` `Tensor` object. - * - * @param data type for {@code serializedSparse()} output + * Serialize a {@code SparseTensor} into a {@code [3]} {@code Tensor} object. */ -@Operator(group = "io") +@OpMetadata( + opType = SerializeSparse.OP_NAME, + inputsClass = SerializeSparse.Inputs.class +) +@Operator( + group = "io" +) public final class SerializeSparse extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SerializeSparse"; + + private Output serializedSparse; + + public SerializeSparse(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + serializedSparse = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SerializeSparse operation. - * + * * @param scope current scope - * @param sparseIndices 2-D. The `indices` of the `SparseTensor`. - * @param sparseValues 1-D. The `values` of the `SparseTensor`. - * @param sparseShape 1-D. The `shape` of the `SparseTensor`. - * @param outType The `dtype` to use for serialization; the supported types are `string` - * (default) and `variant`. + * @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}. + * @param outType The {@code dtype} to use for serialization; the supported types are {@code string} + * (default) and {@code variant}. + * @param data type for {@code SerializeSparse} output and operands * @return a new instance of SerializeSparse */ - @Endpoint(describeByClass = true) - public static SerializeSparse create(Scope scope, Operand sparseIndices, Operand sparseValues, Operand sparseShape, Class outType) { - OperationBuilder opBuilder = scope.env().opBuilder("SerializeSparse", scope.makeOpName("SerializeSparse")); + @Endpoint( + describeByClass = true + ) + public static SerializeSparse create(Scope scope, + Operand sparseIndices, Operand sparseValues, + Operand sparseShape, Class outType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SerializeSparse"); opBuilder.addInput(sparseIndices.asOutput()); opBuilder.addInput(sparseValues.asOutput()); opBuilder.addInput(sparseShape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new SerializeSparse(opBuilder.build()); + return new SerializeSparse<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new SerializeSparse operation using default output types. - * + * Factory method to create a class wrapping a new SerializeSparse operation, with the default output types. + * * @param scope current scope - * @param sparseIndices 2-D. The `indices` of the `SparseTensor`. - * @param sparseValues 1-D. The `values` of the `SparseTensor`. - * @param sparseShape 1-D. The `shape` of the `SparseTensor`. - * @return a new instance of SerializeSparse + * @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}. + * @return a new instance of SerializeSparse, with default output types */ - @Endpoint(describeByClass = true) - public static SerializeSparse create(Scope scope, Operand sparseIndices, Operand sparseValues, Operand sparseShape) { + @Endpoint( + describeByClass = true + ) + public static SerializeSparse create(Scope scope, Operand sparseIndices, + Operand sparseValues, Operand sparseShape) { return create(scope, sparseIndices, sparseValues, sparseShape, TString.class); } - + /** + * Gets serializedSparse. + * + * @return serializedSparse. */ public Output serializedSparse() { return serializedSparse; } - + @Override public Output asOutput() { return serializedSparse; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SerializeSparse"; - - private Output serializedSparse; - - private SerializeSparse(Operation operation) { - super(operation); - int outputIdx = 0; - serializedSparse = operation.output(outputIdx++); + + @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 809b16786e4..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,58 +17,96 @@ 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. */ -@Operator(group = "io") +@OpMetadata( + opType = SerializeTensor.OP_NAME, + inputsClass = SerializeTensor.Inputs.class +) +@Operator( + group = "io" +) public final class SerializeTensor extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SerializeTensor"; + + private Output serialized; + + public SerializeTensor(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + serialized = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SerializeTensor operation. - * + * * @param scope current scope - * @param tensor A Tensor of type `T`. + * @param tensor A Tensor of type {@code T}. * @return a new instance of SerializeTensor */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static SerializeTensor create(Scope scope, Operand tensor) { - OperationBuilder opBuilder = scope.env().opBuilder("SerializeTensor", scope.makeOpName("SerializeTensor")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SerializeTensor"); opBuilder.addInput(tensor.asOutput()); - opBuilder = scope.apply(opBuilder); return new SerializeTensor(opBuilder.build()); } - + /** + * Gets serialized. * A serialized TensorProto proto of the input tensor. + * @return serialized. */ public Output serialized() { return serialized; } - + @Override public Output asOutput() { return serialized; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SerializeTensor"; - - private Output serialized; - - private SerializeTensor(Operation operation) { - super(operation); - int outputIdx = 0; - serialized = operation.output(outputIdx++); + + @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 e4035335864..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,63 +17,107 @@ 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; /** * Generate a sharded filename. The filename is printf formatted as - *

- * %s-%05d-of-%05d, basename, shard, num_shards. + * %s-%05d-of-%05d, basename, shard, num_shards. */ -@Operator(group = "io") +@OpMetadata( + opType = ShardedFilename.OP_NAME, + inputsClass = ShardedFilename.Inputs.class +) +@Operator( + group = "io" +) public final class ShardedFilename extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ShardedFilename"; + + private Output filename; + + public ShardedFilename(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + filename = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ShardedFilename operation. - * + * * @param scope current scope - * @param basename - * @param shard - * @param numShards + * @param basename The basename value + * @param shard The shard value + * @param numShards The numShards value * @return a new instance of ShardedFilename */ - @Endpoint(describeByClass = true) - public static ShardedFilename create(Scope scope, Operand basename, Operand shard, Operand numShards) { - OperationBuilder opBuilder = scope.env().opBuilder("ShardedFilename", scope.makeOpName("ShardedFilename")); + @Endpoint( + describeByClass = true + ) + public static ShardedFilename create(Scope scope, Operand basename, + Operand shard, Operand numShards) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ShardedFilename"); opBuilder.addInput(basename.asOutput()); opBuilder.addInput(shard.asOutput()); opBuilder.addInput(numShards.asOutput()); - opBuilder = scope.apply(opBuilder); return new ShardedFilename(opBuilder.build()); } - + /** + * Gets filename. + * + * @return filename. */ public Output filename() { return filename; } - + @Override public Output asOutput() { return filename; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ShardedFilename"; - - private Output filename; - - private ShardedFilename(Operation operation) { - super(operation); - int outputIdx = 0; - filename = operation.output(outputIdx++); + + @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 3bb96e78030..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,45 +36,79 @@ /** * Generate a glob pattern matching all sharded file names. */ -@Operator(group = "io") +@OpMetadata( + opType = ShardedFilespec.OP_NAME, + inputsClass = ShardedFilespec.Inputs.class +) +@Operator( + group = "io" +) public final class ShardedFilespec extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ShardedFilespec"; + + private Output filename; + + public ShardedFilespec(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + filename = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ShardedFilespec operation. - * + * * @param scope current scope - * @param basename - * @param numShards + * @param basename The basename value + * @param numShards The numShards value * @return a new instance of ShardedFilespec */ - @Endpoint(describeByClass = true) - public static ShardedFilespec create(Scope scope, Operand basename, Operand numShards) { - OperationBuilder opBuilder = scope.env().opBuilder("ShardedFilespec", scope.makeOpName("ShardedFilespec")); + @Endpoint( + describeByClass = true + ) + public static ShardedFilespec create(Scope scope, Operand basename, + Operand numShards) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ShardedFilespec"); opBuilder.addInput(basename.asOutput()); opBuilder.addInput(numShards.asOutput()); - opBuilder = scope.apply(opBuilder); return new ShardedFilespec(opBuilder.build()); } - + /** + * Gets filename. + * + * @return filename. */ public Output filename() { return filename; } - + @Override public Output asOutput() { return filename; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ShardedFilespec"; - - private Output filename; - - private ShardedFilespec(Operation operation) { - super(operation); - int outputIdx = 0; - filename = operation.output(outputIdx++); + + @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 1031adcae92..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,72 +17,58 @@ 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'. */ -@Operator(group = "io") +@OpMetadata( + opType = TextLineReader.OP_NAME, + inputsClass = TextLineReader.Inputs.class +) +@Operator( + group = "io" +) public final class TextLineReader extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.TextLineReader} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param skipHeaderLines Number of lines to skip from the beginning of every file. - */ - public Options skipHeaderLines(Long skipHeaderLines) { - this.skipHeaderLines = skipHeaderLines; - return this; - } - - /** - * @param container If non-empty, this reader is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this reader is named in the given bucket - * with this shared_name. Otherwise, the node name is used instead. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long skipHeaderLines; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "TextLineReaderV2"; + + private Output readerHandle; + + @SuppressWarnings("unchecked") + public TextLineReader(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + readerHandle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new TextLineReader operation. - * + * Factory method to create a class wrapping a new TextLineReaderV2 operation. + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of TextLineReader */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TextLineReader create(Scope scope, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("TextLineReaderV2", scope.makeOpName("TextLineReader")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TextLineReader"); if (options != null) { for (Options opts : options) { if (opts.skipHeaderLines != null) { @@ -98,51 +84,130 @@ public static TextLineReader create(Scope scope, Options... options) { } return new TextLineReader(opBuilder.build()); } - + /** + * Sets the skipHeaderLines option. + * * @param skipHeaderLines Number of lines to skip from the beginning of every file. + * @return this Options instance. */ public static Options skipHeaderLines(Long skipHeaderLines) { return new Options().skipHeaderLines(skipHeaderLines); } - + /** + * Sets the container option. + * * @param container If non-empty, this reader is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this reader is named in the given bucket * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets readerHandle. * The handle to reference the Reader. + * @return readerHandle. */ - public Output readerHandle() { + public Output readerHandle() { return readerHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) readerHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TextLineReaderV2"; - - private Output readerHandle; - - private TextLineReader(Operation operation) { - super(operation); - int outputIdx = 0; - readerHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.TextLineReader} + */ + public static class Options { + private Long skipHeaderLines; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the skipHeaderLines option. + * + * @param skipHeaderLines Number of lines to skip from the beginning of every file. + * @return this Options instance. + */ + public Options skipHeaderLines(Long skipHeaderLines) { + this.skipHeaderLines = skipHeaderLines; + return this; + } + + /** + * Sets the container option. + * + * @param container If non-empty, this reader is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this reader is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = 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 d78e7e2f599..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,72 +17,58 @@ 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. */ -@Operator(group = "io") +@OpMetadata( + opType = TfRecordReader.OP_NAME, + inputsClass = TfRecordReader.Inputs.class +) +@Operator( + group = "io" +) public final class TfRecordReader extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.TfRecordReader} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this reader is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this reader is named in the given bucket - * with this shared_name. Otherwise, the node name is used instead. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param compressionType - */ - public Options compressionType(String compressionType) { - this.compressionType = compressionType; - return this; - } - - private String container; - private String sharedName; - private String compressionType; - - private Options() { - } + public static final String OP_NAME = "TFRecordReaderV2"; + + private Output readerHandle; + + @SuppressWarnings("unchecked") + public TfRecordReader(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + readerHandle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new TfRecordReader operation. - * + * Factory method to create a class wrapping a new TFRecordReaderV2 operation. + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of TfRecordReader */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TfRecordReader create(Scope scope, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("TFRecordReaderV2", scope.makeOpName("TfRecordReader")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TfRecordReader"); if (options != null) { for (Options opts : options) { if (opts.container != null) { @@ -98,51 +84,130 @@ public static TfRecordReader create(Scope scope, Options... options) { } return new TfRecordReader(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this reader is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this reader is named in the given bucket * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * @param compressionType + * Sets the compressionType option. + * + * @param compressionType the compressionType option + * @return this Options instance. */ public static Options compressionType(String compressionType) { return new Options().compressionType(compressionType); } - + /** + * Gets readerHandle. * The handle to reference the Reader. + * @return readerHandle. */ - public Output readerHandle() { + public Output readerHandle() { return readerHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) readerHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TFRecordReaderV2"; - - private Output readerHandle; - - private TfRecordReader(Operation operation) { - super(operation); - int outputIdx = 0; - readerHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.TfRecordReader} + */ + public static class Options { + private String container; + + private String sharedName; + + private String compressionType; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this reader is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this reader is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the compressionType option. + * + * @param compressionType the compressionType option + * @return this Options instance. + */ + public Options compressionType(String compressionType) { + this.compressionType = 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 0b93e777478..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,66 +17,60 @@ 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 entire contents of a file as a value. - *

* To use, enqueue filenames in a Queue. The output of ReaderRead will * be a filename (key) and the contents of that file (value). */ -@Operator(group = "io") +@OpMetadata( + opType = WholeFileReader.OP_NAME, + inputsClass = WholeFileReader.Inputs.class +) +@Operator( + group = "io" +) public final class WholeFileReader extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.WholeFileReader} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this reader is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this reader is named in the given bucket - * with this shared_name. Otherwise, the node name is used instead. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "WholeFileReaderV2"; + + private Output readerHandle; + + @SuppressWarnings("unchecked") + public WholeFileReader(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + readerHandle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new WholeFileReader operation. - * + * Factory method to create a class wrapping a new WholeFileReaderV2 operation. + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of WholeFileReader */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static WholeFileReader create(Scope scope, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("WholeFileReaderV2", scope.makeOpName("WholeFileReader")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "WholeFileReader"); if (options != null) { for (Options opts : options) { if (opts.container != null) { @@ -89,44 +83,101 @@ public static WholeFileReader create(Scope scope, Options... options) { } return new WholeFileReader(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this reader is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this reader is named in the given bucket * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets readerHandle. * The handle to reference the Reader. + * @return readerHandle. */ - public Output readerHandle() { + public Output readerHandle() { return readerHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) readerHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "WholeFileReaderV2"; - - private Output readerHandle; - - private WholeFileReader(Operation operation) { - super(operation); - int outputIdx = 0; - readerHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.WholeFileReader} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this reader is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this reader is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = 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 4d8bbd389ff..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,44 +17,79 @@ 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. */ -@Operator(group = "io") +@OpMetadata( + opType = WriteFile.OP_NAME, + inputsClass = WriteFile.Inputs.class +) +@Operator( + group = "io" +) public final class WriteFile extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "WriteFile"; + + public WriteFile(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new WriteFile operation. - * + * * @param scope current scope * @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. * @return a new instance of WriteFile */ - @Endpoint(describeByClass = true) - public static WriteFile create(Scope scope, Operand filename, Operand contents) { - OperationBuilder opBuilder = scope.env().opBuilder("WriteFile", scope.makeOpName("WriteFile")); + @Endpoint( + describeByClass = true + ) + public static WriteFile create(Scope scope, Operand filename, + Operand contents) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "WriteFile"); opBuilder.addInput(filename.asOutput()); opBuilder.addInput(contents.asOutput()); - opBuilder = scope.apply(opBuilder); return new WriteFile(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "WriteFile"; - - private WriteFile(Operation operation) { - super(operation); + + @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 a1fcc18c2c1..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,102 +17,154 @@ 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; /** * Copy a tensor setting everything outside a central band in each innermost matrix to zero. - *

- * The `band` part is computed as follows: - * Assume `input` has `k` dimensions `[I, J, K, ..., M, N]`, then the output is a + * The {@code band} part is computed as follows: + * Assume {@code input} has {@code k} dimensions {@code [I, J, K, ..., M, N]}, then the output is a * tensor with the same shape where - *

- * `band[i, j, k, ..., m, n] = in_band(m, n) * input[i, j, k, ..., m, n]`. - *

- * The indicator function - *

- * `in_band(m, n) = (num_lower < 0 || (m-n) <= num_lower)) && - * (num_upper < 0 || (n-m) <= num_upper)`. - *

- * For example: - *

{@code
+ * 

{@code band[i, j, k, ..., m, n] = in_band(m, n) * input[i, j, k, ..., m, n]}. + *

The indicator function + *

{@code in_band(m, n) = (num_lower < 0 || (m-n) <= num_lower)) && (num_upper < 0 || (n-m) <= num_upper)}. + *

For example: + *

  * # if 'input' is [[ 0,  1,  2, 3]
- *                  [-1,  0,  1, 2]
- *                  [-2, -1,  0, 1]
- *                  [-3, -2, -1, 0]],
- * 
- * tf.matrix_band_part(input, 1, -1) ==> [[ 0,  1,  2, 3]
+ * #                [-1,  0,  1, 2]
+ * #                [-2, -1,  0, 1]
+ * #                [-3, -2, -1, 0]],
+ *
+ * tf.linalg.band_part(input, 1, -1) ==> [[ 0,  1,  2, 3]
  *                                        [-1,  0,  1, 2]
  *                                        [ 0, -1,  0, 1]
  *                                        [ 0,  0, -1, 0]],
- * 
- * tf.matrix_band_part(input, 2, 1) ==> [[ 0,  1,  0, 0]
+ *
+ * tf.linalg.band_part(input, 2, 1) ==> [[ 0,  1,  0, 0]
  *                                       [-1,  0,  1, 0]
  *                                       [-2, -1,  0, 1]
  *                                       [ 0, -2, -1, 0]]
- * }
- * Useful special cases: - *
{@code
- *  tf.matrix_band_part(input, 0, -1) ==> Upper triangular part.
- *  tf.matrix_band_part(input, -1, 0) ==> Lower triangular part.
- *  tf.matrix_band_part(input, 0, 0) ==> Diagonal.
- * }
- * - * - * @param data type for {@code band()} output + *
+ *

Useful special cases: + *

+ *  tf.linalg.band_part(input, 0, -1) ==> Upper triangular part.
+ *  tf.linalg.band_part(input, -1, 0) ==> Lower triangular part.
+ *  tf.linalg.band_part(input, 0, 0) ==> Diagonal.
+ * 
*/ -@Operator(group = "linalg") +@OpMetadata( + opType = BandPart.OP_NAME, + inputsClass = BandPart.Inputs.class +) +@Operator( + group = "linalg" +) public final class BandPart extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new BandPart operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MatrixBandPart"; + + private Output band; + + public BandPart(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + band = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new MatrixBandPart operation. + * * @param scope current scope - * @param input Rank `k` tensor. + * @param input Rank {@code k} tensor. * @param numLower 0-D tensor. Number of subdiagonals to keep. If negative, keep entire * lower triangle. * @param numUpper 0-D tensor. Number of superdiagonals to keep. If negative, keep * entire upper triangle. + * @param data type for {@code MatrixBandPart} output and operands + * @param data type for {@code MatrixBandPart} output and operands * @return a new instance of BandPart */ - @Endpoint(describeByClass = true) - public static BandPart create(Scope scope, Operand input, Operand numLower, Operand numUpper) { - OperationBuilder opBuilder = scope.env().opBuilder("MatrixBandPart", scope.makeOpName("BandPart")); + @Endpoint( + describeByClass = true + ) + public static BandPart create(Scope scope, + Operand input, Operand numLower, Operand numUpper) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BandPart"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(numLower.asOutput()); opBuilder.addInput(numUpper.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BandPart(opBuilder.build()); + return new BandPart<>(opBuilder.build()); } - + /** - * Rank `k` tensor of the same shape as input. The extracted banded tensor. + * Gets band. + * Rank {@code k} tensor of the same shape as input. The extracted banded tensor. + * @return band. */ public Output band() { return band; } - + @Override public Output asOutput() { return band; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixBandPart"; - - private Output band; - - private BandPart(Operation operation) { - super(operation); - int outputIdx = 0; - band = operation.output(outputIdx++); + + @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 314d184c472..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,64 +17,64 @@ 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; /** - * @param data type for {@code output()} output + * The BandedTriangularSolve operation */ +@OpMetadata( + opType = BandedTriangularSolve.OP_NAME, + inputsClass = BandedTriangularSolve.Inputs.class +) +@Operator( + group = "linalg" +) public final class BandedTriangularSolve extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.BandedTriangularSolve} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param lower - */ - public Options lower(Boolean lower) { - this.lower = lower; - return this; - } - - /** - * @param adjoint - */ - public Options adjoint(Boolean adjoint) { - this.adjoint = adjoint; - return this; - } - - private Boolean lower; - private Boolean adjoint; - - private Options() { - } + public static final String OP_NAME = "BandedTriangularSolve"; + + private Output output; + + public BandedTriangularSolve(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new BandedTriangularSolve operation. - * + * * @param scope current scope - * @param matrix - * @param rhs - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static BandedTriangularSolve create(Scope scope, Operand matrix, Operand rhs, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("BandedTriangularSolve", scope.makeOpName("BandedTriangularSolve")); + @Endpoint( + describeByClass = true + ) + public static BandedTriangularSolve create(Scope scope, Operand matrix, + Operand rhs, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BandedTriangularSolve"); opBuilder.addInput(matrix.asOutput()); opBuilder.addInput(rhs.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.lower != null) { @@ -85,42 +85,114 @@ public static BandedTriangularSolve create(Scope scope, Ope } } } - return new BandedTriangularSolve(opBuilder.build()); + return new BandedTriangularSolve<>(opBuilder.build()); } - + /** - * @param lower + * Sets the lower option. + * + * @param lower the lower option + * @return this Options instance. */ public static Options lower(Boolean lower) { return new Options().lower(lower); } - + /** - * @param adjoint + * 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BandedTriangularSolve"; - - private Output output; - - private BandedTriangularSolve(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.BandedTriangularSolve} + */ + 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; + } + } + + @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 a7ba5c36639..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,56 +17,96 @@ 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; /** - * @param data type for {@code output()} output + * The BatchCholesky operation */ -@Operator(group = "linalg") +@OpMetadata( + opType = BatchCholesky.OP_NAME, + inputsClass = BatchCholesky.Inputs.class +) +@Operator( + group = "linalg" +) public final class BatchCholesky extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchCholesky"; + + private Output output; + + public BatchCholesky(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BatchCholesky operation. - * + * * @param scope current scope - * @param input + * @param input The input value + * @param data type for {@code BatchCholesky} output and operands * @return a new instance of BatchCholesky */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BatchCholesky create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchCholesky", scope.makeOpName("BatchCholesky")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchCholesky"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BatchCholesky(opBuilder.build()); + return new BatchCholesky<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchCholesky"; - - private Output output; - - private BatchCholesky(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 515e582f254..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,58 +17,105 @@ 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; /** - * @param data type for {@code output()} output + * The BatchCholeskyGrad operation */ -@Operator(group = "linalg") +@OpMetadata( + opType = BatchCholeskyGrad.OP_NAME, + inputsClass = BatchCholeskyGrad.Inputs.class +) +@Operator( + group = "linalg" +) public final class BatchCholeskyGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchCholeskyGrad"; + + private Output output; + + public BatchCholeskyGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BatchCholeskyGrad operation. - * + * * @param scope current scope - * @param l - * @param grad + * @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 */ - @Endpoint(describeByClass = true) - public static BatchCholeskyGrad create(Scope scope, Operand l, Operand grad) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchCholeskyGrad", scope.makeOpName("BatchCholeskyGrad")); + @Endpoint( + describeByClass = true + ) + public static BatchCholeskyGrad create(Scope scope, Operand l, + Operand grad) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchCholeskyGrad"); opBuilder.addInput(l.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BatchCholeskyGrad(opBuilder.build()); + return new BatchCholeskyGrad<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchCholeskyGrad"; - - private Output output; - - private BatchCholeskyGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 73781a58062..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,61 +17,114 @@ 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; /** - * @param data type for {@code band()} output + * The BatchMatrixBandPart operation */ -@Operator(group = "linalg") +@OpMetadata( + opType = BatchMatrixBandPart.OP_NAME, + inputsClass = BatchMatrixBandPart.Inputs.class +) +@Operator( + group = "linalg" +) public final class BatchMatrixBandPart extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchMatrixBandPart"; + + private Output band; + + public BatchMatrixBandPart(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + band = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BatchMatrixBandPart operation. - * + * * @param scope current scope - * @param input - * @param numLower - * @param numUpper + * @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 */ - @Endpoint(describeByClass = true) - public static BatchMatrixBandPart create(Scope scope, Operand input, Operand numLower, Operand numUpper) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchMatrixBandPart", scope.makeOpName("BatchMatrixBandPart")); + @Endpoint( + describeByClass = true + ) + public static BatchMatrixBandPart create(Scope scope, Operand input, + Operand numLower, Operand numUpper) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchMatrixBandPart"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(numLower.asOutput()); opBuilder.addInput(numUpper.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BatchMatrixBandPart(opBuilder.build()); + return new BatchMatrixBandPart<>(opBuilder.build()); } - + /** + * Gets band. + * + * @return band. */ public Output band() { return band; } - + @Override public Output asOutput() { return band; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchMatrixBandPart"; - - private Output band; - - private BatchMatrixBandPart(Operation operation) { - super(operation); - int outputIdx = 0; - band = operation.output(outputIdx++); + + @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 a05950bf04a..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,56 +17,96 @@ 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; /** - * @param data type for {@code output()} output + * The BatchMatrixDeterminant operation */ -@Operator(group = "linalg") +@OpMetadata( + opType = BatchMatrixDeterminant.OP_NAME, + inputsClass = BatchMatrixDeterminant.Inputs.class +) +@Operator( + group = "linalg" +) public final class BatchMatrixDeterminant extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchMatrixDeterminant"; + + private Output output; + + public BatchMatrixDeterminant(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BatchMatrixDeterminant operation. - * + * * @param scope current scope - * @param input + * @param input The input value + * @param data type for {@code BatchMatrixDeterminant} output and operands * @return a new instance of BatchMatrixDeterminant */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BatchMatrixDeterminant create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchMatrixDeterminant", scope.makeOpName("BatchMatrixDeterminant")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchMatrixDeterminant"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BatchMatrixDeterminant(opBuilder.build()); + return new BatchMatrixDeterminant<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchMatrixDeterminant"; - - private Output output; - - private BatchMatrixDeterminant(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 9cfc0f9d177..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,56 +17,96 @@ 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; /** - * @param data type for {@code output()} output + * The BatchMatrixDiag operation */ -@Operator(group = "linalg") +@OpMetadata( + opType = BatchMatrixDiag.OP_NAME, + inputsClass = BatchMatrixDiag.Inputs.class +) +@Operator( + group = "linalg" +) public final class BatchMatrixDiag extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchMatrixDiag"; + + private Output output; + + public BatchMatrixDiag(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BatchMatrixDiag operation. - * + * * @param scope current scope - * @param diagonal + * @param diagonal The diagonal value + * @param data type for {@code BatchMatrixDiag} output and operands * @return a new instance of BatchMatrixDiag */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BatchMatrixDiag create(Scope scope, Operand diagonal) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchMatrixDiag", scope.makeOpName("BatchMatrixDiag")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchMatrixDiag"); opBuilder.addInput(diagonal.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BatchMatrixDiag(opBuilder.build()); + return new BatchMatrixDiag<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchMatrixDiag"; - - private Output output; - - private BatchMatrixDiag(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 6e3a206226e..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,56 +17,96 @@ 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; /** - * @param data type for {@code diagonal()} output + * The BatchMatrixDiagPart operation */ -@Operator(group = "linalg") +@OpMetadata( + opType = BatchMatrixDiagPart.OP_NAME, + inputsClass = BatchMatrixDiagPart.Inputs.class +) +@Operator( + group = "linalg" +) public final class BatchMatrixDiagPart extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchMatrixDiagPart"; + + private Output diagonal; + + public BatchMatrixDiagPart(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + diagonal = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BatchMatrixDiagPart operation. - * + * * @param scope current scope - * @param input + * @param input The input value + * @param data type for {@code BatchMatrixDiagPart} output and operands * @return a new instance of BatchMatrixDiagPart */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BatchMatrixDiagPart create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchMatrixDiagPart", scope.makeOpName("BatchMatrixDiagPart")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchMatrixDiagPart"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BatchMatrixDiagPart(opBuilder.build()); + return new BatchMatrixDiagPart<>(opBuilder.build()); } - + /** + * Gets diagonal. + * + * @return diagonal. */ public Output diagonal() { return diagonal; } - + @Override public Output asOutput() { return diagonal; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchMatrixDiagPart"; - - private Output diagonal; - - private BatchMatrixDiagPart(Operation operation) { - super(operation); - int outputIdx = 0; - diagonal = operation.output(outputIdx++); + + @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 709a59404b9..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,54 +17,66 @@ 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; /** - * @param data type for {@code output()} output + * 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). */ -@Operator(group = "linalg") +@OpMetadata( + opType = BatchMatrixInverse.OP_NAME, + inputsClass = BatchMatrixInverse.Inputs.class +) +@Operator( + group = "linalg" +) public final class BatchMatrixInverse extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.BatchMatrixInverse} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param adjoint - */ - public Options adjoint(Boolean adjoint) { - this.adjoint = adjoint; - return this; - } - - private Boolean adjoint; - - private Options() { - } + public static final String OP_NAME = "BatchMatrixInverse"; + + private Output output; + + public BatchMatrixInverse(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new BatchMatrixInverse operation. - * + * * @param scope current scope - * @param input - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static BatchMatrixInverse create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchMatrixInverse", scope.makeOpName("BatchMatrixInverse")); + @Endpoint( + describeByClass = true + ) + public static BatchMatrixInverse create(Scope scope, Operand input, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchMatrixInverse"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.adjoint != null) { @@ -72,35 +84,79 @@ public static BatchMatrixInverse create(Scope scope, Oper } } } - return new BatchMatrixInverse(opBuilder.build()); + return new BatchMatrixInverse<>(opBuilder.build()); } - + /** - * @param adjoint + * 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchMatrixInverse"; - - private Output output; - - private BatchMatrixInverse(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.BatchMatrixInverse} + */ + public static class Options { + private Boolean adjoint; + + private Options() { + } + + /** + * Sets the adjoint option. + * + * @param adjoint the adjoint option + * @return this Options instance. + */ + public Options adjoint(Boolean adjoint) { + this.adjoint = 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 07f59f50c5d..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,58 +17,105 @@ 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; /** - * @param data type for {@code output()} output + * The BatchMatrixSetDiag operation */ -@Operator(group = "linalg") +@OpMetadata( + opType = BatchMatrixSetDiag.OP_NAME, + inputsClass = BatchMatrixSetDiag.Inputs.class +) +@Operator( + group = "linalg" +) public final class BatchMatrixSetDiag extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchMatrixSetDiag"; + + private Output output; + + public BatchMatrixSetDiag(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BatchMatrixSetDiag operation. - * + * * @param scope current scope - * @param input - * @param diagonal + * @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 */ - @Endpoint(describeByClass = true) - public static BatchMatrixSetDiag create(Scope scope, Operand input, Operand diagonal) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchMatrixSetDiag", scope.makeOpName("BatchMatrixSetDiag")); + @Endpoint( + describeByClass = true + ) + public static BatchMatrixSetDiag create(Scope scope, Operand input, + Operand diagonal) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchMatrixSetDiag"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(diagonal.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BatchMatrixSetDiag(opBuilder.build()); + return new BatchMatrixSetDiag<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchMatrixSetDiag"; - - private Output output; - - private BatchMatrixSetDiag(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 64559a23676..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,56 +17,64 @@ 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; /** - * @param data type for {@code output()} output + * The BatchMatrixSolve operation */ -@Operator(group = "linalg") +@OpMetadata( + opType = BatchMatrixSolve.OP_NAME, + inputsClass = BatchMatrixSolve.Inputs.class +) +@Operator( + group = "linalg" +) public final class BatchMatrixSolve extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.BatchMatrixSolve} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param adjoint - */ - public Options adjoint(Boolean adjoint) { - this.adjoint = adjoint; - return this; - } - - private Boolean adjoint; - - private Options() { - } + public static final String OP_NAME = "BatchMatrixSolve"; + + private Output output; + + public BatchMatrixSolve(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new BatchMatrixSolve operation. - * + * * @param scope current scope - * @param matrix - * @param rhs - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static BatchMatrixSolve create(Scope scope, Operand matrix, Operand rhs, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchMatrixSolve", scope.makeOpName("BatchMatrixSolve")); + @Endpoint( + describeByClass = true + ) + public static BatchMatrixSolve create(Scope scope, Operand matrix, + Operand rhs, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchMatrixSolve"); opBuilder.addInput(matrix.asOutput()); opBuilder.addInput(rhs.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.adjoint != null) { @@ -74,35 +82,85 @@ public static BatchMatrixSolve create(Scope scope, Operan } } } - return new BatchMatrixSolve(opBuilder.build()); + return new BatchMatrixSolve<>(opBuilder.build()); } - + /** - * @param adjoint + * 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchMatrixSolve"; - - private Output output; - - private BatchMatrixSolve(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.BatchMatrixSolve} + */ + public static class Options { + private Boolean adjoint; + + private Options() { + } + + /** + * Sets the adjoint option. + * + * @param adjoint the adjoint option + * @return this Options instance. + */ + public Options adjoint(Boolean adjoint) { + this.adjoint = 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 71490a6b153..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,59 +17,67 @@ 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; /** - * @param data type for {@code output()} output + * The BatchMatrixSolveLs operation */ -@Operator(group = "linalg") +@OpMetadata( + opType = BatchMatrixSolveLs.OP_NAME, + inputsClass = BatchMatrixSolveLs.Inputs.class +) +@Operator( + group = "linalg" +) public final class BatchMatrixSolveLs extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.BatchMatrixSolveLs} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param fast - */ - public Options fast(Boolean fast) { - this.fast = fast; - return this; - } - - private Boolean fast; - - private Options() { - } + public static final String OP_NAME = "BatchMatrixSolveLs"; + + private Output output; + + public BatchMatrixSolveLs(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new BatchMatrixSolveLs operation. - * + * * @param scope current scope - * @param matrix - * @param rhs - * @param l2Regularizer - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static BatchMatrixSolveLs create(Scope scope, Operand matrix, Operand rhs, Operand l2Regularizer, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchMatrixSolveLs", scope.makeOpName("BatchMatrixSolveLs")); + @Endpoint( + describeByClass = true + ) + public static BatchMatrixSolveLs create(Scope scope, Operand matrix, + Operand rhs, Operand l2Regularizer, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchMatrixSolveLs"); opBuilder.addInput(matrix.asOutput()); opBuilder.addInput(rhs.asOutput()); opBuilder.addInput(l2Regularizer.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.fast != null) { @@ -77,35 +85,91 @@ public static BatchMatrixSolveLs create(Scope scope, Oper } } } - return new BatchMatrixSolveLs(opBuilder.build()); + return new BatchMatrixSolveLs<>(opBuilder.build()); } - + /** - * @param fast + * Sets the fast option. + * + * @param fast the fast option + * @return this Options instance. */ public static Options fast(Boolean fast) { return new Options().fast(fast); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchMatrixSolveLs"; - - private Output output; - - private BatchMatrixSolveLs(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.BatchMatrixSolveLs} + */ + public static class Options { + private Boolean fast; + + private Options() { + } + + /** + * Sets the fast option. + * + * @param fast the fast option + * @return this Options instance. + */ + public Options fast(Boolean fast) { + this.fast = 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 7bccee674a9..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,65 +17,64 @@ 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; /** - * @param data type for {@code output()} output + * The BatchMatrixTriangularSolve operation */ -@Operator(group = "linalg") +@OpMetadata( + opType = BatchMatrixTriangularSolve.OP_NAME, + inputsClass = BatchMatrixTriangularSolve.Inputs.class +) +@Operator( + group = "linalg" +) public final class BatchMatrixTriangularSolve extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.BatchMatrixTriangularSolve} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param lower - */ - public Options lower(Boolean lower) { - this.lower = lower; - return this; - } - - /** - * @param adjoint - */ - public Options adjoint(Boolean adjoint) { - this.adjoint = adjoint; - return this; - } - - private Boolean lower; - private Boolean adjoint; - - private Options() { - } + public static final String OP_NAME = "BatchMatrixTriangularSolve"; + + private Output output; + + public BatchMatrixTriangularSolve(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new BatchMatrixTriangularSolve operation. - * + * * @param scope current scope - * @param matrix - * @param rhs - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static BatchMatrixTriangularSolve create(Scope scope, Operand matrix, Operand rhs, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchMatrixTriangularSolve", scope.makeOpName("BatchMatrixTriangularSolve")); + @Endpoint( + describeByClass = true + ) + public static BatchMatrixTriangularSolve create(Scope scope, + Operand matrix, Operand rhs, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchMatrixTriangularSolve"); opBuilder.addInput(matrix.asOutput()); opBuilder.addInput(rhs.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.lower != null) { @@ -86,42 +85,114 @@ public static BatchMatrixTriangularSolve create(Scope sco } } } - return new BatchMatrixTriangularSolve(opBuilder.build()); + return new BatchMatrixTriangularSolve<>(opBuilder.build()); } - + /** - * @param lower + * Sets the lower option. + * + * @param lower the lower option + * @return this Options instance. */ public static Options lower(Boolean lower) { return new Options().lower(lower); } - + /** - * @param adjoint + * 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchMatrixTriangularSolve"; - - private Output output; - - private BatchMatrixTriangularSolve(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.BatchMatrixTriangularSolve} + */ + 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; + } + } + + @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 450a7ee419d..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,54 +17,65 @@ 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; /** - * @param data type for {@code e()} output + * The BatchSelfAdjointEigV2 operation */ -@Operator(group = "linalg") +@OpMetadata( + opType = BatchSelfAdjointEig.OP_NAME, + inputsClass = BatchSelfAdjointEig.Inputs.class +) +@Operator( + group = "linalg" +) public final class BatchSelfAdjointEig extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.BatchSelfAdjointEig} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param computeV - */ - public Options computeV(Boolean computeV) { - this.computeV = computeV; - return this; - } - - private Boolean computeV; - - private Options() { - } + public static final String OP_NAME = "BatchSelfAdjointEigV2"; + + private Output e; + + private Output v; + + public BatchSelfAdjointEig(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + e = operation.output(outputIdx++); + v = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new BatchSelfAdjointEig operation. - * + * Factory method to create a class wrapping a new BatchSelfAdjointEigV2 operation. + * * @param scope current scope - * @param input - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static BatchSelfAdjointEig create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchSelfAdjointEigV2", scope.makeOpName("BatchSelfAdjointEig")); + @Endpoint( + describeByClass = true + ) + public static BatchSelfAdjointEig create(Scope scope, Operand input, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchSelfAdjointEig"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.computeV != null) { @@ -72,38 +83,83 @@ public static BatchSelfAdjointEig create(Scope scope, Ope } } } - return new BatchSelfAdjointEig(opBuilder.build()); + return new BatchSelfAdjointEig<>(opBuilder.build()); } - + /** - * @param computeV + * Sets the computeV option. + * + * @param computeV the computeV option + * @return this Options instance. */ public static Options computeV(Boolean computeV) { return new Options().computeV(computeV); } - + /** + * Gets e. + * + * @return e. */ public Output e() { return e; } - + /** + * Gets v. + * + * @return v. */ public Output v() { return v; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchSelfAdjointEigV2"; - - private Output e; - private Output v; - - private BatchSelfAdjointEig(Operation operation) { - super(operation); - int outputIdx = 0; - e = operation.output(outputIdx++); - v = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.BatchSelfAdjointEig} + */ + public static class Options { + private Boolean computeV; + + private Options() { + } + + /** + * Sets the computeV option. + * + * @param computeV the computeV option + * @return this Options instance. + */ + public Options computeV(Boolean computeV) { + this.computeV = 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 a5dc1bf050a..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,63 +17,68 @@ 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; /** - * @param data type for {@code s()} output + * The BatchSvd operation */ -@Operator(group = "linalg") +@OpMetadata( + opType = BatchSvd.OP_NAME, + inputsClass = BatchSvd.Inputs.class +) +@Operator( + group = "linalg" +) public final class BatchSvd extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.BatchSvd} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param computeUv - */ - public Options computeUv(Boolean computeUv) { - this.computeUv = computeUv; - return this; - } - - /** - * @param fullMatrices - */ - public Options fullMatrices(Boolean fullMatrices) { - this.fullMatrices = fullMatrices; - return this; - } - - private Boolean computeUv; - private Boolean fullMatrices; - - private Options() { - } + public static final String OP_NAME = "BatchSvd"; + + private Output s; + + private Output u; + + private Output v; + + public BatchSvd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + s = operation.output(outputIdx++); + u = operation.output(outputIdx++); + v = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new BatchSvd operation. - * + * * @param scope current scope - * @param input - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static BatchSvd create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchSvd", scope.makeOpName("BatchSvd")); + @Endpoint( + describeByClass = true + ) + public static BatchSvd create(Scope scope, Operand input, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchSvd"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.computeUv != null) { @@ -84,53 +89,121 @@ public static BatchSvd create(Scope scope, Operand input } } } - return new BatchSvd(opBuilder.build()); + return new BatchSvd<>(opBuilder.build()); } - + /** - * @param computeUv + * Sets the computeUv option. + * + * @param computeUv the computeUv option + * @return this Options instance. */ public static Options computeUv(Boolean computeUv) { return new Options().computeUv(computeUv); } - + /** - * @param fullMatrices + * Sets the fullMatrices option. + * + * @param fullMatrices the fullMatrices option + * @return this Options instance. */ public static Options fullMatrices(Boolean fullMatrices) { return new Options().fullMatrices(fullMatrices); } - + /** + * Gets s. + * + * @return s. */ public Output s() { return s; } - + /** + * Gets u. + * + * @return u. */ public Output u() { return u; } - + /** + * Gets v. + * + * @return v. */ public Output v() { return v; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchSvd"; - - private Output s; - private Output u; - private Output v; - - private BatchSvd(Operation operation) { - super(operation); - int outputIdx = 0; - s = operation.output(outputIdx++); - u = operation.output(outputIdx++); - v = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.BatchSvd} + */ + public static class Options { + private Boolean computeUv; + + private Boolean fullMatrices; + + private Options() { + } + + /** + * Sets the computeUv option. + * + * @param computeUv the computeUv option + * @return this Options instance. + */ + public Options computeUv(Boolean computeUv) { + this.computeUv = computeUv; + return this; + } + + /** + * Sets the fullMatrices option. + * + * @param fullMatrices the fullMatrices option + * @return this Options instance. + */ + public Options fullMatrices(Boolean fullMatrices) { + this.fullMatrices = 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 a63337aeacf..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,73 +17,106 @@ 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; /** * Computes the Cholesky decomposition of one or more square matrices. - *

- * The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions + * The input is a tensor of shape {@code [..., M, M]} whose inner-most 2 dimensions * form square matrices. - *

- * The input has to be symmetric and positive definite. Only the lower-triangular + *

The input has to be symmetric and positive definite. Only the lower-triangular * part of the input will be used for this operation. The upper-triangular part * will not be read. - *

- * The output is a tensor of the same shape as the input - * containing the Cholesky decompositions for all input submatrices `[..., :, :]`. - *

- * Note: The gradient computation on GPU is faster for large matrices but + *

The output is a tensor of the same shape as the input + * containing the Cholesky decompositions for all input submatrices {@code [..., :, :]}. + *

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 */ -@Operator(group = "linalg") +@OpMetadata( + opType = Cholesky.OP_NAME, + inputsClass = Cholesky.Inputs.class +) +@Operator( + group = "linalg" +) public final class Cholesky extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Cholesky"; + + private Output output; + + public Cholesky(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Cholesky operation. - * + * * @param scope current scope - * @param input Shape is `[..., M, M]`. + * @param input Shape is {@code [..., M, M]}. + * @param data type for {@code Cholesky} output and operands * @return a new instance of Cholesky */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Cholesky create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("Cholesky", scope.makeOpName("Cholesky")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Cholesky"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Cholesky(opBuilder.build()); + return new Cholesky<>(opBuilder.build()); } - + /** - * Shape is `[..., M, M]`. + * Gets output. + * Shape is {@code [..., M, M]}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Cholesky"; - - private Output output; - - private Cholesky(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 5a623ebd876..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,68 +17,115 @@ 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 + * 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 */ -@Operator(group = "linalg") +@OpMetadata( + opType = CholeskyGrad.OP_NAME, + inputsClass = CholeskyGrad.Inputs.class +) +@Operator( + group = "linalg" +) public final class CholeskyGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CholeskyGrad"; + + private Output output; + + public CholeskyGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new CholeskyGrad operation. - * + * * @param scope current scope - * @param l Output of batch Cholesky algorithm l = cholesky(A). Shape is `[..., M, M]`. + * @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. - * @param grad df/dl where f is some scalar function. Shape is `[..., M, M]`. + * @param grad 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. + * @param data type for {@code CholeskyGrad} output and operands * @return a new instance of CholeskyGrad */ - @Endpoint(describeByClass = true) - public static CholeskyGrad create(Scope scope, Operand l, Operand grad) { - OperationBuilder opBuilder = scope.env().opBuilder("CholeskyGrad", scope.makeOpName("CholeskyGrad")); + @Endpoint( + describeByClass = true + ) + public static CholeskyGrad create(Scope scope, Operand l, + Operand grad) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CholeskyGrad"); opBuilder.addInput(l.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); - return new CholeskyGrad(opBuilder.build()); + return new CholeskyGrad<>(opBuilder.build()); } - + /** - * Symmetrized version of df/dA . Shape is `[..., M, M]` + * Gets output. + * Symmetrized version of df/dA . Shape is {@code [..., M, M]} + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CholeskyGrad"; - - private Output output; - - private CholeskyGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 12bfdcc5e8a..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,65 +17,115 @@ 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; /** * Shuffle dimensions of x according to a permutation and conjugate the result. - *

- * The output `y` has the same rank as `x`. The shapes of `x` and `y` satisfy: - * `y.shape[i] == x.shape[perm[i]] for i in [0, 1, ..., rank(x) - 1]` - * `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 + * 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]])} */ -@Operator(group = "linalg") +@OpMetadata( + opType = ConjugateTranspose.OP_NAME, + inputsClass = ConjugateTranspose.Inputs.class +) +@Operator( + group = "linalg" +) public final class ConjugateTranspose extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ConjugateTranspose"; + + private Output y; + + public ConjugateTranspose(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ConjugateTranspose operation. - * + * * @param scope current scope - * @param x - * @param perm + * @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 */ - @Endpoint(describeByClass = true) - public static ConjugateTranspose create(Scope scope, Operand x, Operand perm) { - OperationBuilder opBuilder = scope.env().opBuilder("ConjugateTranspose", scope.makeOpName("ConjugateTranspose")); + @Endpoint( + describeByClass = true + ) + public static ConjugateTranspose create(Scope scope, Operand x, + Operand perm) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ConjugateTranspose"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(perm.asOutput()); - opBuilder = scope.apply(opBuilder); - return new ConjugateTranspose(opBuilder.build()); + return new ConjugateTranspose<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ConjugateTranspose"; - - private Output y; - - private ConjugateTranspose(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 b62fcbf512c..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,65 +17,107 @@ 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; /** * Compute the pairwise cross product. - *

- * `a` and `b` must be the same shape; they can either be simple 3-element vectors, + * {@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 */ -@Operator(group = "linalg") +@OpMetadata( + opType = Cross.OP_NAME, + inputsClass = Cross.Inputs.class +) +@Operator( + group = "linalg" +) public final class Cross extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Cross"; + + private Output product; + + public Cross(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + product = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Cross operation. - * + * * @param scope current scope * @param a A tensor containing 3-element vectors. - * @param b Another tensor, of same type and shape as `a`. + * @param b Another tensor, of same type and shape as {@code a}. + * @param data type for {@code Cross} output and operands * @return a new instance of Cross */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Cross create(Scope scope, Operand a, Operand b) { - OperationBuilder opBuilder = scope.env().opBuilder("Cross", scope.makeOpName("Cross")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Cross"); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Cross(opBuilder.build()); + return new Cross<>(opBuilder.build()); } - + /** - * Pairwise cross product of the vectors in `a` and `b`. + * Gets product. + * Pairwise cross product of the vectors in {@code a} and {@code b}. + * @return product. */ public Output product() { return product; } - + @Override public Output asOutput() { return product; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Cross"; - - private Output product; - - private Cross(Operation operation) { - super(operation); - int outputIdx = 0; - product = operation.output(outputIdx++); + + @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 c207d6093c7..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,63 +17,99 @@ 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; /** * Computes the determinant of one or more square matrices. - *

- * The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions + * 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 `[..., :, :]`. - * - * @param data type for {@code output()} output + * for all input submatrices {@code [..., :, :]}. */ -@Operator(group = "linalg") +@OpMetadata( + opType = Det.OP_NAME, + inputsClass = Det.Inputs.class +) +@Operator( + group = "linalg" +) public final class Det extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Det operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MatrixDeterminant"; + + private Output output; + + public Det(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new MatrixDeterminant operation. + * * @param scope current scope - * @param input Shape is `[..., M, M]`. + * @param input Shape is {@code [..., M, M]}. + * @param data type for {@code MatrixDeterminant} output and operands * @return a new instance of Det */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Det create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("MatrixDeterminant", scope.makeOpName("Det")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Det"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Det(opBuilder.build()); + return new Det<>(opBuilder.build()); } - + /** - * Shape is `[...]`. + * Gets output. + * Shape is {@code [...]}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixDeterminant"; - - private Output output; - - private Det(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 c295f5bb081..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,71 +17,77 @@ 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; /** * Computes the eigen decomposition of one or more square matrices. - *

* Computes the eigenvalues and (optionally) right eigenvectors of each inner matrix in - * `input` such that `input[..., :, :] = v[..., :, :] * diag(e[..., :])`. The eigenvalues + * {@code input} such that {@code input[..., :, :] = v[..., :, :] * diag(e[..., :])}. The eigenvalues * are sorted in non-decreasing order. - *

{@code
+ * 
  * # a is a tensor.
  * # e is a tensor of eigenvalues.
  * # v is a tensor of eigenvectors.
  * e, v = eig(a)
  * e = eig(a, compute_v=False)
- * }
- * - * - * @param data type for {@code e()} output + *
*/ -@Operator(group = "linalg") +@OpMetadata( + opType = Eig.OP_NAME, + inputsClass = Eig.Inputs.class +) +@Operator( + group = "linalg" +) public final class Eig extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.Eig} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param computeV If `True` then eigenvectors will be computed and returned in `v`. - * Otherwise, only the eigenvalues will be computed. - */ - public Options computeV(Boolean computeV) { - this.computeV = computeV; - return this; - } - - private Boolean computeV; - - private Options() { - } + public static final String OP_NAME = "Eig"; + + private Output e; + + private Output v; + + public Eig(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + e = operation.output(outputIdx++); + v = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Eig operation. - * + * * @param scope current scope - * @param input `Tensor` input of shape `[N, N]`. - * @param Tout - * @param options carries optional attributes values + * @param input {@code Tensor} input of shape {@code [N, N]}. + * @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 */ - @Endpoint(describeByClass = true) - public static Eig create(Scope scope, Operand input, Class Tout, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Eig", scope.makeOpName("Eig")); + @Endpoint( + describeByClass = true + ) + public static Eig create(Scope scope, Operand input, + Class Tout, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Eig"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tout", Operands.toDataType(Tout)); if (options != null) { for (Options opts : options) { @@ -90,41 +96,92 @@ public static Eig create(Scope scope, Operand(opBuilder.build()); + return new Eig<>(opBuilder.build()); } - + /** - * @param computeV If `True` then eigenvectors will be computed and returned in `v`. + * Sets the computeV option. + * + * @param computeV If {@code True} then eigenvectors will be computed and returned in {@code v}. * Otherwise, only the eigenvalues will be computed. + * @return this Options instance. */ public static Options computeV(Boolean computeV) { return new Options().computeV(computeV); } - + /** - * Eigenvalues. Shape is `[N]`. + * Gets e. + * Eigenvalues. Shape is {@code [N]}. + * @return e. */ public Output e() { return e; } - + /** - * Eigenvectors. Shape is `[N, N]`. + * Gets v. + * Eigenvectors. Shape is {@code [N, N]}. + * @return v. */ public Output v() { return v; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Eig"; - - private Output e; - private Output v; - - private Eig(Operation operation) { - super(operation); - int outputIdx = 0; - e = operation.output(outputIdx++); - v = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.Eig} + */ + public static class Options { + private Boolean computeV; + + private Options() { + } + + /** + * Sets the computeV option. + * + * @param computeV If {@code True} then eigenvectors will be computed and returned in {@code v}. + * Otherwise, only the eigenvalues will be computed. + * @return this Options instance. + */ + public Options computeV(Boolean computeV) { + this.computeV = 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 fca8d751c75..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,139 +17,171 @@ 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; /** * Tensor contraction according to Einstein summation convention. - *

* Implements generalized Tensor contraction and reduction. Each input Tensor must * have a corresponding input subscript appearing in the comma-separated left-hand * side of the equation. The right-hand side of the equation consists of the * output subscript. The input subscripts and the output subscript should consist - * of zero or more named axis labels and at most one ellipsis (`...`). - *

- * The named axis labels may be any single character other than those having - * special meaning, namely `,.->`. The behavior of this Op is undefined if it + * of zero or more named axis labels and at most one ellipsis ({@code ...}). + *

The named axis labels may be any single character other than those having + * special meaning, namely {@code ,.->}. The behavior of this Op is undefined if it * receives an ill-formatted equation; since the validation is done at * graph-building time, we omit format validation checks at runtime. - *

- * Note: This Op is not intended to be called by the user; instead users should - * call `tf.einsum` directly. It is a hidden Op used by `tf.einsum`. - *

- * Operations are applied to the input(s) according to the following rules: - *

- * (a) Generalized Diagonals: For input dimensions corresponding to axis labels - * appearing more than once in the same input subscript, we take the - * generalized (`k`-dimensional) diagonal. - * For example, in the equation `iii->i` with input shape `[3, 3, 3]`, the - * generalized diagonal would consist of `3` elements at indices `(0, 0, 0)`, - * `(1, 1, 1)` and `(2, 2, 2)` to create a Tensor of shape `[3]`. - *

- * (b) Reduction: Axes corresponding to labels appearing only in one input - * subscript but not in the output subscript are summed over prior to Tensor - * contraction. - * For example, in the equation `ab,bc->b`, the axis labels `a` and `c` are - * the reduction axis labels. - *

- * (c) Batch Dimensions: Axes corresponding to labels appearing in each of the - * input subscripts and also in the output subscript make up the batch - * dimensions in Tensor contraction. Unnamed axis labels corresponding to - * ellipsis (`...`) also correspond to batch dimensions. - * For example, for the equation denoting batch matrix multiplication, - * `bij,bjk->bik`, the axis label `b` corresponds to a batch dimension. - *

- * (d) Contraction: In case of binary einsum, axes corresponding to labels - * appearing in two different inputs (and not in the output) are contracted - * against each other. - * Considering the batch matrix multiplication equation again - * (`bij,bjk->bik`), the contracted axis label is `j`. - *

- * (e) Expand Diagonal: If the output subscripts contain repeated (explicit) axis - * labels, the opposite operation of (a) is applied. For example, in the - * equation `i->iii`, and input shape `[3]`, the output of shape `[3, 3, 3]` - * are all zeros, except for the (generalized) diagonal which is populated - * with values from the input. - * Note: This operation is not supported by `np.einsum` or `tf.einsum`; it is - * provided to enable computing the symbolic gradient of `tf.einsum`. - *

- * The output subscripts must contain only labels appearing in at least one of the + *

Note: This Op is not intended to be called by the user; instead users should + * call {@code tf.einsum} directly. It is a hidden Op used by {@code tf.einsum}. + *

Operations are applied to the input(s) according to the following rules: + *

(a) Generalized Diagonals: For input dimensions corresponding to axis labels + * appearing more than once in the same input subscript, we take the + * generalized ({@code k}-dimensional) diagonal. + * For example, in the equation {@code iii->i} with input shape {@code [3, 3, 3]}, the + * generalized diagonal would consist of {@code 3} elements at indices {@code (0, 0, 0)}, + * {@code (1, 1, 1)} and {@code (2, 2, 2)} to create a Tensor of shape {@code [3]}. + *

(b) Reduction: Axes corresponding to labels appearing only in one input + * subscript but not in the output subscript are summed over prior to Tensor + * contraction. + * For example, in the equation {@code ab,bc->b}, the axis labels {@code a} and {@code c} are + * the reduction axis labels. + *

(c) Batch Dimensions: Axes corresponding to labels appearing in each of the + * input subscripts and also in the output subscript make up the batch + * dimensions in Tensor contraction. Unnamed axis labels corresponding to + * ellipsis ({@code ...}) also correspond to batch dimensions. + * For example, for the equation denoting batch matrix multiplication, + * {@code bij,bjk->bik}, the axis label {@code b} corresponds to a batch dimension. + *

(d) Contraction: In case of binary einsum, axes corresponding to labels + * appearing in two different inputs (and not in the output) are contracted + * against each other. + * Considering the batch matrix multiplication equation again + * ({@code bij,bjk->bik}), the contracted axis label is {@code j}. + *

(e) Expand Diagonal: If the output subscripts contain repeated (explicit) axis + * labels, the opposite operation of (a) is applied. For example, in the + * equation {@code i->iii}, and input shape {@code [3]}, the output of shape {@code [3, 3, 3]} + * are all zeros, except for the (generalized) diagonal which is populated + * with values from the input. + * Note: This operation is not supported by {@code np.einsum} or {@code tf.einsum}; it is + * provided to enable computing the symbolic gradient of {@code tf.einsum}. + *

The output subscripts must contain only labels appearing in at least one of the * input subscripts. Furthermore, all dimensions mapping to the same axis label * must be equal. - *

- * Any of the input and output subscripts may contain at most a single ellipsis - * (`...`). These ellipsis are mapped against dimensions not corresponding to any + *

Any of the input and output subscripts may contain at most a single ellipsis + * ({@code ...}). These ellipsis are mapped against dimensions not corresponding to any * named axis label. If two inputs contain ellipsis, then they are broadcasted * according to standard NumPy broadcasting - * [rules](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html). - *

- * The broadcasted dimensions are placed in the corresponding location of the + * rules . + *

The broadcasted dimensions are placed in the corresponding location of the * ellipsis in the output subscript. If the broadcasted dimensions are non-empty * and the output subscripts do not contain ellipsis, then an InvalidArgument error * is raised. - *

- * @compatibility(numpy) - * Similar to [`numpy.einsum`](https://docs.scipy.org/doc/numpy/reference/generated/numpy.einsum.html). - *

- * Comparison with `numpy.einsum`: - *

- * * This Op only supports unary and binary forms of `numpy.einsum`. - * * This Op does not support implicit form. (i.e. equations without `->`). - * * This Op also supports repeated indices in the output subscript, which is not - * supported by `numpy.einsum`. - * @end_compatibility - * - * - * @param data type for {@code output()} output + *

{@literal @}compatibility(numpy)
+ * Similar to {@code numpy.einsum} . + *

Comparison with {@code numpy.einsum}: + *

    + *
  • This Op only supports unary and binary forms of {@code numpy.einsum}.
  • + *
  • This Op does not support implicit form. (i.e. equations without {@code ->}).
  • + *
  • This Op also supports repeated indices in the output subscript, which is not + * supported by {@code numpy.einsum}. + *
    {@literal @}end_compatibility
  • + *
*/ -@Operator(group = "linalg") +@OpMetadata( + opType = Einsum.OP_NAME, + inputsClass = Einsum.Inputs.class +) +@Operator( + group = "linalg" +) 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 = "Einsum"; + + private Output output; + + public Einsum(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Einsum operation. - * + * * @param scope current scope * @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 * @return a new instance of Einsum */ - @Endpoint(describeByClass = true) - public static Einsum create(Scope scope, Iterable> inputs, String equation) { - OperationBuilder opBuilder = scope.env().opBuilder("Einsum", scope.makeOpName("Einsum")); + @Endpoint( + describeByClass = true + ) + public static Einsum create(Scope scope, Iterable> inputs, + String equation) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Einsum"); opBuilder.addInputList(Operands.asOutputs(inputs)); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("equation", equation); - return new Einsum(opBuilder.build()); + return new Einsum<>(opBuilder.build()); } - + /** - * Output Tensor with shape depending upon `equation`. + * Gets output. + * Output Tensor with shape depending upon {@code equation}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Einsum"; - - private Output output; - - private Einsum(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 2a30dd97d5d..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,65 +17,70 @@ 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; /** * Computes the euclidean norm of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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 */ -@Operator(group = "linalg") +@OpMetadata( + opType = EuclideanNorm.OP_NAME, + inputsClass = EuclideanNorm.Inputs.class +) +@Operator( + group = "linalg" +) public final class EuclideanNorm extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.EuclideanNorm} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "EuclideanNorm"; + + private Output output; + + public EuclideanNorm(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new EuclideanNorm operation. - * + * * @param scope current scope * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values + * @param data type for {@code EuclideanNorm} output and operands * @return a new instance of EuclideanNorm */ - @Endpoint(describeByClass = true) - public static EuclideanNorm create(Scope scope, Operand input, Operand axis, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("EuclideanNorm", scope.makeOpName("EuclideanNorm")); + @Endpoint( + describeByClass = true + ) + public static EuclideanNorm create(Scope scope, Operand input, + Operand axis, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "EuclideanNorm"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.keepDims != null) { @@ -83,36 +88,92 @@ public static EuclideanNorm create(Scope scope, Operand } } } - return new EuclideanNorm(opBuilder.build()); + return new EuclideanNorm<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets output. * The reduced tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EuclideanNorm"; - - private Output output; - - private EuclideanNorm(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.EuclideanNorm} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = 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 7152fceefe8..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,67 +17,68 @@ 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; /** * Computes the inverse of one or more square invertible matrices or their adjoints (conjugate transposes). - *

- * - * The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions + * 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 inverse for all input submatrices `[..., :, :]`. - *

- * The op uses LU decomposition with partial pivoting to compute the inverses. - *

- * If a matrix is not invertible there is no guarantee what the op does. It + * containing the inverse for all input submatrices {@code [..., :, :]}. + *

The op uses LU decomposition with partial pivoting to compute the inverses. + *

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 */ -@Operator(group = "linalg") +@OpMetadata( + opType = Inv.OP_NAME, + inputsClass = Inv.Inputs.class +) +@Operator( + group = "linalg" +) public final class Inv extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.Inv} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param adjoint - */ - public Options adjoint(Boolean adjoint) { - this.adjoint = adjoint; - return this; - } - - private Boolean adjoint; - - private Options() { - } + public static final String OP_NAME = "MatrixInverse"; + + private Output output; + + public Inv(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Inv operation. - * + * Factory method to create a class wrapping a new MatrixInverse operation. + * * @param scope current scope - * @param input Shape is `[..., M, M]`. - * @param options carries optional attributes values + * @param input Shape is {@code [..., M, M]}. + * @param options carries optional attribute values + * @param data type for {@code MatrixInverse} output and operands * @return a new instance of Inv */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Inv create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MatrixInverse", scope.makeOpName("Inv")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Inv"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.adjoint != null) { @@ -85,40 +86,82 @@ public static Inv create(Scope scope, Operand input, Opt } } } - return new Inv(opBuilder.build()); + return new Inv<>(opBuilder.build()); } - + /** - * @param adjoint + * Sets the adjoint option. + * + * @param adjoint the adjoint option + * @return this Options instance. */ public static Options adjoint(Boolean adjoint) { return new Options().adjoint(adjoint); } - + /** - * Shape is `[..., M, M]`. - *

- * @compatibility(numpy) + * Gets output. + * Shape is {@code [..., M, M]}. + *

{@literal @}compatibility(numpy)
* Equivalent to np.linalg.inv - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixInverse"; - - private Output output; - - private Inv(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.Inv} + */ + public static class Options { + private Boolean adjoint; + + private Options() { + } + + /** + * Sets the adjoint option. + * + * @param adjoint the adjoint option + * @return this Options instance. + */ + public Options adjoint(Boolean adjoint) { + this.adjoint = 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 936b81a75bb..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,117 +17,110 @@ 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; import org.tensorflow.types.TString; /** - * Loads a 2-D (matrix) `Tensor` with name `old_tensor_name` from the checkpoint - *

- * at `ckpt_path` and potentially reorders its rows and columns using the + * Loads a 2-D (matrix) {@code Tensor} with name {@code old_tensor_name} from the checkpoint + * at {@code ckpt_path} and potentially reorders its rows and columns using the * specified remappings. - *

- * Most users should use one of the wrapper initializers (such as - * `tf.contrib.framework.load_and_remap_matrix_initializer`) instead of this + *

Most users should use one of the wrapper initializers (such as + * {@code tf.contrib.framework.load_and_remap_matrix_initializer}) instead of this * function directly. - *

- * The remappings are 1-D tensors with the following properties: + *

The remappings are 1-D tensors with the following properties: *

    - *
  • - * `row_remapping` must have exactly `num_rows` entries. Row `i` of the output - * matrix will be initialized from the row corresponding to index - * `row_remapping[i]` in the old `Tensor` from the checkpoint. - *
  • - *
  • - * `col_remapping` must have either 0 entries (indicating that no column - * reordering is needed) or `num_cols` entries. If specified, column `j` of the - * output matrix will be initialized from the column corresponding to index - * `col_remapping[j]` in the old `Tensor` from the checkpoint. - *
  • - *
  • - * A value of -1 in either of the remappings signifies a "missing" entry. In that - * case, values from the `initializing_values` tensor will be used to fill that - * missing row or column. If `row_remapping` has `r` missing entries and - * `col_remapping` has `c` missing entries, then the following condition must be - * true: - *
  • + *
  • {@code row_remapping} must have exactly {@code num_rows} entries. Row {@code i} of the output + * matrix will be initialized from the row corresponding to index + * {@code row_remapping[i]} in the old {@code Tensor} from the checkpoint.
  • + *
  • {@code col_remapping} must have either 0 entries (indicating that no column + * reordering is needed) or {@code num_cols} entries. If specified, column {@code j} of the + * output matrix will be initialized from the column corresponding to index + * {@code col_remapping[j]} in the old {@code Tensor} from the checkpoint.
  • + *
  • A value of -1 in either of the remappings signifies a "missing" entry. In that + * case, values from the {@code initializing_values} tensor will be used to fill that + * missing row or column. If {@code row_remapping} has {@code r} missing entries and + * {@code col_remapping} has {@code c} missing entries, then the following condition must be + * true:
  • *
- * `(r * num_cols) + (c * num_rows) - (r * c) == len(initializing_values)` - *

- * The remapping tensors can be generated using the GenerateVocabRemapping op. - *

- * As an example, with row_remapping = [1, 0, -1], col_remapping = [0, 2, -1], + *

{@code (r * num_cols) + (c * num_rows) - (r * c) == len(initializing_values)} + *

The remapping tensors can be generated using the GenerateVocabRemapping op. + *

As an example, with row_remapping = [1, 0, -1], col_remapping = [0, 2, -1], * initializing_values = [0.5, -0.5, 0.25, -0.25, 42], and w(i, j) representing * the value from row i, column j of the old tensor in the checkpoint, the output * matrix will look like the following: - *

- * [[w(1, 0), w(1, 2), 0.5], - * [w(0, 0), w(0, 2), -0.5], - * [0.25, -0.25, 42]] + *

[[w(1, 0), w(1, 2), 0.5], + * [w(0, 0), w(0, 2), -0.5], + * [0.25, -0.25, 42]] */ -@Operator(group = "linalg") +@OpMetadata( + opType = LoadAndRemapMatrix.OP_NAME, + inputsClass = LoadAndRemapMatrix.Inputs.class +) +@Operator( + group = "linalg" +) public final class LoadAndRemapMatrix extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.LoadAndRemapMatrix} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param maxRowsInMemory 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 Options maxRowsInMemory(Long maxRowsInMemory) { - this.maxRowsInMemory = maxRowsInMemory; - return this; - } - - private Long maxRowsInMemory; - - private Options() { - } + public static final String OP_NAME = "LoadAndRemapMatrix"; + + private Output outputMatrix; + + public LoadAndRemapMatrix(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputMatrix = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new LoadAndRemapMatrix operation. - * + * * @param scope current scope - * @param ckptPath Path to the TensorFlow checkpoint (version 2, `TensorBundle`) from - * which the old matrix `Tensor` will be loaded. - * @param oldTensorName Name of the 2-D `Tensor` to load from checkpoint. - * @param rowRemapping An int `Tensor` of row remappings (generally created by - * `generate_vocab_remapping`). Even if no row remapping is needed, this must + * @param ckptPath Path to the TensorFlow checkpoint (version 2, {@code TensorBundle}) from + * which the old matrix {@code Tensor} will be loaded. + * @param oldTensorName Name of the 2-D {@code Tensor} to load from checkpoint. + * @param rowRemapping 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 `Tensor` (e.g. [8, 9, 10, ...], for partitioned `Variables`). - * @param colRemapping An int `Tensor` of column remappings (generally created by - * `generate_vocab_remapping`). May be a size-0 `Tensor` if only row remapping + * index-valued {@code Tensor} (e.g. [8, 9, 10, ...], for partitioned {@code Variables}). + * @param colRemapping 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). - * @param initializingValues A float `Tensor` containing values to fill in for cells + * @param initializingValues 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. * @param numRows Number of rows (length of the 1st dimension) in the output matrix. * @param numCols Number of columns (length of the 2nd dimension) in the output matrix. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of LoadAndRemapMatrix */ - @Endpoint(describeByClass = true) - public static LoadAndRemapMatrix create(Scope scope, Operand ckptPath, Operand oldTensorName, Operand rowRemapping, Operand colRemapping, Operand initializingValues, Long numRows, Long numCols, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("LoadAndRemapMatrix", scope.makeOpName("LoadAndRemapMatrix")); + @Endpoint( + describeByClass = true + ) + public static LoadAndRemapMatrix create(Scope scope, Operand ckptPath, + Operand oldTensorName, Operand rowRemapping, Operand colRemapping, + Operand initializingValues, Long numRows, Long numCols, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadAndRemapMatrix"); opBuilder.addInput(ckptPath.asOutput()); opBuilder.addInput(oldTensorName.asOutput()); opBuilder.addInput(rowRemapping.asOutput()); opBuilder.addInput(colRemapping.asOutput()); opBuilder.addInput(initializingValues.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_rows", numRows); opBuilder.setAttr("num_cols", numCols); if (options != null) { @@ -139,37 +132,122 @@ public static LoadAndRemapMatrix create(Scope scope, Operand ckptPath, } return new LoadAndRemapMatrix(opBuilder.build()); } - + /** + * Sets the maxRowsInMemory option. + * * @param maxRowsInMemory 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. + * @return this Options instance. */ public static Options maxRowsInMemory(Long maxRowsInMemory) { return new Options().maxRowsInMemory(maxRowsInMemory); } - + /** + * Gets outputMatrix. * Output matrix containing existing values loaded from the * checkpoint, and with any missing values filled in from initializing_values. + * @return outputMatrix. */ public Output outputMatrix() { return outputMatrix; } - + @Override public Output asOutput() { return outputMatrix; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadAndRemapMatrix"; - - private Output outputMatrix; - - private LoadAndRemapMatrix(Operation operation) { - super(operation); - int outputIdx = 0; - outputMatrix = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.LoadAndRemapMatrix} + */ + public static class Options { + private Long maxRowsInMemory; + + private Options() { + } + + /** + * Sets the maxRowsInMemory option. + * + * @param maxRowsInMemory 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. + * @return this Options instance. + */ + public Options maxRowsInMemory(Long maxRowsInMemory) { + this.maxRowsInMemory = 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 082d8c96fb7..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,74 +17,112 @@ 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; /** * Computes the sign and the log of the absolute value of the determinant of - *

* one or more square matrices. - *

- * The input is a tensor of shape `[N, M, M]` whose inner-most 2 dimensions + *

The input is a tensor of shape {@code [N, M, M]} whose inner-most 2 dimensions * form square matrices. The outputs are two tensors containing the signs and * absolute values of the log determinants for all N input submatrices - * `[..., :, :]` such that `determinant = sign*exp(log_abs_determinant)`. - * The `log_abs_determinant` is computed as `det(P)*sum(log(diag(LU)))` where `LU` - * is the `LU` decomposition of the input and `P` is the corresponding + * {@code [..., :, :]} such that {@code determinant = sign*exp(log_abs_determinant)}. + * 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 */ -@Operator(group = "linalg") +@OpMetadata( + opType = LogMatrixDeterminant.OP_NAME, + inputsClass = LogMatrixDeterminant.Inputs.class +) +@Operator( + group = "linalg" +) public final class LogMatrixDeterminant extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LogMatrixDeterminant"; + + private Output sign; + + private Output logAbsDeterminant; + + public LogMatrixDeterminant(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + sign = operation.output(outputIdx++); + logAbsDeterminant = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LogMatrixDeterminant operation. - * + * * @param scope current scope - * @param input Shape is `[N, M, M]`. + * @param input Shape is {@code [N, M, M]}. + * @param data type for {@code LogMatrixDeterminant} output and operands * @return a new instance of LogMatrixDeterminant */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static LogMatrixDeterminant create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("LogMatrixDeterminant", scope.makeOpName("LogMatrixDeterminant")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LogMatrixDeterminant"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new LogMatrixDeterminant(opBuilder.build()); + return new LogMatrixDeterminant<>(opBuilder.build()); } - + /** - * The signs of the log determinants of the inputs. Shape is `[N]`. + * Gets sign. + * The signs of the log determinants of the inputs. Shape is {@code [N]}. + * @return sign. */ public Output sign() { return sign; } - + /** + * Gets logAbsDeterminant. * The logs of the absolute values of the determinants - * of the N input matrices. Shape is `[N]`. + * of the N input matrices. Shape is {@code [N]}. + * @return logAbsDeterminant. */ public Output logAbsDeterminant() { return logAbsDeterminant; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LogMatrixDeterminant"; - - private Output sign; - private Output logAbsDeterminant; - - private LogMatrixDeterminant(Operation operation) { - super(operation); - int outputIdx = 0; - sign = operation.output(outputIdx++); - logAbsDeterminant = operation.output(outputIdx++); + + @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 3edb62f927a..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,110 +17,156 @@ 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; /** * Computes the LU decomposition of one or more square matrices. - *

- * The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions + * The input is a tensor of shape {@code [..., M, M]} whose inner-most 2 dimensions * form square matrices. - *

- * The input has to be invertible. - *

- * The output consists of two tensors LU and P containing the LU decomposition - * of all input submatrices `[..., :, :]`. LU encodes the lower triangular and + *

The input has to be invertible. + *

The output consists of two tensors LU and P containing the LU decomposition + * of all input submatrices {@code [..., :, :]}. LU encodes the lower triangular and * upper triangular factors. - *

- * For each input submatrix of shape `[M, M]`, L is a lower triangular matrix of - * shape `[M, M]` with unit diagonal whose entries correspond to the strictly lower - * triangular part of LU. U is a upper triangular matrix of shape `[M, M]` whose + *

For each input submatrix of shape {@code [M, M]}, L is a lower triangular matrix of + * shape {@code [M, M]} with unit diagonal whose entries correspond to the strictly lower + * triangular part of LU. U is a upper triangular matrix of shape {@code [M, M]} whose * entries correspond to the upper triangular part, including the diagonal, of LU. - *

- * P represents a permutation matrix encoded as a list of indices each between `0` - * and `M-1`, inclusive. If P_mat denotes the permutation matrix corresponding to + *

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 */ -@Operator(group = "linalg") +@OpMetadata( + opType = Lu.OP_NAME, + inputsClass = Lu.Inputs.class +) +@Operator( + group = "linalg" +) public final class Lu extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Lu"; + + private Output lu; + + private Output p; + + public Lu(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + lu = operation.output(outputIdx++); + p = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Lu operation. - * + * * @param scope current scope - * @param input A tensor of shape `[..., M, M]` whose inner-most 2 dimensions form matrices of - * size `[M, M]`. - * @param outputIdxType + * @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 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 */ - @Endpoint(describeByClass = true) - public static Lu create(Scope scope, Operand input, Class outputIdxType) { - OperationBuilder opBuilder = scope.env().opBuilder("Lu", scope.makeOpName("Lu")); + @Endpoint( + describeByClass = true + ) + public static Lu create(Scope scope, Operand input, + Class outputIdxType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Lu"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_idx_type", Operands.toDataType(outputIdxType)); - return new Lu(opBuilder.build()); + return new Lu<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Lu operation using default output types. - * + * Factory method to create a class wrapping a new Lu operation, with the default output types. + * * @param scope current scope - * @param input A tensor of shape `[..., M, M]` whose inner-most 2 dimensions form matrices of - * size `[M, M]`. - * @return a new instance of Lu + * @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 + * @return a new instance of Lu, with default output types */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Lu create(Scope scope, Operand input) { return create(scope, input, TInt32.class); } - + /** - * A tensor of shape `[..., M, M]` whose strictly lower triangular part denotes the - * lower triangular factor `L` with unit diagonal, and whose upper triangular part - * denotes the upper triangular factor `U`. + * Gets lu. + * A tensor of shape {@code [..., M, M]} whose strictly lower triangular part denotes the + * lower triangular factor {@code L} with unit diagonal, and whose upper triangular part + * denotes the upper triangular factor {@code U}. + * @return lu. */ public Output lu() { return lu; } - + /** - * Permutation of the rows encoded as a list of indices in `0..M-1`. Shape is - * `[..., M]`. - * @compatibility(scipy) - * Similar to `scipy.linalg.lu`, except the triangular factors `L` and `U` are - * packed into a single tensor, the permutation is applied to `input` instead of - * the right hand side and the permutation `P` is returned as a list of indices + * Gets p. + * Permutation of the rows encoded as a list of indices in {@code 0..M-1}. Shape is + * {@code [..., M]}. + * {@literal @}compatibility(scipy)
+ * Similar to {@code scipy.linalg.lu}, except the triangular factors {@code L} and {@code U} are + * packed into a single tensor, the permutation is applied to {@code input} instead of + * the right hand side and the permutation {@code P} is returned as a list of indices * instead of a permutation matrix. - * @end_compatibility + *
{@literal @}end_compatibility + * @return p. */ public Output p() { return p; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Lu"; - - private Output lu; - private Output p; - - private Lu(Operation operation) { - super(operation); - int outputIdx = 0; - lu = operation.output(outputIdx++); - p = operation.output(outputIdx++); + + @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 5e5b010baec..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,75 +17,70 @@ 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; /** - * Multiply the matrix "a" by the matrix "b". - *

+ * Multiply the matrix "a" by the matrix "b". * The inputs must be two-dimensional matrices and the inner dimension of - * "a" (after being transposed if transpose_a is true) must match the - * outer dimension of "b" (after being transposed if transposed_b is + * "a" (after being transposed if transpose_a is true) must match the + * outer dimension of "b" (after being transposed if transposed_b is * true). - *

- * Note: The default kernel implementation for MatMul on GPUs uses + *

Note: The default kernel implementation for MatMul on GPUs uses * cublas. - * - * @param data type for {@code product()} output */ -@Operator(group = "linalg") +@OpMetadata( + opType = MatMul.OP_NAME, + inputsClass = MatMul.Inputs.class +) +@Operator( + group = "linalg" +) public final class MatMul extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.MatMul} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param transposeA If true, "a" is transposed before multiplication. - */ - public Options transposeA(Boolean transposeA) { - this.transposeA = transposeA; - return this; - } - - /** - * @param transposeB If true, "b" is transposed before multiplication. - */ - public Options transposeB(Boolean transposeB) { - this.transposeB = transposeB; - return this; - } - - private Boolean transposeA; - private Boolean transposeB; - - private Options() { - } + public static final String OP_NAME = "MatMul"; + + private Output product; + + public MatMul(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + product = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new MatMul operation. - * + * * @param scope current scope - * @param a - * @param b - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static MatMul create(Scope scope, Operand a, Operand b, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MatMul", scope.makeOpName("MatMul")); + @Endpoint( + describeByClass = true + ) + public static MatMul create(Scope scope, Operand a, Operand b, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MatMul"); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.transposeA != null) { @@ -94,44 +89,180 @@ 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()); + return new MatMul<>(opBuilder.build()); } - + /** - * @param transposeA If true, "a" is transposed before multiplication. + * Sets the transposeA option. + * + * @param transposeA If true, "a" is transposed before multiplication. + * @return this Options instance. */ public static Options transposeA(Boolean transposeA) { return new Options().transposeA(transposeA); } - + /** - * @param transposeB If true, "b" is transposed before multiplication. + * Sets the transposeB option. + * + * @param transposeB If true, "b" is transposed before multiplication. + * @return this Options instance. */ 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. + * + * @return product. */ public Output product() { return product; } - + @Override public Output asOutput() { return product; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatMul"; - - private Output product; - - private MatMul(Operation operation) { - super(operation); - int outputIdx = 0; - product = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.MatMul} + */ + public static class Options { + private Boolean transposeA; + + private Boolean transposeB; + + private Boolean gradA; + + private Boolean gradB; + + private Options() { + } + + /** + * Sets the transposeA option. + * + * @param transposeA If true, "a" is transposed before multiplication. + * @return this Options instance. + */ + public Options transposeA(Boolean transposeA) { + this.transposeA = transposeA; + return this; + } + + /** + * Sets the transposeB option. + * + * @param transposeB If true, "b" is transposed before multiplication. + * @return this Options instance. + */ + 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 1187bf3d865..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,56 +17,58 @@ 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; /** * Returns a batched diagonal tensor with given batched diagonal values. - *

- * Returns a tensor with the contents in `diagonal` as `k[0]`-th to `k[1]`-th - * diagonals of a matrix, with everything else padded with `padding`. `num_rows` - * and `num_cols` specify the dimension of the innermost matrix of the output. If + * Returns a tensor with the contents in {@code diagonal} as {@code k[0]}-th to {@code k[1]}-th + * diagonals of a matrix, with everything else padded with {@code padding}. {@code num_rows} + * and {@code num_cols} specify the dimension of the innermost matrix of the output. If * both are not specified, the op assumes the innermost matrix is square and infers - * its size from `k` and the innermost dimension of `diagonal`. If only one of them + * its size from {@code k} and the innermost dimension of {@code diagonal}. If only one of them * is specified, the op assumes the unspecified value is the smallest possible * based on other criteria. - *

- * Let `diagonal` have `r` dimensions `[I, J, ..., L, M, N]`. The output tensor has - * rank `r+1` with shape `[I, J, ..., L, M, num_rows, num_cols]` when only one - * diagonal is given (`k` is an integer or `k[0] == k[1]`). Otherwise, it has rank - * `r` with shape `[I, J, ..., L, num_rows, num_cols]`. - *

- * The second innermost dimension of `diagonal` has double meaning. - * When `k` is scalar or `k[0] == k[1]`, `M` is part of the batch size + *

Let {@code diagonal} have {@code r} dimensions {@code [I, J, ..., L, M, N]}. The output tensor has + * rank {@code r+1} with shape {@code [I, J, ..., L, M, num_rows, num_cols]} when only one + * diagonal is given ({@code k} is an integer or {@code k[0] == k[1]}). Otherwise, it has rank + * {@code r} with shape {@code [I, J, ..., L, num_rows, num_cols]}. + *

The second innermost dimension of {@code diagonal} has double meaning. + * When {@code k} is scalar or {@code k[0] == k[1]}, {@code M} is part of the batch size * [I, J, ..., M], and the output tensor is: - *

{@code
+ * 
  * output[i, j, ..., l, m, n]
  *   = diagonal[i, j, ..., l, n-max(d_upper, 0)] ; if n - m == d_upper
  *     padding_value                             ; otherwise
- * }
- * Otherwise, `M` is treated as the number of diagonals for the matrix in the - * same batch (`M = k[1]-k[0]+1`), and the output tensor is: - *
{@code
+ * 
+ *

Otherwise, {@code M} is treated as the number of diagonals for the matrix in the + * same batch ({@code M = k[1]-k[0]+1}), and the output tensor is: + *

  * output[i, j, ..., l, m, n]
- *   = diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]
+ *   = diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]
  *     padding_value                                     ; otherwise
- * }
- * where `d = n - m`, `diag_index = k[1] - d`, and `index_in_diag = n - max(d, 0)`. - *

- * For example: - *

{@code
+ * 
+ *

where {@code d = n - m}, {@code diag_index = k[1] - d}, and {@code index_in_diag = n - max(d, 0)}. + *

For example: + *

  * # The main diagonal.
  * diagonal = np.array([[1, 2, 3, 4],            # Input shape: (2, 4)
  *                      [5, 6, 7, 8]])
- * tf.matrix_diag(diagonal) ==> [[[1, 0, 0, 0],  # Output shape: (2, 4, 4)
+ * tf.matrix_diag(diagonal) ==> [[[1, 0, 0, 0],  # Output shape: (2, 4, 4)
  *                                [0, 2, 0, 0],
  *                                [0, 0, 3, 0],
  *                                [0, 0, 0, 4]],
@@ -74,12 +76,12 @@
  *                                [0, 6, 0, 0],
  *                                [0, 0, 7, 0],
  *                                [0, 0, 0, 8]]]
- * 
+ *
  * # A superdiagonal (per batch).
  * diagonal = np.array([[1, 2, 3],  # Input shape: (2, 3)
  *                      [4, 5, 6]])
  * tf.matrix_diag(diagonal, k = 1)
- *   ==> [[[0, 1, 0, 0],  # Output shape: (2, 4, 4)
+ *   ==> [[[0, 1, 0, 0],  # Output shape: (2, 4, 4)
  *         [0, 0, 2, 0],
  *         [0, 0, 0, 3],
  *         [0, 0, 0, 0]],
@@ -87,91 +89,155 @@
  *         [0, 0, 5, 0],
  *         [0, 0, 0, 6],
  *         [0, 0, 0, 0]]]
- * 
+ *
  * # A band of diagonals.
  * diagonals = np.array([[[1, 2, 3],  # Input shape: (2, 2, 3)
  *                        [4, 5, 0]],
  *                       [[6, 7, 9],
  *                        [9, 1, 0]]])
  * tf.matrix_diag(diagonals, k = (-1, 0))
- *   ==> [[[1, 0, 0],  # Output shape: (2, 3, 3)
+ *   ==> [[[1, 0, 0],  # Output shape: (2, 3, 3)
  *         [4, 2, 0],
  *         [0, 5, 3]],
  *        [[6, 0, 0],
  *         [9, 7, 0],
  *         [0, 1, 9]]]
- * 
+ *
  * # Rectangular matrix.
  * diagonal = np.array([1, 2])  # Input shape: (2)
  * tf.matrix_diag(diagonal, k = -1, num_rows = 3, num_cols = 4)
- *   ==> [[0, 0, 0, 0],  # Output shape: (3, 4)
+ *   ==> [[0, 0, 0, 0],  # Output shape: (3, 4)
  *        [1, 0, 0, 0],
  *        [0, 2, 0, 0]]
- * 
+ *
  * # Rectangular matrix with inferred num_cols and padding_value = 9.
  * tf.matrix_diag(diagonal, k = -1, num_rows = 3, padding_value = 9)
- *   ==> [[9, 9],  # Output shape: (3, 2)
+ *   ==> [[9, 9],  # Output shape: (3, 2)
  *        [1, 9],
  *        [9, 2]]
- * }
- * - * - * @param data type for {@code output()} output + *
*/ -@Operator(group = "linalg") +@OpMetadata( + opType = MatrixDiag.OP_NAME, + inputsClass = MatrixDiag.Inputs.class +) +@Operator( + group = "linalg" +) public final class MatrixDiag extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new MatrixDiag operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MatrixDiagV2"; + + private Output output; + + public MatrixDiag(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new MatrixDiagV2 operation. + * * @param scope current scope - * @param diagonal Rank `r`, where `r >= 1` + * @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. `k` can be a single integer + * 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. `k[0]` must not be larger than `k[1]`. + * of a matrix band. {@code k[0]} must not be larger than {@code k[1]}. * @param numRows 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 `diagonal`. + * innermost dimension of {@code diagonal}. * @param numCols 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 `diagonal`. + * k and the innermost dimension of {@code diagonal}. * @param paddingValue The number to fill the area outside the specified diagonal band with. * Default is 0. + * @param data type for {@code MatrixDiagV2} output and operands * @return a new instance of MatrixDiag */ - @Endpoint(describeByClass = true) - public static MatrixDiag create(Scope scope, Operand diagonal, Operand k, Operand numRows, Operand numCols, Operand paddingValue) { - OperationBuilder opBuilder = scope.env().opBuilder("MatrixDiagV2", scope.makeOpName("MatrixDiag")); + @Endpoint( + describeByClass = true + ) + public static MatrixDiag create(Scope scope, Operand diagonal, + Operand k, Operand numRows, Operand numCols, + Operand paddingValue) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MatrixDiag"); opBuilder.addInput(diagonal.asOutput()); opBuilder.addInput(k.asOutput()); opBuilder.addInput(numRows.asOutput()); opBuilder.addInput(numCols.asOutput()); opBuilder.addInput(paddingValue.asOutput()); - opBuilder = scope.apply(opBuilder); - return new MatrixDiag(opBuilder.build()); + return new MatrixDiag<>(opBuilder.build()); } - + /** - * Has rank `r+1` when `k` is an integer or `k[0] == k[1]`, rank `r` otherwise. + * Gets output. + * Has rank {@code r+1} when {@code k} is an integer or {@code k[0] == k[1]}, rank {@code r} otherwise. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixDiagV2"; - - private Output output; - - private MatrixDiag(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 c56d2557755..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,135 +17,182 @@ 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; /** * Returns the batched diagonal part of a batched tensor. - *

- * Returns a tensor with the `k[0]`-th to `k[1]`-th diagonals of the batched - * `input`. - *

- * Assume `input` has `r` dimensions `[I, J, ..., L, M, N]`. - * Let `max_diag_len` be the maximum length among all diagonals to be extracted, - * `max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0))` - * Let `num_diags` be the number of diagonals to extract, - * `num_diags = k[1] - k[0] + 1`. - *

- * If `num_diags == 1`, the output tensor is of rank `r - 1` with shape - * `[I, J, ..., L, max_diag_len]` and values: - *

{@code
+ * Returns a tensor with the {@code k[0]}-th to {@code k[1]}-th diagonals of the batched
+ * {@code input}.
+ * 

Assume {@code input} has {@code r} dimensions {@code [I, J, ..., L, M, N]}. + * Let {@code max_diag_len} be the maximum length among all diagonals to be extracted, + * {@code max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0))} + * Let {@code num_diags} be the number of diagonals to extract, + * {@code num_diags = k[1] - k[0] + 1}. + *

If {@code num_diags == 1}, the output tensor is of rank {@code r - 1} with shape + * {@code [I, J, ..., L, max_diag_len]} and values: + *

  * diagonal[i, j, ..., l, n]
- *   = input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
+ *   = input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
  *     padding_value                 ; otherwise.
- * }
- * where `y = max(-k[1], 0)`, `x = max(k[1], 0)`. - *

- * Otherwise, the output tensor has rank `r` with dimensions - * `[I, J, ..., L, num_diags, max_diag_len]` with values: - *

{@code
+ * 
+ *

where {@code y = max(-k[1], 0)}, {@code x = max(k[1], 0)}. + *

Otherwise, the output tensor has rank {@code r} with dimensions + * {@code [I, J, ..., L, num_diags, max_diag_len]} with values: + *

  * diagonal[i, j, ..., l, m, n]
- *   = input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
+ *   = input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
  *     padding_value                 ; otherwise.
- * }
- * where `d = k[1] - m`, `y = max(-d, 0)`, and `x = max(d, 0)`. - *

- * The input must be at least a matrix. - *

- * For example: - *

{@code
+ * 
+ *

where {@code d = k[1] - m}, {@code y = max(-d, 0)}, and {@code x = max(d, 0)}. + *

The input must be at least a matrix. + *

For example: + *

  * input = np.array([[[1, 2, 3, 4],  # Input shape: (2, 3, 4)
  *                    [5, 6, 7, 8],
  *                    [9, 8, 7, 6]],
  *                   [[5, 4, 3, 2],
  *                    [1, 2, 3, 4],
  *                    [5, 6, 7, 8]]])
- * 
+ *
  * # A main diagonal from each batch.
- * tf.matrix_diag_part(input) ==> [[1, 6, 7],  # Output shape: (2, 3)
+ * tf.matrix_diag_part(input) ==> [[1, 6, 7],  # Output shape: (2, 3)
  *                                 [5, 2, 7]]
- * 
+ *
  * # A superdiagonal from each batch.
  * tf.matrix_diag_part(input, k = 1)
- *   ==> [[2, 7, 6],  # Output shape: (2, 3)
+ *   ==> [[2, 7, 6],  # Output shape: (2, 3)
  *        [4, 3, 8]]
- * 
+ *
  * # A tridiagonal band from each batch.
  * tf.matrix_diag_part(input, k = (-1, 1))
- *   ==> [[[2, 7, 6],  # Output shape: (2, 3, 3)
+ *   ==> [[[2, 7, 6],  # Output shape: (2, 3, 3)
  *         [1, 6, 7],
  *         [5, 8, 0]],
  *        [[4, 3, 8],
  *         [5, 2, 7],
  *         [1, 6, 0]]]
- * 
+ *
  * # Padding value = 9
  * tf.matrix_diag_part(input, k = (1, 3), padding_value = 9)
- *   ==> [[[4, 9, 9],  # Output shape: (2, 3, 3)
+ *   ==> [[[4, 9, 9],  # Output shape: (2, 3, 3)
  *         [3, 8, 9],
  *         [2, 7, 6]],
  *        [[2, 9, 9],
  *         [3, 4, 9],
  *         [4, 3, 8]]]
- * }
- * - * - * @param data type for {@code diagonal()} output + *
*/ -@Operator(group = "linalg") +@OpMetadata( + opType = MatrixDiagPart.OP_NAME, + inputsClass = MatrixDiagPart.Inputs.class +) +@Operator( + group = "linalg" +) public final class MatrixDiagPart extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new MatrixDiagPart operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MatrixDiagPartV2"; + + private Output diagonal; + + public MatrixDiagPart(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + diagonal = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new MatrixDiagPartV2 operation. + * * @param scope current scope - * @param input Rank `r` tensor where `r >= 2`. + * @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. `k` can be a single integer + * 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. `k[0]` must not be larger than `k[1]`. + * of a matrix band. {@code k[0]} must not be larger than {@code k[1]}. * @param paddingValue The value to fill the area outside the specified diagonal band with. * Default is 0. + * @param data type for {@code MatrixDiagPartV2} output and operands * @return a new instance of MatrixDiagPart */ - @Endpoint(describeByClass = true) - public static MatrixDiagPart create(Scope scope, Operand input, Operand k, Operand paddingValue) { - OperationBuilder opBuilder = scope.env().opBuilder("MatrixDiagPartV2", scope.makeOpName("MatrixDiagPart")); + @Endpoint( + describeByClass = true + ) + public static MatrixDiagPart create(Scope scope, Operand input, + Operand k, Operand paddingValue) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MatrixDiagPart"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(k.asOutput()); opBuilder.addInput(paddingValue.asOutput()); - opBuilder = scope.apply(opBuilder); - return new MatrixDiagPart(opBuilder.build()); + return new MatrixDiagPart<>(opBuilder.build()); } - + /** + * Gets diagonal. * The extracted diagonal(s). + * @return diagonal. */ public Output diagonal() { return diagonal; } - + @Override public Output asOutput() { return diagonal; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixDiagPartV2"; - - private Output diagonal; - - private MatrixDiagPart(Operation operation) { - super(operation); - int outputIdx = 0; - diagonal = operation.output(outputIdx++); + + @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 04cb6fc3b17..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,80 +17,79 @@ 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; /** * Returns the batched diagonal part of a batched tensor. - *

- * Returns a tensor with the `k[0]`-th to `k[1]`-th diagonals of the batched - * `input`. - *

- * Assume `input` has `r` dimensions `[I, J, ..., L, M, N]`. - * Let `max_diag_len` be the maximum length among all diagonals to be extracted, - * `max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0))` - * Let `num_diags` be the number of diagonals to extract, - * `num_diags = k[1] - k[0] + 1`. - *

- * If `num_diags == 1`, the output tensor is of rank `r - 1` with shape - * `[I, J, ..., L, max_diag_len]` and values: - *

{@code
+ * Returns a tensor with the {@code k[0]}-th to {@code k[1]}-th diagonals of the batched
+ * {@code input}.
+ * 

Assume {@code input} has {@code r} dimensions {@code [I, J, ..., L, M, N]}. + * Let {@code max_diag_len} be the maximum length among all diagonals to be extracted, + * {@code max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0))} + * Let {@code num_diags} be the number of diagonals to extract, + * {@code num_diags = k[1] - k[0] + 1}. + *

If {@code num_diags == 1}, the output tensor is of rank {@code r - 1} with shape + * {@code [I, J, ..., L, max_diag_len]} and values: + *

  * diagonal[i, j, ..., l, n]
- *   = input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
+ *   = input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
  *     padding_value                 ; otherwise.
- * }
- * where `y = max(-k[1], 0)`, `x = max(k[1], 0)`. - *

- * Otherwise, the output tensor has rank `r` with dimensions - * `[I, J, ..., L, num_diags, max_diag_len]` with values: - *

{@code
+ * 
+ *

where {@code y = max(-k[1], 0)}, {@code x = max(k[1], 0)}. + *

Otherwise, the output tensor has rank {@code r} with dimensions + * {@code [I, J, ..., L, num_diags, max_diag_len]} with values: + *

  * diagonal[i, j, ..., l, m, n]
- *   = input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
+ *   = input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
  *     padding_value                 ; otherwise.
- * }
- * where `d = k[1] - m`, `y = max(-d, 0) - offset`, and `x = max(d, 0) - offset`. - *

- * `offset` is zero except when the alignment of the diagonal is to the right. - *

{@code
+ * 
+ *

where {@code d = k[1] - m}, {@code y = max(-d, 0) - offset}, and {@code x = max(d, 0) - offset}. + *

{@code offset} is zero except when the alignment of the diagonal is to the right. + *

  * offset = max_diag_len - diag_len(d) ; if (`align` in {RIGHT_LEFT, RIGHT_RIGHT}
- *                                            and `d >= 0`) or
+ *                                            and `d >= 0`) or
  *                                          (`align` in {LEFT_RIGHT, RIGHT_RIGHT}
- *                                            and `d <= 0`)
+ *                                            and `d <= 0`)
  *          0                          ; otherwise
- * }
- * where `diag_len(d) = min(cols - max(d, 0), rows + min(d, 0))`. - *

- * The input must be at least a matrix. - *

- * For example: - *

{@code
+ * 
+ *

where {@code diag_len(d) = min(cols - max(d, 0), rows + min(d, 0))}. + *

The input must be at least a matrix. + *

For example: + *

  * input = np.array([[[1, 2, 3, 4],  # Input shape: (2, 3, 4)
  *                    [5, 6, 7, 8],
  *                    [9, 8, 7, 6]],
  *                   [[5, 4, 3, 2],
  *                    [1, 2, 3, 4],
  *                    [5, 6, 7, 8]]])
- * 
+ *
  * # A main diagonal from each batch.
- * tf.matrix_diag_part(input) ==> [[1, 6, 7],  # Output shape: (2, 3)
+ * tf.matrix_diag_part(input) ==> [[1, 6, 7],  # Output shape: (2, 3)
  *                                 [5, 2, 7]]
- * 
+ *
  * # A superdiagonal from each batch.
  * tf.matrix_diag_part(input, k = 1)
- *   ==> [[2, 7, 6],  # Output shape: (2, 3)
+ *   ==> [[2, 7, 6],  # Output shape: (2, 3)
  *        [4, 3, 8]]
- * 
+ *
  * # A band from each batch.
  * tf.matrix_diag_part(input, k = (-1, 2))
- *   ==> [[[0, 3, 8],  # Output shape: (2, 4, 3)
+ *   ==> [[[0, 3, 8],  # Output shape: (2, 4, 3)
  *         [2, 7, 6],
  *         [1, 6, 7],
  *         [5, 8, 0]],
@@ -98,10 +97,10 @@
  *         [4, 3, 8],
  *         [5, 2, 7],
  *         [1, 6, 0]]]
- * 
+ *
  * # LEFT_RIGHT alignment.
- * tf.matrix_diag_part(input, k = (-1, 2), align="LEFT_RIGHT")
- *   ==> [[[3, 8, 0],  # Output shape: (2, 4, 3)
+ * tf.matrix_diag_part(input, k = (-1, 2), align="LEFT_RIGHT")
+ *   ==> [[[3, 8, 0],  # Output shape: (2, 4, 3)
  *         [2, 7, 6],
  *         [1, 6, 7],
  *         [0, 5, 8]],
@@ -109,77 +108,70 @@
  *         [4, 3, 8],
  *         [5, 2, 7],
  *         [0, 1, 6]]]
- * 
+ *
  * # max_diag_len can be shorter than the main diagonal.
  * tf.matrix_diag_part(input, k = (-2, -1))
- *   ==> [[[5, 8],
+ *   ==> [[[5, 8],
  *         [9, 0]],
  *        [[1, 6],
  *         [5, 0]]]
- * 
+ *
  * # padding_value = 9
  * tf.matrix_diag_part(input, k = (1, 3), padding_value = 9)
- *   ==> [[[9, 9, 4],  # Output shape: (2, 3, 3)
+ *   ==> [[[9, 9, 4],  # Output shape: (2, 3, 3)
  *         [9, 3, 8],
  *         [2, 7, 6]],
  *        [[9, 9, 2],
  *         [9, 3, 4],
  *         [4, 3, 8]]]
- * 
- * }
- * - * - * @param data type for {@code diagonal()} output + * + *
*/ -@Operator(group = "linalg") +@OpMetadata( + opType = MatrixDiagPartV3.OP_NAME, + inputsClass = MatrixDiagPartV3.Inputs.class +) +@Operator( + group = "linalg" +) public final class MatrixDiagPartV3 extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.MatrixDiagPartV3} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param align Some diagonals are shorter than `max_diag_len` and need to be padded. `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 Options align(String align) { - this.align = align; - return this; - } - - private String align; - - private Options() { - } + public static final String OP_NAME = "MatrixDiagPartV3"; + + private Output diagonal; + + public MatrixDiagPartV3(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + diagonal = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new MatrixDiagPartV3 operation. - * + * * @param scope current scope - * @param input Rank `r` tensor where `r >= 2`. + * @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. `k` can be a single integer + * 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. `k[0]` must not be larger than `k[1]`. + * of a matrix band. {@code k[0]} must not be larger than {@code k[1]}. * @param paddingValue The value to fill the area outside the specified diagonal band with. * Default is 0. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MatrixDiagPartV3} output and operands * @return a new instance of MatrixDiagPartV3 */ - @Endpoint(describeByClass = true) - public static MatrixDiagPartV3 create(Scope scope, Operand input, Operand k, Operand paddingValue, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MatrixDiagPartV3", scope.makeOpName("MatrixDiagPartV3")); + @Endpoint( + describeByClass = true + ) + public static MatrixDiagPartV3 create(Scope scope, Operand input, + Operand k, Operand paddingValue, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MatrixDiagPartV3"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(k.asOutput()); opBuilder.addInput(paddingValue.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.align != null) { @@ -187,42 +179,113 @@ public static MatrixDiagPartV3 create(Scope scope, Operand< } } } - return new MatrixDiagPartV3(opBuilder.build()); + return new MatrixDiagPartV3<>(opBuilder.build()); } - + /** - * @param align Some diagonals are shorter than `max_diag_len` and need to be padded. `align` is + * Sets the align option. + * + * @param align 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 + * 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 + * row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT_RIGHT", which is * the opposite alignment. + * @return this Options instance. */ public static Options align(String align) { return new Options().align(align); } - + /** + * Gets diagonal. * The extracted diagonal(s). + * @return diagonal. */ public Output diagonal() { return diagonal; } - + @Override public Output asOutput() { return diagonal; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixDiagPartV3"; - - private Output diagonal; - - private MatrixDiagPartV3(Operation operation) { - super(operation); - int outputIdx = 0; - diagonal = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.MatrixDiagPartV3} + */ + public static class Options { + private String align; + + private Options() { + } + + /** + * Sets the align option. + * + * @param align 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. + * @return this Options instance. + */ + public Options align(String align) { + this.align = 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 dab7e78c7ec..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,67 +17,68 @@ 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; /** * Returns a batched diagonal tensor with given batched diagonal values. - *

- * Returns a tensor with the contents in `diagonal` as `k[0]`-th to `k[1]`-th - * diagonals of a matrix, with everything else padded with `padding`. `num_rows` - * and `num_cols` specify the dimension of the innermost matrix of the output. If + * Returns a tensor with the contents in {@code diagonal} as {@code k[0]}-th to {@code k[1]}-th + * diagonals of a matrix, with everything else padded with {@code padding}. {@code num_rows} + * and {@code num_cols} specify the dimension of the innermost matrix of the output. If * both are not specified, the op assumes the innermost matrix is square and infers - * its size from `k` and the innermost dimension of `diagonal`. If only one of them + * its size from {@code k} and the innermost dimension of {@code diagonal}. If only one of them * is specified, the op assumes the unspecified value is the smallest possible * based on other criteria. - *

- * Let `diagonal` have `r` dimensions `[I, J, ..., L, M, N]`. The output tensor has - * rank `r+1` with shape `[I, J, ..., L, M, num_rows, num_cols]` when only one - * diagonal is given (`k` is an integer or `k[0] == k[1]`). Otherwise, it has rank - * `r` with shape `[I, J, ..., L, num_rows, num_cols]`. - *

- * The second innermost dimension of `diagonal` has double meaning. - * When `k` is scalar or `k[0] == k[1]`, `M` is part of the batch size + *

Let {@code diagonal} have {@code r} dimensions {@code [I, J, ..., L, M, N]}. The output tensor has + * rank {@code r+1} with shape {@code [I, J, ..., L, M, num_rows, num_cols]} when only one + * diagonal is given ({@code k} is an integer or {@code k[0] == k[1]}). Otherwise, it has rank + * {@code r} with shape {@code [I, J, ..., L, num_rows, num_cols]}. + *

The second innermost dimension of {@code diagonal} has double meaning. + * When {@code k} is scalar or {@code k[0] == k[1]}, {@code M} is part of the batch size * [I, J, ..., M], and the output tensor is: - *

{@code
+ * 
  * output[i, j, ..., l, m, n]
  *   = diagonal[i, j, ..., l, n-max(d_upper, 0)] ; if n - m == d_upper
  *     padding_value                             ; otherwise
- * }
- * Otherwise, `M` is treated as the number of diagonals for the matrix in the - * same batch (`M = k[1]-k[0]+1`), and the output tensor is: - *
{@code
+ * 
+ *

Otherwise, {@code M} is treated as the number of diagonals for the matrix in the + * same batch ({@code M = k[1]-k[0]+1}), and the output tensor is: + *

  * output[i, j, ..., l, m, n]
- *   = diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]
+ *   = diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]
  *     padding_value                                     ; otherwise
- * }
- * where `d = n - m`, `diag_index = [k] - d`, and - * `index_in_diag = n - max(d, 0) + offset`. - *

- * `offset` is zero except when the alignment of the diagonal is to the right. - *

{@code
+ * 
+ *

where {@code d = n - m}, {@code diag_index = [k] - d}, and + * {@code index_in_diag = n - max(d, 0) + offset}. + *

{@code offset} is zero except when the alignment of the diagonal is to the right. + *

  * offset = max_diag_len - diag_len(d) ; if (`align` in {RIGHT_LEFT, RIGHT_RIGHT}
- *                                            and `d >= 0`) or
+ *                                            and `d >= 0`) or
  *                                          (`align` in {LEFT_RIGHT, RIGHT_RIGHT}
- *                                            and `d <= 0`)
+ *                                            and `d <= 0`)
  *          0                          ; otherwise
- * }
- * where `diag_len(d) = min(cols - max(d, 0), rows + min(d, 0))`. - *

- * For example: - *

{@code
+ * 
+ *

where {@code diag_len(d) = min(cols - max(d, 0), rows + min(d, 0))}. + *

For example: + *

  * # The main diagonal.
  * diagonal = np.array([[1, 2, 3, 4],            # Input shape: (2, 4)
  *                      [5, 6, 7, 8]])
- * tf.matrix_diag(diagonal) ==> [[[1, 0, 0, 0],  # Output shape: (2, 4, 4)
+ * tf.matrix_diag(diagonal) ==> [[[1, 0, 0, 0],  # Output shape: (2, 4, 4)
  *                                [0, 2, 0, 0],
  *                                [0, 0, 3, 0],
  *                                [0, 0, 0, 4]],
@@ -85,12 +86,12 @@
  *                                [0, 6, 0, 0],
  *                                [0, 0, 7, 0],
  *                                [0, 0, 0, 8]]]
- * 
+ *
  * # A superdiagonal (per batch).
  * diagonal = np.array([[1, 2, 3],  # Input shape: (2, 3)
  *                      [4, 5, 6]])
  * tf.matrix_diag(diagonal, k = 1)
- *   ==> [[[0, 1, 0, 0],  # Output shape: (2, 4, 4)
+ *   ==> [[[0, 1, 0, 0],  # Output shape: (2, 4, 4)
  *         [0, 0, 2, 0],
  *         [0, 0, 0, 3],
  *         [0, 0, 0, 0]],
@@ -98,7 +99,7 @@
  *         [0, 0, 5, 0],
  *         [0, 0, 0, 6],
  *         [0, 0, 0, 0]]]
- * 
+ *
  * # A tridiagonal band (per batch).
  * diagonals = np.array([[[0, 8, 9],  # Input shape: (2, 2, 3)
  *                        [1, 2, 3],
@@ -107,13 +108,13 @@
  *                        [6, 7, 9],
  *                        [9, 1, 0]]])
  * tf.matrix_diag(diagonals, k = (-1, 1))
- *   ==> [[[1, 8, 0],  # Output shape: (2, 3, 3)
+ *   ==> [[[1, 8, 0],  # Output shape: (2, 3, 3)
  *         [4, 2, 9],
  *         [0, 5, 3]],
  *        [[6, 2, 0],
  *         [9, 7, 3],
  *         [0, 1, 9]]]
- * 
+ *
  * # LEFT_RIGHT alignment.
  * diagonals = np.array([[[8, 9, 0],  # Input shape: (2, 2, 3)
  *                        [1, 2, 3],
@@ -121,89 +122,83 @@
  *                       [[2, 3, 0],
  *                        [6, 7, 9],
  *                        [0, 9, 1]]])
- * tf.matrix_diag(diagonals, k = (-1, 1), align="LEFT_RIGHT")
- *   ==> [[[1, 8, 0],  # Output shape: (2, 3, 3)
+ * tf.matrix_diag(diagonals, k = (-1, 1), align="LEFT_RIGHT")
+ *   ==> [[[1, 8, 0],  # Output shape: (2, 3, 3)
  *         [4, 2, 9],
  *         [0, 5, 3]],
  *        [[6, 2, 0],
  *         [9, 7, 3],
  *         [0, 1, 9]]]
- * 
+ *
  * # Rectangular matrix.
  * diagonal = np.array([1, 2])  # Input shape: (2)
  * tf.matrix_diag(diagonal, k = -1, num_rows = 3, num_cols = 4)
- *   ==> [[0, 0, 0, 0],  # Output shape: (3, 4)
+ *   ==> [[0, 0, 0, 0],  # Output shape: (3, 4)
  *        [1, 0, 0, 0],
  *        [0, 2, 0, 0]]
- * 
+ *
  * # Rectangular matrix with inferred num_cols and padding_value = 9.
  * tf.matrix_diag(diagonal, k = -1, num_rows = 3, padding_value = 9)
- *   ==> [[9, 9],  # Output shape: (3, 2)
+ *   ==> [[9, 9],  # Output shape: (3, 2)
  *        [1, 9],
  *        [9, 2]]
- * 
- * }
- * - * - * @param data type for {@code output()} output + * + *
*/ -@Operator(group = "linalg") +@OpMetadata( + opType = MatrixDiagV3.OP_NAME, + inputsClass = MatrixDiagV3.Inputs.class +) +@Operator( + group = "linalg" +) public final class MatrixDiagV3 extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.MatrixDiagV3} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param align Some diagonals are shorter than `max_diag_len` and need to be padded. `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 Options align(String align) { - this.align = align; - return this; - } - - private String align; - - private Options() { - } + public static final String OP_NAME = "MatrixDiagV3"; + + private Output output; + + public MatrixDiagV3(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new MatrixDiagV3 operation. - * + * * @param scope current scope - * @param diagonal Rank `r`, where `r >= 1` + * @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. `k` can be a single integer + * 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. `k[0]` must not be larger than `k[1]`. + * of a matrix band. {@code k[0]} must not be larger than {@code k[1]}. * @param numRows 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 `diagonal`. + * innermost dimension of {@code diagonal}. * @param numCols 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 `diagonal`. + * k and the innermost dimension of {@code diagonal}. * @param paddingValue The number to fill the area outside the specified diagonal band with. * Default is 0. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MatrixDiagV3} output and operands * @return a new instance of MatrixDiagV3 */ - @Endpoint(describeByClass = true) - public static MatrixDiagV3 create(Scope scope, Operand diagonal, Operand k, Operand numRows, Operand numCols, Operand paddingValue, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MatrixDiagV3", scope.makeOpName("MatrixDiagV3")); + @Endpoint( + describeByClass = true + ) + public static MatrixDiagV3 create(Scope scope, Operand diagonal, + Operand k, Operand numRows, Operand numCols, Operand paddingValue, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MatrixDiagV3"); opBuilder.addInput(diagonal.asOutput()); opBuilder.addInput(k.asOutput()); opBuilder.addInput(numRows.asOutput()); opBuilder.addInput(numCols.asOutput()); opBuilder.addInput(paddingValue.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.align != null) { @@ -211,42 +206,129 @@ public static MatrixDiagV3 create(Scope scope, Operand d } } } - return new MatrixDiagV3(opBuilder.build()); + return new MatrixDiagV3<>(opBuilder.build()); } - + /** - * @param align Some diagonals are shorter than `max_diag_len` and need to be padded. `align` is + * Sets the align option. + * + * @param align 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 + * 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 + * row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT_RIGHT", which is * the opposite alignment. + * @return this Options instance. */ public static Options align(String align) { return new Options().align(align); } - + /** - * Has rank `r+1` when `k` is an integer or `k[0] == k[1]`, rank `r` otherwise. + * Gets output. + * Has rank {@code r+1} when {@code k} is an integer or {@code k[0] == k[1]}, rank {@code r} otherwise. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixDiagV3"; - - private Output output; - - private MatrixDiagV3(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.MatrixDiagV3} + */ + public static class Options { + private String align; + + private Options() { + } + + /** + * Sets the align option. + * + * @param align 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. + * @return this Options instance. + */ + public Options align(String align) { + this.align = 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 64b55cf2662..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,78 +17,110 @@ 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; /** * 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 + * \(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. + *

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 `[..., M, M]` whose inner-most 2 dimensions + *

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 `[..., :, :]`. - * - * @param data type for {@code output()} output + * containing the exponential for all input submatrices {@code [..., :, :]}. */ +@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 + */ + public static final String OP_NAME = "MatrixLogarithm"; + + private Output output; + + public MatrixLogarithm(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MatrixLogarithm operation. - * + * * @param scope current scope - * @param input Shape is `[..., M, M]`. + * @param input Shape is {@code [..., M, M]}. + * @param data type for {@code MatrixLogarithm} output and operands * @return a new instance of MatrixLogarithm */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static MatrixLogarithm create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("MatrixLogarithm", scope.makeOpName("MatrixLogarithm")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MatrixLogarithm"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new MatrixLogarithm(opBuilder.build()); + return new MatrixLogarithm<>(opBuilder.build()); } - + /** - * Shape is `[..., M, M]`. - *

- * @compatibility(scipy) + * Gets output. + * Shape is {@code [..., M, M]}. + *

{@literal @}compatibility(scipy)
* Equivalent to scipy.linalg.logm - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixLogarithm"; - - private Output output; - - private MatrixLogarithm(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 9b1edba5615..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,59 +17,60 @@ 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; /** * Returns a batched matrix tensor with new batched diagonal values. - *

- * Given `input` and `diagonal`, this operation returns a tensor with the - * same shape and values as `input`, except for the specified diagonals of the - * innermost matrices. These will be overwritten by the values in `diagonal`. - *

- * `input` has `r+1` dimensions `[I, J, ..., L, M, N]`. When `k` is scalar or - * `k[0] == k[1]`, `diagonal` has `r` dimensions `[I, J, ..., L, max_diag_len]`. - * Otherwise, it has `r+1` dimensions `[I, J, ..., L, num_diags, max_diag_len]`. - * `num_diags` is the number of diagonals, `num_diags = k[1] - k[0] + 1`. - * `max_diag_len` is the longest diagonal in the range `[k[0], k[1]]`, - * `max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0))` - *

- * The output is a tensor of rank `k+1` with dimensions `[I, J, ..., L, M, N]`. - * If `k` is scalar or `k[0] == k[1]`: - *

{@code
+ * Given {@code input} and {@code diagonal}, this operation returns a tensor with the
+ * same shape and values as {@code input}, except for the specified diagonals of the
+ * innermost matrices. These will be overwritten by the values in {@code diagonal}.
+ * 

{@code input} has {@code r+1} dimensions {@code [I, J, ..., L, M, N]}. When {@code k} is scalar or + * {@code k[0] == k[1]}, {@code diagonal} has {@code r} dimensions {@code [I, J, ..., L, max_diag_len]}. + * Otherwise, it has {@code r+1} dimensions {@code [I, J, ..., L, num_diags, max_diag_len]}. + * {@code num_diags} is the number of diagonals, {@code num_diags = k[1] - k[0] + 1}. + * {@code max_diag_len} is the longest diagonal in the range {@code [k[0], k[1]]}, + * {@code max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0))} + *

The output is a tensor of rank {@code k+1} with dimensions {@code [I, J, ..., L, M, N]}. + * If {@code k} is scalar or {@code k[0] == k[1]}: + *

  * output[i, j, ..., l, m, n]
  *   = diagonal[i, j, ..., l, n-max(k[1], 0)] ; if n - m == k[1]
  *     input[i, j, ..., l, m, n]              ; otherwise
- * }
- * Otherwise, - *
{@code
+ * 
+ *

Otherwise, + *

  * output[i, j, ..., l, m, n]
- *   = diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]
+ *   = diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]
  *     input[i, j, ..., l, m, n]                         ; otherwise
- * }
- * where `d = n - m`, `diag_index = k[1] - d`, and - * `index_in_diag = n - max(d, 0) + offset`. - *

- * `offset` is zero except when the alignment of the diagonal is to the right. - *

{@code
+ * 
+ *

where {@code d = n - m}, {@code diag_index = k[1] - d}, and + * {@code index_in_diag = n - max(d, 0) + offset}. + *

{@code offset} is zero except when the alignment of the diagonal is to the right. + *

  * offset = max_diag_len - diag_len(d) ; if (`align` in {RIGHT_LEFT, RIGHT_RIGHT}
- *                                            and `d >= 0`) or
+ *                                            and `d >= 0`) or
  *                                          (`align` in {LEFT_RIGHT, RIGHT_RIGHT}
- *                                            and `d <= 0`)
+ *                                            and `d <= 0`)
  *          0                          ; otherwise
- * }
- * where `diag_len(d) = min(cols - max(d, 0), rows + min(d, 0))`. - *

- * For example: - *

{@code
+ * 
+ *

where {@code diag_len(d) = min(cols - max(d, 0), rows + min(d, 0))}. + *

For example: + *

  * # The main diagonal.
  * input = np.array([[[7, 7, 7, 7],              # Input shape: (2, 3, 4)
  *                    [7, 7, 7, 7],
@@ -80,22 +81,22 @@
  * diagonal = np.array([[1, 2, 3],               # Diagonal shape: (2, 3)
  *                      [4, 5, 6]])
  * tf.matrix_set_diag(input, diagonal)
- *   ==> [[[1, 7, 7, 7],  # Output shape: (2, 3, 4)
+ *   ==> [[[1, 7, 7, 7],  # Output shape: (2, 3, 4)
  *         [7, 2, 7, 7],
  *         [7, 7, 3, 7]],
  *        [[4, 7, 7, 7],
  *         [7, 5, 7, 7],
  *         [7, 7, 6, 7]]]
- * 
+ *
  * # A superdiagonal (per batch).
  * tf.matrix_set_diag(input, diagonal, k = 1)
- *   ==> [[[7, 1, 7, 7],  # Output shape: (2, 3, 4)
+ *   ==> [[[7, 1, 7, 7],  # Output shape: (2, 3, 4)
  *         [7, 7, 2, 7],
  *         [7, 7, 7, 3]],
  *        [[7, 4, 7, 7],
  *         [7, 7, 5, 7],
  *         [7, 7, 7, 6]]]
- * 
+ *
  * # A band of diagonals.
  * diagonals = np.array([[[0, 9, 1],  # Diagonal shape: (2, 4, 3)
  *                        [6, 5, 8],
@@ -106,13 +107,13 @@
  *                        [6, 1, 2],
  *                        [3, 4, 0]]])
  * tf.matrix_set_diag(input, diagonals, k = (-1, 2))
- *   ==> [[[1, 6, 9, 7],  # Output shape: (2, 3, 4)
+ *   ==> [[[1, 6, 9, 7],  # Output shape: (2, 3, 4)
  *         [4, 2, 5, 1],
  *         [7, 5, 3, 8]],
  *        [[6, 5, 1, 7],
  *         [3, 1, 6, 2],
  *         [7, 4, 2, 4]]]
- * 
+ *
  * # LEFT_RIGHT alignment.
  * diagonals = np.array([[[9, 1, 0],  # Diagonal shape: (2, 4, 3)
  *                        [6, 5, 8],
@@ -122,68 +123,61 @@
  *                        [5, 6, 4],
  *                        [6, 1, 2],
  *                        [0, 3, 4]]])
- * tf.matrix_set_diag(input, diagonals, k = (-1, 2), align="LEFT_RIGHT")
- *   ==> [[[1, 6, 9, 7],  # Output shape: (2, 3, 4)
+ * tf.matrix_set_diag(input, diagonals, k = (-1, 2), align="LEFT_RIGHT")
+ *   ==> [[[1, 6, 9, 7],  # Output shape: (2, 3, 4)
  *         [4, 2, 5, 1],
  *         [7, 5, 3, 8]],
  *        [[6, 5, 1, 7],
  *         [3, 1, 6, 2],
  *         [7, 4, 2, 4]]]
- * 
- * }
- * - * - * @param data type for {@code output()} output + * + *
*/ -@Operator(group = "linalg") +@OpMetadata( + opType = MatrixSetDiag.OP_NAME, + inputsClass = MatrixSetDiag.Inputs.class +) +@Operator( + group = "linalg" +) public final class MatrixSetDiag extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.MatrixSetDiag} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param align Some diagonals are shorter than `max_diag_len` and need to be padded. `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 Options align(String align) { - this.align = align; - return this; - } - - private String align; - - private Options() { - } + public static final String OP_NAME = "MatrixSetDiagV3"; + + private Output output; + + public MatrixSetDiag(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new MatrixSetDiag operation. - * + * Factory method to create a class wrapping a new MatrixSetDiagV3 operation. + * * @param scope current scope - * @param input Rank `r+1`, where `r >= 1`. - * @param diagonal Rank `r` when `k` is an integer or `k[0] == k[1]`. Otherwise, it has rank `r+1`. - * `k >= 1`. + * @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}. * @param k Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main - * diagonal, and negative value means subdiagonals. `k` can be a single integer + * 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. `k[0]` must not be larger than `k[1]`. - * @param options carries optional attributes values + * of a matrix band. {@code k[0]} must not be larger than {@code k[1]}. + * @param options carries optional attribute values + * @param data type for {@code MatrixSetDiagV3} output and operands * @return a new instance of MatrixSetDiag */ - @Endpoint(describeByClass = true) - public static MatrixSetDiag create(Scope scope, Operand input, Operand diagonal, Operand k, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MatrixSetDiagV3", scope.makeOpName("MatrixSetDiag")); + @Endpoint( + describeByClass = true + ) + public static MatrixSetDiag create(Scope scope, Operand input, + Operand diagonal, Operand k, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MatrixSetDiag"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(diagonal.asOutput()); opBuilder.addInput(k.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.align != null) { @@ -191,42 +185,113 @@ public static MatrixSetDiag create(Scope scope, Operand } } } - return new MatrixSetDiag(opBuilder.build()); + return new MatrixSetDiag<>(opBuilder.build()); } - + /** - * @param align Some diagonals are shorter than `max_diag_len` and need to be padded. `align` is + * Sets the align option. + * + * @param align 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 + * 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 + * row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT_RIGHT", which is * the opposite alignment. + * @return this Options instance. */ public static Options align(String align) { return new Options().align(align); } - + /** - * Rank `r+1`, with `output.shape = input.shape`. + * Gets output. + * Rank {@code r+1}, with {@code output.shape = input.shape}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixSetDiagV3"; - - private Output output; - - private MatrixSetDiag(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.MatrixSetDiag} + */ + public static class Options { + private String align; + + private Options() { + } + + /** + * Sets the align option. + * + * @param align 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. + * @return this Options instance. + */ + public Options align(String align) { + this.align = 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 9d0841e6c4b..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,100 +17,100 @@ 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; /** * Solves one or more linear least-squares problems. - *

- * `matrix` is a tensor of shape `[..., M, N]` whose inner-most 2 dimensions - * form real or complex matrices of size `[M, N]`. `Rhs` is a tensor of the same - * type as `matrix` and shape `[..., M, K]`. - * The output is a tensor shape `[..., N, K]` where each output matrix solves + * {@code matrix} is a tensor of shape {@code [..., M, N]} whose inner-most 2 dimensions + * form real or complex matrices of size {@code [M, N]}. {@code Rhs} is a tensor of the same + * type as {@code matrix} and shape {@code [..., M, K]}. + * The output is a tensor shape {@code [..., N, K]} where each output matrix solves * each of the equations - * `matrix[..., :, :]` * `output[..., :, :]` = `rhs[..., :, :]` + * {@code matrix[..., :, :]} * {@code output[..., :, :]} = {@code rhs[..., :, :]} * in the least squares sense. - *

- * We use the following notation for (complex) matrix and right-hand sides + *

We use the following notation for (complex) matrix and right-hand sides * in the batch: - *

- * `matrix`=\\(A \in \mathbb{C}^{m \times n}\\), - * `rhs`=\\(B \in \mathbb{C}^{m \times k}\\), - * `output`=\\(X \in \mathbb{C}^{n \times k}\\), - * `l2_regularizer`=\\(\lambda \in \mathbb{R}\\). - *

- * If `fast` is `True`, then the solution is computed by solving the normal - * equations using Cholesky decomposition. Specifically, if \\(m \ge n\\) then - * \\(X = (A^H A + \lambda I)^{-1} A^H B\\), which solves the least-squares - * problem \\(X = \mathrm{argmin}_{Z \in \Re^{n \times k} } ||A Z - B||_F^2 + \lambda ||Z||_F^2\\). - * If \\(m \lt n\\) then `output` is computed as - * \\(X = A^H (A A^H + \lambda I)^{-1} B\\), which (for \\(\lambda = 0\\)) is the + *

{@code matrix}=\(A \in \mathbb{C}^{m \times n}\), + * {@code rhs}=\(B \in \mathbb{C}^{m \times k}\), + * {@code output}=\(X \in \mathbb{C}^{n \times k}\), + * {@code l2_regularizer}=\(\lambda \in \mathbb{R}\). + *

If {@code fast} is {@code True}, then the solution is computed by solving the normal + * equations using Cholesky decomposition. Specifically, if \(m \ge n\) then + * \(X = (A^H A + \lambda I)^{-1} A^H B\), which solves the least-squares + * problem \(X = \mathrm{argmin}_{Z \in \Re^{n \times k} } ||A Z - B||_F^2 + \lambda ||Z||F^2\). + * If \(m \lt n\) then {@code output} is computed as + * \(X = A^H (A A^H + \lambda I)^{-1} B\), which (for \(\lambda = 0\)) is the * minimum-norm solution to the under-determined linear system, i.e. - * \\(X = \mathrm{argmin}_{Z \in \mathbb{C}^{n \times k} } ||Z||_F^2 \\), - * subject to \\(A Z = B\\). Notice that the fast path is only numerically stable - * when \\(A\\) is numerically full rank and has a condition number - * \\(\mathrm{cond}(A) \lt \frac{1}{\sqrt{\epsilon_{mach} } }\\) or \\(\lambda\\) is + * \(X = \mathrm{argmin}{Z \in \mathbb{C}^{n \times k} } ||Z||F^2 \), + * subject to \(A Z = B\). Notice that the fast path is only numerically stable + * when \(A\) is numerically full rank and has a condition number + * \(\mathrm{cond}(A) \lt \frac{1}{\sqrt{\epsilon{mach} } }\) or \(\lambda\) is * sufficiently large. - *

- * If `fast` is `False` an algorithm based on the numerically robust complete + *

If {@code fast} is {@code False} an algorithm based on the numerically robust complete * orthogonal decomposition is used. This computes the minimum-norm - * least-squares solution, even when \\(A\\) is rank deficient. This path is - * typically 6-7 times slower than the fast path. If `fast` is `False` then - * `l2_regularizer` is ignored. - * - * @param data type for {@code output()} output + * 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. */ -@Operator(group = "linalg") +@OpMetadata( + opType = MatrixSolveLs.OP_NAME, + inputsClass = MatrixSolveLs.Inputs.class +) +@Operator( + group = "linalg" +) public final class MatrixSolveLs extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.MatrixSolveLs} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param fast - */ - public Options fast(Boolean fast) { - this.fast = fast; - return this; - } - - private Boolean fast; - - private Options() { - } + public static final String OP_NAME = "MatrixSolveLs"; + + private Output output; + + public MatrixSolveLs(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new MatrixSolveLs operation. - * + * * @param scope current scope - * @param matrix Shape is `[..., M, N]`. - * @param rhs Shape is `[..., M, K]`. + * @param matrix Shape is {@code [..., M, N]}. + * @param rhs Shape is {@code [..., M, K]}. * @param l2Regularizer Scalar tensor. - *

- * @compatibility(numpy) + *

{@literal @}compatibility(numpy)
* Equivalent to np.linalg.lstsq - * @end_compatibility - * @param options carries optional attributes values + *
{@literal @}end_compatibility + * @param options carries optional attribute values + * @param data type for {@code MatrixSolveLs} output and operands * @return a new instance of MatrixSolveLs */ - @Endpoint(describeByClass = true) - public static MatrixSolveLs create(Scope scope, Operand matrix, Operand rhs, Operand l2Regularizer, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MatrixSolveLs", scope.makeOpName("MatrixSolveLs")); + @Endpoint( + describeByClass = true + ) + public static MatrixSolveLs create(Scope scope, Operand matrix, + Operand rhs, Operand l2Regularizer, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MatrixSolveLs"); opBuilder.addInput(matrix.asOutput()); opBuilder.addInput(rhs.asOutput()); opBuilder.addInput(l2Regularizer.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.fast != null) { @@ -118,36 +118,94 @@ public static MatrixSolveLs create(Scope scope, Operand } } } - return new MatrixSolveLs(opBuilder.build()); + return new MatrixSolveLs<>(opBuilder.build()); } - + /** - * @param fast + * Sets the fast option. + * + * @param fast the fast option + * @return this Options instance. */ public static Options fast(Boolean fast) { return new Options().fast(fast); } - + /** - * Shape is `[..., N, K]`. + * Gets output. + * Shape is {@code [..., N, K]}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixSolveLs"; - - private Output output; - - private MatrixSolveLs(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.MatrixSolveLs} + */ + public static class Options { + private Boolean fast; + + private Options() { + } + + /** + * Sets the fast option. + * + * @param fast the fast option + * @return this Options instance. + */ + public Options fast(Boolean fast) { + this.fast = 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 9335adb16c9..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,73 +17,77 @@ 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; /** * Computes the QR decompositions of one or more matrices. - *

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

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

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

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

  * # a is a tensor.
  * # q is a tensor of orthonormal matrices.
  * # r is a tensor of upper triangular matrices.
  * q, r = qr(a)
  * q_full, r_full = qr(a, full_matrices=True)
- * }
- * - * - * @param data type for {@code q()} output + *
*/ -@Operator(group = "linalg") +@OpMetadata( + opType = Qr.OP_NAME, + inputsClass = Qr.Inputs.class +) +@Operator( + group = "linalg" +) public final class Qr extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.Qr} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param fullMatrices If true, compute full-sized `q` and `r`. If false - * (the default), compute only the leading `P` columns of `q`. - */ - public Options fullMatrices(Boolean fullMatrices) { - this.fullMatrices = fullMatrices; - return this; - } - - private Boolean fullMatrices; - - private Options() { - } + public static final String OP_NAME = "Qr"; + + private Output q; + + private Output r; + + public Qr(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + q = operation.output(outputIdx++); + r = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Qr operation. - * + * * @param scope current scope - * @param input A tensor of shape `[..., M, N]` whose inner-most 2 dimensions - * form matrices of size `[M, N]`. Let `P` be the minimum of `M` and `N`. - * @param options carries optional attributes values + * @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 + * @param data type for {@code Qr} output and operands * @return a new instance of Qr */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Qr create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Qr", scope.makeOpName("Qr")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Qr"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.fullMatrices != null) { @@ -91,44 +95,90 @@ public static Qr create(Scope scope, Operand input, Opti } } } - return new Qr(opBuilder.build()); + return new Qr<>(opBuilder.build()); } - + /** - * @param fullMatrices If true, compute full-sized `q` and `r`. If false - * (the default), compute only the leading `P` columns of `q`. + * Sets the fullMatrices option. + * + * @param fullMatrices If true, compute full-sized {@code q} and {@code r}. If false + * (the default), compute only the leading {@code P} columns of {@code q}. + * @return this Options instance. */ public static Options fullMatrices(Boolean fullMatrices) { return new Options().fullMatrices(fullMatrices); } - + /** - * Orthonormal basis for range of `a`. If `full_matrices` is `False` then - * shape is `[..., M, P]`; if `full_matrices` is `True` then shape is - * `[..., M, M]`. + * Gets q. + * Orthonormal basis for range of {@code a}. If {@code full_matrices} is {@code False} then + * shape is {@code [..., M, P]}; if {@code full_matrices} is {@code True} then shape is + * {@code [..., M, M]}. + * @return q. */ public Output q() { return q; } - + /** - * Triangular factor. If `full_matrices` is `False` then shape is - * `[..., P, N]`. If `full_matrices` is `True` then shape is `[..., M, N]`. + * Gets r. + * Triangular factor. If {@code full_matrices} is {@code False} then shape is + * {@code [..., P, N]}. If {@code full_matrices} is {@code True} then shape is {@code [..., M, N]}. + * @return r. */ public Output r() { return r; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Qr"; - - private Output q; - private Output r; - - private Qr(Operation operation) { - super(operation); - int outputIdx = 0; - q = operation.output(outputIdx++); - r = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.Qr} + */ + public static class Options { + private Boolean fullMatrices; + + private Options() { + } + + /** + * Sets the fullMatrices option. + * + * @param fullMatrices If true, compute full-sized {@code q} and {@code r}. If false + * (the default), compute only the leading {@code P} columns of {@code q}. + * @return this Options instance. + */ + public Options fullMatrices(Boolean fullMatrices) { + this.fullMatrices = 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 28e9c3ae7c4..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,85 +17,90 @@ 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.TType; +import org.tensorflow.types.family.TNumber; /** - * Perform a quantized matrix multiplication of `a` by the matrix `b`. - *

+ * Perform a quantized matrix multiplication of {@code a} by the matrix {@code b}. * The inputs must be two-dimensional matrices and the inner dimension of - * `a` (after being transposed if `transpose_a` is non-zero) must match the - * outer dimension of `b` (after being transposed if `transposed_b` is + * {@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 */ -@Operator(group = "linalg") -public final class QuantizedMatMul extends RawOp { - +@OpMetadata( + opType = QuantizedMatMul.OP_NAME, + inputsClass = QuantizedMatMul.Inputs.class +) +@Operator( + group = "linalg" +) +public final class QuantizedMatMul extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.linalg.QuantizedMatMul} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param transposeA If true, `a` is transposed before multiplication. - */ - public Options transposeA(Boolean transposeA) { - this.transposeA = transposeA; - return this; - } - - /** - * @param transposeB If true, `b` is transposed before multiplication. - */ - public Options transposeB(Boolean transposeB) { - this.transposeB = transposeB; - return this; - } - - private Boolean transposeA; - private Boolean transposeB; - - private Options() { - } + public static final String OP_NAME = "QuantizedMatMul"; + + private Output out; + + private Output minOut; + + private Output maxOut; + + public QuantizedMatMul(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); + minOut = operation.output(outputIdx++); + maxOut = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedMatMul operation. - * + * * @param scope current scope * @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 `a` value represents. - * @param maxA The float value that the highest quantized `a` value represents. - * @param minB The float value that the lowest quantized `b` value represents. - * @param maxB The float value that the highest quantized `b` value represents. - * @param Toutput + * @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 Tactivation The type of output produced by activation function * following this operation. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code QuantizedMatMul} output and operands + * @param data type for {@code QuantizedMatMul} output and operands * @return a new instance of QuantizedMatMul */ - @Endpoint(describeByClass = true) - public static QuantizedMatMul create(Scope scope, Operand a, Operand b, Operand minA, Operand maxA, Operand minB, Operand maxB, Class Toutput, Class Tactivation, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedMatMul", scope.makeOpName("QuantizedMatMul")); + @Endpoint( + describeByClass = true + ) + public static QuantizedMatMul create(Scope scope, + Operand a, Operand b, Operand minA, + Operand maxA, Operand minB, Operand maxB, Class Toutput, + Class Tactivation, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedMatMul"); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); opBuilder.addInput(minA.asOutput()); opBuilder.addInput(maxA.asOutput()); opBuilder.addInput(minB.asOutput()); opBuilder.addInput(maxB.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Toutput", Operands.toDataType(Toutput)); opBuilder.setAttr("Tactivation", Operands.toDataType(Tactivation)); if (options != null) { @@ -108,55 +113,170 @@ public static QuantizedMatMul create(Scope } } } - return new QuantizedMatMul(opBuilder.build()); + return new QuantizedMatMul<>(opBuilder.build()); } - + /** - * @param transposeA If true, `a` is transposed before multiplication. + * Sets the transposeA option. + * + * @param transposeA If true, {@code a} is transposed before multiplication. + * @return this Options instance. */ public static Options transposeA(Boolean transposeA) { return new Options().transposeA(transposeA); } - + /** - * @param transposeB If true, `b` is transposed before multiplication. + * Sets the transposeB option. + * + * @param transposeB If true, {@code b} is transposed before multiplication. + * @return this Options instance. */ public static Options transposeB(Boolean transposeB) { return new Options().transposeB(transposeB); } - + /** + * Gets out. + * + * @return out. */ public Output out() { return out; } - + /** + * Gets minOut. * The float value that the lowest quantized output value represents. + * @return minOut. */ public Output minOut() { return minOut; } - + /** + * Gets maxOut. * The float value that the highest quantized output value represents. + * @return maxOut. */ public Output maxOut() { return maxOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedMatMul"; - - private Output out; - private Output minOut; - private Output maxOut; - - private QuantizedMatMul(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); - minOut = operation.output(outputIdx++); - maxOut = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.QuantizedMatMul} + */ + public static class Options { + private Boolean transposeA; + + private Boolean transposeB; + + private Options() { + } + + /** + * Sets the transposeA option. + * + * @param transposeA If true, {@code a} is transposed before multiplication. + * @return this Options instance. + */ + public Options transposeA(Boolean transposeA) { + this.transposeA = transposeA; + return this; + } + + /** + * Sets the transposeB option. + * + * @param transposeB If true, {@code b} is transposed before multiplication. + * @return this Options instance. + */ + public Options transposeB(Boolean transposeB) { + this.transposeB = 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 fd85581fbc9..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,88 +17,85 @@ 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.TType; +import org.tensorflow.types.family.TNumber; /** - * Performs a quantized matrix multiplication of `a` by the matrix `b` with bias + * 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 `a` (after being transposed if `transpose_a` is non-zero) must - * match the outer dimension of `b` (after being transposed if `transposed_b` is + * 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 `b`. - * - * @param data type for {@code out()} output + * multiplication result. The bias size must match inner dimension of {@code b}. */ -public final class QuantizedMatMulWithBias extends RawOp { - +@OpMetadata( + opType = QuantizedMatMulWithBias.OP_NAME, + inputsClass = QuantizedMatMulWithBias.Inputs.class +) +@Operator( + group = "linalg" +) +public final class QuantizedMatMulWithBias extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.linalg.QuantizedMatMulWithBias} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param transposeA If true, `a` is transposed before multiplication. - */ - public Options transposeA(Boolean transposeA) { - this.transposeA = transposeA; - return this; - } - - /** - * @param transposeB If true, `b` is transposed before multiplication. - */ - public Options transposeB(Boolean transposeB) { - this.transposeB = transposeB; - return this; - } - - /** - * @param inputQuantMode Input data quantization mode. Either MIN_FIRST(default) or SCALED. - */ - public Options inputQuantMode(String inputQuantMode) { - this.inputQuantMode = inputQuantMode; - return this; - } - - private Boolean transposeA; - private Boolean transposeB; - private String inputQuantMode; - - private Options() { - } + public static final String OP_NAME = "QuantizedMatMulWithBias"; + + private Output out; + + private Output minOut; + + private Output maxOut; + + public QuantizedMatMulWithBias(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); + minOut = operation.output(outputIdx++); + maxOut = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedMatMulWithBias operation. - * + * * @param scope current scope - * @param a A matrix to be multiplied. Must be a two-dimensional tensor of type `quint8`. - * @param b A matrix to be multiplied and must be a two-dimensional tensor of type `qint8`. - * @param bias A 1D bias tensor with size matching inner dimension of `b` (after being - * transposed if `transposed_b` is non-zero). - * @param minA The float value that the lowest quantized `a` value represents. - * @param maxA The float value that the highest quantized `a` value represents. - * @param minB The float value that the lowest quantized `b` value represents. - * @param maxB The float value that the highest quantized `b` value represents. - * @param Toutput - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedMatMulWithBias create(Scope scope, Operand a, Operand b, Operand bias, Operand minA, Operand maxA, Operand minB, Operand maxB, Class Toutput, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedMatMulWithBias", scope.makeOpName("QuantizedMatMulWithBias")); + @Endpoint( + describeByClass = true + ) + public static QuantizedMatMulWithBias create(Scope scope, + Operand a, Operand b, Operand bias, + Operand minA, Operand maxA, Operand minB, + Operand maxB, Class Toutput, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedMatMulWithBias"); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); opBuilder.addInput(bias.asOutput()); @@ -106,7 +103,6 @@ public static QuantizedMatMulWithBias create(Scope scope, O opBuilder.addInput(maxA.asOutput()); opBuilder.addInput(minB.asOutput()); opBuilder.addInput(maxB.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Toutput", Operands.toDataType(Toutput)); if (options != null) { for (Options opts : options) { @@ -121,62 +117,205 @@ public static QuantizedMatMulWithBias create(Scope scope, O } } } - return new QuantizedMatMulWithBias(opBuilder.build()); + return new QuantizedMatMulWithBias<>(opBuilder.build()); } - + /** - * @param transposeA If true, `a` is transposed before multiplication. + * Sets the transposeA option. + * + * @param transposeA If true, {@code a} is transposed before multiplication. + * @return this Options instance. */ public static Options transposeA(Boolean transposeA) { return new Options().transposeA(transposeA); } - + /** - * @param transposeB If true, `b` is transposed before multiplication. + * Sets the transposeB option. + * + * @param transposeB If true, {@code b} is transposed before multiplication. + * @return this Options instance. */ public static Options transposeB(Boolean transposeB) { return new Options().transposeB(transposeB); } - + /** + * Sets the inputQuantMode option. + * * @param inputQuantMode Input data quantization mode. Either MIN_FIRST(default) or SCALED. + * @return this Options instance. */ public static Options inputQuantMode(String inputQuantMode) { return new Options().inputQuantMode(inputQuantMode); } - + /** + * Gets out. + * + * @return out. */ public Output out() { return out; } - + /** + * Gets minOut. * The float value that the lowest quantized output value represents. + * @return minOut. */ public Output minOut() { return minOut; } - + /** + * Gets maxOut. * The float value that the highest quantized output value represents. + * @return maxOut. */ public Output maxOut() { return maxOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedMatMulWithBias"; - - private Output out; - private Output minOut; - private Output maxOut; - - private QuantizedMatMulWithBias(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); - minOut = operation.output(outputIdx++); - maxOut = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.QuantizedMatMulWithBias} + */ + public static class Options { + private Boolean transposeA; + + private Boolean transposeB; + + private String inputQuantMode; + + private Options() { + } + + /** + * Sets the transposeA option. + * + * @param transposeA If true, {@code a} is transposed before multiplication. + * @return this Options instance. + */ + public Options transposeA(Boolean transposeA) { + this.transposeA = transposeA; + return this; + } + + /** + * Sets the transposeB option. + * + * @param transposeB If true, {@code b} is transposed before multiplication. + * @return this Options instance. + */ + public Options transposeB(Boolean transposeB) { + this.transposeB = transposeB; + return this; + } + + /** + * Sets the inputQuantMode option. + * + * @param inputQuantMode Input data quantization mode. Either MIN_FIRST(default) or SCALED. + * @return this Options instance. + */ + public Options inputQuantMode(String inputQuantMode) { + this.inputQuantMode = 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 ddf4f44b6d2..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,89 +17,86 @@ 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.TType; +import org.tensorflow.types.family.TNumber; /** - * Perform a quantized matrix multiplication of `a` by the matrix `b` with bias + * 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 `a` (after being transposed if `transpose_a` is non-zero) must - * match the outer dimension of `b` (after being transposed if `transposed_b` is + * 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 `b`. Then do + * 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 */ -public final class QuantizedMatMulWithBiasAndRelu extends RawOp { - +@OpMetadata( + opType = QuantizedMatMulWithBiasAndRelu.OP_NAME, + inputsClass = QuantizedMatMulWithBiasAndRelu.Inputs.class +) +@Operator( + group = "linalg" +) +public final class QuantizedMatMulWithBiasAndRelu extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.linalg.QuantizedMatMulWithBiasAndRelu} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param transposeA If true, `a` is transposed before multiplication. - */ - public Options transposeA(Boolean transposeA) { - this.transposeA = transposeA; - return this; - } - - /** - * @param transposeB If true, `b` is transposed before multiplication. - */ - public Options transposeB(Boolean transposeB) { - this.transposeB = transposeB; - return this; - } - - /** - * @param inputQuantMode Input data quantization mode. Either MIN_FIRST(default) or SCALED. - */ - public Options inputQuantMode(String inputQuantMode) { - this.inputQuantMode = inputQuantMode; - return this; - } - - private Boolean transposeA; - private Boolean transposeB; - private String inputQuantMode; - - private Options() { - } + public static final String OP_NAME = "QuantizedMatMulWithBiasAndRelu"; + + private Output out; + + private Output minOut; + + private Output maxOut; + + public QuantizedMatMulWithBiasAndRelu(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); + minOut = operation.output(outputIdx++); + maxOut = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedMatMulWithBiasAndRelu operation. - * + * * @param scope current scope - * @param a A matrix to be multiplied. Must be a two-dimensional tensor of type `quint8`. - * @param b A matrix to be multiplied and must be a two-dimensional tensor of type `qint8`. - * @param bias A 1D bias tensor with size matching with inner dimension of `b` (after being - * transposed if `transposed_b` is non-zero). - * @param minA The float value that the lowest quantized `a` value represents. - * @param maxA The float value that the highest quantized `a` value represents. - * @param minB The float value that the lowest quantized `b` value represents. - * @param maxB The float value that the highest quantized `b` value represents. - * @param Toutput - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedMatMulWithBiasAndRelu create(Scope scope, Operand a, Operand b, Operand bias, Operand minA, Operand maxA, Operand minB, Operand maxB, Class Toutput, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedMatMulWithBiasAndRelu", scope.makeOpName("QuantizedMatMulWithBiasAndRelu")); + @Endpoint( + describeByClass = true + ) + public static QuantizedMatMulWithBiasAndRelu create(Scope scope, + Operand a, Operand b, Operand bias, + Operand minA, Operand maxA, Operand minB, + Operand maxB, Class Toutput, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedMatMulWithBiasAndRelu"); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); opBuilder.addInput(bias.asOutput()); @@ -107,7 +104,6 @@ public static QuantizedMatMulWithBiasAndRelu create(Scope s opBuilder.addInput(maxA.asOutput()); opBuilder.addInput(minB.asOutput()); opBuilder.addInput(maxB.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Toutput", Operands.toDataType(Toutput)); if (options != null) { for (Options opts : options) { @@ -122,62 +118,199 @@ public static QuantizedMatMulWithBiasAndRelu create(Scope s } } } - return new QuantizedMatMulWithBiasAndRelu(opBuilder.build()); + return new QuantizedMatMulWithBiasAndRelu<>(opBuilder.build()); } - + /** - * @param transposeA If true, `a` is transposed before multiplication. + * Sets the transposeA option. + * + * @param transposeA If true, {@code a} is transposed before multiplication. + * @return this Options instance. */ public static Options transposeA(Boolean transposeA) { return new Options().transposeA(transposeA); } - + /** - * @param transposeB If true, `b` is transposed before multiplication. + * Sets the transposeB option. + * + * @param transposeB If true, {@code b} is transposed before multiplication. + * @return this Options instance. */ public static Options transposeB(Boolean transposeB) { return new Options().transposeB(transposeB); } - + /** + * Sets the inputQuantMode option. + * * @param inputQuantMode Input data quantization mode. Either MIN_FIRST(default) or SCALED. + * @return this Options instance. */ public static Options inputQuantMode(String inputQuantMode) { return new Options().inputQuantMode(inputQuantMode); } - + /** + * Gets out. + * + * @return out. */ public Output out() { return out; } - + /** + * Gets minOut. * The float value that the lowest quantized output value represents. + * @return minOut. */ public Output minOut() { return minOut; } - + /** + * Gets maxOut. * The float value that the highest quantized output value represents. + * @return maxOut. */ public Output maxOut() { return maxOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedMatMulWithBiasAndRelu"; - - private Output out; - private Output minOut; - private Output maxOut; - - private QuantizedMatMulWithBiasAndRelu(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); - minOut = operation.output(outputIdx++); - maxOut = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.QuantizedMatMulWithBiasAndRelu} + */ + public static class Options { + private Boolean transposeA; + + private Boolean transposeB; + + private String inputQuantMode; + + private Options() { + } + + /** + * Sets the transposeA option. + * + * @param transposeA If true, {@code a} is transposed before multiplication. + * @return this Options instance. + */ + public Options transposeA(Boolean transposeA) { + this.transposeA = transposeA; + return this; + } + + /** + * Sets the transposeB option. + * + * @param transposeB If true, {@code b} is transposed before multiplication. + * @return this Options instance. + */ + public Options transposeB(Boolean transposeB) { + this.transposeB = transposeB; + return this; + } + + /** + * Sets the inputQuantMode option. + * + * @param inputQuantMode Input data quantization mode. Either MIN_FIRST(default) or SCALED. + * @return this Options instance. + */ + public Options inputQuantMode(String inputQuantMode) { + this.inputQuantMode = 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 06734e0a715..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,92 +17,90 @@ 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.TType; +import org.tensorflow.types.family.TNumber; /** - * Perform a quantized matrix multiplication of `a` by the matrix `b` with bias + * 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 `a` (after being transposed if `transpose_a` is non-zero) must - * match the outer dimension of `b` (after being transposed if `transposed_b` is + * 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 `b`. Then do + * 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 */ -public final class QuantizedMatMulWithBiasAndReluAndRequantize extends RawOp { - +@OpMetadata( + opType = QuantizedMatMulWithBiasAndReluAndRequantize.OP_NAME, + inputsClass = QuantizedMatMulWithBiasAndReluAndRequantize.Inputs.class +) +@Operator( + group = "linalg" +) +public final class QuantizedMatMulWithBiasAndReluAndRequantize extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.linalg.QuantizedMatMulWithBiasAndReluAndRequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param transposeA If true, `a` is transposed before multiplication. - */ - public Options transposeA(Boolean transposeA) { - this.transposeA = transposeA; - return this; - } - - /** - * @param transposeB If true, `b` is transposed before multiplication. - */ - public Options transposeB(Boolean transposeB) { - this.transposeB = transposeB; - return this; - } - - /** - * @param inputQuantMode Input data quantization mode. Either MIN_FIRST(default) or SCALED. - */ - public Options inputQuantMode(String inputQuantMode) { - this.inputQuantMode = inputQuantMode; - return this; - } - - private Boolean transposeA; - private Boolean transposeB; - private String inputQuantMode; - - private Options() { - } + public static final String OP_NAME = "QuantizedMatMulWithBiasAndReluAndRequantize"; + + private Output out; + + private Output minOut; + + private Output maxOut; + + public QuantizedMatMulWithBiasAndReluAndRequantize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); + minOut = operation.output(outputIdx++); + maxOut = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedMatMulWithBiasAndReluAndRequantize operation. - * + * * @param scope current scope - * @param a A matrix to be multiplied. Must be a two-dimensional tensor of type `quint8`. - * @param b A matrix to be multiplied and must be a two-dimensional tensor of type `qint8`. - * @param bias A 1D bias tensor with size matching with inner dimension of `b` (after being - * transposed if `transposed_b` is non-zero). - * @param minA The float value that the lowest quantized `a` value represents. - * @param maxA The float value that the highest quantized `a` value represents. - * @param minB The float value that the lowest quantized `b` value represents. - * @param maxB The float value that the highest quantized `b` value represents. + * @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 - * @param Toutput - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedMatMulWithBiasAndReluAndRequantize create(Scope scope, Operand a, Operand b, Operand bias, Operand minA, Operand maxA, Operand minB, Operand maxB, Operand minFreezedOutput, Operand maxFreezedOutput, Class Toutput, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedMatMulWithBiasAndReluAndRequantize", scope.makeOpName("QuantizedMatMulWithBiasAndReluAndRequantize")); + @Endpoint( + describeByClass = true + ) + public static QuantizedMatMulWithBiasAndReluAndRequantize create( + Scope scope, Operand a, Operand b, + Operand bias, Operand minA, Operand maxA, + Operand minB, Operand maxB, Operand minFreezedOutput, + Operand maxFreezedOutput, Class Toutput, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedMatMulWithBiasAndReluAndRequantize"); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); opBuilder.addInput(bias.asOutput()); @@ -112,7 +110,6 @@ public static QuantizedMatMulWithBiasAndReluAndRequantize c opBuilder.addInput(maxB.asOutput()); opBuilder.addInput(minFreezedOutput.asOutput()); opBuilder.addInput(maxFreezedOutput.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Toutput", Operands.toDataType(Toutput)); if (options != null) { for (Options opts : options) { @@ -127,62 +124,217 @@ public static QuantizedMatMulWithBiasAndReluAndRequantize c } } } - return new QuantizedMatMulWithBiasAndReluAndRequantize(opBuilder.build()); + return new QuantizedMatMulWithBiasAndReluAndRequantize<>(opBuilder.build()); } - + /** - * @param transposeA If true, `a` is transposed before multiplication. + * Sets the transposeA option. + * + * @param transposeA If true, {@code a} is transposed before multiplication. + * @return this Options instance. */ public static Options transposeA(Boolean transposeA) { return new Options().transposeA(transposeA); } - + /** - * @param transposeB If true, `b` is transposed before multiplication. + * Sets the transposeB option. + * + * @param transposeB If true, {@code b} is transposed before multiplication. + * @return this Options instance. */ public static Options transposeB(Boolean transposeB) { return new Options().transposeB(transposeB); } - + /** + * Sets the inputQuantMode option. + * * @param inputQuantMode Input data quantization mode. Either MIN_FIRST(default) or SCALED. + * @return this Options instance. */ public static Options inputQuantMode(String inputQuantMode) { return new Options().inputQuantMode(inputQuantMode); } - + /** + * Gets out. + * + * @return out. */ public Output out() { return out; } - + /** + * Gets minOut. * The float value that the lowest quantized output value represents. + * @return minOut. */ public Output minOut() { return minOut; } - + /** + * Gets maxOut. * The float value that the highest quantized output value represents. + * @return maxOut. */ public Output maxOut() { return maxOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedMatMulWithBiasAndReluAndRequantize"; - - private Output out; - private Output minOut; - private Output maxOut; - - private QuantizedMatMulWithBiasAndReluAndRequantize(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); - minOut = operation.output(outputIdx++); - maxOut = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.QuantizedMatMulWithBiasAndReluAndRequantize} + */ + public static class Options { + private Boolean transposeA; + + private Boolean transposeB; + + private String inputQuantMode; + + private Options() { + } + + /** + * Sets the transposeA option. + * + * @param transposeA If true, {@code a} is transposed before multiplication. + * @return this Options instance. + */ + public Options transposeA(Boolean transposeA) { + this.transposeA = transposeA; + return this; + } + + /** + * Sets the transposeB option. + * + * @param transposeB If true, {@code b} is transposed before multiplication. + * @return this Options instance. + */ + public Options transposeB(Boolean transposeB) { + this.transposeB = transposeB; + return this; + } + + /** + * Sets the inputQuantMode option. + * + * @param inputQuantMode Input data quantization mode. Either MIN_FIRST(default) or SCALED. + * @return this Options instance. + */ + public Options inputQuantMode(String inputQuantMode) { + this.inputQuantMode = 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 b0617360f1c..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,69 +17,75 @@ 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; /** * Computes the eigen decomposition of one or more square self-adjoint matrices. - *

* Computes the eigenvalues and (optionally) eigenvectors of each inner matrix in - * `input` such that `input[..., :, :] = v[..., :, :] * diag(e[..., :])`. The eigenvalues + * {@code input} such that {@code input[..., :, :] = v[..., :, :] * diag(e[..., :])}. The eigenvalues * are sorted in non-decreasing order. - *

{@code
+ * 
  * # a is a tensor.
  * # e is a tensor of eigenvalues.
  * # v is a tensor of eigenvectors.
  * e, v = self_adjoint_eig(a)
  * e = self_adjoint_eig(a, compute_v=False)
- * }
- * - * - * @param data type for {@code e()} output + *
*/ -@Operator(group = "linalg") +@OpMetadata( + opType = SelfAdjointEig.OP_NAME, + inputsClass = SelfAdjointEig.Inputs.class +) +@Operator( + group = "linalg" +) public final class SelfAdjointEig extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.SelfAdjointEig} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param computeV If `True` then eigenvectors will be computed and returned in `v`. - * Otherwise, only the eigenvalues will be computed. - */ - public Options computeV(Boolean computeV) { - this.computeV = computeV; - return this; - } - - private Boolean computeV; - - private Options() { - } + public static final String OP_NAME = "SelfAdjointEigV2"; + + private Output e; + + private Output v; + + public SelfAdjointEig(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + e = operation.output(outputIdx++); + v = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new SelfAdjointEig operation. - * + * Factory method to create a class wrapping a new SelfAdjointEigV2 operation. + * * @param scope current scope - * @param input `Tensor` input of shape `[N, N]`. - * @param options carries optional attributes values + * @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 * @return a new instance of SelfAdjointEig */ - @Endpoint(describeByClass = true) - public static SelfAdjointEig create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SelfAdjointEigV2", scope.makeOpName("SelfAdjointEig")); + @Endpoint( + describeByClass = true + ) + public static SelfAdjointEig create(Scope scope, Operand input, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SelfAdjointEig"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.computeV != null) { @@ -87,41 +93,86 @@ public static SelfAdjointEig create(Scope scope, Operand } } } - return new SelfAdjointEig(opBuilder.build()); + return new SelfAdjointEig<>(opBuilder.build()); } - + /** - * @param computeV If `True` then eigenvectors will be computed and returned in `v`. + * Sets the computeV option. + * + * @param computeV If {@code True} then eigenvectors will be computed and returned in {@code v}. * Otherwise, only the eigenvalues will be computed. + * @return this Options instance. */ public static Options computeV(Boolean computeV) { return new Options().computeV(computeV); } - + /** - * Eigenvalues. Shape is `[N]`. + * Gets e. + * Eigenvalues. Shape is {@code [N]}. + * @return e. */ public Output e() { return e; } - + /** - * Eigenvectors. Shape is `[N, N]`. + * Gets v. + * Eigenvectors. Shape is {@code [N, N]}. + * @return v. */ public Output v() { return v; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SelfAdjointEigV2"; - - private Output e; - private Output v; - - private SelfAdjointEig(Operation operation) { - super(operation); - int outputIdx = 0; - e = operation.output(outputIdx++); - v = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.SelfAdjointEig} + */ + public static class Options { + private Boolean computeV; + + private Options() { + } + + /** + * Sets the computeV option. + * + * @param computeV If {@code True} then eigenvectors will be computed and returned in {@code v}. + * Otherwise, only the eigenvalues will be computed. + * @return this Options instance. + */ + public Options computeV(Boolean computeV) { + this.computeV = 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 2c44b02cbc8..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,66 +17,70 @@ 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; /** * Solves systems of linear equations. - *

- * `Matrix` is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions - * form square matrices. `Rhs` is a tensor of shape `[..., M, K]`. The `output` is - * a tensor shape `[..., M, K]`. If `adjoint` is `False` then each output matrix - * satisfies `matrix[..., :, :] * output[..., :, :] = rhs[..., :, :]`. - * If `adjoint` is `True` then each output matrix satisfies - * `adjoint(matrix[..., :, :]) * output[..., :, :] = rhs[..., :, :]`. - * - * @param data type for {@code output()} output + * {@code Matrix} is a tensor of shape {@code [..., M, M]} whose inner-most 2 dimensions + * form square matrices. {@code Rhs} is a tensor of shape {@code [..., M, K]}. The {@code output} is + * a tensor shape {@code [..., M, K]}. If {@code adjoint} is {@code False} then each output matrix + * satisfies {@code matrix[..., :, :] * output[..., :, :] = rhs[..., :, :]}. + * If {@code adjoint} is {@code True} then each output matrix satisfies + * {@code adjoint(matrix[..., :, :]) * output[..., :, :] = rhs[..., :, :]}. */ -@Operator(group = "linalg") +@OpMetadata( + opType = Solve.OP_NAME, + inputsClass = Solve.Inputs.class +) +@Operator( + group = "linalg" +) public final class Solve extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.Solve} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param adjoint Boolean indicating whether to solve with `matrix` or its (block-wise) - * adjoint. - */ - public Options adjoint(Boolean adjoint) { - this.adjoint = adjoint; - return this; - } - - private Boolean adjoint; - - private Options() { - } + public static final String OP_NAME = "MatrixSolve"; + + private Output output; + + public Solve(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Solve operation. - * + * Factory method to create a class wrapping a new MatrixSolve operation. + * * @param scope current scope - * @param matrix Shape is `[..., M, M]`. - * @param rhs Shape is `[..., M, K]`. - * @param options carries optional attributes values + * @param matrix Shape is {@code [..., M, M]}. + * @param rhs Shape is {@code [..., M, K]}. + * @param options carries optional attribute values + * @param data type for {@code MatrixSolve} output and operands * @return a new instance of Solve */ - @Endpoint(describeByClass = true) - public static Solve create(Scope scope, Operand matrix, Operand rhs, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MatrixSolve", scope.makeOpName("Solve")); + @Endpoint( + describeByClass = true + ) + public static Solve create(Scope scope, Operand matrix, Operand rhs, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Solve"); opBuilder.addInput(matrix.asOutput()); opBuilder.addInput(rhs.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.adjoint != null) { @@ -84,37 +88,88 @@ public static Solve create(Scope scope, Operand matrix, } } } - return new Solve(opBuilder.build()); + return new Solve<>(opBuilder.build()); } - + /** - * @param adjoint Boolean indicating whether to solve with `matrix` or its (block-wise) + * Sets the adjoint option. + * + * @param adjoint Boolean indicating whether to solve with {@code matrix} or its (block-wise) * adjoint. + * @return this Options instance. */ public static Options adjoint(Boolean adjoint) { return new Options().adjoint(adjoint); } - + /** - * Shape is `[..., M, K]`. + * Gets output. + * Shape is {@code [..., M, K]}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixSolve"; - - private Output output; - - private Solve(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.Solve} + */ + public static class Options { + private Boolean adjoint; + + private Options() { + } + + /** + * Sets the adjoint option. + * + * @param adjoint Boolean indicating whether to solve with {@code matrix} or its (block-wise) + * adjoint. + * @return this Options instance. + */ + public Options adjoint(Boolean adjoint) { + this.adjoint = 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 742b75e147e..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,79 +17,111 @@ 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; /** * Computes the matrix square root of one or more square matrices: - *

* matmul(sqrtm(A), sqrtm(A)) = A - *

- * The input matrix should be invertible. If the input matrix is real, it should + *

The input matrix should be invertible. If the input matrix is real, it should * have no eigenvalues which are real and negative (pairs of complex conjugate * eigenvalues are allowed). - *

- * The matrix square root is computed by first reducing the matrix to + *

The matrix square root is computed by first reducing the matrix to * quasi-triangular form with the real Schur decomposition. The square root * of the quasi-triangular matrix is then computed directly. Details of - * the algorithm can be found in: Nicholas J. Higham, "Computing real - * square roots of a real matrix", Linear Algebra Appl., 1987. - *

- * The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions + * the algorithm can be found in: Nicholas J. Higham, "Computing real + * square roots of a real matrix", Linear Algebra Appl., 1987. + *

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 `[..., :, :]`. - * - * @param data type for {@code output()} output + * containing the matrix square root for all input submatrices {@code [..., :, :]}. */ -@Operator(group = "linalg") +@OpMetadata( + opType = Sqrtm.OP_NAME, + inputsClass = Sqrtm.Inputs.class +) +@Operator( + group = "linalg" +) public final class Sqrtm extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Sqrtm operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MatrixSquareRoot"; + + private Output output; + + public Sqrtm(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new MatrixSquareRoot operation. + * * @param scope current scope - * @param input Shape is `[..., M, M]`. + * @param input Shape is {@code [..., M, M]}. + * @param data type for {@code MatrixSquareRoot} output and operands * @return a new instance of Sqrtm */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Sqrtm create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("MatrixSquareRoot", scope.makeOpName("Sqrtm")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Sqrtm"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Sqrtm(opBuilder.build()); + return new Sqrtm<>(opBuilder.build()); } - + /** - * Shape is `[..., M, M]`. - *

- * @compatibility(scipy) + * Gets output. + * Shape is {@code [..., M, M]}. + *

{@literal @}compatibility(scipy)
* Equivalent to scipy.linalg.sqrtm - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixSquareRoot"; - - private Output output; - - private Sqrtm(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 c24b4882bb8..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,82 +17,78 @@ 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; /** * Computes the singular value decompositions of one or more matrices. - *

- * Computes the SVD of each inner matrix in `input` such that - * `input[..., :, :] = u[..., :, :] * diag(s[..., :, :]) * transpose(v[..., :, :])` - *

{@code
+ * Computes the SVD of each inner matrix in {@code input} such that
+ * {@code input[..., :, :] = u[..., :, :] * diag(s[..., :, :]) * transpose(v[..., :, :])}
+ * 
  * # a is a tensor containing a batch of matrices.
  * # s is a tensor of singular values for each matrix.
  * # u is the tensor containing the left singular vectors for each matrix.
  * # v is the tensor containing the right singular vectors for each matrix.
  * s, u, v = svd(a)
  * s, _, _ = svd(a, compute_uv=False)
- * }
- * - * - * @param data type for {@code s()} output + *
*/ -@Operator(group = "linalg") +@OpMetadata( + opType = Svd.OP_NAME, + inputsClass = Svd.Inputs.class +) +@Operator( + group = "linalg" +) public final class Svd extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.Svd} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param computeUv If true, left and right singular vectors will be - * computed and returned in `u` and `v`, respectively. - * If false, `u` and `v` are not set and should never referenced. - */ - public Options computeUv(Boolean computeUv) { - this.computeUv = computeUv; - return this; - } - - /** - * @param fullMatrices If true, compute full-sized `u` and `v`. If false - * (the default), compute only the leading `P` singular vectors. - * Ignored if `compute_uv` is `False`. - */ - public Options fullMatrices(Boolean fullMatrices) { - this.fullMatrices = fullMatrices; - return this; - } - - private Boolean computeUv; - private Boolean fullMatrices; - - private Options() { - } + public static final String OP_NAME = "Svd"; + + private Output s; + + private Output u; + + private Output v; + + public Svd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + s = operation.output(outputIdx++); + u = operation.output(outputIdx++); + v = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Svd operation. - * + * * @param scope current scope - * @param input A tensor of shape `[..., M, N]` whose inner-most 2 dimensions - * form matrices of size `[M, N]`. Let `P` be the minimum of `M` and `N`. - * @param options carries optional attributes values + * @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 + * @param data type for {@code Svd} output and operands * @return a new instance of Svd */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Svd create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Svd", scope.makeOpName("Svd")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Svd"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.computeUv != null) { @@ -103,64 +99,138 @@ public static Svd create(Scope scope, Operand input, Opt } } } - return new Svd(opBuilder.build()); + return new Svd<>(opBuilder.build()); } - + /** + * Sets the computeUv option. + * * @param computeUv If true, left and right singular vectors will be - * computed and returned in `u` and `v`, respectively. - * If false, `u` and `v` are not set and should never referenced. + * computed and returned in {@code u} and {@code v}, respectively. + * If false, {@code u} and {@code v} are not set and should never referenced. + * @return this Options instance. */ public static Options computeUv(Boolean computeUv) { return new Options().computeUv(computeUv); } - + /** - * @param fullMatrices If true, compute full-sized `u` and `v`. If false - * (the default), compute only the leading `P` singular vectors. - * Ignored if `compute_uv` is `False`. + * Sets the fullMatrices option. + * + * @param fullMatrices 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}. + * @return this Options instance. */ public static Options fullMatrices(Boolean fullMatrices) { return new Options().fullMatrices(fullMatrices); } - + /** - * Singular values. Shape is `[..., P]`. + * Gets s. + * Singular values. Shape is {@code [..., P]}. + * @return s. */ public Output s() { return s; } - + /** - * Left singular vectors. If `full_matrices` is `False` then shape is - * `[..., M, P]`; if `full_matrices` is `True` then shape is - * `[..., M, M]`. Undefined if `compute_uv` is `False`. + * Gets u. + * Left singular vectors. If {@code full_matrices} is {@code False} then shape is + * {@code [..., M, P]}; if {@code full_matrices} is {@code True} then shape is + * {@code [..., M, M]}. Undefined if {@code compute_uv} is {@code False}. + * @return u. */ public Output u() { return u; } - + /** - * Left singular vectors. If `full_matrices` is `False` then shape is - * `[..., N, P]`. If `full_matrices` is `True` then shape is `[..., N, N]`. - * Undefined if `compute_uv` is false. + * Gets v. + * Left singular vectors. If {@code full_matrices} is {@code False} then shape is + * {@code [..., N, P]}. If {@code full_matrices} is {@code True} then shape is {@code [..., N, N]}. + * Undefined if {@code compute_uv} is false. + * @return v. */ public Output v() { return v; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Svd"; - - 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++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.Svd} + */ + public static class Options { + private Boolean computeUv; + + private Boolean fullMatrices; + + private Options() { + } + + /** + * Sets the computeUv option. + * + * @param computeUv 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. + * @return this Options instance. + */ + public Options computeUv(Boolean computeUv) { + this.computeUv = computeUv; + return this; + } + + /** + * Sets the fullMatrices option. + * + * @param fullMatrices 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}. + * @return this Options instance. + */ + public Options fullMatrices(Boolean fullMatrices) { + this.fullMatrices = 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 13dfe42f962..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,76 +17,109 @@ 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; /** * Returns a diagonal tensor with a given diagonal values. - *

- * Given a `diagonal`, this operation returns a tensor with the `diagonal` and + * Given a {@code diagonal}, this operation returns a tensor with the {@code diagonal} and * everything else padded with zeros. The diagonal is computed as follows: - *

- * Assume `diagonal` has dimensions [D1,..., Dk], then the output is a tensor of + *

Assume {@code diagonal} has dimensions [D1,..., Dk], then the output is a tensor of * rank 2k with dimensions [D1,..., Dk, D1,..., Dk] where: - *

- * `output[i1,..., ik, i1,..., ik] = diagonal[i1, ..., ik]` and 0 everywhere else. - *

- * For example: - *

{@code
+ * 

{@code output[i1,..., ik, i1,..., ik] = diagonal[i1, ..., ik]} and 0 everywhere else. + *

For example: + *

  * # 'diagonal' is [1, 2, 3, 4]
- * tf.diag(diagonal) ==> [[1, 0, 0, 0]
+ * tf.diag(diagonal) ==> [[1, 0, 0, 0]
  *                        [0, 2, 0, 0]
  *                        [0, 0, 3, 0]
  *                        [0, 0, 0, 4]]
- * }
- * - * - * @param data type for {@code output()} output + *
*/ -@Operator(group = "linalg") +@OpMetadata( + opType = TensorDiag.OP_NAME, + inputsClass = TensorDiag.Inputs.class +) +@Operator( + group = "linalg" +) public final class TensorDiag extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TensorDiag operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Diag"; + + private Output output; + + public TensorDiag(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new Diag operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TensorDiag create(Scope scope, Operand diagonal) { - OperationBuilder opBuilder = scope.env().opBuilder("Diag", scope.makeOpName("TensorDiag")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorDiag"); opBuilder.addInput(diagonal.asOutput()); - opBuilder = scope.apply(opBuilder); - return new TensorDiag(opBuilder.build()); + return new TensorDiag<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Diag"; - - private Output output; - - private TensorDiag(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 ee7010dd7e6..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,78 +17,110 @@ 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; /** * Returns the diagonal part of the tensor. - *

- * This operation returns a tensor with the `diagonal` part - * of the `input`. The `diagonal` part is computed as follows: - *

- * Assume `input` has dimensions `[D1,..., Dk, D1,..., Dk]`, then the output is a - * tensor of rank `k` with dimensions `[D1,..., Dk]` where: - *

- * `diagonal[i1,..., ik] = input[i1, ..., ik, i1,..., ik]`. - *

- * For example: - *

{@code
+ * This operation returns a tensor with the {@code diagonal} part
+ * of the {@code input}. The {@code diagonal} part is computed as follows:
+ * 

Assume {@code input} has dimensions {@code [D1,..., Dk, D1,..., Dk]}, then the output is a + * tensor of rank {@code k} with dimensions {@code [D1,..., Dk]} where: + *

{@code diagonal[i1,..., ik] = input[i1, ..., ik, i1,..., ik]}. + *

For example: + *

  * # 'input' is [[1, 0, 0, 0]
  *               [0, 2, 0, 0]
  *               [0, 0, 3, 0]
  *               [0, 0, 0, 4]]
- * 
- * tf.diag_part(input) ==> [1, 2, 3, 4]
- * }
- * - * - * @param data type for {@code diagonal()} output + * + * tf.diag_part(input) ==> [1, 2, 3, 4] + *
*/ -@Operator(group = "linalg") +@OpMetadata( + opType = TensorDiagPart.OP_NAME, + inputsClass = TensorDiagPart.Inputs.class +) +@Operator( + group = "linalg" +) public final class TensorDiagPart extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TensorDiagPart operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DiagPart"; + + private Output diagonal; + + public TensorDiagPart(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + diagonal = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new DiagPart operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TensorDiagPart create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("DiagPart", scope.makeOpName("TensorDiagPart")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorDiagPart"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new TensorDiagPart(opBuilder.build()); + return new TensorDiagPart<>(opBuilder.build()); } - + /** + * Gets diagonal. * The extracted diagonal. + * @return diagonal. */ public Output diagonal() { return diagonal; } - + @Override public Output asOutput() { return diagonal; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DiagPart"; - - private Output diagonal; - - private TensorDiagPart(Operation operation) { - super(operation); - int outputIdx = 0; - diagonal = operation.output(outputIdx++); + + @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 41d9c28d9d2..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,64 +17,114 @@ 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; /** * Shuffle dimensions of x according to a permutation. - *

- * The output `y` has the same rank as `x`. The shapes of `x` and `y` satisfy: - * `y.shape[i] == x.shape[perm[i]] for i in [0, 1, ..., rank(x) - 1]` - * - * @param data type for {@code y()} output + * 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]} */ -@Operator(group = "linalg") +@OpMetadata( + opType = Transpose.OP_NAME, + inputsClass = Transpose.Inputs.class +) +@Operator( + group = "linalg" +) public final class Transpose extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Transpose"; + + private Output y; + + public Transpose(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Transpose operation. - * + * * @param scope current scope - * @param x - * @param perm + * @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 */ - @Endpoint(describeByClass = true) - public static Transpose create(Scope scope, Operand x, Operand perm) { - OperationBuilder opBuilder = scope.env().opBuilder("Transpose", scope.makeOpName("Transpose")); + @Endpoint( + describeByClass = true + ) + public static Transpose create(Scope scope, Operand x, + Operand perm) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Transpose"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(perm.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Transpose(opBuilder.build()); + return new Transpose<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Transpose"; - - private Output y; - - private Transpose(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 03bb6f86426..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,120 +17,106 @@ 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; /** * Solves systems of linear equations with upper or lower triangular matrices by backsubstitution. - *

- * - * `matrix` is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions form - * square matrices. If `lower` is `True` then the strictly upper triangular part + * {@code matrix} is a tensor of shape {@code [..., M, M]} whose inner-most 2 dimensions form + * square matrices. If {@code lower} is {@code True} then the strictly upper triangular part * of each inner-most matrix is assumed to be zero and not accessed. - * If `lower` is False then the strictly lower triangular part of each inner-most + * If {@code lower} is False then the strictly lower triangular part of each inner-most * matrix is assumed to be zero and not accessed. - * `rhs` is a tensor of shape `[..., M, N]`. - *

- * The output is a tensor of shape `[..., M, N]`. If `adjoint` is - * `True` then the innermost matrices in `output` satisfy matrix equations - * `matrix[..., :, :] * output[..., :, :] = rhs[..., :, :]`. - * If `adjoint` is `False` then the strictly then the innermost matrices in - * `output` satisfy matrix equations - * `adjoint(matrix[..., i, k]) * output[..., k, j] = rhs[..., i, j]`. - *

- * Note, the batch shapes for the inputs only need to broadcast. - *

- * Example: - *

{@code
+ * {@code rhs} is a tensor of shape {@code [..., M, N]}.
+ * 

The output is a tensor of shape {@code [..., M, N]}. If {@code adjoint} is + * {@code True} then the innermost matrices in {@code output} satisfy matrix equations + * {@code matrix[..., :, :] * output[..., :, :] = rhs[..., :, :]}. + * If {@code adjoint} is {@code False} then the strictly then the innermost matrices in + * {@code output} satisfy matrix equations + * {@code adjoint(matrix[..., i, k]) * output[..., k, j] = rhs[..., i, j]}. + *

Note, the batch shapes for the inputs only need to broadcast. + *

Example: + *

+ *
  * a = tf.constant([[3,  0,  0,  0],
  *                  [2,  1,  0,  0],
  *                  [1,  0,  1,  0],
  *                  [1,  1,  1,  1]], dtype=tf.float32)
- * 
+ *
  * b = tf.constant([[4],
  *                  [2],
  *                  [4],
  *                  [2]], dtype=tf.float32)
- * 
+ *
  * x = tf.linalg.triangular_solve(a, b, lower=True)
  * x
- * # 
- * 
+ * #        [-1.3333331 ]], dtype=float32)>
+ *
  * # in python3 one can use `a@x`
  * tf.matmul(a, x)
- * # 
- * }
- * - * - * @param data type for {@code output()} output + * # [1.9999999]], dtype=float32)> + *
*/ -@Operator(group = "linalg") +@OpMetadata( + opType = TriangularSolve.OP_NAME, + inputsClass = TriangularSolve.Inputs.class +) +@Operator( + group = "linalg" +) public final class TriangularSolve extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.TriangularSolve} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param lower Boolean indicating whether the innermost matrices in `matrix` are - * lower or upper triangular. - */ - public Options lower(Boolean lower) { - this.lower = lower; - return this; - } - - /** - * @param adjoint Boolean indicating whether to solve with `matrix` or its (block-wise) - * adjoint. - *

- * @compatibility(numpy) - * Equivalent to scipy.linalg.solve_triangular - * @end_compatibility - */ - public Options adjoint(Boolean adjoint) { - this.adjoint = adjoint; - return this; - } - - private Boolean lower; - private Boolean adjoint; - - private Options() { - } + public static final String OP_NAME = "MatrixTriangularSolve"; + + private Output output; + + public TriangularSolve(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new TriangularSolve operation. - * + * Factory method to create a class wrapping a new MatrixTriangularSolve operation. + * * @param scope current scope - * @param matrix Shape is `[..., M, M]`. - * @param rhs Shape is `[..., M, K]`. - * @param options carries optional attributes values + * @param matrix Shape is {@code [..., M, M]}. + * @param rhs Shape is {@code [..., M, K]}. + * @param options carries optional attribute values + * @param data type for {@code MatrixTriangularSolve} output and operands * @return a new instance of TriangularSolve */ - @Endpoint(describeByClass = true) - public static TriangularSolve create(Scope scope, Operand matrix, Operand rhs, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MatrixTriangularSolve", scope.makeOpName("TriangularSolve")); + @Endpoint( + describeByClass = true + ) + public static TriangularSolve create(Scope scope, Operand matrix, + Operand rhs, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TriangularSolve"); opBuilder.addInput(matrix.asOutput()); opBuilder.addInput(rhs.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.lower != null) { @@ -141,49 +127,129 @@ public static TriangularSolve create(Scope scope, Operand(opBuilder.build()); + return new TriangularSolve<>(opBuilder.build()); } - + /** - * @param lower Boolean indicating whether the innermost matrices in `matrix` are + * Sets the lower option. + * + * @param lower Boolean indicating whether the innermost matrices in {@code matrix} are * lower or upper triangular. + * @return this Options instance. */ public static Options lower(Boolean lower) { return new Options().lower(lower); } - + /** - * @param adjoint Boolean indicating whether to solve with `matrix` or its (block-wise) - * adjoint. - *

- * @compatibility(numpy) + * Sets the adjoint option. + * + * @param adjoint Boolean indicating whether to solve with {@code matrix} or its (block-wise) + * adjoint. + *

{@literal @}compatibility(numpy)
* Equivalent to scipy.linalg.solve_triangular - * @end_compatibility + *
{@literal @}end_compatibility + * @return this Options instance. */ public static Options adjoint(Boolean adjoint) { return new Options().adjoint(adjoint); } - + /** - * Shape is `[..., M, K]`. + * Gets output. + * Shape is {@code [..., M, K]}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixTriangularSolve"; - - private Output output; - - private TriangularSolve(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.TriangularSolve} + */ + public static class Options { + private Boolean lower; + + private Boolean adjoint; + + private Options() { + } + + /** + * Sets the lower option. + * + * @param lower Boolean indicating whether the innermost matrices in {@code matrix} are + * lower or upper triangular. + * @return this Options instance. + */ + public Options lower(Boolean lower) { + this.lower = lower; + return this; + } + + /** + * Sets the adjoint option. + * + * @param adjoint 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 + * @return this Options instance. + */ + public Options adjoint(Boolean adjoint) { + this.adjoint = 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 6a77d00f8d1..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,70 +17,130 @@ 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 + */ + public static final String OP_NAME = "TridiagonalMatMul"; + + private Output output; + + public TridiagonalMatMul(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TridiagonalMatMul operation. - * + * * @param scope current scope - * @param superdiag Tensor of shape `[..., 1, M]`, representing superdiagonals of + * @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 `[..., 1, M]`, representing main diagonals of tri-diagonal + * @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 `[..., 1, M]`, representing subdiagonals of tri-diagonal + * @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 `[..., M, N]`, representing MxN matrices to the right of + * @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 */ - @Endpoint(describeByClass = true) - public static TridiagonalMatMul create(Scope scope, Operand superdiag, Operand maindiag, Operand subdiag, Operand rhs) { - OperationBuilder opBuilder = scope.env().opBuilder("TridiagonalMatMul", scope.makeOpName("TridiagonalMatMul")); + @Endpoint( + describeByClass = true + ) + public static TridiagonalMatMul create(Scope scope, Operand superdiag, + Operand maindiag, Operand subdiag, Operand rhs) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TridiagonalMatMul"); opBuilder.addInput(superdiag.asOutput()); opBuilder.addInput(maindiag.asOutput()); opBuilder.addInput(subdiag.asOutput()); opBuilder.addInput(rhs.asOutput()); - opBuilder = scope.apply(opBuilder); - return new TridiagonalMatMul(opBuilder.build()); + return new TridiagonalMatMul<>(opBuilder.build()); } - + /** - * Tensor of shape `[..., M, N]` containing the product. + * Gets output. + * Tensor of shape {@code [..., M, N]} containing the product. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TridiagonalMatMul"; - - private Output output; - - private TridiagonalMatMul(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 2b379d46d5e..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,108 +17,200 @@ 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; /** * 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 `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 + * 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. */ +@OpMetadata( + opType = TridiagonalSolve.OP_NAME, + inputsClass = TridiagonalSolve.Inputs.class +) +@Operator( + group = "linalg" +) public final class TridiagonalSolve extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.TridiagonalSolve} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param partialPivoting Whether to apply partial pivoting. Partial pivoting makes the procedure more - * stable, but slower. - */ - public Options partialPivoting(Boolean partialPivoting) { - this.partialPivoting = partialPivoting; - return this; - } - - private Boolean partialPivoting; - - private Options() { - } + public static final String OP_NAME = "TridiagonalSolve"; + + private Output output; + + public TridiagonalSolve(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new TridiagonalSolve operation. - * + * * @param scope current scope - * @param diagonals Tensor of shape `[..., 3, M]` whose innermost 2 dimensions represent the + * @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 `[..., M, K]`, representing K right-hand sides per each + * @param rhs Tensor of shape {@code [..., M, K]}, representing K right-hand sides per each * left-hand side. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code TridiagonalSolve} output and operands * @return a new instance of TridiagonalSolve */ - @Endpoint(describeByClass = true) - public static TridiagonalSolve create(Scope scope, Operand diagonals, Operand rhs, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("TridiagonalSolve", scope.makeOpName("TridiagonalSolve")); + @Endpoint( + describeByClass = true + ) + public static TridiagonalSolve create(Scope scope, Operand diagonals, + Operand rhs, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TridiagonalSolve"); opBuilder.addInput(diagonals.asOutput()); opBuilder.addInput(rhs.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.partialPivoting != null) { opBuilder.setAttr("partial_pivoting", opts.partialPivoting); } + if (opts.perturbSingular != null) { + opBuilder.setAttr("perturb_singular", opts.perturbSingular); + } } } - return new TridiagonalSolve(opBuilder.build()); + return new TridiagonalSolve<>(opBuilder.build()); } - + /** + * Sets the partialPivoting option. + * * @param partialPivoting Whether to apply partial pivoting. Partial pivoting makes the procedure more * stable, but slower. + * @return this Options instance. */ public static Options partialPivoting(Boolean partialPivoting) { return new Options().partialPivoting(partialPivoting); } - + + /** + * Sets the perturbSingular option. + * + * @param perturbSingular the perturbSingular option + * @return this Options instance. + */ + public static Options perturbSingular(Boolean perturbSingular) { + return new Options().perturbSingular(perturbSingular); + } + /** - * Tensor of shape `[..., M, K]` containing the solutions + * Gets output. + * Tensor of shape {@code [..., M, K]} containing the solutions + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TridiagonalSolve"; - - private Output output; - - private TridiagonalSolve(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.TridiagonalSolve} + */ + public static class Options { + private Boolean partialPivoting; + + private Boolean perturbSingular; + + private Options() { + } + + /** + * Sets the partialPivoting option. + * + * @param partialPivoting Whether to apply partial pivoting. Partial pivoting makes the procedure more + * stable, but slower. + * @return this Options instance. + */ + public Options partialPivoting(Boolean partialPivoting) { + this.partialPivoting = partialPivoting; + return this; + } + + /** + * Sets the perturbSingular option. + * + * @param perturbSingular the perturbSingular option + * @return this Options instance. + */ + public Options perturbSingular(Boolean perturbSingular) { + this.perturbSingular = 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 5f215d1e8b1..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,80 +17,130 @@ 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; /** - * Reads out the CSR components at batch `index`. - *

+ * 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 + */ + public static final String OP_NAME = "CSRSparseMatrixComponents"; + + private Output rowPtrs; + + private Output colInds; + + private Output values; + + public CSRSparseMatrixComponents(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + rowPtrs = operation.output(outputIdx++); + colInds = operation.output(outputIdx++); + values = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new CSRSparseMatrixComponents operation. - * + * * @param scope current scope * @param csrSparseMatrix A batched CSRSparseMatrix. - * @param index The index in `csr_sparse_matrix`'s batch. - * @param type + * @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 */ - @Endpoint(describeByClass = true) - public static CSRSparseMatrixComponents create(Scope scope, Operand csrSparseMatrix, Operand index, Class type) { - OperationBuilder opBuilder = scope.env().opBuilder("CSRSparseMatrixComponents", scope.makeOpName("CSRSparseMatrixComponents")); + @Endpoint( + describeByClass = true + ) + public static CSRSparseMatrixComponents create(Scope scope, + Operand csrSparseMatrix, Operand index, Class type) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CSRSparseMatrixComponents"); opBuilder.addInput(csrSparseMatrix.asOutput()); opBuilder.addInput(index.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("type", Operands.toDataType(type)); - return new CSRSparseMatrixComponents(opBuilder.build()); + return new CSRSparseMatrixComponents<>(opBuilder.build()); } - + /** + * Gets rowPtrs. * An array containing CSR matrix row pointers. + * @return rowPtrs. */ public Output rowPtrs() { return rowPtrs; } - + /** + * Gets colInds. * An array containing CSR matrix column indices. + * @return colInds. */ public Output colInds() { return colInds; } - + /** + * Gets values. * An array containing CSR matrix nonzero values. + * @return values. */ public Output values() { return values; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CSRSparseMatrixComponents"; - - private Output rowPtrs; - private Output colInds; - private Output values; - - private CSRSparseMatrixComponents(Operation operation) { - super(operation); - int outputIdx = 0; - rowPtrs = operation.output(outputIdx++); - colInds = operation.output(outputIdx++); - values = operation.output(outputIdx++); + + @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 2c42786fb53..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,61 +17,100 @@ 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 denseOutput()} 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 + */ + public static final String OP_NAME = "CSRSparseMatrixToDense"; + + private Output denseOutput; + + public CSRSparseMatrixToDense(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + denseOutput = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new CSRSparseMatrixToDense operation. - * + * * @param scope current scope * @param sparseInput A batched CSRSparseMatrix. - * @param type + * @param type The value of the type attribute + * @param data type for {@code CSRSparseMatrixToDense} output and operands * @return a new instance of CSRSparseMatrixToDense */ - @Endpoint(describeByClass = true) - public static CSRSparseMatrixToDense create(Scope scope, Operand sparseInput, Class type) { - OperationBuilder opBuilder = scope.env().opBuilder("CSRSparseMatrixToDense", scope.makeOpName("CSRSparseMatrixToDense")); + @Endpoint( + describeByClass = true + ) + public static CSRSparseMatrixToDense create(Scope scope, + Operand sparseInput, Class type) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CSRSparseMatrixToDense"); opBuilder.addInput(sparseInput.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("type", Operands.toDataType(type)); - return new CSRSparseMatrixToDense(opBuilder.build()); + return new CSRSparseMatrixToDense<>(opBuilder.build()); } - + /** + * Gets denseOutput. * A dense tensor. + * @return denseOutput. */ public Output denseOutput() { return denseOutput; } - + @Override public Output asOutput() { return denseOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CSRSparseMatrixToDense"; - - private Output denseOutput; - - private CSRSparseMatrixToDense(Operation operation) { - super(operation); - int outputIdx = 0; - denseOutput = operation.output(outputIdx++); + + @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 3b88662432f..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,75 +17,120 @@ 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 + */ + public static final String OP_NAME = "CSRSparseMatrixToSparseTensor"; + + private Output indices; + + private Output values; + + private Output denseShape; + + public CSRSparseMatrixToSparseTensor(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + indices = operation.output(outputIdx++); + values = operation.output(outputIdx++); + denseShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new CSRSparseMatrixToSparseTensor operation. - * + * * @param scope current scope * @param sparseMatrix A (possibly batched) CSRSparseMatrix. - * @param type + * @param type The value of the type attribute + * @param data type for {@code CSRSparseMatrixToSparseTensor} output and operands * @return a new instance of CSRSparseMatrixToSparseTensor */ - @Endpoint(describeByClass = true) - public static CSRSparseMatrixToSparseTensor create(Scope scope, Operand sparseMatrix, Class type) { - OperationBuilder opBuilder = scope.env().opBuilder("CSRSparseMatrixToSparseTensor", scope.makeOpName("CSRSparseMatrixToSparseTensor")); + @Endpoint( + describeByClass = true + ) + public static CSRSparseMatrixToSparseTensor create(Scope scope, + Operand sparseMatrix, Class type) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CSRSparseMatrixToSparseTensor"); opBuilder.addInput(sparseMatrix.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("type", Operands.toDataType(type)); - return new CSRSparseMatrixToSparseTensor(opBuilder.build()); + return new CSRSparseMatrixToSparseTensor<>(opBuilder.build()); } - + /** + * Gets indices. * SparseTensor indices. + * @return indices. */ public Output indices() { return indices; } - + /** + * Gets values. * SparseTensor values. + * @return values. */ public Output values() { return values; } - + /** + * Gets denseShape. * SparseTensor dense shape. + * @return denseShape. */ public Output denseShape() { return denseShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CSRSparseMatrixToSparseTensor"; - - private Output indices; - private Output values; - private Output denseShape; - - private CSRSparseMatrixToSparseTensor(Operation operation) { - super(operation); - int outputIdx = 0; - indices = operation.output(outputIdx++); - values = operation.output(outputIdx++); - denseShape = operation.output(outputIdx++); + + @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 f380826f82d..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,60 +17,107 @@ 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 + */ + public static final String OP_NAME = "DenseToCSRSparseMatrix"; + + private Output sparseOutput; + + @SuppressWarnings("unchecked") + public DenseToCSRSparseMatrix(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + sparseOutput = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DenseToCSRSparseMatrix operation. - * + * * @param scope current scope * @param denseInput A Dense tensor. * @param indices Indices of nonzero elements. * @return a new instance of DenseToCSRSparseMatrix */ - @Endpoint(describeByClass = true) - public static DenseToCSRSparseMatrix create(Scope scope, Operand denseInput, Operand indices) { - OperationBuilder opBuilder = scope.env().opBuilder("DenseToCSRSparseMatrix", scope.makeOpName("DenseToCSRSparseMatrix")); + @Endpoint( + describeByClass = true + ) + public static DenseToCSRSparseMatrix create(Scope scope, Operand denseInput, + Operand indices) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DenseToCSRSparseMatrix"); opBuilder.addInput(denseInput.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); return new DenseToCSRSparseMatrix(opBuilder.build()); } - + /** + * Gets sparseOutput. * A (possibly batched) CSRSparseMatrix. + * @return sparseOutput. */ - public Output sparseOutput() { + public Output sparseOutput() { return sparseOutput; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) sparseOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DenseToCSRSparseMatrix"; - - private Output sparseOutput; - - private DenseToCSRSparseMatrix(Operation operation) { - super(operation); - int outputIdx = 0; - sparseOutput = operation.output(outputIdx++); + + @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 dca9b41ab13..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,66 +17,125 @@ 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; /** * 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). */ +@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 + */ + public static final String OP_NAME = "SparseMatrixAdd"; + + private Output c; + + @SuppressWarnings("unchecked") + public SparseMatrixAdd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + c = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseMatrixAdd operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static SparseMatrixAdd create(Scope scope, Operand a, Operand b, Operand alpha, Operand beta) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseMatrixAdd", scope.makeOpName("SparseMatrixAdd")); + @Endpoint( + describeByClass = true + ) + public static SparseMatrixAdd create(Scope scope, Operand a, + Operand b, Operand alpha, Operand beta) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseMatrixAdd"); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); opBuilder.addInput(alpha.asOutput()); opBuilder.addInput(beta.asOutput()); - opBuilder = scope.apply(opBuilder); return new SparseMatrixAdd(opBuilder.build()); } - + /** + * Gets c. * A CSRSparseMatrix. + * @return c. */ - public Output c() { + public Output c() { return c; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) c; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatrixAdd"; - - private Output c; - - private SparseMatrixAdd(Operation operation) { - super(operation); - int outputIdx = 0; - c = operation.output(outputIdx++); + + @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 ee5bf50586c..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,127 +17,85 @@ 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; /** * 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: - *

{@code
+ * 

If transpose_output is false, returns: + *

  *   C = A . B
- * }
- * If transpose_output is `true`, returns: - *
{@code
+ * 
+ *

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

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

- * If conjugate_output is `true`, returns: - *

{@code
+ * 

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

  *   C = conjugate(A . B) = conjugate(A) . conjugate(B)
- * }
- * If both conjugate_output and transpose_output are `true`, returns: - *
{@code
+ * 
+ *

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

  *   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 { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.sparse.SparseMatrixMatMul} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param transposeA Indicates whether `a` should be transposed. - */ - public Options transposeA(Boolean transposeA) { - this.transposeA = transposeA; - return this; - } - - /** - * @param transposeB Indicates whether `b` should be transposed. - */ - public Options transposeB(Boolean transposeB) { - this.transposeB = transposeB; - return this; - } - - /** - * @param adjointA Indicates whether `a` should be conjugate-transposed. - */ - public Options adjointA(Boolean adjointA) { - this.adjointA = adjointA; - return this; - } - - /** - * @param adjointB Indicates whether `b` should be conjugate-transposed. - */ - public Options adjointB(Boolean adjointB) { - this.adjointB = adjointB; - return this; - } - - /** - * @param transposeOutput Transposes the product of `a` and `b`. - */ - public Options transposeOutput(Boolean transposeOutput) { - this.transposeOutput = transposeOutput; - return this; - } - - /** - * @param conjugateOutput Conjugates the product of `a` and `b`. - */ - public Options conjugateOutput(Boolean conjugateOutput) { - this.conjugateOutput = conjugateOutput; - return this; - } - - private Boolean transposeA; - private Boolean transposeB; - private Boolean adjointA; - private Boolean adjointB; - private Boolean transposeOutput; - private Boolean conjugateOutput; - - private Options() { - } + public static final String OP_NAME = "SparseMatrixMatMul"; + + private Output output; + + public SparseMatrixMatMul(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseMatrixMatMul operation. - * + * * @param scope current scope * @param a A CSRSparseMatrix. * @param b A dense tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseMatrixMatMul} output and operands * @return a new instance of SparseMatrixMatMul */ - @Endpoint(describeByClass = true) - public static SparseMatrixMatMul create(Scope scope, Operand a, Operand b, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseMatrixMatMul", scope.makeOpName("SparseMatrixMatMul")); + @Endpoint( + describeByClass = true + ) + public static SparseMatrixMatMul create(Scope scope, + Operand a, Operand b, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseMatrixMatMul"); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.transposeA != null) { @@ -160,71 +118,230 @@ public static SparseMatrixMatMul create(Scope scope, Operan } } } - return new SparseMatrixMatMul(opBuilder.build()); + return new SparseMatrixMatMul<>(opBuilder.build()); } - + /** - * @param transposeA Indicates whether `a` should be transposed. + * Sets the transposeA option. + * + * @param transposeA Indicates whether {@code a} should be transposed. + * @return this Options instance. */ public static Options transposeA(Boolean transposeA) { return new Options().transposeA(transposeA); } - + /** - * @param transposeB Indicates whether `b` should be transposed. + * Sets the transposeB option. + * + * @param transposeB Indicates whether {@code b} should be transposed. + * @return this Options instance. */ public static Options transposeB(Boolean transposeB) { return new Options().transposeB(transposeB); } - + /** - * @param adjointA Indicates whether `a` should be conjugate-transposed. + * Sets the adjointA option. + * + * @param adjointA Indicates whether {@code a} should be conjugate-transposed. + * @return this Options instance. */ public static Options adjointA(Boolean adjointA) { return new Options().adjointA(adjointA); } - + /** - * @param adjointB Indicates whether `b` should be conjugate-transposed. + * Sets the adjointB option. + * + * @param adjointB Indicates whether {@code b} should be conjugate-transposed. + * @return this Options instance. */ public static Options adjointB(Boolean adjointB) { return new Options().adjointB(adjointB); } - + /** - * @param transposeOutput Transposes the product of `a` and `b`. + * Sets the transposeOutput option. + * + * @param transposeOutput Transposes the product of {@code a} and {@code b}. + * @return this Options instance. */ public static Options transposeOutput(Boolean transposeOutput) { return new Options().transposeOutput(transposeOutput); } - + /** - * @param conjugateOutput Conjugates the product of `a` and `b`. + * Sets the conjugateOutput option. + * + * @param conjugateOutput Conjugates the product of {@code a} and {@code b}. + * @return this Options instance. */ public static Options conjugateOutput(Boolean conjugateOutput) { return new Options().conjugateOutput(conjugateOutput); } - + /** + * Gets output. * A dense output tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatrixMatMul"; - - private Output output; - - private SparseMatrixMatMul(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.sparse.SparseMatrixMatMul} + */ + public static class Options { + private Boolean transposeA; + + private Boolean transposeB; + + private Boolean adjointA; + + private Boolean adjointB; + + private Boolean transposeOutput; + + private Boolean conjugateOutput; + + private Options() { + } + + /** + * Sets the transposeA option. + * + * @param transposeA Indicates whether {@code a} should be transposed. + * @return this Options instance. + */ + public Options transposeA(Boolean transposeA) { + this.transposeA = transposeA; + return this; + } + + /** + * Sets the transposeB option. + * + * @param transposeB Indicates whether {@code b} should be transposed. + * @return this Options instance. + */ + public Options transposeB(Boolean transposeB) { + this.transposeB = transposeB; + return this; + } + + /** + * Sets the adjointA option. + * + * @param adjointA Indicates whether {@code a} should be conjugate-transposed. + * @return this Options instance. + */ + public Options adjointA(Boolean adjointA) { + this.adjointA = adjointA; + return this; + } + + /** + * Sets the adjointB option. + * + * @param adjointB Indicates whether {@code b} should be conjugate-transposed. + * @return this Options instance. + */ + public Options adjointB(Boolean adjointB) { + this.adjointB = adjointB; + return this; + } + + /** + * Sets the transposeOutput option. + * + * @param transposeOutput Transposes the product of {@code a} and {@code b}. + * @return this Options instance. + */ + public Options transposeOutput(Boolean transposeOutput) { + this.transposeOutput = transposeOutput; + return this; + } + + /** + * Sets the conjugateOutput option. + * + * @param conjugateOutput Conjugates the product of {@code a} and {@code b}. + * @return this Options instance. + */ + public Options conjugateOutput(Boolean conjugateOutput) { + this.conjugateOutput = 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 0939b31939c..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,68 +17,112 @@ 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; /** * Element-wise multiplication of a sparse matrix with a dense tensor. - *

* Returns a sparse matrix. - *

- * The dense tensor `b` may be either a scalar; otherwise `a` must be a rank-3 - * `SparseMatrix`; in this case `b` must be shaped `[batch_size, 1, 1]` and the + *

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 `b` is zero, the sparsity structure of the output does not + *

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 + */ + public static final String OP_NAME = "SparseMatrixMul"; + + private Output output; + + @SuppressWarnings("unchecked") + public SparseMatrixMul(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseMatrixMul operation. - * + * * @param scope current scope * @param a A CSRSparseMatrix. * @param b A dense tensor. * @return a new instance of SparseMatrixMul */ - @Endpoint(describeByClass = true) - public static SparseMatrixMul create(Scope scope, Operand a, Operand b) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseMatrixMul", scope.makeOpName("SparseMatrixMul")); + @Endpoint( + describeByClass = true + ) + public static SparseMatrixMul create(Scope scope, Operand a, + Operand b) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseMatrixMul"); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); - opBuilder = scope.apply(opBuilder); return new SparseMatrixMul(opBuilder.build()); } - + /** + * Gets output. * A dense output tensor. + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatrixMul"; - - private Output output; - - private SparseMatrixMul(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 a39b5cd941c..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,56 +17,89 @@ 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 `sparse_matrix`. + * 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 + */ + public static final String OP_NAME = "SparseMatrixNNZ"; + + private Output nnz; + + public SparseMatrixNNZ(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + nnz = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseMatrixNNZ operation. - * + * * @param scope current scope * @param sparseMatrix A CSRSparseMatrix. * @return a new instance of SparseMatrixNNZ */ - @Endpoint(describeByClass = true) - public static SparseMatrixNNZ create(Scope scope, Operand sparseMatrix) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseMatrixNNZ", scope.makeOpName("SparseMatrixNNZ")); + @Endpoint( + describeByClass = true + ) + public static SparseMatrixNNZ create(Scope scope, Operand sparseMatrix) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseMatrixNNZ"); opBuilder.addInput(sparseMatrix.asOutput()); - opBuilder = scope.apply(opBuilder); return new SparseMatrixNNZ(opBuilder.build()); } - + /** - * The number of nonzeroes of `sparse_matrix`. + * Gets nnz. + * The number of nonzeroes of {@code sparse_matrix}. + * @return nnz. */ public Output nnz() { return nnz; } - + @Override public Output asOutput() { return nnz; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatrixNNZ"; - - private Output nnz; - - private SparseMatrixNNZ(Operation operation) { - super(operation); - int outputIdx = 0; - nnz = operation.output(outputIdx++); + + @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 f440f3fccc7..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,104 +17,130 @@ 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; /** - * Computes the Approximate Minimum Degree (AMD) ordering of `input`. - *

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

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

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

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 `N` - * elements, where the input sparse matrix components each have `N` rows. That is, - * the component contains each of the integers `{0, .. N-1}` exactly once. The - * `i`th element represents the row index that the `i`th row maps to. - *

- * Usage example: - *

{@code
+ * 

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)
- * }
- * `ordering_amd_value` stores the AMD ordering: `[1 2 3 0]`. - *

- * input: A `CSRSparseMatrix`. + *

+ *

{@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 + */ + public static final String OP_NAME = "SparseMatrixOrderingAMD"; + + private Output output; + + public SparseMatrixOrderingAMD(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseMatrixOrderingAMD operation. - * + * * @param scope current scope - * @param input A `CSRSparseMatrix`. + * @param input A {@code CSRSparseMatrix}. * @return a new instance of SparseMatrixOrderingAMD */ - @Endpoint(describeByClass = true) - public static SparseMatrixOrderingAMD create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseMatrixOrderingAMD", scope.makeOpName("SparseMatrixOrderingAMD")); + @Endpoint( + describeByClass = true + ) + public static SparseMatrixOrderingAMD create(Scope scope, Operand input) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseMatrixOrderingAMD"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); return new SparseMatrixOrderingAMD(opBuilder.build()); } - + /** - * The Approximate Minimum Degree (AMD) ordering of `input`. + * Gets output. + * The Approximate Minimum Degree (AMD) ordering of {@code input}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatrixOrderingAMD"; - - private Output output; - - private SparseMatrixOrderingAMD(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 973a63ade9d..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,67 +17,107 @@ 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 softmax of a CSRSparseMatrix. - *

* Calculate the softmax of the innermost dimensions of a SparseMatrix. - *

- * Missing values are treated as `-inf` (i.e., logits of zero probability); and + *

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). */ +@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 + */ + public static final String OP_NAME = "SparseMatrixSoftmax"; + + private Output softmax; + + @SuppressWarnings("unchecked") + public SparseMatrixSoftmax(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + softmax = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseMatrixSoftmax operation. - * + * * @param scope current scope * @param logits A CSRSparseMatrix. - * @param type + * @param type The value of the type attribute + * @param data type for {@code SparseMatrixSoftmax} output and operands * @return a new instance of SparseMatrixSoftmax */ - @Endpoint(describeByClass = true) - public static SparseMatrixSoftmax create(Scope scope, Operand logits, Class type) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseMatrixSoftmax", scope.makeOpName("SparseMatrixSoftmax")); + @Endpoint( + describeByClass = true + ) + public static SparseMatrixSoftmax create(Scope scope, + Operand logits, Class type) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseMatrixSoftmax"); opBuilder.addInput(logits.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("type", Operands.toDataType(type)); return new SparseMatrixSoftmax(opBuilder.build()); } - + /** + * Gets softmax. * A CSRSparseMatrix. + * @return softmax. */ - public Output softmax() { + public Output softmax() { return softmax; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) softmax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatrixSoftmax"; - - private Output softmax; - - private SparseMatrixSoftmax(Operation operation) { - super(operation); - int outputIdx = 0; - softmax = operation.output(outputIdx++); + + @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 3de1b6edc1b..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,63 +17,111 @@ 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 + */ + public static final String OP_NAME = "SparseMatrixSoftmaxGrad"; + + private Output gradient; + + @SuppressWarnings("unchecked") + public SparseMatrixSoftmaxGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + gradient = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseMatrixSoftmaxGrad operation. - * + * * @param scope current scope * @param softmax A CSRSparseMatrix. - * @param gradSoftmax The gradient of `softmax`. - * @param type + * @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 */ - @Endpoint(describeByClass = true) - public static SparseMatrixSoftmaxGrad create(Scope scope, Operand softmax, Operand gradSoftmax, Class type) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseMatrixSoftmaxGrad", scope.makeOpName("SparseMatrixSoftmaxGrad")); + @Endpoint( + describeByClass = true + ) + public static SparseMatrixSoftmaxGrad create(Scope scope, + Operand softmax, Operand gradSoftmax, Class type) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseMatrixSoftmaxGrad"); opBuilder.addInput(softmax.asOutput()); opBuilder.addInput(gradSoftmax.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("type", Operands.toDataType(type)); return new SparseMatrixSoftmaxGrad(opBuilder.build()); } - + /** + * Gets gradient. * The output gradient. + * @return gradient. */ - public Output gradient() { + public Output gradient() { return gradient; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) gradient; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatrixSoftmaxGrad"; - - private Output gradient; - - private SparseMatrixSoftmaxGrad(Operation operation) { - super(operation); - int outputIdx = 0; - gradient = operation.output(outputIdx++); + + @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 91ec5e652a4..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,134 +17,175 @@ 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; /** - * Computes the sparse Cholesky decomposition of `input`. - *

+ * 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 `permutation` must + *

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 `B`, then the `permutation` must be of rank 2; with the same batch - * dimension `B`. There is no support for broadcasting. - *

- * Furthermore, each component vector of `permutation` must be of length `N`, - * containing each of the integers {0, 1, ..., N - 1} exactly once, where `N` is + * 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 + *

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 `A` of the input sparse matrix, the corresponding output - * sparse matrix represents `L`, the lower triangular Cholesky factor satisfying + *

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: - *

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

- * The `type` parameter denotes the type of the matrix elements. The supported - * types are: `float32`, `float64`, `complex64` and `complex128`. - *

- * Usage example: - *

{@code
+ * 
+ *

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)
- * }
- * `dense_cholesky_value` stores the dense Cholesky factor: - *
{@code
+ * 
+ *

{@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 `CSRSparseMatrix`. - * permutation: A `Tensor`. - * type: The type of `input`. + *
+ *

input: A {@code CSRSparseMatrix}. + * 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 + */ + public static final String OP_NAME = "SparseMatrixSparseCholesky"; + + private Output output; + + @SuppressWarnings("unchecked") + public SparseMatrixSparseCholesky(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseMatrixSparseCholesky operation. - * + * * @param scope current scope - * @param input A `CSRSparseMatrix`. + * @param input A {@code CSRSparseMatrix}. * @param permutation A fill-in reducing permutation matrix. - * @param type + * @param type The value of the type attribute + * @param data type for {@code SparseMatrixSparseCholesky} output and operands * @return a new instance of SparseMatrixSparseCholesky */ - @Endpoint(describeByClass = true) - public static SparseMatrixSparseCholesky create(Scope scope, Operand input, Operand permutation, Class type) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseMatrixSparseCholesky", scope.makeOpName("SparseMatrixSparseCholesky")); + @Endpoint( + describeByClass = true + ) + public static SparseMatrixSparseCholesky create(Scope scope, + Operand input, Operand permutation, Class type) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseMatrixSparseCholesky"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(permutation.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("type", Operands.toDataType(type)); return new SparseMatrixSparseCholesky(opBuilder.build()); } - + /** - * The sparse Cholesky decompsition of `input`. + * Gets output. + * The sparse Cholesky decompsition of {@code input}. + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatrixSparseCholesky"; - - private Output output; - - private SparseMatrixSparseCholesky(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 2e47c1ca6ab..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,157 +17,133 @@ 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; /** - * Sparse-matrix-multiplies two CSR matrices `a` and `b`. - *

- * Performs a matrix multiplication of a sparse matrix `a` with a sparse matrix - * `b`; returns a sparse matrix `a * b`, unless either `a` or `b` is transposed or + * 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 `transpose_a`, `adjoint_a`, `transpose_b` - * and `adjoint_b`. At most one of `transpose_a` or `adjoint_a` may be True. - * Similarly, at most one of `transpose_b` or `adjoint_b` may be True. - *

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

- * The `type` parameter denotes the type of the matrix elements. Both `a` and `b` - * must have the same type. The supported types are: `float32`, `float64`, - * `complex64` and `complex128`. - *

- * Both `a` and `b` must have the same rank. Broadcasting is not supported. If they - * have rank 3, each batch of 2D CSRSparseMatrices within `a` and `b` must have the + *

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

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: - *

{@code
+ * 

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)
- * }
- * `c_sm_dense_value` stores the dense matrix product: - *
{@code
+ * 
+ *

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

  *     [[  2.   0.   0.]
  *      [  0.   0.   0.]
  *      [ 35.  40.   0.]
  *      [ -4.   0.   0.]]
- * }
- * a: A `CSRSparseMatrix`. - * b: A `CSRSparseMatrix` with the same type and rank as `a`. - * type: The type of both `a` and `b`. - * transpose_a: If True, `a` transposed before multiplication. - * transpose_b: If True, `b` transposed before multiplication. - * adjoint_a: If True, `a` adjointed before multiplication. - * adjoint_b: If True, `b` adjointed before multiplication. + *
+ *

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. */ +@OpMetadata( + opType = SparseMatrixSparseMatMul.OP_NAME, + inputsClass = SparseMatrixSparseMatMul.Inputs.class +) +@Operator( + group = "linalg.sparse" +) public final class SparseMatrixSparseMatMul extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.sparse.SparseMatrixSparseMatMul} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param transposeA Indicates whether `a` should be transposed. - */ - public Options transposeA(Boolean transposeA) { - this.transposeA = transposeA; - return this; - } - - /** - * @param transposeB Indicates whether `b` should be transposed. - */ - public Options transposeB(Boolean transposeB) { - this.transposeB = transposeB; - return this; - } - - /** - * @param adjointA Indicates whether `a` should be conjugate-transposed. - */ - public Options adjointA(Boolean adjointA) { - this.adjointA = adjointA; - return this; - } - - /** - * @param adjointB Indicates whether `b` should be conjugate-transposed. - */ - public Options adjointB(Boolean adjointB) { - this.adjointB = adjointB; - return this; - } - - private Boolean transposeA; - private Boolean transposeB; - private Boolean adjointA; - private Boolean adjointB; - - private Options() { - } + public static final String OP_NAME = "SparseMatrixSparseMatMul"; + + private Output c; + + @SuppressWarnings("unchecked") + public SparseMatrixSparseMatMul(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + c = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseMatrixSparseMatMul operation. - * + * * @param scope current scope * @param a A CSRSparseMatrix. * @param b A CSRSparseMatrix. - * @param type - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static SparseMatrixSparseMatMul create(Scope scope, Operand a, Operand b, Class type, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseMatrixSparseMatMul", scope.makeOpName("SparseMatrixSparseMatMul")); + @Endpoint( + describeByClass = true + ) + public static SparseMatrixSparseMatMul create(Scope scope, + Operand a, Operand b, Class type, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseMatrixSparseMatMul"); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("type", Operands.toDataType(type)); if (options != null) { for (Options opts : options) { @@ -187,56 +163,171 @@ public static SparseMatrixSparseMatMul create(Scope scope, Ope } return new SparseMatrixSparseMatMul(opBuilder.build()); } - + /** - * @param transposeA Indicates whether `a` should be transposed. + * Sets the transposeA option. + * + * @param transposeA Indicates whether {@code a} should be transposed. + * @return this Options instance. */ public static Options transposeA(Boolean transposeA) { return new Options().transposeA(transposeA); } - + /** - * @param transposeB Indicates whether `b` should be transposed. + * Sets the transposeB option. + * + * @param transposeB Indicates whether {@code b} should be transposed. + * @return this Options instance. */ public static Options transposeB(Boolean transposeB) { return new Options().transposeB(transposeB); } - + /** - * @param adjointA Indicates whether `a` should be conjugate-transposed. + * Sets the adjointA option. + * + * @param adjointA Indicates whether {@code a} should be conjugate-transposed. + * @return this Options instance. */ public static Options adjointA(Boolean adjointA) { return new Options().adjointA(adjointA); } - + /** - * @param adjointB Indicates whether `b` should be conjugate-transposed. + * Sets the adjointB option. + * + * @param adjointB Indicates whether {@code b} should be conjugate-transposed. + * @return this Options instance. */ public static Options adjointB(Boolean adjointB) { return new Options().adjointB(adjointB); } - + /** + * Gets c. * A CSRSparseMatrix. + * @return c. */ - public Output c() { + public Output c() { return c; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) c; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatrixSparseMatMul"; - - private Output c; - - private SparseMatrixSparseMatMul(Operation operation) { - super(operation); - int outputIdx = 0; - c = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.sparse.SparseMatrixSparseMatMul} + */ + public static class Options { + private Boolean transposeA; + + private Boolean transposeB; + + private Boolean adjointA; + + private Boolean adjointB; + + private Options() { + } + + /** + * Sets the transposeA option. + * + * @param transposeA Indicates whether {@code a} should be transposed. + * @return this Options instance. + */ + public Options transposeA(Boolean transposeA) { + this.transposeA = transposeA; + return this; + } + + /** + * Sets the transposeB option. + * + * @param transposeB Indicates whether {@code b} should be transposed. + * @return this Options instance. + */ + public Options transposeB(Boolean transposeB) { + this.transposeB = transposeB; + return this; + } + + /** + * Sets the adjointA option. + * + * @param adjointA Indicates whether {@code a} should be conjugate-transposed. + * @return this Options instance. + */ + public Options adjointA(Boolean adjointA) { + this.adjointA = adjointA; + return this; + } + + /** + * Sets the adjointB option. + * + * @param adjointB Indicates whether {@code b} should be conjugate-transposed. + * @return this Options instance. + */ + public Options adjointB(Boolean adjointB) { + this.adjointB = 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 f1f71b33b4f..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,58 +17,67 @@ 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; /** * Transposes the inner (matrix) dimensions of a CSRSparseMatrix. - *

* 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 { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.sparse.SparseMatrixTranspose} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param conjugate Indicates whether `input` should be conjugated. - */ - public Options conjugate(Boolean conjugate) { - this.conjugate = conjugate; - return this; - } - - private Boolean conjugate; - - private Options() { - } + public static final String OP_NAME = "SparseMatrixTranspose"; + + private Output output; + + @SuppressWarnings("unchecked") + public SparseMatrixTranspose(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseMatrixTranspose operation. - * + * * @param scope current scope * @param input A CSRSparseMatrix. - * @param type - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static SparseMatrixTranspose create(Scope scope, Operand input, Class type, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseMatrixTranspose", scope.makeOpName("SparseMatrixTranspose")); + @Endpoint( + describeByClass = true + ) + public static SparseMatrixTranspose create(Scope scope, + Operand input, Class type, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseMatrixTranspose"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("type", Operands.toDataType(type)); if (options != null) { for (Options opts : options) { @@ -79,35 +88,78 @@ public static SparseMatrixTranspose create(Scope scope, Operan } return new SparseMatrixTranspose(opBuilder.build()); } - + /** - * @param conjugate Indicates whether `input` should be conjugated. + * Sets the conjugate option. + * + * @param conjugate Indicates whether {@code input} should be conjugated. + * @return this Options instance. */ public static Options conjugate(Boolean conjugate) { return new Options().conjugate(conjugate); } - + /** + * Gets output. * A CSRSparseMatrix. + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatrixTranspose"; - - private Output output; - - private SparseMatrixTranspose(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.sparse.SparseMatrixTranspose} + */ + public static class Options { + private Boolean conjugate; + + private Options() { + } + + /** + * Sets the conjugate option. + * + * @param conjugate Indicates whether {@code input} should be conjugated. + * @return this Options instance. + */ + public Options conjugate(Boolean conjugate) { + this.conjugate = 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 eea60f2298a..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,61 +17,103 @@ 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 `dense_shape`. + * 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 + */ + public static final String OP_NAME = "SparseMatrixZeros"; + + private Output sparseMatrix; + + @SuppressWarnings("unchecked") + public SparseMatrixZeros(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + sparseMatrix = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseMatrixZeros operation. - * + * * @param scope current scope * @param denseShape The desired matrix shape. - * @param type + * @param type The value of the type attribute + * @param data type for {@code SparseMatrixZeros} output and operands * @return a new instance of SparseMatrixZeros */ - @Endpoint(describeByClass = true) - public static SparseMatrixZeros create(Scope scope, Operand denseShape, Class type) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseMatrixZeros", scope.makeOpName("SparseMatrixZeros")); + @Endpoint( + describeByClass = true + ) + public static SparseMatrixZeros create(Scope scope, Operand denseShape, + Class type) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseMatrixZeros"); opBuilder.addInput(denseShape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("type", Operands.toDataType(type)); return new SparseMatrixZeros(opBuilder.build()); } - + /** - * An empty CSR matrix with shape `dense_shape`. + * Gets sparseMatrix. + * An empty CSR matrix with shape {@code dense_shape}. + * @return sparseMatrix. */ - public Output sparseMatrix() { + public Output sparseMatrix() { return sparseMatrix; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) sparseMatrix; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatrixZeros"; - - private Output sparseMatrix; - - private SparseMatrixZeros(Operation operation) { - super(operation); - int outputIdx = 0; - sparseMatrix = operation.output(outputIdx++); + + @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 985d39b6ce5..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,62 +17,115 @@ 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 + */ + public static final String OP_NAME = "SparseTensorToCSRSparseMatrix"; + + private Output sparseMatrix; + + @SuppressWarnings("unchecked") + public SparseTensorToCSRSparseMatrix(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + sparseMatrix = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseTensorToCSRSparseMatrix operation. - * + * * @param scope current scope * @param indices SparseTensor indices. * @param values SparseTensor values. * @param denseShape SparseTensor dense shape. * @return a new instance of SparseTensorToCSRSparseMatrix */ - @Endpoint(describeByClass = true) - public static SparseTensorToCSRSparseMatrix create(Scope scope, Operand indices, Operand values, Operand denseShape) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseTensorToCSRSparseMatrix", scope.makeOpName("SparseTensorToCSRSparseMatrix")); + @Endpoint( + describeByClass = true + ) + public static SparseTensorToCSRSparseMatrix create(Scope scope, Operand indices, + Operand values, Operand denseShape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseTensorToCSRSparseMatrix"); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(values.asOutput()); opBuilder.addInput(denseShape.asOutput()); - opBuilder = scope.apply(opBuilder); return new SparseTensorToCSRSparseMatrix(opBuilder.build()); } - + /** + * Gets sparseMatrix. * A (possibly batched) CSRSparseMatrix. + * @return sparseMatrix. */ - public Output sparseMatrix() { + public Output sparseMatrix() { return sparseMatrix; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) sparseMatrix; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseTensorToCSRSparseMatrix"; - - private Output sparseMatrix; - - private SparseTensorToCSRSparseMatrix(Operation operation) { - super(operation); - int outputIdx = 0; - sparseMatrix = operation.output(outputIdx++); + + @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 dd31fbdc711..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,62 +17,99 @@ 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 absolute value of a tensor. - *

- * Given a tensor `x`, this operation returns a tensor containing the absolute - * value of each element in `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 + * 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|\). */ -@Operator(group = "math") +@OpMetadata( + opType = Abs.OP_NAME, + inputsClass = Abs.Inputs.class +) +@Operator( + group = "math" +) public final class Abs extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Abs"; + + private Output y; + + public Abs(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Abs operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Abs} output and operands * @return a new instance of Abs */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Abs create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Abs", scope.makeOpName("Abs")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Abs"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Abs(opBuilder.build()); + return new Abs<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Abs"; - - private Output y; - - private Abs(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 1bfbe61fac9..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,64 +26,106 @@ 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 element-wise sum of a list of tensors. - *

- * `tf.accumulate_n_v2` performs the same operation as `tf.add_n`, but does not + * {@code tf.accumulate_n_v2} performs the same operation as {@code tf.add_n}, but does not * wait for all of its inputs to be ready before beginning to sum. This can * save memory if inputs are ready at different times, since minimum temporary * storage is proportional to the output size rather than the inputs size. - *

- * Unlike the original `accumulate_n`, `accumulate_n_v2` is differentiable. - *

- * Returns a `Tensor` of same shape and type as the elements of `inputs`. - * - * @param data type for {@code sum()} output + *

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}. */ -@Operator(group = "math") +@OpMetadata( + opType = AccumulateN.OP_NAME, + inputsClass = AccumulateN.Inputs.class +) +@Operator( + group = "math" +) public final class AccumulateN extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new AccumulateN operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AccumulateNV2"; + + private Output sum; + + public AccumulateN(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + sum = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new AccumulateNV2 operation. + * * @param scope current scope - * @param inputs A list of `Tensor` objects, each with same shape and type. - * @param shape Shape of elements of `inputs`. + * @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 * @return a new instance of AccumulateN */ - @Endpoint(describeByClass = true) - public static AccumulateN create(Scope scope, Iterable> inputs, Shape shape) { - OperationBuilder opBuilder = scope.env().opBuilder("AccumulateNV2", scope.makeOpName("AccumulateN")); + @Endpoint( + describeByClass = true + ) + public static AccumulateN create(Scope scope, Iterable> inputs, + Shape shape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AccumulateN"); opBuilder.addInputList(Operands.asOutputs(inputs)); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("shape", shape); - return new AccumulateN(opBuilder.build()); + return new AccumulateN<>(opBuilder.build()); } - + /** + * Gets sum. + * + * @return sum. */ public Output sum() { return sum; } - + @Override public Output asOutput() { return sum; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AccumulateNV2"; - - private Output sum; - - private AccumulateN(Operation operation) { - super(operation); - int outputIdx = 0; - sum = operation.output(outputIdx++); + + @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 8e0c146d03b..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,64 +17,98 @@ 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 `tf.math.acos` operation returns the inverse cosine of each element of the tensor. If `y = tf.math.cos(x)` then, `x = tf.math.acos(y)`. - *

- * Input range is `[-1, 1]` and the output has a range of `[0, pi]`. - * - * - * @param data type for {@code y()} output + * 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]}. */ -@Operator(group = "math") +@OpMetadata( + opType = Acos.OP_NAME, + inputsClass = Acos.Inputs.class +) +@Operator( + group = "math" +) public final class Acos extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Acos"; + + private Output y; + + public Acos(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Acos operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Acos} output and operands * @return a new instance of Acos */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Acos create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Acos", scope.makeOpName("Acos")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Acos"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Acos(opBuilder.build()); + return new Acos<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Acos"; - - private Output y; - - private Acos(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 64384fef1c0..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,66 +17,102 @@ 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 inverse hyperbolic cosine of x element-wise. - *

* Given an input tensor, the function computes inverse hyperbolic cosine of every element. - * Input range is `[1, inf]`. It returns `nan` if the input lies outside the range. - *

{@code
- * 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 + * Input range is {@code [1, inf]}. It returns {@code nan} if the input lies outside the range. + *
+ * 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]
+ * 
*/ -@Operator(group = "math") +@OpMetadata( + opType = Acosh.OP_NAME, + inputsClass = Acosh.Inputs.class +) +@Operator( + group = "math" +) public final class Acosh extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Acosh"; + + private Output y; + + public Acosh(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Acosh operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Acosh} output and operands * @return a new instance of Acosh */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Acosh create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Acosh", scope.makeOpName("Acosh")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Acosh"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Acosh(opBuilder.build()); + return new Acosh<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Acosh"; - - private Output y; - - private Acosh(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 5ec4a7e295a..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,68 +17,108 @@ 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: `math.Add` supports broadcasting. `AddN` does not. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - *

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

- * Both input and output have a range `(-inf, inf)`. - * - * - * @param data type for {@code z()} output + * NOTE: {@code math.Add} supports broadcasting. {@code AddN} does not. More about broadcasting + * 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)}. */ -@Operator(group = "math") +@OpMetadata( + opType = Add.OP_NAME, + inputsClass = Add.Inputs.class +) +@Operator( + group = "math" +) public final class Add extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Add"; + + private Output z; + + public Add(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Add operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Add create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("Add", scope.makeOpName("Add")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Add"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Add(opBuilder.build()); + return new Add<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Add"; - - private Output z; - - private Add(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 a29b27e2ce7..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,67 +17,104 @@ 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; /** * Add all input tensors element wise. - *

- * Inputs must be of same size and shape. - *

- *

{@code
- *   x = [9, 7, 10]
- *   tf.math.add_n(x) ==> 26
- *   }
- * - * - * @param data type for {@code sum()} output + * Inputs must be of same size and shape. + *
+ * x = [9, 7, 10]
+ * tf.math.add_n(x) ==> 26
+ * 
*/ -@Operator(group = "math") +@OpMetadata( + opType = AddN.OP_NAME, + inputsClass = AddN.Inputs.class +) +@Operator( + group = "math" +) public final class AddN extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AddN"; + + private Output sum; + + public AddN(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + sum = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new AddN operation. - * + * * @param scope current scope - * @param inputs + * @param inputs The inputs value + * @param data type for {@code AddN} output and operands * @return a new instance of AddN */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static AddN create(Scope scope, Iterable> inputs) { - OperationBuilder opBuilder = scope.env().opBuilder("AddN", scope.makeOpName("AddN")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AddN"); opBuilder.addInputList(Operands.asOutputs(inputs)); - opBuilder = scope.apply(opBuilder); - return new AddN(opBuilder.build()); + return new AddN<>(opBuilder.build()); } - + /** + * Gets sum. + * + * @return sum. */ public Output sum() { return sum; } - + @Override public Output asOutput() { return sum; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AddN"; - - private Output sum; - - private AddN(Operation operation) { - super(operation); - int outputIdx = 0; - sum = operation.output(outputIdx++); + + @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 c92611dbc52..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,91 +17,135 @@ 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; /** * Returns the argument of a complex number. - *

- * Given a tensor `input` of complex numbers, this operation returns a tensor of - * type `float` that is the argument of each element in `input`. All elements in - * `input` must be complex numbers of the form \\(a + bj\\), where a - * is the real part and b is the imaginary part. - *

- * The argument returned by this operation is of the form \\(atan2(b, a)\\). - *

- * For example: - *

{@code
+ * Given a tensor {@code input} of complex numbers, this operation returns a tensor of
+ * type {@code float} that is the argument of each element in {@code input}. All elements in
+ * {@code input} must be complex numbers of the form \(a + bj\), where a
+ * is the real part and b is the imaginary part.
+ * 

The argument returned by this operation is of the form \(atan2(b, a)\). + *

For example: + *

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

{@literal @}compatibility(numpy)
* Equivalent to np.angle. - * @end_compatibility - * - * @param data type for {@code output()} output + *
{@literal @}end_compatibility */ -@Operator(group = "math") +@OpMetadata( + opType = Angle.OP_NAME, + inputsClass = Angle.Inputs.class +) +@Operator( + group = "math" +) public final class Angle extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Angle"; + + private Output output; + + public Angle(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Angle operation. - * + * * @param scope current scope - * @param input - * @param Tout + * @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 */ - @Endpoint(describeByClass = true) - public static Angle create(Scope scope, Operand input, Class Tout) { - OperationBuilder opBuilder = scope.env().opBuilder("Angle", scope.makeOpName("Angle")); + @Endpoint( + describeByClass = true + ) + public static Angle create(Scope scope, Operand input, + Class Tout) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Angle"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tout", Operands.toDataType(Tout)); - return new Angle(opBuilder.build()); + return new Angle<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Angle operation using default output types. - * + * Factory method to create a class wrapping a new Angle operation, with the default output types. + * * @param scope current scope - * @param input - * @return a new instance of Angle + * @param input The input value + * @return a new instance of Angle, with default output types */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Angle 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Angle"; - - private Output output; - - private Angle(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 2a7ecb6b5d7..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,57 +17,65 @@ 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. + * Returns the truth value of abs(x-y) < tolerance element-wise. */ -@Operator(group = "math") +@OpMetadata( + opType = ApproximateEqual.OP_NAME, + inputsClass = ApproximateEqual.Inputs.class +) +@Operator( + group = "math" +) public final class ApproximateEqual extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.math.ApproximateEqual} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tolerance - */ - public Options tolerance(Float tolerance) { - this.tolerance = tolerance; - return this; - } - - private Float tolerance; - - private Options() { - } + public static final String OP_NAME = "ApproximateEqual"; + + private Output z; + + public ApproximateEqual(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApproximateEqual operation. - * + * * @param scope current scope - * @param x - * @param y - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static ApproximateEqual create(Scope scope, Operand x, Operand y, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ApproximateEqual", scope.makeOpName("ApproximateEqual")); + @Endpoint( + describeByClass = true + ) + public static ApproximateEqual create(Scope scope, Operand x, Operand y, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ApproximateEqual"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.tolerance != null) { @@ -77,33 +85,83 @@ public static ApproximateEqual create(Scope scope, Operand } return new ApproximateEqual(opBuilder.build()); } - + /** - * @param tolerance + * Sets the tolerance option. + * + * @param tolerance the tolerance option + * @return this Options instance. */ public static Options tolerance(Float tolerance) { return new Options().tolerance(tolerance); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApproximateEqual"; - - private Output z; - - private ApproximateEqual(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.math.ApproximateEqual} + */ + public static class Options { + private Float tolerance; + + private Options() { + } + + /** + * Sets the tolerance option. + * + * @param tolerance the tolerance option + * @return this Options instance. + */ + public Options tolerance(Float tolerance) { + this.tolerance = 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 051a1645c72..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,95 +17,154 @@ 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; /** * Returns the index with the largest value across dimensions of a tensor. - *

* Note that in case of ties the identity of the return value is not guaranteed. - *

- * Usage: - *

{@code
- *   import tensorflow as tf
- *   a = [1, 10, 26.9, 2.8, 166.32, 62.3]
- *   b = tf.math.argmax(input = a)
- *   c = tf.keras.backend.eval(b)
- *   # c = 4
- *   # here a[4] = 166.32 which is the largest element of a across axis 0
- *   }
- * - * - * @param data type for {@code output()} output + *

Usage: + *

+ * import tensorflow as tf
+ * a = [1, 10, 26.9, 2.8, 166.32, 62.3]
+ * b = tf.math.argmax(input = a)
+ * c = tf.keras.backend.eval(b)
+ * # c = 4
+ * # here a[4] = 166.32 which is the largest element of a across axis 0
+ * 
*/ -@Operator(group = "math") +@OpMetadata( + opType = ArgMax.OP_NAME, + inputsClass = ArgMax.Inputs.class +) +@Operator( + group = "math" +) public final class ArgMax extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ArgMax"; + + private Output output; + + public ArgMax(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ArgMax operation. - * + * * @param scope current scope - * @param input - * @param dimension int32 or int64, must be in the range `[-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 + * @param outputType The value of the outputType attribute + * @param data type for {@code ArgMax} output and operands * @return a new instance of ArgMax */ - @Endpoint(describeByClass = true) - public static ArgMax create(Scope scope, Operand input, Operand dimension, Class outputType) { - OperationBuilder opBuilder = scope.env().opBuilder("ArgMax", scope.makeOpName("ArgMax")); + @Endpoint( + describeByClass = true + ) + public static ArgMax create(Scope scope, Operand input, + Operand dimension, Class outputType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ArgMax"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(dimension.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_type", Operands.toDataType(outputType)); - return new ArgMax(opBuilder.build()); + return new ArgMax<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new ArgMax operation using default output types. - * + * Factory method to create a class wrapping a new ArgMax operation, with the default output types. + * * @param scope current scope - * @param input - * @param dimension int32 or int64, must be in the range `[-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 + * @return a new instance of ArgMax, with default output types */ - @Endpoint(describeByClass = true) - public static ArgMax create(Scope scope, Operand input, Operand dimension) { + @Endpoint( + describeByClass = true + ) + public static ArgMax create(Scope scope, Operand input, + Operand dimension) { return create(scope, input, dimension, TInt64.class); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ArgMax"; - - private Output output; - - private ArgMax(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 8ff43dd5900..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,95 +17,154 @@ 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; /** * Returns the index with the smallest value across dimensions of a tensor. - *

* Note that in case of ties the identity of the return value is not guaranteed. - *

- * Usage: - *

{@code
- *   import tensorflow as tf
- *   a = [1, 10, 26.9, 2.8, 166.32, 62.3]
- *   b = tf.math.argmin(input = a)
- *   c = tf.keras.backend.eval(b)
- *   # c = 0
- *   # here a[0] = 1 which is the smallest element of a across axis 0
- *   }
- * - * - * @param data type for {@code output()} output + *

Usage: + *

+ * import tensorflow as tf
+ * a = [1, 10, 26.9, 2.8, 166.32, 62.3]
+ * b = tf.math.argmin(input = a)
+ * c = tf.keras.backend.eval(b)
+ * # c = 0
+ * # here a[0] = 1 which is the smallest element of a across axis 0
+ * 
*/ -@Operator(group = "math") +@OpMetadata( + opType = ArgMin.OP_NAME, + inputsClass = ArgMin.Inputs.class +) +@Operator( + group = "math" +) public final class ArgMin extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ArgMin"; + + private Output output; + + public ArgMin(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ArgMin operation. - * + * * @param scope current scope - * @param input - * @param dimension int32 or int64, must be in the range `[-rank(input), rank(input))`. + * @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 + * @param outputType The value of the outputType attribute + * @param data type for {@code ArgMin} output and operands * @return a new instance of ArgMin */ - @Endpoint(describeByClass = true) - public static ArgMin create(Scope scope, Operand input, Operand dimension, Class outputType) { - OperationBuilder opBuilder = scope.env().opBuilder("ArgMin", scope.makeOpName("ArgMin")); + @Endpoint( + describeByClass = true + ) + public static ArgMin create(Scope scope, Operand input, + Operand dimension, Class outputType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ArgMin"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(dimension.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_type", Operands.toDataType(outputType)); - return new ArgMin(opBuilder.build()); + return new ArgMin<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new ArgMin operation using default output types. - * + * Factory method to create a class wrapping a new ArgMin operation, with the default output types. + * * @param scope current scope - * @param input - * @param dimension int32 or int64, must be in the range `[-rank(input), rank(input))`. + * @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. - * @return a new instance of ArgMin + * @return a new instance of ArgMin, with default output types */ - @Endpoint(describeByClass = true) - public static ArgMin create(Scope scope, Operand input, Operand dimension) { + @Endpoint( + describeByClass = true + ) + public static ArgMin create(Scope scope, Operand input, + Operand dimension) { return create(scope, input, dimension, TInt64.class); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ArgMin"; - - private Output output; - - private ArgMin(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 0a4a3e7fc18..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,74 +17,108 @@ 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 trignometric inverse sine of x element-wise. - *

- * The `tf.math.asin` operation returns the inverse of `tf.math.sin`, such that - * if `y = tf.math.sin(x)` then, `x = tf.math.asin(y)`. - *

- * Note: The output of `tf.math.asin` will lie within the invertible range + * The {@code tf.math.asin} operation returns the inverse of {@code tf.math.sin}, such that + * if {@code y = tf.math.sin(x)} then, {@code x = tf.math.asin(y)}. + *

Note: The output of {@code tf.math.asin} will lie within the invertible range * of sine, i.e [-pi/2, pi/2]. - *

- * For example: - *

{@code
+ * 

For example: + *

  * # Note: [1.047, 0.785] ~= [(pi/3), (pi/4)]
  * x = tf.constant([1.047, 0.785])
  * y = tf.math.sin(x) # [0.8659266, 0.7068252]
- * 
+ *
  * tf.math.asin(y) # [1.047, 0.785] = x
- * }
- * - * - * @param data type for {@code y()} output + *
*/ -@Operator(group = "math") +@OpMetadata( + opType = Asin.OP_NAME, + inputsClass = Asin.Inputs.class +) +@Operator( + group = "math" +) public final class Asin extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Asin"; + + private Output y; + + public Asin(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Asin operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Asin} output and operands * @return a new instance of Asin */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Asin create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Asin", scope.makeOpName("Asin")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Asin"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Asin(opBuilder.build()); + return new Asin<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Asin"; - - private Output y; - - private Asin(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 920f43774ed..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,68 +17,103 @@ 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 inverse hyperbolic sine of x element-wise. - *

- * Given an input tensor, this function computes inverse hyperbolic sine - * for every element in the tensor. Both input and output has a range of - * `[-inf, inf]`. - *

- *

{@code
- *   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 + * Given an input tensor, this function computes inverse hyperbolic sine + * for every element in the tensor. Both input and output has a range of + * {@code [-inf, inf]}. + *
+ * 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]
+ * 
*/ -@Operator(group = "math") +@OpMetadata( + opType = Asinh.OP_NAME, + inputsClass = Asinh.Inputs.class +) +@Operator( + group = "math" +) public final class Asinh extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Asinh"; + + private Output y; + + public Asinh(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Asinh operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Asinh} output and operands * @return a new instance of Asinh */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Asinh create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Asinh", scope.makeOpName("Asinh")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Asinh"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Asinh(opBuilder.build()); + return new Asinh<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Asinh"; - - private Output y; - - private Asinh(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 07397b65f6b..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,74 +17,108 @@ 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 trignometric inverse tangent of x element-wise. - *

- * The `tf.math.atan` operation returns the inverse of `tf.math.tan`, such that - * if `y = tf.math.tan(x)` then, `x = tf.math.atan(y)`. - *

- * Note: The output of `tf.math.atan` will lie within the invertible range + * The {@code tf.math.atan} operation returns the inverse of {@code tf.math.tan}, such that + * if {@code y = tf.math.tan(x)} then, {@code x = tf.math.atan(y)}. + *

Note: The output of {@code tf.math.atan} will lie within the invertible range * of tan, i.e (-pi/2, pi/2). - *

- * For example: - *

{@code
+ * 

For example: + *

  * # Note: [1.047, 0.785] ~= [(pi/3), (pi/4)]
  * x = tf.constant([1.047, 0.785])
  * y = tf.math.tan(x) # [1.731261, 0.99920404]
- * 
+ *
  * tf.math.atan(y) # [1.047, 0.785] = x
- * }
- * - * - * @param data type for {@code y()} output + *
*/ -@Operator(group = "math") +@OpMetadata( + opType = Atan.OP_NAME, + inputsClass = Atan.Inputs.class +) +@Operator( + group = "math" +) public final class Atan extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Atan"; + + private Output y; + + public Atan(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Atan operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Atan} output and operands * @return a new instance of Atan */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Atan create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Atan", scope.makeOpName("Atan")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Atan"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Atan(opBuilder.build()); + return new Atan<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Atan"; - - private Output y; - - private Atan(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 e8ad73ca897..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,66 +17,120 @@ 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 arctangent of `y/x` element-wise, respecting signs of the arguments. - *

+ * Computes arctangent of {@code y/x} element-wise, respecting signs of the arguments. * This is the angle \( \theta \in [-\pi, \pi] \) such that * \[ x = r \cos(\theta) \] * and * \[ y = r \sin(\theta) \] - * where \(r = \sqrt(x^2 + y^2) \). - * - * @param data type for {@code z()} output + * where \(r = \sqrt{x^2 + y^2} \). + *

For example: + *

+ *
+ *
+ *

x = [1., 1.] + * y = [1., -1.] + * print((tf.math.atan2(y,x) * (180 / np.pi)).numpy()) + * [ 45. -45.] + *

+ *
+ *
*/ -@Operator(group = "math") +@OpMetadata( + opType = Atan2.OP_NAME, + inputsClass = Atan2.Inputs.class +) +@Operator( + group = "math" +) public final class Atan2 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Atan2"; + + private Output z; + + public Atan2(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Atan2 operation. - * + * * @param scope current scope - * @param y - * @param x + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Atan2 create(Scope scope, Operand y, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Atan2", scope.makeOpName("Atan2")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Atan2"); opBuilder.addInput(y.asOutput()); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Atan2(opBuilder.build()); + return new Atan2<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Atan2"; - - private Output z; - - private Atan2(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 e24a225e341..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,70 +17,105 @@ 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 inverse hyperbolic tangent of x element-wise. - *

- * Given an input tensor, this function computes inverse hyperbolic tangent - * for every element in the tensor. Input range is `[-1,1]` and output range is - * `[-inf, inf]`. If input is `-1`, output will be `-inf` and if the - * input is `1`, output will be `inf`. Values outside the range will have - * `nan` as output. - *

- *

{@code
- *   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 + * Given an input tensor, this function computes inverse hyperbolic tangent + * for every element in the tensor. Input range is {@code [-1,1]} and output range is + * {@code [-inf, inf]}. If input is {@code -1}, output will be {@code -inf} and if the + * input is {@code 1}, output will be {@code inf}. Values outside the range will have + * {@code nan} as output. + *
+ * 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]
+ * 
*/ -@Operator(group = "math") +@OpMetadata( + opType = Atanh.OP_NAME, + inputsClass = Atanh.Inputs.class +) +@Operator( + group = "math" +) public final class Atanh extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Atanh"; + + private Output y; + + public Atanh(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Atanh operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Atanh} output and operands * @return a new instance of Atanh */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Atanh create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Atanh", scope.makeOpName("Atanh")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Atanh"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Atanh(opBuilder.build()); + return new Atanh<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Atanh"; - - private Output y; - - private Atanh(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 ec9c56c199e..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,55 +17,96 @@ 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; /** - * @param data type for {@code y()} output + * The BesselI0 operation */ +@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 + */ + public static final String OP_NAME = "BesselI0"; + + private Output y; + + public BesselI0(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselI0 operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code BesselI0} output and operands * @return a new instance of BesselI0 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselI0 create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("BesselI0", scope.makeOpName("BesselI0")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BesselI0"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BesselI0(opBuilder.build()); + return new BesselI0<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselI0"; - - private Output y; - - private BesselI0(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 26cfa68f377..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,55 +17,96 @@ 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; /** - * @param data type for {@code y()} output + * The BesselI0e operation */ +@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 + */ + public static final String OP_NAME = "BesselI0e"; + + private Output y; + + public BesselI0e(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselI0e operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code BesselI0e} output and operands * @return a new instance of BesselI0e */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselI0e create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("BesselI0e", scope.makeOpName("BesselI0e")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BesselI0e"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BesselI0e(opBuilder.build()); + return new BesselI0e<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselI0e"; - - private Output y; - - private BesselI0e(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 4eb2b0d38da..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,55 +17,96 @@ 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; /** - * @param data type for {@code y()} output + * The BesselI1 operation */ +@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 + */ + public static final String OP_NAME = "BesselI1"; + + private Output y; + + public BesselI1(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselI1 operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code BesselI1} output and operands * @return a new instance of BesselI1 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselI1 create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("BesselI1", scope.makeOpName("BesselI1")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BesselI1"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BesselI1(opBuilder.build()); + return new BesselI1<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselI1"; - - private Output y; - - private BesselI1(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 8eed4770299..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,55 +17,96 @@ 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; /** - * @param data type for {@code y()} output + * The BesselI1e operation */ +@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 + */ + public static final String OP_NAME = "BesselI1e"; + + private Output y; + + public BesselI1e(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselI1e operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code BesselI1e} output and operands * @return a new instance of BesselI1e */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselI1e create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("BesselI1e", scope.makeOpName("BesselI1e")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BesselI1e"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BesselI1e(opBuilder.build()); + return new BesselI1e<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselI1e"; - - private Output y; - - private BesselI1e(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 86caad140d5..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,73 +17,119 @@ 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 regularized incomplete beta integral \\(I_x(a, b)\\). - *

+ * Compute the regularized incomplete beta integral \(I_x(a, b)\). * The regularized incomplete beta integral is defined as: - *

- * \\(I_x(a, b) = \frac{B(x; a, b)}{B(a, b)}\\) - *

- * where - *

- * \\(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 + *

\(I_x(a, b) = \frac{B(x; a, b)}{B(a, b)}\) + *

where + *

\(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 */ -@Operator(group = "math") +@OpMetadata( + opType = Betainc.OP_NAME, + inputsClass = Betainc.Inputs.class +) +@Operator( + group = "math" +) public final class Betainc extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Betainc"; + + private Output z; + + public Betainc(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Betainc operation. - * + * * @param scope current scope - * @param a - * @param b - * @param x + * @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 */ - @Endpoint(describeByClass = true) - public static Betainc create(Scope scope, Operand a, Operand b, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Betainc", scope.makeOpName("Betainc")); + @Endpoint( + describeByClass = true + ) + public static Betainc create(Scope scope, Operand a, Operand b, + Operand x) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Betainc"); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Betainc(opBuilder.build()); + return new Betainc<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Betainc"; - - private Output z; - - private Betainc(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 9e8f03af4cc..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,75 +17,125 @@ 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; /** * Counts the number of occurrences of each value in an integer array. - *

- * Outputs a vector with length `size` and the same dtype as `weights`. If - * `weights` are empty, then index `i` stores the number of times the value `i` is - * counted in `arr`. If `weights` are non-empty, then index `i` stores the sum of - * the value in `weights` at each index where the corresponding value in `arr` is - * `i`. - *

- * Values in `arr` outside of the range [0, size) are ignored. - * - * @param data type for {@code bins()} output + * Outputs a vector with length {@code size} and the same dtype as {@code weights}. If + * {@code weights} are empty, then index {@code i} stores the number of times the value {@code i} is + * counted in {@code arr}. If {@code weights} are non-empty, then index {@code i} stores the sum of + * 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. */ -@Operator(group = "math") +@OpMetadata( + opType = Bincount.OP_NAME, + inputsClass = Bincount.Inputs.class +) +@Operator( + group = "math" +) public final class Bincount extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Bincount"; + + private Output bins; + + public Bincount(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + bins = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Bincount operation. - * + * * @param scope current scope - * @param arr int32 `Tensor`. - * @param size non-negative int32 scalar `Tensor`. - * @param weights is an int32, int64, float32, or float64 `Tensor` with the same - * shape as `arr`, or a length-0 `Tensor`, in which case it acts as all weights + * @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 + * shape as {@code arr}, or a length-0 {@code Tensor}, in which case it acts as all weights * equal to 1. + * @param data type for {@code Bincount} output and operands * @return a new instance of Bincount */ - @Endpoint(describeByClass = true) - public static Bincount create(Scope scope, Operand arr, Operand size, Operand weights) { - OperationBuilder opBuilder = scope.env().opBuilder("Bincount", scope.makeOpName("Bincount")); + @Endpoint( + describeByClass = true + ) + public static Bincount create(Scope scope, Operand arr, + Operand sizeOutput, Operand weights) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Bincount"); opBuilder.addInput(arr.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder.addInput(weights.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Bincount(opBuilder.build()); + return new Bincount<>(opBuilder.build()); } - + /** - * 1D `Tensor` with length equal to `size`. The counts or summed weights for + * Gets bins. + * 1D {@code Tensor} with length equal to {@code size}. The counts or summed weights for * each value in the range [0, size). + * @return bins. */ public Output bins() { return bins; } - + @Override public Output asOutput() { return bins; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Bincount"; - - private Output bins; - - private Bincount(Operation operation) { - super(operation); - int outputIdx = 0; - bins = operation.output(outputIdx++); + + @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 ab36643898b..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,58 +17,96 @@ 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 */ -@Operator(group = "math") +@OpMetadata( + opType = Ceil.OP_NAME, + inputsClass = Ceil.Inputs.class +) +@Operator( + group = "math" +) public final class Ceil extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Ceil"; + + private Output y; + + public Ceil(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Ceil operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Ceil} output and operands * @return a new instance of Ceil */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Ceil create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Ceil", scope.makeOpName("Ceil")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Ceil"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Ceil(opBuilder.build()); + return new Ceil<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Ceil"; - - private Output y; - - private Ceil(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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/CompareAndBitpack.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/CompareAndBitpack.java deleted file mode 100644 index 7a3ea0e193f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/CompareAndBitpack.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.math; - -import 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.TUint8; -import org.tensorflow.types.family.TType; - -/** - * Compare values of `input` to `threshold` and pack resulting bits into a `uint8`. - *

- * Each comparison returns a boolean `true` (if `input_value > threshold`) - * or and `false` otherwise. - *

- * This operation is useful for Locality-Sensitive-Hashing (LSH) and other - * algorithms that use hashing approximations of cosine and `L2` distances; - * codes can be generated from an input via: - *

{@code
- * codebook_size = 50
- * codebook_bits = codebook_size * 32
- * codebook = tf.get_variable('codebook', [x.shape[-1].value, codebook_bits],
- *                            dtype=x.dtype,
- *                            initializer=tf.orthogonal_initializer())
- * codes = compare_and_threshold(tf.matmul(x, codebook), threshold=0.)
- * codes = tf.bitcast(codes, tf.int32)  # go from uint8 to int32
- * # now codes has shape x.shape[:-1] + [codebook_size]
- * }
- * NOTE: Currently, the innermost dimension of the tensor must be divisible - * by 8. - *

- * Given an `input` shaped `[s0, s1, ..., s_n]`, the output is - * a `uint8` tensor shaped `[s0, s1, ..., s_n / 8]`. - */ -@Operator(group = "math") -public final class CompareAndBitpack extends RawOp implements Operand { - - /** - * Factory method to create a class wrapping a new CompareAndBitpack operation. - * - * @param scope current scope - * @param input Values to compare against `threshold` and bitpack. - * @param threshold Threshold to compare against. - * @return a new instance of CompareAndBitpack - */ - @Endpoint(describeByClass = true) - public static CompareAndBitpack create(Scope scope, Operand input, Operand threshold) { - OperationBuilder opBuilder = scope.env().opBuilder("CompareAndBitpack", scope.makeOpName("CompareAndBitpack")); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(threshold.asOutput()); - opBuilder = scope.apply(opBuilder); - return new CompareAndBitpack(opBuilder.build()); - } - - /** - * The bitpacked comparisons. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CompareAndBitpack"; - - private Output output; - - private CompareAndBitpack(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ComplexAbs.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ComplexAbs.java index 67a698e0365..807724d575d 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,80 +17,138 @@ 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; /** * Computes the complex absolute value of a tensor. - *

- * Given a tensor `x` of complex numbers, this operation returns a tensor of type - * `float` or `double` that is the absolute value of each element in `x`. All - * elements in `x` must be complex numbers of the form \\(a + bj\\). The absolute - * value is computed as \\( \sqrt{a^2 + b^2}\\). - * - * @param data type for {@code y()} output + * Given a tensor {@code x} of complex numbers, this operation returns a tensor of type + * {@code float} or {@code double} that is the absolute value of each element in {@code x}. All + * elements in {@code x} must be complex numbers of the form \(a + bj\). The absolute + * value is computed as \( \sqrt{a^2 + b^2}\). + *

For example: + *

+ *
+ *
+ *

x = tf.complex(3.0, 4.0) + * print((tf.raw_ops.ComplexAbs(x=x, Tout=tf.dtypes.float32, name=None)).numpy()) + * 5.0 + *

+ *
+ *
*/ -@Operator(group = "math") +@OpMetadata( + opType = ComplexAbs.OP_NAME, + inputsClass = ComplexAbs.Inputs.class +) +@Operator( + group = "math" +) public final class ComplexAbs extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ComplexAbs"; + + private Output y; + + public ComplexAbs(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ComplexAbs operation. - * + * * @param scope current scope - * @param x - * @param Tout + * @param x The x value + * @param Tout Need to be {@code tf.float32} when the type of {@code x} is {@code tf.complex64}. + * Need to be {@code tf.float64} when the type of {@code x} is {@code tf.complex128}. + * @param data type for {@code ComplexAbs} output and operands * @return a new instance of ComplexAbs */ - @Endpoint(describeByClass = true) - public static ComplexAbs create(Scope scope, Operand x, Class Tout) { - OperationBuilder opBuilder = scope.env().opBuilder("ComplexAbs", scope.makeOpName("ComplexAbs")); + @Endpoint( + describeByClass = true + ) + public static ComplexAbs create(Scope scope, Operand x, + Class Tout) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ComplexAbs"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tout", Operands.toDataType(Tout)); - return new ComplexAbs(opBuilder.build()); + return new ComplexAbs<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new ComplexAbs operation using default output types. - * + * Factory method to create a class wrapping a new ComplexAbs operation, with the default output types. + * * @param scope current scope - * @param x - * @return a new instance of ComplexAbs + * @param x The x value + * @return a new instance of ComplexAbs, with default output types */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ComplexAbs create(Scope scope, Operand x) { return create(scope, x, TFloat32.class); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ComplexAbs"; - - private Output y; - - private ComplexAbs(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @OpInputsMetadata( + outputsClass = ComplexAbs.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Need to be {@code tf.float32} when the type of {@code x} is {@code tf.complex64}. + * Need to be {@code tf.float64} when the type of {@code x} is {@code tf.complex128}. + */ + 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 cf429b6e96f..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,72 +17,106 @@ 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 the complex conjugate of a complex number. - *

- * Given a tensor `input` of complex numbers, this operation returns a tensor of - * complex numbers that are the complex conjugate of each element in `input`. The - * complex numbers in `input` must be of the form \\(a + bj\\), where a is the - * real part and b is the imaginary part. - *

- * The complex conjugate returned by this operation is of the form \\(a - bj\\). - *

- * For example: - *

{@code
+ * Given a tensor {@code input} of complex numbers, this operation returns a tensor of
+ * complex numbers that are the complex conjugate of each element in {@code input}. The
+ * complex numbers in {@code input} must be of the form \(a + bj\), where a is the
+ * real part and b is the imaginary part.
+ * 

The complex conjugate returned by this operation is of the form \(a - bj\). + *

For example: + *

  * # 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 + * tf.conj(input) ==> [-2.25 - 4.75j, 3.25 - 5.75j] + *
*/ -@Operator(group = "math") +@OpMetadata( + opType = Conj.OP_NAME, + inputsClass = Conj.Inputs.class +) +@Operator( + group = "math" +) public final class Conj extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Conj"; + + private Output output; + + public Conj(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Conj operation. - * + * * @param scope current scope - * @param input + * @param input The input value + * @param data type for {@code Conj} output and operands * @return a new instance of Conj */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Conj create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("Conj", scope.makeOpName("Conj")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Conj"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Conj(opBuilder.build()); + return new Conj<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Conj"; - - private Output output; - - private Conj(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 614057659d5..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,69 +17,104 @@ 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 cos of x element-wise. - *

- * Given an input tensor, this function computes cosine of every - * element in the tensor. Input range is `(-inf, inf)` and - * output range is `[-1,1]`. If input lies outside the boundary, `nan` - * is returned. - *

- *

{@code
- *   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 + * Given an input tensor, this function computes cosine of every + * element in the tensor. Input range is {@code (-inf, inf)} and + * output range is {@code [-1,1]}. If input lies outside the boundary, {@code nan} + * is returned. + *
+ * 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]
+ * 
*/ -@Operator(group = "math") +@OpMetadata( + opType = Cos.OP_NAME, + inputsClass = Cos.Inputs.class +) +@Operator( + group = "math" +) public final class Cos extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Cos"; + + private Output y; + + public Cos(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Cos operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Cos} output and operands * @return a new instance of Cos */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Cos create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Cos", scope.makeOpName("Cos")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Cos"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Cos(opBuilder.build()); + return new Cos<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Cos"; - - private Output y; - - private Cos(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 e47154811a2..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,68 +17,103 @@ 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 hyperbolic cosine of x element-wise. - *

- * Given an input tensor, this function computes hyperbolic cosine of every - * element in the tensor. Input range is `[-inf, inf]` and output range - * is `[1, inf]`. - *

- *

{@code
- *   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 + * Given an input tensor, this function computes hyperbolic cosine of every + * element in the tensor. Input range is {@code [-inf, inf]} and output range + * is {@code [1, inf]}. + *
+ * 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]
+ * 
*/ -@Operator(group = "math") +@OpMetadata( + opType = Cosh.OP_NAME, + inputsClass = Cosh.Inputs.class +) +@Operator( + group = "math" +) public final class Cosh extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Cosh"; + + private Output y; + + public Cosh(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Cosh operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Cosh} output and operands * @return a new instance of Cosh */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Cosh create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Cosh", scope.makeOpName("Cosh")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Cosh"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Cosh(opBuilder.build()); + return new Cosh<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Cosh"; - - private Output y; - - private Cosh(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 96c8285ea92..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,94 +17,88 @@ 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; /** - * Compute the cumulative product of the tensor `x` along `axis`. - *

+ * Compute the cumulative product of the tensor {@code x} along {@code axis}. * By default, this op performs an inclusive cumprod, which means that the first * element of the input is identical to the first element of the output: - *

{@code
- * tf.cumprod([a, b, c])  # => [a, a * b, a * b * c]
- * }
- * By setting the `exclusive` kwarg to `True`, an exclusive cumprod is + *
+ * tf.cumprod([a, b, c])  # => [a, a * b, a * b * c]
+ * 
+ *

By setting the {@code exclusive} kwarg to {@code True}, an exclusive cumprod is * performed instead: - *

{@code
- * tf.cumprod([a, b, c], exclusive=True)  # => [1, a, a * b]
- * }
- * By setting the `reverse` kwarg to `True`, the cumprod is performed in the + *
+ * tf.cumprod([a, b, c], exclusive=True)  # => [1, a, a * b]
+ * 
+ *

By setting the {@code reverse} kwarg to {@code True}, the cumprod is performed in the * opposite direction: - *

{@code
- * tf.cumprod([a, b, c], reverse=True)  # => [a * b * c, b * c, c]
- * }
- * This is more efficient than using separate `tf.reverse` ops. - *

- * The `reverse` and `exclusive` kwargs can also be combined: - *

{@code
- * tf.cumprod([a, b, c], exclusive=True, reverse=True)  # => [b * c, c, 1]
- * }
- * - * - * @param data type for {@code out()} output + *
+ * tf.cumprod([a, b, c], reverse=True)  # => [a * b * c, b * c, c]
+ * 
+ *

This is more efficient than using separate {@code tf.reverse} ops. + *

The {@code reverse} and {@code exclusive} kwargs can also be combined: + *

+ * tf.cumprod([a, b, c], exclusive=True, reverse=True)  # => [b * c, c, 1]
+ * 
*/ -@Operator(group = "math") +@OpMetadata( + opType = Cumprod.OP_NAME, + inputsClass = Cumprod.Inputs.class +) +@Operator( + group = "math" +) public final class Cumprod extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.math.Cumprod} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param exclusive If `True`, perform exclusive cumprod. - */ - public Options exclusive(Boolean exclusive) { - this.exclusive = exclusive; - return this; - } - - /** - * @param reverse A `bool` (default: False). - */ - public Options reverse(Boolean reverse) { - this.reverse = reverse; - return this; - } - - private Boolean exclusive; - private Boolean reverse; - - private Options() { - } + public static final String OP_NAME = "Cumprod"; + + private Output out; + + public Cumprod(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Cumprod operation. - * + * * @param scope current scope - * @param x A `Tensor`. Must be one of the following types: `float32`, `float64`, - * `int64`, `int32`, `uint8`, `uint16`, `int16`, `int8`, `complex64`, - * `complex128`, `qint8`, `quint8`, `qint32`, `half`. - * @param axis A `Tensor` of type `int32` (default: 0). Must be in the range - * `[-rank(x), rank(x))`. - * @param options carries optional attributes values + * @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}. + * @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 Cumprod} output and operands * @return a new instance of Cumprod */ - @Endpoint(describeByClass = true) - public static Cumprod create(Scope scope, Operand x, Operand axis, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Cumprod", scope.makeOpName("Cumprod")); + @Endpoint( + describeByClass = true + ) + public static Cumprod create(Scope scope, Operand x, + Operand axis, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Cumprod"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.exclusive != null) { @@ -115,42 +109,123 @@ public static Cumprod create(Scope scope, Operand x, Ope } } } - return new Cumprod(opBuilder.build()); + return new Cumprod<>(opBuilder.build()); } - + /** - * @param exclusive If `True`, perform exclusive cumprod. + * Sets the exclusive option. + * + * @param exclusive If {@code True}, perform exclusive cumprod. + * @return this Options instance. */ public static Options exclusive(Boolean exclusive) { return new Options().exclusive(exclusive); } - + /** - * @param reverse A `bool` (default: False). + * Sets the reverse option. + * + * @param reverse A {@code bool} (default: False). + * @return this Options instance. */ public static Options reverse(Boolean reverse) { return new Options().reverse(reverse); } - + /** + * Gets out. + * + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Cumprod"; - - private Output out; - - private Cumprod(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.math.Cumprod} + */ + public static class Options { + private Boolean exclusive; + + private Boolean reverse; + + private Options() { + } + + /** + * Sets the exclusive option. + * + * @param exclusive If {@code True}, perform exclusive cumprod. + * @return this Options instance. + */ + public Options exclusive(Boolean exclusive) { + this.exclusive = exclusive; + return this; + } + + /** + * Sets the reverse option. + * + * @param reverse A {@code bool} (default: False). + * @return this Options instance. + */ + public Options reverse(Boolean reverse) { + this.reverse = 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 72395338fda..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,94 +17,88 @@ 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; /** - * Compute the cumulative sum of the tensor `x` along `axis`. - *

+ * Compute the cumulative sum of the tensor {@code x} along {@code axis}. * By default, this op performs an inclusive cumsum, which means that the first * element of the input is identical to the first element of the output: - *

{@code
- * tf.cumsum([a, b, c])  # => [a, a + b, a + b + c]
- * }
- * By setting the `exclusive` kwarg to `True`, an exclusive cumsum is + *
+ * tf.cumsum([a, b, c])  # => [a, a + b, a + b + c]
+ * 
+ *

By setting the {@code exclusive} kwarg to {@code True}, an exclusive cumsum is * performed instead: - *

{@code
- * tf.cumsum([a, b, c], exclusive=True)  # => [0, a, a + b]
- * }
- * By setting the `reverse` kwarg to `True`, the cumsum is performed in the + *
+ * tf.cumsum([a, b, c], exclusive=True)  # => [0, a, a + b]
+ * 
+ *

By setting the {@code reverse} kwarg to {@code True}, the cumsum is performed in the * opposite direction: - *

{@code
- * tf.cumsum([a, b, c], reverse=True)  # => [a + b + c, b + c, c]
- * }
- * This is more efficient than using separate `tf.reverse` ops. - *

- * The `reverse` and `exclusive` kwargs can also be combined: - *

{@code
- * tf.cumsum([a, b, c], exclusive=True, reverse=True)  # => [b + c, c, 0]
- * }
- * - * - * @param data type for {@code out()} output + *
+ * tf.cumsum([a, b, c], reverse=True)  # => [a + b + c, b + c, c]
+ * 
+ *

This is more efficient than using separate {@code tf.reverse} ops. + *

The {@code reverse} and {@code exclusive} kwargs can also be combined: + *

+ * tf.cumsum([a, b, c], exclusive=True, reverse=True)  # => [b + c, c, 0]
+ * 
*/ -@Operator(group = "math") +@OpMetadata( + opType = Cumsum.OP_NAME, + inputsClass = Cumsum.Inputs.class +) +@Operator( + group = "math" +) public final class Cumsum extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.math.Cumsum} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param exclusive If `True`, perform exclusive cumsum. - */ - public Options exclusive(Boolean exclusive) { - this.exclusive = exclusive; - return this; - } - - /** - * @param reverse A `bool` (default: False). - */ - public Options reverse(Boolean reverse) { - this.reverse = reverse; - return this; - } - - private Boolean exclusive; - private Boolean reverse; - - private Options() { - } + public static final String OP_NAME = "Cumsum"; + + private Output out; + + public Cumsum(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Cumsum operation. - * + * * @param scope current scope - * @param x A `Tensor`. Must be one of the following types: `float32`, `float64`, - * `int64`, `int32`, `uint8`, `uint16`, `int16`, `int8`, `complex64`, - * `complex128`, `qint8`, `quint8`, `qint32`, `half`. - * @param axis A `Tensor` of type `int32` (default: 0). Must be in the range - * `[-rank(x), rank(x))`. - * @param options carries optional attributes values + * @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}. + * @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 Cumsum} output and operands * @return a new instance of Cumsum */ - @Endpoint(describeByClass = true) - public static Cumsum create(Scope scope, Operand x, Operand axis, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Cumsum", scope.makeOpName("Cumsum")); + @Endpoint( + describeByClass = true + ) + public static Cumsum create(Scope scope, Operand x, + Operand axis, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Cumsum"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.exclusive != null) { @@ -115,42 +109,123 @@ public static Cumsum create(Scope scope, Operand x, Oper } } } - return new Cumsum(opBuilder.build()); + return new Cumsum<>(opBuilder.build()); } - + /** - * @param exclusive If `True`, perform exclusive cumsum. + * Sets the exclusive option. + * + * @param exclusive If {@code True}, perform exclusive cumsum. + * @return this Options instance. */ public static Options exclusive(Boolean exclusive) { return new Options().exclusive(exclusive); } - + /** - * @param reverse A `bool` (default: False). + * Sets the reverse option. + * + * @param reverse A {@code bool} (default: False). + * @return this Options instance. */ public static Options reverse(Boolean reverse) { return new Options().reverse(reverse); } - + /** + * Gets out. + * + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Cumsum"; - - private Output out; - - private Cumsum(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.math.Cumsum} + */ + public static class Options { + private Boolean exclusive; + + private Boolean reverse; + + private Options() { + } + + /** + * Sets the exclusive option. + * + * @param exclusive If {@code True}, perform exclusive cumsum. + * @return this Options instance. + */ + public Options exclusive(Boolean exclusive) { + this.exclusive = exclusive; + return this; + } + + /** + * Sets the reverse option. + * + * @param reverse A {@code bool} (default: False). + * @return this Options instance. + */ + public Options reverse(Boolean reverse) { + this.reverse = 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 b8d65b857da..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,85 +17,81 @@ 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 cumulative product of the tensor `x` along `axis`. - *

+ * Compute the cumulative product of the tensor {@code x} along {@code axis}. * By default, this op performs an inclusive cumulative log-sum-exp, * which means that the first * element of the input is identical to the first element of the output: - *

{@code
- * tf.math.cumulative_logsumexp([a, b, c])  # => [a, log(exp(a) + exp(b)), log(exp(a) + exp(b) + exp(c))]
- * }
- * By setting the `exclusive` kwarg to `True`, an exclusive cumulative log-sum-exp is + *
+ * 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: - *

{@code
- * 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 `-inf`, + *
+ * 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 `reverse` kwarg to `True`, the cumulative log-sum-exp is performed in the + *

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 { - /** - * Optional attributes for {@link org.tensorflow.op.math.CumulativeLogsumexp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param exclusive If `True`, perform exclusive cumulative log-sum-exp. - */ - public Options exclusive(Boolean exclusive) { - this.exclusive = exclusive; - return this; - } - - /** - * @param reverse A `bool` (default: False). - */ - public Options reverse(Boolean reverse) { - this.reverse = reverse; - return this; - } - - private Boolean exclusive; - private Boolean reverse; - - private Options() { - } + public static final String OP_NAME = "CumulativeLogsumexp"; + + private Output out; + + public CumulativeLogsumexp(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new CumulativeLogsumexp operation. - * + * * @param scope current scope - * @param x A `Tensor`. Must be one of the following types: `float16`, `float32`, `float64`. - * @param axis A `Tensor` of type `int32` (default: 0). Must be in the range - * `[-rank(x), rank(x))`. - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static CumulativeLogsumexp create(Scope scope, Operand x, Operand axis, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("CumulativeLogsumexp", scope.makeOpName("CumulativeLogsumexp")); + @Endpoint( + describeByClass = true + ) + public static CumulativeLogsumexp create(Scope scope, Operand x, + Operand axis, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CumulativeLogsumexp"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.exclusive != null) { @@ -106,42 +102,121 @@ public static CumulativeLogsumexp create(Scope scope, Ope } } } - return new CumulativeLogsumexp(opBuilder.build()); + return new CumulativeLogsumexp<>(opBuilder.build()); } - + /** - * @param exclusive If `True`, perform exclusive cumulative log-sum-exp. + * Sets the exclusive option. + * + * @param exclusive If {@code True}, perform exclusive cumulative log-sum-exp. + * @return this Options instance. */ public static Options exclusive(Boolean exclusive) { return new Options().exclusive(exclusive); } - + /** - * @param reverse A `bool` (default: False). + * Sets the reverse option. + * + * @param reverse A {@code bool} (default: False). + * @return this Options instance. */ public static Options reverse(Boolean reverse) { return new Options().reverse(reverse); } - + /** + * Gets out. + * + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CumulativeLogsumexp"; - - private Output out; - - private CumulativeLogsumexp(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.math.CumulativeLogsumexp} + */ + public static class Options { + private Boolean exclusive; + + private Boolean reverse; + + private Options() { + } + + /** + * Sets the exclusive option. + * + * @param exclusive If {@code True}, perform exclusive cumulative log-sum-exp. + * @return this Options instance. + */ + public Options exclusive(Boolean exclusive) { + this.exclusive = exclusive; + return this; + } + + /** + * Sets the reverse option. + * + * @param reverse A {@code bool} (default: False). + * @return this Options instance. + */ + public Options reverse(Boolean reverse) { + this.reverse = 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 d6a9d95e4d8..f4581fe9844 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,70 +17,75 @@ 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; /** * Counts the number of occurrences of each value in an integer array. - *

- * Outputs a vector with length `size` and the same dtype as `weights`. If - * `weights` are empty, then index `i` stores the number of times the value `i` is - * counted in `arr`. If `weights` are non-empty, then index `i` stores the sum of - * the value in `weights` at each index where the corresponding value in `arr` is - * `i`. - *

- * Values in `arr` outside of the range [0, size) are ignored. - * - * @param data type for {@code output()} output + * Outputs a vector with length {@code size} and the same dtype as {@code weights}. If + * {@code weights} are empty, then index {@code i} stores the number of times the value {@code i} is + * counted in {@code arr}. If {@code weights} are non-empty, then index {@code i} stores the sum of + * 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. */ -@Operator(group = "math") +@OpMetadata( + opType = DenseBincount.OP_NAME, + inputsClass = DenseBincount.Inputs.class +) +@Operator( + group = "math" +) public final class DenseBincount extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.math.DenseBincount} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param binaryOutput bool; Whether the kernel should count the appearance or number of occurrences. - */ - public Options binaryOutput(Boolean binaryOutput) { - this.binaryOutput = binaryOutput; - return this; - } - - private Boolean binaryOutput; - - private Options() { - } + public static final String OP_NAME = "DenseBincount"; + + private Output output; + + public DenseBincount(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DenseBincount operation. - * + * * @param scope current scope - * @param input 1D or 2D int `Tensor`. - * @param size non-negative int scalar `Tensor`. - * @param weights is an int32, int64, float32, or float64 `Tensor` with the same - * shape as `arr`, or a length-0 `Tensor`, in which case it acts as all weights - * equal to 1. - * @param options carries optional attributes values + * @param input 1D or 2D int {@code Tensor}. + * @param sizeOutput non-negative int scalar {@code Tensor}. + * @param weights {@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. + * Not supported by the GPU implementation of Bincount. + * @param options carries optional attribute values + * @param data type for {@code DenseBincount} output and operands + * @param data type for {@code DenseBincount} output and operands * @return a new instance of DenseBincount */ - @Endpoint(describeByClass = true) - public static DenseBincount create(Scope scope, Operand input, Operand size, Operand weights, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DenseBincount", scope.makeOpName("DenseBincount")); + @Endpoint( + describeByClass = true + ) + public static DenseBincount create(Scope scope, + Operand input, Operand sizeOutput, Operand weights, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DenseBincount"); opBuilder.addInput(input.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder.addInput(weights.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.binaryOutput != null) { @@ -88,37 +93,106 @@ public static DenseBincount create(Sco } } } - return new DenseBincount(opBuilder.build()); + return new DenseBincount<>(opBuilder.build()); } - + /** - * @param binaryOutput bool; Whether the kernel should count the appearance or number of occurrences. + * Sets the binaryOutput option. + * + * @param binaryOutput Whether the kernel should count the appearance or number of occurrences. + * Will raise {@code UnimplementedError} when {@code binary_output} is specified to {@code True} + * and the size of {@code weights} is not 0. + * @return this Options instance. */ public static Options binaryOutput(Boolean binaryOutput) { return new Options().binaryOutput(binaryOutput); } - + /** - * 1D `Tensor` with length equal to `size` or 2D `Tensor` with [batch_size, `size`]. + * Gets output. + * 1D {@code Tensor} with length equal to {@code size} or 2D {@code Tensor} with [batch_size, {@code size}]. * The counts or summed weights for each value in the range [0, size). + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DenseBincount"; - - private Output output; - - private DenseBincount(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.math.DenseBincount} + */ + public static class Options { + private Boolean binaryOutput; + + private Options() { + } + + /** + * Sets the binaryOutput option. + * + * @param binaryOutput Whether the kernel should count the appearance or number of occurrences. + * Will raise {@code UnimplementedError} when {@code binary_output} is specified to {@code True} + * and the size of {@code weights} is not 0. + * @return this Options instance. + */ + public Options binaryOutput(Boolean binaryOutput) { + this.binaryOutput = 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; + + /** + * {@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. + * Not supported by the GPU implementation of Bincount. + */ + public final Operand weights; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Whether the kernel should count the appearance or number of occurrences. + * Will raise {@code UnimplementedError} when {@code binary_output} is specified to {@code True} + * and the size of {@code weights} is not 0. + */ + 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 c64f3b40f6d..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,60 +17,97 @@ 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 - *

- * `Gamma(x)`), element-wise. - * - * @param data type for {@code y()} output + * {@code Gamma(x)}), element-wise. */ -@Operator(group = "math") +@OpMetadata( + opType = Digamma.OP_NAME, + inputsClass = Digamma.Inputs.class +) +@Operator( + group = "math" +) public final class Digamma extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Digamma"; + + private Output y; + + public Digamma(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Digamma operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Digamma} output and operands * @return a new instance of Digamma */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Digamma create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Digamma", scope.makeOpName("Digamma")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Digamma"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Digamma(opBuilder.build()); + return new Digamma<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Digamma"; - - private Output y; - - private Digamma(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 60895ff2c56..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,63 +17,106 @@ 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: `math.Div` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - * - * @param data type for {@code z()} output + * NOTE: {@code math.Div} supports broadcasting. More about broadcasting + * here */ -@Operator(group = "math") +@OpMetadata( + opType = Div.OP_NAME, + inputsClass = Div.Inputs.class +) +@Operator( + group = "math" +) public final class Div extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Div"; + + private Output z; + + public Div(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Div operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Div create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("Div", scope.makeOpName("Div")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Div"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Div(opBuilder.build()); + return new Div<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Div"; - - private Output z; - - private Div(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 62651e64084..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,64 +17,106 @@ 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: `math.DivNoNan` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - * - * @param data type for {@code z()} output + * NOTE: {@code math.DivNoNan} supports broadcasting. More about broadcasting + * here */ -@Operator(group = "math") +@OpMetadata( + opType = DivNoNan.OP_NAME, + inputsClass = DivNoNan.Inputs.class +) +@Operator( + group = "math" +) public final class DivNoNan extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DivNoNan"; + + private Output z; + + public DivNoNan(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DivNoNan operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DivNoNan create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("DivNoNan", scope.makeOpName("DivNoNan")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DivNoNan"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new DivNoNan(opBuilder.build()); + return new DivNoNan<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DivNoNan"; - - private Output z; - - private DivNoNan(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 962a271e93d..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,70 +17,76 @@ 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 (x == y) element-wise. - *

- * NOTE: `math.Equal` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - *

{@code
+ * NOTE: {@code math.Equal} supports broadcasting. More about broadcasting
+ *  here 
+ * 
  * x = tf.constant([2, 4])
  * y = tf.constant(2)
- * tf.math.equal(x, y) ==> array([True, False])
- * 
+ * tf.math.equal(x, y) ==> array([True, False])
+ *
  * x = tf.constant([2, 4])
  * y = tf.constant([2, 4])
- * tf.math.equal(x, y) ==> array([True,  True])
- * }
- * + * tf.math.equal(x, y) ==> array([True, True]) + *
*/ -@Operator(group = "math") +@OpMetadata( + opType = Equal.OP_NAME, + inputsClass = Equal.Inputs.class +) +@Operator( + group = "math" +) public final class Equal extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.math.Equal} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param incompatibleShapeError - */ - public Options incompatibleShapeError(Boolean incompatibleShapeError) { - this.incompatibleShapeError = incompatibleShapeError; - return this; - } - - private Boolean incompatibleShapeError; - - private Options() { - } + public static final String OP_NAME = "Equal"; + + private Output z; + + public Equal(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Equal operation. - * + * * @param scope current scope - * @param x - * @param y - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static Equal create(Scope scope, Operand x, Operand y, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Equal", scope.makeOpName("Equal")); + @Endpoint( + describeByClass = true + ) + public static Equal create(Scope scope, Operand x, Operand y, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Equal"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.incompatibleShapeError != null) { @@ -90,33 +96,83 @@ public static Equal create(Scope scope, Operand x, Operand< } return new Equal(opBuilder.build()); } - + /** - * @param incompatibleShapeError + * Sets the incompatibleShapeError option. + * + * @param incompatibleShapeError the incompatibleShapeError option + * @return this Options instance. */ public static Options incompatibleShapeError(Boolean incompatibleShapeError) { return new Options().incompatibleShapeError(incompatibleShapeError); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Equal"; - - private Output z; - - private Equal(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.math.Equal} + */ + public static class Options { + private Boolean incompatibleShapeError; + + private Options() { + } + + /** + * Sets the incompatibleShapeError option. + * + * @param incompatibleShapeError the incompatibleShapeError option + * @return this Options instance. + */ + public Options incompatibleShapeError(Boolean incompatibleShapeError) { + this.incompatibleShapeError = 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 eb723c89f2a..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,58 +17,96 @@ 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 `x` element-wise. - * - * @param data type for {@code y()} output + * 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]$. */ -@Operator(group = "math") +@OpMetadata( + opType = Erf.OP_NAME, + inputsClass = Erf.Inputs.class +) +@Operator( + group = "math" +) public final class Erf extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Erf"; + + private Output y; + + public Erf(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Erf operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Erf} output and operands * @return a new instance of Erf */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Erf create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Erf", scope.makeOpName("Erf")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Erf"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Erf(opBuilder.build()); + return new Erf<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Erf"; - - private Output y; - - private Erf(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 123ce651d03..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,58 +17,96 @@ 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 `x` element-wise. - * - * @param data type for {@code y()} output + * Computes the complementary error function of {@code x} element-wise. */ -@Operator(group = "math") +@OpMetadata( + opType = Erfc.OP_NAME, + inputsClass = Erfc.Inputs.class +) +@Operator( + group = "math" +) public final class Erfc extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Erfc"; + + private Output y; + + public Erfc(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Erfc operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Erfc} output and operands * @return a new instance of Erfc */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Erfc create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Erfc", scope.makeOpName("Erfc")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Erfc"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Erfc(opBuilder.build()); + return new Erfc<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Erfc"; - - private Output y; - - private Erfc(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 c5a55cba72b..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,84 +17,117 @@ 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 exponential of x element-wise. \\(y = e^x\\). - *

- * This function computes the exponential of every element in the input tensor. - * i.e. `exp(x)` or `e^(x)`, where `x` is the input tensor. - * `e` denotes Euler's number and is approximately equal to 2.718281. - * Output is positive for any real input. - *

- *

{@code
- *   x = tf.constant(2.0)
- *   tf.math.exp(x) ==> 7.389056
- * 
- *   x = tf.constant([2.0, 8.0])
- *   tf.math.exp(x) ==> array([7.389056, 2980.958], dtype=float32)
- *   }
- * For complex numbers, the exponential value is calculated as follows: - *

- *

{@code
- *   e^(x+iy) = e^x * e^iy = e^x * (cos y + i sin y)
- *   }
- * Let's consider complex number 1+1j as an example. - * e^1 * (cos 1 + i sin 1) = 2.7182818284590 * (0.54030230586+0.8414709848j) - *

- *

{@code
- *   x = tf.constant(1 + 1j)
- *   tf.math.exp(x) ==> 1.4686939399158851+2.2873552871788423j
- *   }
- * - * - * @param data type for {@code y()} output + * Computes exponential of x element-wise. \(y = e^x\). + * This function computes the exponential of every element in the input tensor. + * i.e. {@code exp(x)} or {@code e^(x)}, where {@code x} is the input tensor. + * {@code e} denotes Euler's number and is approximately equal to 2.718281. + * Output is positive for any real input. + *
+ * x = tf.constant(2.0)
+ * tf.math.exp(x) ==> 7.389056
+ *
+ * x = tf.constant([2.0, 8.0])
+ * tf.math.exp(x) ==> array([7.389056, 2980.958], dtype=float32)
+ * 
+ *

For complex numbers, the exponential value is calculated as follows: + *

+ * e^(x+iy) = e^x * e^iy = e^x * (cos y + i sin y)
+ * 
+ *

Let's consider complex number 1+1j as an example. + * e^1 * (cos 1 + i sin 1) = 2.7182818284590 * (0.54030230586+0.8414709848j) + *

+ * x = tf.constant(1 + 1j)
+ * tf.math.exp(x) ==> 1.4686939399158851+2.2873552871788423j
+ * 
*/ -@Operator(group = "math") +@OpMetadata( + opType = Exp.OP_NAME, + inputsClass = Exp.Inputs.class +) +@Operator( + group = "math" +) public final class Exp extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Exp"; + + private Output y; + + public Exp(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Exp operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Exp} output and operands * @return a new instance of Exp */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Exp create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Exp", scope.makeOpName("Exp")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Exp"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Exp(opBuilder.build()); + return new Exp<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Exp"; - - private Output y; - - private Exp(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 86d10be91e7..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,73 +17,108 @@ 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 `exp(x) - 1` element-wise. - *

- * i.e. `exp(x) - 1` or `e^(x) - 1`, where `x` is the input tensor. - * `e` denotes Euler's number and is approximately equal to 2.718281. - *

- *

{@code
- *   x = tf.constant(2.0)
- *   tf.math.expm1(x) ==> 6.389056
- * 
- *   x = tf.constant([2.0, 8.0])
- *   tf.math.expm1(x) ==> array([6.389056, 2979.958], dtype=float32)
- * 
- *   x = tf.constant(1 + 1j)
- *   tf.math.expm1(x) ==> (0.46869393991588515+2.2873552871788423j)
- *   }
- * - * - * @param data type for {@code y()} output + * Computes {@code exp(x) - 1} element-wise. + * i.e. {@code exp(x) - 1} or {@code e^(x) - 1}, where {@code x} is the input tensor. + * {@code e} denotes Euler's number and is approximately equal to 2.718281. + *
+ * x = tf.constant(2.0)
+ * tf.math.expm1(x) ==> 6.389056
+ *
+ * x = tf.constant([2.0, 8.0])
+ * tf.math.expm1(x) ==> array([6.389056, 2979.958], dtype=float32)
+ *
+ * x = tf.constant(1 + 1j)
+ * tf.math.expm1(x) ==> (0.46869393991588515+2.2873552871788423j)
+ * 
*/ -@Operator(group = "math") +@OpMetadata( + opType = Expm1.OP_NAME, + inputsClass = Expm1.Inputs.class +) +@Operator( + group = "math" +) public final class Expm1 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Expm1"; + + private Output y; + + public Expm1(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Expm1 operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Expm1} output and operands * @return a new instance of Expm1 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Expm1 create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Expm1", scope.makeOpName("Expm1")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Expm1"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Expm1(opBuilder.build()); + return new Expm1<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Expm1"; - - private Output y; - - private Expm1(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 2d7f39d217e..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,54 +17,80 @@ 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. */ -@Operator(group = "math") +@OpMetadata( + opType = Fact.OP_NAME, + inputsClass = Fact.Inputs.class +) +@Operator( + group = "math" +) public final class Fact extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Fact"; + + private Output fact; + + public Fact(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + fact = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Fact operation. - * + * * @param scope current scope * @return a new instance of Fact */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Fact create(Scope scope) { - OperationBuilder opBuilder = scope.env().opBuilder("Fact", scope.makeOpName("Fact")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Fact"); return new Fact(opBuilder.build()); } - + /** + * Gets fact. + * + * @return fact. */ public Output fact() { return fact; } - + @Override public Output asOutput() { return fact; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Fact"; - - private Output fact; - - private Fact(Operation operation) { - super(operation); - int outputIdx = 0; - fact = operation.output(outputIdx++); + + @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 2fa22d7a60c..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,58 +17,96 @@ 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 */ -@Operator(group = "math") +@OpMetadata( + opType = Floor.OP_NAME, + inputsClass = Floor.Inputs.class +) +@Operator( + group = "math" +) public final class Floor extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Floor"; + + private Output y; + + public Floor(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Floor operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Floor} output and operands * @return a new instance of Floor */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Floor create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Floor", scope.makeOpName("Floor")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Floor"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Floor(opBuilder.build()); + return new Floor<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Floor"; - - private Output y; - - private Floor(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 5cd5fe74349..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,63 +17,106 @@ 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: `math.FloorDiv` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - * - * @param data type for {@code z()} output + * NOTE: {@code math.FloorDiv} supports broadcasting. More about broadcasting + * here */ -@Operator(group = "math") +@OpMetadata( + opType = FloorDiv.OP_NAME, + inputsClass = FloorDiv.Inputs.class +) +@Operator( + group = "math" +) public final class FloorDiv extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FloorDiv"; + + private Output z; + + public FloorDiv(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new FloorDiv operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static FloorDiv create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("FloorDiv", scope.makeOpName("FloorDiv")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FloorDiv"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new FloorDiv(opBuilder.build()); + return new FloorDiv<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FloorDiv"; - - private Output z; - - private FloorDiv(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 18c6c4fd34d..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,66 +17,109 @@ 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 `x < 0` xor `y < 0` is - *

- * true, this follows Python semantics in that the result here is consistent - * with a flooring divide. E.g. `floor(x / y) * y + mod(x, y) = x`. - *

- * NOTE: `math.FloorMod` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - * - * @param data type for {@code z()} output + * 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 */ -@Operator(group = "math") +@OpMetadata( + opType = FloorMod.OP_NAME, + inputsClass = FloorMod.Inputs.class +) +@Operator( + group = "math" +) public final class FloorMod extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FloorMod"; + + private Output z; + + public FloorMod(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new FloorMod operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static FloorMod create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("FloorMod", scope.makeOpName("FloorMod")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FloorMod"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new FloorMod(opBuilder.build()); + return new FloorMod<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FloorMod"; - - private Output z; - - private FloorMod(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 3db7896647a..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,74 +17,117 @@ 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; /** - * Returns the truth value of (x > y) element-wise. - *

- * NOTE: `math.Greater` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - *

- * Example: - *

{@code
+ * Returns the truth value of (x > y) element-wise.
+ * NOTE: {@code math.Greater} supports broadcasting. More about broadcasting
+ *  here 
+ * 

Example: + *

  * x = tf.constant([5, 4, 6])
  * y = tf.constant([5, 2, 5])
- * tf.math.greater(x, y) ==> [False, True, True]
- * 
+ * tf.math.greater(x, y) ==> [False, True, True]
+ *
  * x = tf.constant([5, 4, 6])
  * y = tf.constant([5])
- * tf.math.greater(x, y) ==> [False, False, True]
- * }
- * + * tf.math.greater(x, y) ==> [False, False, True] + *
*/ -@Operator(group = "math") +@OpMetadata( + opType = Greater.OP_NAME, + inputsClass = Greater.Inputs.class +) +@Operator( + group = "math" +) public final class Greater extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Greater"; + + private Output z; + + public Greater(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Greater operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Greater create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("Greater", scope.makeOpName("Greater")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Greater"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); return new Greater(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Greater"; - - private Output z; - - private Greater(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 abeb67c3e66..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,74 +17,117 @@ 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; /** - * Returns the truth value of (x >= y) element-wise. - *

- * NOTE: `math.GreaterEqual` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - *

- * Example: - *

{@code
+ * Returns the truth value of (x >= y) element-wise.
+ * NOTE: {@code math.GreaterEqual} supports broadcasting. More about broadcasting
+ *  here 
+ * 

Example: + *

  * x = tf.constant([5, 4, 6, 7])
  * y = tf.constant([5, 2, 5, 10])
- * tf.math.greater_equal(x, y) ==> [True, True, True, False]
- * 
+ * tf.math.greater_equal(x, y) ==> [True, True, True, False]
+ *
  * x = tf.constant([5, 4, 6, 7])
  * y = tf.constant([5])
- * tf.math.greater_equal(x, y) ==> [True, False, True, True]
- * }
- * + * tf.math.greater_equal(x, y) ==> [True, False, True, True] + *
*/ -@Operator(group = "math") +@OpMetadata( + opType = GreaterEqual.OP_NAME, + inputsClass = GreaterEqual.Inputs.class +) +@Operator( + group = "math" +) public final class GreaterEqual extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GreaterEqual"; + + private Output z; + + public GreaterEqual(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new GreaterEqual operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static GreaterEqual create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("GreaterEqual", scope.makeOpName("GreaterEqual")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GreaterEqual"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); return new GreaterEqual(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "GreaterEqual"; - - private Output z; - - private GreaterEqual(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 7cb4c526e14..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,73 +17,111 @@ 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 lower regularized incomplete Gamma function `P(a, x)`. - *

+ * Compute the lower regularized incomplete Gamma function {@code P(a, x)}. * The lower regularized incomplete Gamma function is defined as: - *

- * \\(P(a, x) = gamma(a, x) / Gamma(a) = 1 - Q(a, x)\\) - *

- * where - *

- * \\(gamma(a, x) = \\int_{0}^{x} t^{a-1} exp(-t) dt\\) - *

- * is the lower incomplete Gamma function. - *

- * Note, above `Q(a, x)` (`Igammac`) is the upper regularized complete + *

\(P(a, x) = gamma(a, x) / Gamma(a) = 1 - Q(a, x)\) + *

where + *

\(gamma(a, x) = \int_{0}^{x} t^{a-1} exp(-t) dt\) + *

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 */ -@Operator(group = "math") +@OpMetadata( + opType = Igamma.OP_NAME, + inputsClass = Igamma.Inputs.class +) +@Operator( + group = "math" +) public final class Igamma extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Igamma"; + + private Output z; + + public Igamma(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Igamma operation. - * + * * @param scope current scope - * @param a - * @param x + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Igamma create(Scope scope, Operand a, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Igamma", scope.makeOpName("Igamma")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Igamma"); opBuilder.addInput(a.asOutput()); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Igamma(opBuilder.build()); + return new Igamma<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Igamma"; - - private Output z; - - private Igamma(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 e81622a3391..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,59 +17,104 @@ 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 `igamma(a, x)` wrt `a`. - * - * @param data type for {@code z()} output + * Computes the gradient of {@code igamma(a, x)} wrt {@code a}. */ +@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 + */ + public static final String OP_NAME = "IgammaGradA"; + + private Output z; + + public IgammaGradA(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new IgammaGradA operation. - * + * * @param scope current scope - * @param a - * @param x + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static IgammaGradA create(Scope scope, Operand a, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("IgammaGradA", scope.makeOpName("IgammaGradA")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IgammaGradA"); opBuilder.addInput(a.asOutput()); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new IgammaGradA(opBuilder.build()); + return new IgammaGradA<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IgammaGradA"; - - private Output z; - - private IgammaGradA(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 ab67c74b7b5..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,73 +17,111 @@ 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 upper regularized incomplete Gamma function `Q(a, x)`. - *

+ * Compute the upper regularized incomplete Gamma function {@code Q(a, x)}. * The upper regularized incomplete Gamma function is defined as: - *

- * \\(Q(a, x) = Gamma(a, x) / Gamma(a) = 1 - P(a, x)\\) - *

- * where - *

- * \\(Gamma(a, x) = int_{x}^{\infty} t^{a-1} exp(-t) dt\\) - *

- * is the upper incomplete Gama function. - *

- * Note, above `P(a, x)` (`Igamma`) is the lower regularized complete + *

\(Q(a, x) = Gamma(a, x) / Gamma(a) = 1 - P(a, x)\) + *

where + *

\(Gamma(a, x) = \int_{x}^{\infty} t^{a-1} exp(-t) dt\) + *

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 */ -@Operator(group = "math") +@OpMetadata( + opType = Igammac.OP_NAME, + inputsClass = Igammac.Inputs.class +) +@Operator( + group = "math" +) public final class Igammac extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Igammac"; + + private Output z; + + public Igammac(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Igammac operation. - * + * * @param scope current scope - * @param a - * @param x + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Igammac create(Scope scope, Operand a, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Igammac", scope.makeOpName("Igammac")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Igammac"); opBuilder.addInput(a.asOutput()); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Igammac(opBuilder.build()); + return new Igammac<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Igammac"; - - private Output z; - - private Igammac(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 74058c43ad1..ce739b420de 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,87 +17,133 @@ 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; /** * Returns the imaginary part of a complex number. - *

- * Given a tensor `input` of complex numbers, this operation returns a tensor of - * type `float` that is the imaginary part of each element in `input`. All - * elements in `input` must be complex numbers of the form \\(a + bj\\), where a - * is the real part and b is the imaginary part returned by this operation. - *

- * For example: - *

{@code
+ * Given a tensor {@code input} of complex numbers, this operation returns a tensor of
+ * type {@code float} that is the imaginary part of each element in {@code input}. All
+ * elements in {@code input} must be complex numbers of the form \(a + bj\), where a
+ * is the real part and b is the imaginary part returned by this operation.
+ * 

For example: + *

  * # 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 + * tf.imag(input) ==> [4.75, 5.75] + *
*/ -@Operator(group = "math") +@OpMetadata( + opType = Imag.OP_NAME, + inputsClass = Imag.Inputs.class +) +@Operator( + group = "math" +) public final class Imag extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Imag"; + + private Output output; + + public Imag(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Imag operation. - * + * * @param scope current scope - * @param input - * @param Tout + * @param input The input value + * @param Tout Need to be {@code tf.float32} when the type of {@code x} is {@code tf.complex64}. + * Need to be {@code tf.float64} when the type of {@code x} is {@code tf.complex128}. + * @param data type for {@code Imag} output and operands * @return a new instance of Imag */ - @Endpoint(describeByClass = true) - public static Imag create(Scope scope, Operand input, Class Tout) { - OperationBuilder opBuilder = scope.env().opBuilder("Imag", scope.makeOpName("Imag")); + @Endpoint( + describeByClass = true + ) + public static Imag create(Scope scope, Operand input, + Class Tout) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Imag"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tout", Operands.toDataType(Tout)); - return new Imag(opBuilder.build()); + return new Imag<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Imag operation using default output types. - * + * Factory method to create a class wrapping a new Imag operation, with the default output types. + * * @param scope current scope - * @param input - * @return a new instance of Imag + * @param input The input value + * @return a new instance of Imag, with default output types */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Imag 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Imag"; - - private Output output; - - private Imag(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @OpInputsMetadata( + outputsClass = Imag.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Need to be {@code tf.float32} when the type of {@code x} is {@code tf.complex64}. + * Need to be {@code tf.float64} when the type of {@code x} is {@code tf.complex128}. + */ + 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 04373176367..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,75 +17,107 @@ 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 inverse permutation of a tensor. - *

* This operation computes the inverse of an index permutation. It takes a 1-D - * integer tensor `x`, which represents the indices of a zero-based array, and + * integer tensor {@code x}, which represents the indices of a zero-based array, and * swaps each value with its index position. In other words, for an output tensor - * `y` and an input tensor `x`, this operation computes the following: - *

- * `y[x[i]] = i for i in [0, 1, ..., len(x) - 1]` - *

- * The values must include 0. There can be no duplicate values or negative values. - *

- * For example: - *

{@code
+ * {@code y} and an input tensor {@code x}, this operation computes the following:
+ * 

{@code y[x[i]] = i for i in [0, 1, ..., len(x) - 1]} + *

The values must include 0. There can be no duplicate values or negative values. + *

For example: + *

  * # tensor `x` is [3, 4, 0, 2, 1]
- * invert_permutation(x) ==> [2, 4, 3, 0, 1]
- * }
- * - * - * @param data type for {@code y()} output + * invert_permutation(x) ==> [2, 4, 3, 0, 1] + *
*/ -@Operator(group = "math") +@OpMetadata( + opType = InvertPermutation.OP_NAME, + inputsClass = InvertPermutation.Inputs.class +) +@Operator( + group = "math" +) public final class InvertPermutation extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "InvertPermutation"; + + private Output y; + + public InvertPermutation(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new InvertPermutation operation. - * + * * @param scope current scope * @param x 1-D. + * @param data type for {@code InvertPermutation} output and operands * @return a new instance of InvertPermutation */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static InvertPermutation create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("InvertPermutation", scope.makeOpName("InvertPermutation")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "InvertPermutation"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new InvertPermutation(opBuilder.build()); + return new InvertPermutation<>(opBuilder.build()); } - + /** + * Gets y. * 1-D. + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InvertPermutation"; - - private Output y; - - private InvertPermutation(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 6f047b27412..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,68 +17,104 @@ 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; /** * Returns which elements of x are finite. - *

- * @compatibility(numpy) + * {@literal @}compatibility(numpy)
* Equivalent to np.isfinite - * @end_compatibility - *

- * Example: - *

{@code
+ * 
{@literal @}end_compatibility + *

Example: + *

  * x = tf.constant([5.0, 4.8, 6.8, np.inf, np.nan])
- * tf.math.is_finite(x) ==> [True, True, True, False, False]
- * }
- * + * tf.math.is_finite(x) ==> [True, True, True, False, False] + *
*/ -@Operator(group = "math") +@OpMetadata( + opType = IsFinite.OP_NAME, + inputsClass = IsFinite.Inputs.class +) +@Operator( + group = "math" +) public final class IsFinite extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IsFinite"; + + private Output y; + + public IsFinite(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new IsFinite operation. - * + * * @param scope current scope - * @param x + * @param x The x value * @return a new instance of IsFinite */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static IsFinite create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("IsFinite", scope.makeOpName("IsFinite")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IsFinite"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); return new IsFinite(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IsFinite"; - - private Output y; - - private IsFinite(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 a66ef147923..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,68 +17,104 @@ 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; /** * Returns which elements of x are Inf. - *

- * @compatibility(numpy) + * {@literal @}compatibility(numpy)
* Equivalent to np.isinf - * @end_compatibility - *

- * Example: - *

{@code
+ * 
{@literal @}end_compatibility + *

Example: + *

  * x = tf.constant([5.0, np.inf, 6.8, np.inf])
- * tf.math.is_inf(x) ==> [False, True, False, True]
- * }
- * + * tf.math.is_inf(x) ==> [False, True, False, True] + *
*/ -@Operator(group = "math") +@OpMetadata( + opType = IsInf.OP_NAME, + inputsClass = IsInf.Inputs.class +) +@Operator( + group = "math" +) public final class IsInf extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IsInf"; + + private Output y; + + public IsInf(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new IsInf operation. - * + * * @param scope current scope - * @param x + * @param x The x value * @return a new instance of IsInf */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static IsInf create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("IsInf", scope.makeOpName("IsInf")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IsInf"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); return new IsInf(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IsInf"; - - private Output y; - - private IsInf(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 e7542bad57e..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,68 +17,104 @@ 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; /** * Returns which elements of x are NaN. - *

- * @compatibility(numpy) + * {@literal @}compatibility(numpy)
* Equivalent to np.isnan - * @end_compatibility - *

- * Example: - *

{@code
+ * 
{@literal @}end_compatibility + *

Example: + *

  * x = tf.constant([5.0, np.nan, 6.8, np.nan, np.inf])
- * tf.math.is_nan(x) ==> [False, True, False, True, False]
- * }
- * + * tf.math.is_nan(x) ==> [False, True, False, True, False] + *
*/ -@Operator(group = "math") +@OpMetadata( + opType = IsNan.OP_NAME, + inputsClass = IsNan.Inputs.class +) +@Operator( + group = "math" +) public final class IsNan extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IsNan"; + + private Output y; + + public IsNan(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new IsNan operation. - * + * * @param scope current scope - * @param x + * @param x The x value * @return a new instance of IsNan */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static IsNan create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("IsNan", scope.makeOpName("IsNan")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IsNan"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); return new IsNan(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IsNan"; - - private Output y; - - private IsNan(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 9564f1b84ff..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,74 +17,117 @@ 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; /** - * Returns the truth value of (x < y) element-wise. - *

- * NOTE: `math.Less` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - *

- * Example: - *

{@code
+ * Returns the truth value of (x < y) element-wise.
+ * NOTE: {@code math.Less} supports broadcasting. More about broadcasting
+ *  here 
+ * 

Example: + *

  * x = tf.constant([5, 4, 6])
  * y = tf.constant([5])
- * tf.math.less(x, y) ==> [False, True, False]
- * 
+ * tf.math.less(x, y) ==> [False, True, False]
+ *
  * x = tf.constant([5, 4, 6])
  * y = tf.constant([5, 6, 7])
- * tf.math.less(x, y) ==> [False, True, True]
- * }
- * + * tf.math.less(x, y) ==> [False, True, True] + *
*/ -@Operator(group = "math") +@OpMetadata( + opType = Less.OP_NAME, + inputsClass = Less.Inputs.class +) +@Operator( + group = "math" +) public final class Less extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Less"; + + private Output z; + + public Less(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Less operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Less create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("Less", scope.makeOpName("Less")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Less"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); return new Less(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Less"; - - private Output z; - - private Less(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 10c0b7647cb..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,74 +17,117 @@ 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; /** - * Returns the truth value of (x <= y) element-wise. - *

- * NOTE: `math.LessEqual` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - *

- * Example: - *

{@code
+ * Returns the truth value of (x <= y) element-wise.
+ * NOTE: {@code math.LessEqual} supports broadcasting. More about broadcasting
+ *  here 
+ * 

Example: + *

  * x = tf.constant([5, 4, 6])
  * y = tf.constant([5])
- * tf.math.less_equal(x, y) ==> [True, True, False]
- * 
+ * tf.math.less_equal(x, y) ==> [True, True, False]
+ *
  * x = tf.constant([5, 4, 6])
  * y = tf.constant([5, 6, 6])
- * tf.math.less_equal(x, y) ==> [True, True, True]
- * }
- * + * tf.math.less_equal(x, y) ==> [True, True, True] + *
*/ -@Operator(group = "math") +@OpMetadata( + opType = LessEqual.OP_NAME, + inputsClass = LessEqual.Inputs.class +) +@Operator( + group = "math" +) public final class LessEqual extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LessEqual"; + + private Output z; + + public LessEqual(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LessEqual operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static LessEqual create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("LessEqual", scope.makeOpName("LessEqual")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LessEqual"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); return new LessEqual(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LessEqual"; - - private Output z; - - private LessEqual(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 817993ef5c5..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,68 +17,103 @@ 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 log of the absolute value of `Gamma(x)` element-wise. - *

- * For positive numbers, this function computes log((input - 1)!) for every element in the tensor. - * `lgamma(5) = log((5-1)!) = log(4!) = log(24) = 3.1780539` - *

- * Example: - *

{@code
+ * Computes the log of the absolute value of {@code Gamma(x)} element-wise.
+ * For positive numbers, this function computes log((input - 1)!) for every element in the tensor.
+ * {@code lgamma(5) = log((5-1)!) = log(4!) = log(24) = 3.1780539}
+ * 

Example: + *

  * 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 + * tf.math.lgamma(x) ==> [inf, 0.5723649, 0., 2.4537368, inf, -4.6477685] + *
*/ -@Operator(group = "math") +@OpMetadata( + opType = Lgamma.OP_NAME, + inputsClass = Lgamma.Inputs.class +) +@Operator( + group = "math" +) public final class Lgamma extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Lgamma"; + + private Output y; + + public Lgamma(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Lgamma operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Lgamma} output and operands * @return a new instance of Lgamma */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Lgamma create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Lgamma", scope.makeOpName("Lgamma")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Lgamma"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Lgamma(opBuilder.build()); + return new Lgamma<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Lgamma"; - - private Output y; - - private Lgamma(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 4b45bf622d1..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,67 +17,102 @@ 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 natural logarithm of x element-wise. - *

- * I.e., \\(y = \log_e x\\). - *

- * Example: - *

{@code
+ * I.e., \(y = \log_e x\).
+ * 

Example: + *

  * 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 + * tf.math.log(x) ==> [-inf, -0.6931472, 0. , 1.609438] + *
*/ -@Operator(group = "math") +@OpMetadata( + opType = Log.OP_NAME, + inputsClass = Log.Inputs.class +) +@Operator( + group = "math" +) public final class Log extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Log"; + + private Output y; + + public Log(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Log operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Log} output and operands * @return a new instance of Log */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Log create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Log", scope.makeOpName("Log")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Log"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Log(opBuilder.build()); + return new Log<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Log"; - - private Output y; - - private Log(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 ed84f97012e..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,67 +17,102 @@ 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 natural logarithm of (1 + x) element-wise. - *

- * I.e., \\(y = \log_e (1 + x)\\). - *

- * Example: - *

{@code
+ * I.e., \(y = \log_e (1 + x)\).
+ * 

Example: + *

  * 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 + * tf.math.log1p(x) ==> [0., 0.4054651, 0.6931472, 1.7917595] + *
*/ -@Operator(group = "math") +@OpMetadata( + opType = Log1p.OP_NAME, + inputsClass = Log1p.Inputs.class +) +@Operator( + group = "math" +) public final class Log1p extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Log1p"; + + private Output y; + + public Log1p(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Log1p operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Log1p} output and operands * @return a new instance of Log1p */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Log1p create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Log1p", scope.makeOpName("Log1p")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Log1p"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Log1p(opBuilder.build()); + return new Log1p<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Log1p"; - - private Output y; - - private Log1p(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 214e0b61ea3..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,61 +17,98 @@ 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 x AND y element-wise. - *

- * NOTE: `math.LogicalAnd` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + * NOTE: {@code math.LogicalAnd} supports broadcasting. More about broadcasting + * here */ -@Operator(group = "math") +@OpMetadata( + opType = LogicalAnd.OP_NAME, + inputsClass = LogicalAnd.Inputs.class +) +@Operator( + group = "math" +) public final class LogicalAnd extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LogicalAnd"; + + private Output z; + + public LogicalAnd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LogicalAnd operation. - * + * * @param scope current scope - * @param x - * @param y + * @param x The x value + * @param y The y value * @return a new instance of LogicalAnd */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static LogicalAnd create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("LogicalAnd", scope.makeOpName("LogicalAnd")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LogicalAnd"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); return new LogicalAnd(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LogicalAnd"; - - private Output z; - - private LogicalAnd(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 7bcb001cc6a..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,57 +17,88 @@ 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 `NOT x` element-wise. + * Returns the truth value of {@code NOT x} element-wise. */ -@Operator(group = "math") +@OpMetadata( + opType = LogicalNot.OP_NAME, + inputsClass = LogicalNot.Inputs.class +) +@Operator( + group = "math" +) public final class LogicalNot extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LogicalNot"; + + private Output y; + + public LogicalNot(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LogicalNot operation. - * + * * @param scope current scope - * @param x A `Tensor` of type `bool`. + * @param x A {@code Tensor} of type {@code bool}. * @return a new instance of LogicalNot */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static LogicalNot create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("LogicalNot", scope.makeOpName("LogicalNot")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LogicalNot"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); return new LogicalNot(opBuilder.build()); } - + /** - * A `Tensor` of type `bool` with the same shape as `x`. The logical negation of `x`. + * Gets y. + * A {@code Tensor} of type {@code bool} with the same shape as {@code x}. The logical negation of {@code x}. + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LogicalNot"; - - private Output y; - - private LogicalNot(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 5465751c543..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,61 +17,98 @@ 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 x OR y element-wise. - *

- * NOTE: `math.LogicalOr` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + * NOTE: {@code math.LogicalOr} supports broadcasting. More about broadcasting + * here */ -@Operator(group = "math") +@OpMetadata( + opType = LogicalOr.OP_NAME, + inputsClass = LogicalOr.Inputs.class +) +@Operator( + group = "math" +) public final class LogicalOr extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LogicalOr"; + + private Output z; + + public LogicalOr(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LogicalOr operation. - * + * * @param scope current scope - * @param x - * @param y + * @param x The x value + * @param y The y value * @return a new instance of LogicalOr */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static LogicalOr create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("LogicalOr", scope.makeOpName("LogicalOr")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LogicalOr"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); return new LogicalOr(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LogicalOr"; - - private Output z; - - private LogicalOr(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 e592e34e500..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,63 +17,106 @@ 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: `math.Maximum` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - * - * @param data type for {@code z()} output + * 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 */ -@Operator(group = "math") +@OpMetadata( + opType = Maximum.OP_NAME, + inputsClass = Maximum.Inputs.class +) +@Operator( + group = "math" +) public final class Maximum extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Maximum"; + + private Output z; + + public Maximum(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Maximum operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Maximum create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("Maximum", scope.makeOpName("Maximum")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Maximum"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Maximum(opBuilder.build()); + return new Maximum<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Maximum"; - - private Output z; - - private Maximum(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 6cff5088249..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,65 +17,70 @@ 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; /** * Computes the mean of elements across dimensions of a tensor. - *

- * Reduces `input` along the dimensions given in `axis`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `axis`. If `keep_dims` is true, the reduced dimensions are + * Reduces {@code input} along the dimensions given in {@code axis}. Unless + * {@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 */ -@Operator(group = "math") +@OpMetadata( + opType = Mean.OP_NAME, + inputsClass = Mean.Inputs.class +) +@Operator( + group = "math" +) public final class Mean extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.math.Mean} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "Mean"; + + private Output output; + + public Mean(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Mean operation. - * + * * @param scope current scope * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range - * `[-rank(input), rank(input))`. - * @param options carries optional attributes values + * {@code [-rank(input), rank(input))}. + * @param options carries optional attribute values + * @param data type for {@code Mean} output and operands * @return a new instance of Mean */ - @Endpoint(describeByClass = true) - public static Mean create(Scope scope, Operand input, Operand axis, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Mean", scope.makeOpName("Mean")); + @Endpoint( + describeByClass = true + ) + public static Mean create(Scope scope, Operand input, + Operand axis, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Mean"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.keepDims != null) { @@ -83,36 +88,92 @@ public static Mean create(Scope scope, Operand input, Op } } } - return new Mean(opBuilder.build()); + return new Mean<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets output. * The reduced tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Mean"; - - private Output output; - - private Mean(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.math.Mean} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = 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 1c3ab3bb724..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,63 +17,106 @@ 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: `math.Minimum` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - * - * @param data type for {@code z()} output + * 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 */ -@Operator(group = "math") +@OpMetadata( + opType = Minimum.OP_NAME, + inputsClass = Minimum.Inputs.class +) +@Operator( + group = "math" +) public final class Minimum extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Minimum"; + + private Output z; + + public Minimum(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Minimum operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Minimum create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("Minimum", scope.makeOpName("Minimum")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Minimum"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Minimum(opBuilder.build()); + return new Minimum<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Minimum"; - - private Output z; - - private Minimum(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 e8ead53a30d..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,66 +17,108 @@ 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. This emulates C semantics in that - *

* the result here is consistent with a truncating divide. E.g. - * `tf.truncatediv(x, y) * y + truncate_mod(x, y) = x`. - *

- * NOTE: `math.Mod` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - * - * @param data type for {@code z()} output + * {@code tf.truncatediv(x, y) * y + truncate_mod(x, y) = x}. + *

NOTE: {@code math.Mod} supports broadcasting. More about broadcasting + * here */ -@Operator(group = "math") +@OpMetadata( + opType = Mod.OP_NAME, + inputsClass = Mod.Inputs.class +) +@Operator( + group = "math" +) public final class Mod extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Mod"; + + private Output z; + + public Mod(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Mod operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Mod create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("Mod", scope.makeOpName("Mod")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Mod"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Mod(opBuilder.build()); + return new Mod<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Mod"; - - private Output z; - - private Mod(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 4d91744ba23..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,63 +17,106 @@ 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: `math.Mul` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - * - * @param data type for {@code z()} output + * NOTE: {@code math.Mul} supports broadcasting. More about broadcasting + * here */ -@Operator(group = "math") +@OpMetadata( + opType = Mul.OP_NAME, + inputsClass = Mul.Inputs.class +) +@Operator( + group = "math" +) public final class Mul extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Mul"; + + private Output z; + + public Mul(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Mul operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Mul create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("Mul", scope.makeOpName("Mul")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Mul"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Mul(opBuilder.build()); + return new Mul<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Mul"; - - private Output z; - - private Mul(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 312b0e0018a..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,63 +17,106 @@ 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: `math.MulNoNan` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - * - * @param data type for {@code z()} output + * NOTE: {@code math.MulNoNan} supports broadcasting. More about broadcasting + * here */ -@Operator(group = "math") +@OpMetadata( + opType = MulNoNan.OP_NAME, + inputsClass = MulNoNan.Inputs.class +) +@Operator( + group = "math" +) public final class MulNoNan extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MulNoNan"; + + private Output z; + + public MulNoNan(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MulNoNan operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static MulNoNan create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("MulNoNan", scope.makeOpName("MulNoNan")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MulNoNan"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new MulNoNan(opBuilder.build()); + return new MulNoNan<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MulNoNan"; - - private Output z; - - private MulNoNan(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 5e5f9d8b326..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,56 +17,96 @@ 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; /** - * @param data type for {@code y()} output + * The Ndtri operation */ -@Operator(group = "math") +@OpMetadata( + opType = Ndtri.OP_NAME, + inputsClass = Ndtri.Inputs.class +) +@Operator( + group = "math" +) public final class Ndtri extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Ndtri"; + + private Output y; + + public Ndtri(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Ndtri operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Ndtri} output and operands * @return a new instance of Ndtri */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Ndtri create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Ndtri", scope.makeOpName("Ndtri")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Ndtri"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Ndtri(opBuilder.build()); + return new Ndtri<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Ndtri"; - - private Output y; - - private Ndtri(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 4ecedcfff31..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,60 +17,97 @@ 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 + * I.e., \(y = -x\). */ -@Operator(group = "math") +@OpMetadata( + opType = Neg.OP_NAME, + inputsClass = Neg.Inputs.class +) +@Operator( + group = "math" +) public final class Neg extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Neg"; + + private Output y; + + public Neg(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Neg operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Neg} output and operands * @return a new instance of Neg */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Neg create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Neg", scope.makeOpName("Neg")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Neg"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Neg(opBuilder.build()); + return new Neg<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Neg"; - - private Output y; - - private Neg(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 ec8a0231618..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,68 +17,109 @@ 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 next representable value of `x1` in the direction of `x2`, element-wise. - *

+ * Returns the next representable value of {@code x1} in the direction of {@code x2}, element-wise. * This operation returns the same result as the C++ std::nextafter function. - *

- * It can also return a subnormal number. - *

- * @compatibility(cpp) + *

It can also return a subnormal number. + *

{@literal @}compatibility(cpp)
* Equivalent to C++ std::nextafter function. - * @end_compatibility - * - * @param data type for {@code output()} output + *
{@literal @}end_compatibility */ -@Operator(group = "math") +@OpMetadata( + opType = NextAfter.OP_NAME, + inputsClass = NextAfter.Inputs.class +) +@Operator( + group = "math" +) public final class NextAfter extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "NextAfter"; + + private Output output; + + public NextAfter(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NextAfter operation. - * + * * @param scope current scope - * @param x1 - * @param x2 + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static NextAfter create(Scope scope, Operand x1, Operand x2) { - OperationBuilder opBuilder = scope.env().opBuilder("NextAfter", scope.makeOpName("NextAfter")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "NextAfter"); opBuilder.addInput(x1.asOutput()); opBuilder.addInput(x2.asOutput()); - opBuilder = scope.apply(opBuilder); - return new NextAfter(opBuilder.build()); + return new NextAfter<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NextAfter"; - - private Output output; - - private NextAfter(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 852567ff301..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,60 +17,67 @@ 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 (x != y) element-wise. - *

- * NOTE: `math.NotEqual` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + * NOTE: {@code math.NotEqual} supports broadcasting. More about broadcasting + * here */ -@Operator(group = "math") +@OpMetadata( + opType = NotEqual.OP_NAME, + inputsClass = NotEqual.Inputs.class +) +@Operator( + group = "math" +) public final class NotEqual extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.math.NotEqual} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param incompatibleShapeError - */ - public Options incompatibleShapeError(Boolean incompatibleShapeError) { - this.incompatibleShapeError = incompatibleShapeError; - return this; - } - - private Boolean incompatibleShapeError; - - private Options() { - } + public static final String OP_NAME = "NotEqual"; + + private Output z; + + public NotEqual(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new NotEqual operation. - * + * * @param scope current scope - * @param x - * @param y - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static NotEqual create(Scope scope, Operand x, Operand y, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("NotEqual", scope.makeOpName("NotEqual")); + @Endpoint( + describeByClass = true + ) + public static NotEqual create(Scope scope, Operand x, Operand y, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "NotEqual"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.incompatibleShapeError != null) { @@ -80,33 +87,83 @@ public static NotEqual create(Scope scope, Operand x, Opera } return new NotEqual(opBuilder.build()); } - + /** - * @param incompatibleShapeError + * Sets the incompatibleShapeError option. + * + * @param incompatibleShapeError the incompatibleShapeError option + * @return this Options instance. */ public static Options incompatibleShapeError(Boolean incompatibleShapeError) { return new Options().incompatibleShapeError(incompatibleShapeError); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NotEqual"; - - private Output z; - - private NotEqual(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.math.NotEqual} + */ + public static class Options { + private Boolean incompatibleShapeError; + + private Options() { + } + + /** + * Sets the incompatibleShapeError option. + * + * @param incompatibleShapeError the incompatibleShapeError option + * @return this Options instance. + */ + public Options incompatibleShapeError(Boolean incompatibleShapeError) { + this.incompatibleShapeError = 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 f17bc4958b1..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,67 +17,108 @@ 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 polygamma function \\(\psi^{(n)}(x)\\). - *

+ * Compute the polygamma function \(\psi^{(n)}(x)\). * The polygamma function is defined as: - *

- * \\(\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 + *

\(\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\. */ -@Operator(group = "math") +@OpMetadata( + opType = Polygamma.OP_NAME, + inputsClass = Polygamma.Inputs.class +) +@Operator( + group = "math" +) public final class Polygamma extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Polygamma"; + + private Output z; + + public Polygamma(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Polygamma operation. - * + * * @param scope current scope - * @param a - * @param x + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Polygamma create(Scope scope, Operand a, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Polygamma", scope.makeOpName("Polygamma")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Polygamma"); opBuilder.addInput(a.asOutput()); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Polygamma(opBuilder.build()); + return new Polygamma<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Polygamma"; - - private Output z; - - private Polygamma(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 4907717b342..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,64 +17,101 @@ 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; /** * Computes element-wise population count (a.k.a. popcount, bitsum, bitcount). - *

- * For each entry in `x`, calculates the number of `1` (on) bits in the binary + * For each entry in {@code x}, calculates the number of {@code 1} (on) bits in the binary * representation of that entry. - *

- * NOTE: It is more efficient to first `tf.bitcast` your tensors into - * `int32` or `int64` and perform the bitcount on the result, than to feed in + *

NOTE: It is more efficient to first {@code tf.bitcast} your tensors into + * {@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. */ -@Operator(group = "math") +@OpMetadata( + opType = PopulationCount.OP_NAME, + inputsClass = PopulationCount.Inputs.class +) +@Operator( + group = "math" +) public final class PopulationCount extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "PopulationCount"; + + private Output y; + + public PopulationCount(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new PopulationCount operation. - * + * * @param scope current scope - * @param x + * @param x The x value * @return a new instance of PopulationCount */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static PopulationCount create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("PopulationCount", scope.makeOpName("PopulationCount")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "PopulationCount"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); return new PopulationCount(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "PopulationCount"; - - private Output y; - - private PopulationCount(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 d9347818c1a..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,69 +17,111 @@ 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 power of one value to another. - *

- * Given a tensor `x` and a tensor `y`, this operation computes \\(x^y\\) for - * corresponding elements in `x` and `y`. For example: - *

{@code
+ * Given a tensor {@code x} and a tensor {@code y}, this operation computes \(x^y\) for
+ * corresponding elements in {@code x} and {@code y}. For example:
+ * 
  * # tensor 'x' is [[2, 2]], [3, 3]]
  * # tensor 'y' is [[8, 16], [2, 3]]
- * tf.pow(x, y) ==> [[256, 65536], [9, 27]]
- * }
- * - * - * @param data type for {@code z()} output + * tf.pow(x, y) ==> [[256, 65536], [9, 27]] + *
*/ -@Operator(group = "math") +@OpMetadata( + opType = Pow.OP_NAME, + inputsClass = Pow.Inputs.class +) +@Operator( + group = "math" +) public final class Pow extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Pow"; + + private Output z; + + public Pow(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Pow operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Pow create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("Pow", scope.makeOpName("Pow")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Pow"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Pow(opBuilder.build()); + return new Pow<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Pow"; - - private Output z; - - private Pow(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 5ae6dd24dd4..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,88 +17,175 @@ 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.TType; +import org.tensorflow.types.family.TNumber; /** * Returns x + y element-wise, working on quantized buffers. - * - * @param data type for {@code z()} output */ -@Operator(group = "math") -public final class QuantizedAdd extends RawOp { - +@OpMetadata( + opType = QuantizedAdd.OP_NAME, + inputsClass = QuantizedAdd.Inputs.class +) +@Operator( + group = "math" +) +public final class QuantizedAdd extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizedAdd"; + + private Output z; + + private Output minZ; + + private Output maxZ; + + public QuantizedAdd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + minZ = operation.output(outputIdx++); + maxZ = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizedAdd operation. - * + * * @param scope current scope - * @param x - * @param y - * @param minX The float value that the lowest quantized `x` value represents. - * @param maxX The float value that the highest quantized `x` value represents. - * @param minY The float value that the lowest quantized `y` value represents. - * @param maxY The float value that the highest quantized `y` value represents. - * @param Toutput + * @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 attribute + * @param data type for {@code QuantizedAdd} output and operands * @return a new instance of QuantizedAdd */ - @Endpoint(describeByClass = true) - public static QuantizedAdd create(Scope scope, Operand x, Operand y, Operand minX, Operand maxX, Operand minY, Operand maxY, Class Toutput) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedAdd", scope.makeOpName("QuantizedAdd")); + @Endpoint( + describeByClass = true + ) + public static QuantizedAdd create(Scope scope, + Operand x, Operand y, Operand minX, + Operand maxX, Operand minY, Operand maxY, Class Toutput) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedAdd"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder.addInput(minX.asOutput()); opBuilder.addInput(maxX.asOutput()); opBuilder.addInput(minY.asOutput()); opBuilder.addInput(maxY.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Toutput", Operands.toDataType(Toutput)); - return new QuantizedAdd(opBuilder.build()); + return new QuantizedAdd<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + /** + * Gets minZ. * The float value that the lowest quantized output value represents. + * @return minZ. */ public Output minZ() { return minZ; } - + /** + * Gets maxZ. * The float value that the highest quantized output value represents. - *

- * NOTE: `math.QuantizedAdd` supports limited forms of broadcasting. More about - * broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + *

NOTE: {@code math.QuantizedAdd} supports limited forms of broadcasting. More about + * broadcasting here + * @return maxZ. */ public Output maxZ() { return maxZ; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedAdd"; - - private Output z; - private Output minZ; - private Output maxZ; - - private QuantizedAdd(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - minZ = operation.output(outputIdx++); - maxZ = operation.output(outputIdx++); + + @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 bc64e12438b..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,88 +17,175 @@ 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.TType; +import org.tensorflow.types.family.TNumber; /** * Returns x * y element-wise, working on quantized buffers. - * - * @param data type for {@code z()} output */ -@Operator(group = "math") -public final class QuantizedMul extends RawOp { - +@OpMetadata( + opType = QuantizedMul.OP_NAME, + inputsClass = QuantizedMul.Inputs.class +) +@Operator( + group = "math" +) +public final class QuantizedMul extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizedMul"; + + private Output z; + + private Output minZ; + + private Output maxZ; + + public QuantizedMul(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + minZ = operation.output(outputIdx++); + maxZ = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizedMul operation. - * + * * @param scope current scope - * @param x - * @param y - * @param minX The float value that the lowest quantized `x` value represents. - * @param maxX The float value that the highest quantized `x` value represents. - * @param minY The float value that the lowest quantized `y` value represents. - * @param maxY The float value that the highest quantized `y` value represents. - * @param Toutput + * @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 attribute + * @param data type for {@code QuantizedMul} output and operands * @return a new instance of QuantizedMul */ - @Endpoint(describeByClass = true) - public static QuantizedMul create(Scope scope, Operand x, Operand y, Operand minX, Operand maxX, Operand minY, Operand maxY, Class Toutput) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedMul", scope.makeOpName("QuantizedMul")); + @Endpoint( + describeByClass = true + ) + public static QuantizedMul create(Scope scope, + Operand x, Operand y, Operand minX, + Operand maxX, Operand minY, Operand maxY, Class Toutput) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedMul"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder.addInput(minX.asOutput()); opBuilder.addInput(maxX.asOutput()); opBuilder.addInput(minY.asOutput()); opBuilder.addInput(maxY.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Toutput", Operands.toDataType(Toutput)); - return new QuantizedMul(opBuilder.build()); + return new QuantizedMul<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + /** + * Gets minZ. * The float value that the lowest quantized output value represents. + * @return minZ. */ public Output minZ() { return minZ; } - + /** + * Gets maxZ. * The float value that the highest quantized output value represents. - *

- * NOTE: `math.QuantizedMul` supports limited forms of broadcasting. More about - * broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + *

NOTE: {@code math.QuantizedMul} supports limited forms of broadcasting. More about + * broadcasting here + * @return maxZ. */ public Output maxZ() { return maxZ; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedMul"; - - private Output z; - private Output minZ; - private Output maxZ; - - private QuantizedMul(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - minZ = operation.output(outputIdx++); - maxZ = operation.output(outputIdx++); + + @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 8758983ba50..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,87 +17,131 @@ 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; /** * Returns the real part of a complex number. - *

- * Given a tensor `input` of complex numbers, this operation returns a tensor of - * type `float` that is the real part of each element in `input`. All elements in - * `input` must be complex numbers of the form \\(a + bj\\), where a is the real - * part returned by this operation and b is the imaginary part. - *

- * For example: - *

{@code
+ * Given a tensor {@code input} of complex numbers, this operation returns a tensor of
+ * type {@code float} that is the real part of each element in {@code input}. All elements in
+ * {@code input} must be complex numbers of the form \(a + bj\), where a is the real
+ * part returned by this operation and b is the imaginary part.
+ * 

For example: + *

  * # 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 + * tf.real(input) ==> [-2.25, 3.25] + *
*/ -@Operator(group = "math") +@OpMetadata( + opType = Real.OP_NAME, + inputsClass = Real.Inputs.class +) +@Operator( + group = "math" +) public final class Real extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Real"; + + private Output output; + + public Real(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Real operation. - * + * * @param scope current scope - * @param input - * @param Tout + * @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 */ - @Endpoint(describeByClass = true) - public static Real create(Scope scope, Operand input, Class Tout) { - OperationBuilder opBuilder = scope.env().opBuilder("Real", scope.makeOpName("Real")); + @Endpoint( + describeByClass = true + ) + public static Real create(Scope scope, Operand input, + Class Tout) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Real"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tout", Operands.toDataType(Tout)); - return new Real(opBuilder.build()); + return new Real<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Real operation using default output types. - * + * Factory method to create a class wrapping a new Real operation, with the default output types. + * * @param scope current scope - * @param input - * @return a new instance of Real + * @param input The input value + * @return a new instance of Real, with default output types */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Real 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Real"; - - private Output output; - - private Real(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 5c5155ed78c..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,65 +17,107 @@ 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 real types. - *

- * If `x` and `y` are reals, this will return the floating-point division. - *

- * NOTE: `Div` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - * - * @param data type for {@code z()} output + * If {@code x} and {@code y} are reals, this will return the floating-point division. + *

NOTE: {@code Div} supports broadcasting. More about broadcasting + * here */ -@Operator(group = "math") +@OpMetadata( + opType = RealDiv.OP_NAME, + inputsClass = RealDiv.Inputs.class +) +@Operator( + group = "math" +) public final class RealDiv extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RealDiv"; + + private Output z; + + public RealDiv(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RealDiv operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static RealDiv create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("RealDiv", scope.makeOpName("RealDiv")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RealDiv"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new RealDiv(opBuilder.build()); + return new RealDiv<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RealDiv"; - - private Output z; - - private RealDiv(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 0b8571d742c..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,60 +17,97 @@ 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 + * I.e., \(y = 1 / x\). */ -@Operator(group = "math") +@OpMetadata( + opType = Reciprocal.OP_NAME, + inputsClass = Reciprocal.Inputs.class +) +@Operator( + group = "math" +) public final class Reciprocal extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Reciprocal"; + + private Output y; + + public Reciprocal(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Reciprocal operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Reciprocal} output and operands * @return a new instance of Reciprocal */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Reciprocal create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Reciprocal", scope.makeOpName("Reciprocal")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Reciprocal"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Reciprocal(opBuilder.build()); + return new Reciprocal<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Reciprocal"; - - private Output y; - - private Reciprocal(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 6c1c8edc3b9..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,62 +17,107 @@ 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 `x` wrt its input. - *

- * Specifically, `grad = -dy yy`, where `y = 1/x`, and `dy` + * 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 + */ + public static final String OP_NAME = "ReciprocalGrad"; + + private Output z; + + public ReciprocalGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ReciprocalGrad operation. - * + * * @param scope current scope - * @param y - * @param dy + * @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 */ - @Endpoint(describeByClass = true) - public static ReciprocalGrad create(Scope scope, Operand y, Operand dy) { - OperationBuilder opBuilder = scope.env().opBuilder("ReciprocalGrad", scope.makeOpName("ReciprocalGrad")); + @Endpoint( + describeByClass = true + ) + public static ReciprocalGrad create(Scope scope, Operand y, + Operand dy) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReciprocalGrad"); opBuilder.addInput(y.asOutput()); opBuilder.addInput(dy.asOutput()); - opBuilder = scope.apply(opBuilder); - return new ReciprocalGrad(opBuilder.build()); + return new ReciprocalGrad<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReciprocalGrad"; - - private Output z; - - private ReciprocalGrad(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 9439a3be134..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,25 +17,53 @@ 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.TType; +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 + */ + public static final String OP_NAME = "RequantizationRangePerChannel"; + + private Output outputMin; + + private Output outputMax; + + public RequantizationRangePerChannel(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputMin = operation.output(outputIdx++); + outputMax = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RequantizationRangePerChannel operation. - * + * * @param scope current scope * @param input The original input tensor. * @param inputMin The minimum value of the input tensor @@ -44,41 +72,75 @@ public final class RequantizationRangePerChannel extends RawOp { * Example: set this to 6 for Relu6. * @return a new instance of RequantizationRangePerChannel */ - @Endpoint(describeByClass = true) - public static RequantizationRangePerChannel create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Float clipValueMax) { - OperationBuilder opBuilder = scope.env().opBuilder("RequantizationRangePerChannel", scope.makeOpName("RequantizationRangePerChannel")); + @Endpoint( + describeByClass = true + ) + public static RequantizationRangePerChannel create(Scope scope, Operand input, + Operand inputMin, Operand inputMax, Float clipValueMax) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RequantizationRangePerChannel"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputMin.asOutput()); opBuilder.addInput(inputMax.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("clip_value_max", clipValueMax); return new RequantizationRangePerChannel(opBuilder.build()); } - + /** + * Gets outputMin. * The minimum value of the final output tensor + * @return outputMin. */ public Output outputMin() { return outputMin; } - + /** + * Gets outputMax. * The maximum value of the final output tensor. + * @return outputMax. */ public Output outputMax() { return outputMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RequantizationRangePerChannel"; - - private Output outputMin; - private Output outputMax; - - private RequantizationRangePerChannel(Operation operation) { - super(operation); - int outputIdx = 0; - outputMin = operation.output(outputIdx++); - outputMax = operation.output(outputIdx++); + + @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 a1995a76e20..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,28 +17,57 @@ 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.TType; +import org.tensorflow.types.family.TNumber; /** * Requantizes input with min and max values known per channel. - * - * @param data type for {@code output()} output */ -public final class RequantizePerChannel extends RawOp { - +@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 + */ + public static final String OP_NAME = "RequantizePerChannel"; + + private Output output; + + private Output outputMin; + + private Output outputMax; + + public RequantizePerChannel(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + outputMin = operation.output(outputIdx++); + outputMax = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RequantizePerChannel operation. - * + * * @param scope current scope * @param input The original input tensor. * @param inputMin The minimum value of the input tensor @@ -46,54 +75,102 @@ public final class RequantizePerChannel extends RawOp { * @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 */ - @Endpoint(describeByClass = true) - public static RequantizePerChannel create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Operand requestedOutputMin, Operand requestedOutputMax, Class outType) { - OperationBuilder opBuilder = scope.env().opBuilder("RequantizePerChannel", scope.makeOpName("RequantizePerChannel")); + @Endpoint( + describeByClass = true + ) + public static RequantizePerChannel create(Scope scope, + Operand input, Operand inputMin, Operand inputMax, + Operand requestedOutputMin, Operand requestedOutputMax, + Class outType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RequantizePerChannel"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputMin.asOutput()); opBuilder.addInput(inputMax.asOutput()); opBuilder.addInput(requestedOutputMin.asOutput()); opBuilder.addInput(requestedOutputMax.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new RequantizePerChannel(opBuilder.build()); + return new RequantizePerChannel<>(opBuilder.build()); } - + /** + * Gets output. * Output tensor. + * @return output. */ public Output output() { return output; } - + /** + * Gets outputMin. * The minimum value of the final output tensor + * @return outputMin. */ public Output outputMin() { return outputMin; } - + /** + * Gets outputMax. * The maximum value of the final output tensor. + * @return outputMax. */ public Output outputMax() { return outputMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RequantizePerChannel"; - - private Output output; - private Output outputMin; - private Output outputMax; - - private RequantizePerChannel(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - outputMin = operation.output(outputIdx++); - outputMax = operation.output(outputIdx++); + + @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 1de8f528899..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,68 +17,104 @@ 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 integer closest to x. - *

* If the result is midway between two representable values, * the even representable is chosen. * For example: - *

{@code
- * rint(-1.5) ==> -2.0
- * 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 + *
+ * rint(-1.5) ==> -2.0
+ * 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.]
+ * 
*/ -@Operator(group = "math") +@OpMetadata( + opType = Rint.OP_NAME, + inputsClass = Rint.Inputs.class +) +@Operator( + group = "math" +) public final class Rint extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Rint"; + + private Output y; + + public Rint(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Rint operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Rint} output and operands * @return a new instance of Rint */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Rint create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Rint", scope.makeOpName("Rint")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Rint"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Rint(opBuilder.build()); + return new Rint<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Rint"; - - private Output y; - - private Rint(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 4c1352fb547..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,61 +17,98 @@ 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 */ -@Operator(group = "math") +@OpMetadata( + opType = Round.OP_NAME, + inputsClass = Round.Inputs.class +) +@Operator( + group = "math" +) public final class Round extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Round"; + + private Output y; + + public Round(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Round operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Round} output and operands * @return a new instance of Round */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Round create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Round", scope.makeOpName("Round")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Round"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Round(opBuilder.build()); + return new Round<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Round"; - - private Output y; - - private Round(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 4d8d3e620e4..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,60 +17,97 @@ 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 + * I.e., \(y = 1 / \sqrt{x}\). */ -@Operator(group = "math") +@OpMetadata( + opType = Rsqrt.OP_NAME, + inputsClass = Rsqrt.Inputs.class +) +@Operator( + group = "math" +) public final class Rsqrt extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Rsqrt"; + + private Output y; + + public Rsqrt(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Rsqrt operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Rsqrt} output and operands * @return a new instance of Rsqrt */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Rsqrt create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Rsqrt", scope.makeOpName("Rsqrt")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Rsqrt"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Rsqrt(opBuilder.build()); + return new Rsqrt<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Rsqrt"; - - private Output y; - - private Rsqrt(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 a1696644fc3..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,62 +17,106 @@ 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 `x` wrt its input. - *

- * Specifically, `grad = dy * -0.5 * y^3`, where `y = rsqrt(x)`, and `dy` + * 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 + */ + public static final String OP_NAME = "RsqrtGrad"; + + private Output z; + + public RsqrtGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RsqrtGrad operation. - * + * * @param scope current scope - * @param y - * @param dy + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static RsqrtGrad create(Scope scope, Operand y, Operand dy) { - OperationBuilder opBuilder = scope.env().opBuilder("RsqrtGrad", scope.makeOpName("RsqrtGrad")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RsqrtGrad"); opBuilder.addInput(y.asOutput()); opBuilder.addInput(dy.asOutput()); - opBuilder = scope.apply(opBuilder); - return new RsqrtGrad(opBuilder.build()); + return new RsqrtGrad<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RsqrtGrad"; - - private Output z; - - private RsqrtGrad(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 8c5bc8344fa..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,86 +17,173 @@ 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 maximum along segments of a tensor. - *

* Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * the section on segmentation * for an explanation of segments. - *

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

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

- *

- * - *
- *

- * For example: - *

{@code
+ * 

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 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) + * + * + * */ -@Operator(group = "math") +@OpMetadata( + opType = SegmentMax.OP_NAME, + inputsClass = SegmentMax.Inputs.class +) +@Operator( + group = "math" +) public final class SegmentMax extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new SegmentMax operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SegmentMaxV2"; + + private Output output; + + public SegmentMax(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new SegmentMaxV2 operation. + * * @param scope current scope - * @param data - * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s + * @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. + * 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) { - OperationBuilder opBuilder = scope.env().opBuilder("SegmentMax", scope.makeOpName("SegmentMax")); + @Endpoint( + describeByClass = true + ) + public static SegmentMax create(Scope scope, Operand data, + Operand segmentIds, Operand numSegments) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SegmentMax"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(segmentIds.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SegmentMax(opBuilder.build()); + opBuilder.addInput(numSegments.asOutput()); + return new SegmentMax<>(opBuilder.build()); } - + /** - * Has same shape as data, except for dimension 0 which - * has size `k`, the number of segments. + * Gets output. + * 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() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SegmentMax"; - - private Output output; - - private SegmentMax(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 558a027606a..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,88 +17,147 @@ 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; /** * Computes the mean along segments of a tensor. - *

* Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * the section on segmentation * for an explanation of segments. - *

- * Computes a tensor such that - * \\(output_i = \frac{\sum_j data_j}{N}\\) where `mean` is - * over `j` such that `segment_ids[j] == i` and `N` is the total number of + *

Computes a tensor such that + * \(output_i = \frac{\sum_j data_j}{N}\) where {@code mean} is + * 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 `i`, `output[i] = 0`. - *

+ *

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: - *

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

For example: + *

+ *
+ *
+ *

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

+ *
+ *
*/ -@Operator(group = "math") +@OpMetadata( + opType = SegmentMean.OP_NAME, + inputsClass = SegmentMean.Inputs.class +) +@Operator( + group = "math" +) public final class SegmentMean extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SegmentMean"; + + private Output output; + + public SegmentMean(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SegmentMean operation. - * + * * @param scope current scope - * @param data - * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s + * @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 */ - @Endpoint(describeByClass = true) - public static SegmentMean create(Scope scope, Operand data, Operand segmentIds) { - OperationBuilder opBuilder = scope.env().opBuilder("SegmentMean", scope.makeOpName("SegmentMean")); + @Endpoint( + describeByClass = true + ) + public static SegmentMean create(Scope scope, Operand data, + Operand segmentIds) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SegmentMean"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(segmentIds.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SegmentMean(opBuilder.build()); + return new SegmentMean<>(opBuilder.build()); } - + /** + * Gets output. * Has same shape as data, except for dimension 0 which - * has size `k`, the number of segments. + * has size {@code k}, the number of segments. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SegmentMean"; - - private Output output; - - private SegmentMean(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 5b8b768ac75..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,86 +17,173 @@ 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 minimum along segments of a tensor. - *

* Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * the section on segmentation * for an explanation of segments. - *

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

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

- *

- * - *
- *

- * For example: - *

{@code
+ * 

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 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) + * + * + * */ -@Operator(group = "math") +@OpMetadata( + opType = SegmentMin.OP_NAME, + inputsClass = SegmentMin.Inputs.class +) +@Operator( + group = "math" +) public final class SegmentMin extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new SegmentMin operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SegmentMinV2"; + + private Output output; + + public SegmentMin(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new SegmentMinV2 operation. + * * @param scope current scope - * @param data - * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s + * @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. + * 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) { - OperationBuilder opBuilder = scope.env().opBuilder("SegmentMin", scope.makeOpName("SegmentMin")); + @Endpoint( + describeByClass = true + ) + public static SegmentMin create(Scope scope, Operand data, + Operand segmentIds, Operand numSegments) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SegmentMin"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(segmentIds.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SegmentMin(opBuilder.build()); + opBuilder.addInput(numSegments.asOutput()); + return new SegmentMin<>(opBuilder.build()); } - + /** - * Has same shape as data, except for dimension 0 which - * has size `k`, the number of segments. + * Gets output. + * 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() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SegmentMin"; - - private Output output; - - private SegmentMin(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 ff79fb6fa8a..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,87 +17,166 @@ 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; /** * Computes the product along segments of a tensor. - *

* Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * the section on segmentation * for an explanation of segments. - *

- * Computes a tensor such that - * \\(output_i = \prod_j data_j\\) where the product is over `j` such - * that `segment_ids[j] == i`. - *

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

- *

- * - *
- *

- * For example: - *

{@code
+ * 

Computes a tensor such that + * \(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) + * + * + * */ -@Operator(group = "math") +@OpMetadata( + opType = SegmentProd.OP_NAME, + inputsClass = SegmentProd.Inputs.class +) +@Operator( + group = "math" +) public final class SegmentProd extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new SegmentProd operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SegmentProdV2"; + + private Output output; + + public SegmentProd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new SegmentProdV2 operation. + * * @param scope current scope - * @param data - * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s + * @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. + * 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) { - OperationBuilder opBuilder = scope.env().opBuilder("SegmentProd", scope.makeOpName("SegmentProd")); + @Endpoint( + describeByClass = true + ) + public static SegmentProd create(Scope scope, Operand data, + Operand segmentIds, Operand numSegments) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SegmentProd"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(segmentIds.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SegmentProd(opBuilder.build()); + opBuilder.addInput(numSegments.asOutput()); + return new SegmentProd<>(opBuilder.build()); } - + /** - * Has same shape as data, except for dimension 0 which - * has size `k`, the number of segments. + * Gets output. + * 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() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SegmentProd"; - - private Output output; - - private SegmentProd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 e86b3a55469..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,87 +17,144 @@ 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; /** * Computes the sum along segments of a tensor. - *

* Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * the section on segmentation * for an explanation of segments. - *

- * Computes a tensor such that - * \\(output_i = \sum_j data_j\\) where sum is over `j` such - * that `segment_ids[j] == i`. - *

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

- *

- * - *
- *

- * For example: - *

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

Computes a tensor such that + * \(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}. + *

Note that this op is currently only supported with jit_compile=True. */ -@Operator(group = "math") +@OpMetadata( + opType = SegmentSum.OP_NAME, + inputsClass = SegmentSum.Inputs.class +) +@Operator( + group = "math" +) public final class SegmentSum extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new SegmentSum operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SegmentSumV2"; + + private Output output; + + public SegmentSum(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new SegmentSumV2 operation. + * * @param scope current scope - * @param data - * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s + * @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. + * 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) { - OperationBuilder opBuilder = scope.env().opBuilder("SegmentSum", scope.makeOpName("SegmentSum")); + @Endpoint( + describeByClass = true + ) + public static SegmentSum create(Scope scope, Operand data, + Operand segmentIds, Operand numSegments) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SegmentSum"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(segmentIds.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SegmentSum(opBuilder.build()); + opBuilder.addInput(numSegments.asOutput()); + return new SegmentSum<>(opBuilder.build()); } - + /** - * Has same shape as data, except for dimension 0 which - * has size `k`, the number of segments. + * Gets output. + * 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() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SegmentSum"; - - private Output output; - - private SegmentSum(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 bd2a43a910f..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,60 +17,97 @@ 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 `x` element-wise. - *

- * Specifically, `y = 1 / (1 + exp(-x))`. - * - * @param data type for {@code y()} output + * Computes sigmoid of {@code x} element-wise. + * Specifically, {@code y = 1 / (1 + exp(-x))}. */ -@Operator(group = "math") +@OpMetadata( + opType = Sigmoid.OP_NAME, + inputsClass = Sigmoid.Inputs.class +) +@Operator( + group = "math" +) public final class Sigmoid extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Sigmoid"; + + private Output y; + + public Sigmoid(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Sigmoid operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Sigmoid} output and operands * @return a new instance of Sigmoid */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Sigmoid create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Sigmoid", scope.makeOpName("Sigmoid")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Sigmoid"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Sigmoid(opBuilder.build()); + return new Sigmoid<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Sigmoid"; - - private Output y; - - private Sigmoid(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 5bb275ca5ce..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,62 +17,106 @@ 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 `x` wrt its input. - *

- * Specifically, `grad = dy * y * (1 - y)`, where `y = sigmoid(x)`, and - * `dy` is the corresponding input gradient. - * - * @param data type for {@code z()} output + * 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. */ +@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 + */ + public static final String OP_NAME = "SigmoidGrad"; + + private Output z; + + public SigmoidGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SigmoidGrad operation. - * + * * @param scope current scope - * @param y - * @param dy + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static SigmoidGrad create(Scope scope, Operand y, Operand dy) { - OperationBuilder opBuilder = scope.env().opBuilder("SigmoidGrad", scope.makeOpName("SigmoidGrad")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SigmoidGrad"); opBuilder.addInput(y.asOutput()); opBuilder.addInput(dy.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SigmoidGrad(opBuilder.build()); + return new SigmoidGrad<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SigmoidGrad"; - - private Output z; - - private SigmoidGrad(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 ca2ae2cda02..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,66 +17,107 @@ 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 an element-wise indication of the sign of a number. - *

- * `y = sign(x) = -1` if `x < 0`; 0 if `x == 0`; 1 if `x > 0`. - *

- * For complex numbers, `y = sign(x) = x / |x|` if `x != 0`, otherwise `y = 0`. - *

- * Example usage: - * >>> tf.math.sign([0., 2., -3.]) - * - * - * @param data type for {@code y()} output + * {@code y = sign(x) = -1} if {@code x < 0}; 0 if {@code x == 0}; 1 if {@code x > 0}. + *

For complex numbers, {@code y = sign(x) = x / |x|} if {@code x != 0}, otherwise {@code y = 0}. + *

Example usage: + *

+ *
+ *
+ *

tf.math.sign([0., 2., -3.]) + * <tf.Tensor: shape=(3,), dtype=float32, numpy=array([ 0., 1., -1.], dtype=float32)> + *

+ *
+ *
*/ -@Operator(group = "math") +@OpMetadata( + opType = Sign.OP_NAME, + inputsClass = Sign.Inputs.class +) +@Operator( + group = "math" +) public final class Sign extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Sign"; + + private Output y; + + public Sign(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Sign operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Sign} output and operands * @return a new instance of Sign */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Sign create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Sign", scope.makeOpName("Sign")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Sign"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Sign(opBuilder.build()); + return new Sign<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Sign"; - - private Output y; - - private Sign(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 35f6f8fd812..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,68 +17,103 @@ 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 sine of x element-wise. - *

- * Given an input tensor, this function computes sine of every - * element in the tensor. Input range is `(-inf, inf)` and - * output range is `[-1,1]`. - *

- *

{@code
- *   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 + * Given an input tensor, this function computes sine of every + * element in the tensor. Input range is {@code (-inf, inf)} and + * output range is {@code [-1,1]}. + *
+ * 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]
+ * 
*/ -@Operator(group = "math") +@OpMetadata( + opType = Sin.OP_NAME, + inputsClass = Sin.Inputs.class +) +@Operator( + group = "math" +) public final class Sin extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Sin"; + + private Output y; + + public Sin(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Sin operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Sin} output and operands * @return a new instance of Sin */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Sin create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Sin", scope.makeOpName("Sin")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Sin"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Sin(opBuilder.build()); + return new Sin<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Sin"; - - private Output y; - - private Sin(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 8ee456108fa..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,68 +17,103 @@ 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 hyperbolic sine of x element-wise. - *

- * Given an input tensor, this function computes hyperbolic sine of every - * element in the tensor. Input range is `[-inf,inf]` and output range - * is `[-inf,inf]`. - *

- *

{@code
- *   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 + * Given an input tensor, this function computes hyperbolic sine of every + * element in the tensor. Input range is {@code [-inf,inf]} and output range + * is {@code [-inf,inf]}. + *
+ * 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]
+ * 
*/ -@Operator(group = "math") +@OpMetadata( + opType = Sinh.OP_NAME, + inputsClass = Sinh.Inputs.class +) +@Operator( + group = "math" +) public final class Sinh extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Sinh"; + + private Output y; + + public Sinh(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Sinh operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Sinh} output and operands * @return a new instance of Sinh */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Sinh create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Sinh", scope.makeOpName("Sinh")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Sinh"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Sinh(opBuilder.build()); + return new Sinh<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Sinh"; - - private Output y; - - private Sinh(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 5424188a9a6..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,88 +17,143 @@ 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; /** * Generates points from the Sobol sequence. - *

- * Creates a Sobol sequence with `num_results` samples. Each sample has dimension - * `dim`. Skips the first `skip` samples. - * - * @param data type for {@code samples()} output + * Creates a Sobol sequence with {@code num_results} samples. Each sample has dimension + * {@code dim}. Skips the first {@code skip} samples. */ +@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 + */ + public static final String OP_NAME = "SobolSample"; + + private Output samples; + + public SobolSample(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + samples = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SobolSample operation. - * + * * @param scope current scope - * @param dim Positive scalar `Tensor` representing each sample's dimension. - * @param numResults Positive scalar `Tensor` of dtype int32. The number of Sobol points to return + * @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 `Tensor` of dtype int32. The number of initial points of the + * @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: `float32` or `float64`. + * @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 */ - @Endpoint(describeByClass = true) - public static SobolSample create(Scope scope, Operand dim, Operand numResults, Operand skip, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("SobolSample", scope.makeOpName("SobolSample")); + @Endpoint( + describeByClass = true + ) + public static SobolSample create(Scope scope, Operand dim, + Operand numResults, Operand skip, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SobolSample"); opBuilder.addInput(dim.asOutput()); opBuilder.addInput(numResults.asOutput()); opBuilder.addInput(skip.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new SobolSample(opBuilder.build()); + return new SobolSample<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new SobolSample operation using default output types. - * + * Factory method to create a class wrapping a new SobolSample operation, with the default output types. + * * @param scope current scope - * @param dim Positive scalar `Tensor` representing each sample's dimension. - * @param numResults Positive scalar `Tensor` of dtype int32. The number of Sobol points to return + * @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 `Tensor` of dtype int32. The number of initial points of the + * @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 + * @return a new instance of SobolSample, with default output types */ - @Endpoint(describeByClass = true) - public static SobolSample create(Scope scope, Operand dim, Operand numResults, Operand skip) { + @Endpoint( + describeByClass = true + ) + public static SobolSample create(Scope scope, Operand dim, + Operand numResults, Operand skip) { return create(scope, dim, numResults, skip, TFloat32.class); } - + /** - * `Tensor` of samples from Sobol sequence with `shape` [num_results, dim]. + * Gets samples. + * {@code Tensor} of samples from Sobol sequence with {@code shape} [num_results, dim]. + * @return samples. */ public Output samples() { return samples; } - + @Override public Output asOutput() { return samples; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SobolSample"; - - private Output samples; - - private SobolSample(Operation operation) { - super(operation); - int outputIdx = 0; - samples = operation.output(outputIdx++); + + @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 1014467d255..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,58 +17,96 @@ 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: `log(exp(features) + 1)`. - * - * @param data type for {@code activations()} output + * The Softplus operation */ -@Operator(group = "math") +@OpMetadata( + opType = Softplus.OP_NAME, + inputsClass = Softplus.Inputs.class +) +@Operator( + group = "math" +) public final class Softplus extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Softplus"; + + private Output activations; + + public Softplus(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + activations = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Softplus operation. - * + * * @param scope current scope - * @param features + * @param features The features value + * @param data type for {@code Softplus} output and operands * @return a new instance of Softplus */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Softplus create(Scope scope, Operand features) { - OperationBuilder opBuilder = scope.env().opBuilder("Softplus", scope.makeOpName("Softplus")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Softplus"); opBuilder.addInput(features.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Softplus(opBuilder.build()); + return new Softplus<>(opBuilder.build()); } - + /** + * Gets activations. + * + * @return activations. */ public Output activations() { return activations; } - + @Override public Output asOutput() { return activations; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Softplus"; - - private Output activations; - - private Softplus(Operation operation) { - super(operation); - int outputIdx = 0; - activations = operation.output(outputIdx++); + + @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 e3582acab64..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,60 +17,105 @@ 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 + */ + public static final String OP_NAME = "SoftplusGrad"; + + private Output backprops; + + public SoftplusGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + backprops = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SoftplusGrad operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static SoftplusGrad create(Scope scope, Operand gradients, Operand features) { - OperationBuilder opBuilder = scope.env().opBuilder("SoftplusGrad", scope.makeOpName("SoftplusGrad")); + @Endpoint( + describeByClass = true + ) + public static SoftplusGrad create(Scope scope, Operand gradients, + Operand features) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SoftplusGrad"); opBuilder.addInput(gradients.asOutput()); opBuilder.addInput(features.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SoftplusGrad(opBuilder.build()); + return new SoftplusGrad<>(opBuilder.build()); } - + /** - * The gradients: `gradients / (1 + exp(-features))`. + * Gets backprops. + * The gradients: {@code gradients / (1 + exp(-features))}. + * @return backprops. */ public Output backprops() { return backprops; } - + @Override public Output asOutput() { return backprops; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SoftplusGrad"; - - private Output backprops; - - private SoftplusGrad(Operation operation) { - super(operation); - int outputIdx = 0; - backprops = operation.output(outputIdx++); + + @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 5cf9dd2327f..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,60 +17,97 @@ 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 + * I.e., \(y = \sqrt{x} = x^{1/2}\). */ -@Operator(group = "math") +@OpMetadata( + opType = Sqrt.OP_NAME, + inputsClass = Sqrt.Inputs.class +) +@Operator( + group = "math" +) public final class Sqrt extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Sqrt"; + + private Output y; + + public Sqrt(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Sqrt operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Sqrt} output and operands * @return a new instance of Sqrt */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Sqrt create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Sqrt", scope.makeOpName("Sqrt")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Sqrt"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Sqrt(opBuilder.build()); + return new Sqrt<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Sqrt"; - - private Output y; - - private Sqrt(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 9b9bef4fd92..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,62 +17,106 @@ 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 `x` wrt its input. - *

- * Specifically, `grad = dy * 0.5 / y`, where `y = sqrt(x)`, and `dy` + * 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 + */ + public static final String OP_NAME = "SqrtGrad"; + + private Output z; + + public SqrtGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SqrtGrad operation. - * + * * @param scope current scope - * @param y - * @param dy + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static SqrtGrad create(Scope scope, Operand y, Operand dy) { - OperationBuilder opBuilder = scope.env().opBuilder("SqrtGrad", scope.makeOpName("SqrtGrad")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SqrtGrad"); opBuilder.addInput(y.asOutput()); opBuilder.addInput(dy.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SqrtGrad(opBuilder.build()); + return new SqrtGrad<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SqrtGrad"; - - private Output z; - - private SqrtGrad(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 c7f2781605f..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,60 +17,97 @@ 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 + * I.e., \(y = x * x = x^2\). */ -@Operator(group = "math") +@OpMetadata( + opType = Square.OP_NAME, + inputsClass = Square.Inputs.class +) +@Operator( + group = "math" +) public final class Square extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Square"; + + private Output y; + + public Square(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Square operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Square} output and operands * @return a new instance of Square */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Square create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Square", scope.makeOpName("Square")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Square"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Square(opBuilder.build()); + return new Square<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Square"; - - private Output y; - - private Square(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 4874e3db903..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,63 +17,107 @@ 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: `math.SquaredDifference` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - * - * @param data type for {@code z()} output + * NOTE: {@code math.SquaredDifference} supports broadcasting. More about broadcasting + * here */ -@Operator(group = "math") +@OpMetadata( + opType = SquaredDifference.OP_NAME, + inputsClass = SquaredDifference.Inputs.class +) +@Operator( + group = "math" +) public final class SquaredDifference extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SquaredDifference"; + + private Output z; + + public SquaredDifference(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SquaredDifference operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) - public static SquaredDifference create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("SquaredDifference", scope.makeOpName("SquaredDifference")); + @Endpoint( + describeByClass = true + ) + public static SquaredDifference create(Scope scope, Operand x, + Operand y) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SquaredDifference"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SquaredDifference(opBuilder.build()); + return new SquaredDifference<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SquaredDifference"; - - private Output z; - - private SquaredDifference(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 bb81618f654..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,63 +17,106 @@ 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: `math.Sub` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - * - * @param data type for {@code z()} output + * NOTE: {@code math.Sub} supports broadcasting. More about broadcasting + * here */ -@Operator(group = "math") +@OpMetadata( + opType = Sub.OP_NAME, + inputsClass = Sub.Inputs.class +) +@Operator( + group = "math" +) public final class Sub extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Sub"; + + private Output z; + + public Sub(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Sub operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Sub create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("Sub", scope.makeOpName("Sub")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Sub"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Sub(opBuilder.build()); + return new Sub<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Sub"; - - private Output z; - - private Sub(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 0ea80fcfaa8..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,69 +17,104 @@ 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 tan of x element-wise. - *

- * Given an input tensor, this function computes tangent of every - * element in the tensor. Input range is `(-inf, inf)` and - * output range is `(-inf, inf)`. If input lies outside the boundary, `nan` - * is returned. - *

- *

{@code
- *   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 + * Given an input tensor, this function computes tangent of every + * element in the tensor. Input range is {@code (-inf, inf)} and + * output range is {@code (-inf, inf)}. If input lies outside the boundary, {@code nan} + * is returned. + *
+ * 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]
+ * 
*/ -@Operator(group = "math") +@OpMetadata( + opType = Tan.OP_NAME, + inputsClass = Tan.Inputs.class +) +@Operator( + group = "math" +) public final class Tan extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Tan"; + + private Output y; + + public Tan(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Tan operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Tan} output and operands * @return a new instance of Tan */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Tan create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Tan", scope.makeOpName("Tan")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Tan"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Tan(opBuilder.build()); + return new Tan<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Tan"; - - private Output y; - - private Tan(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 5f71c39cd78..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,69 +17,110 @@ 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 hyperbolic tangent of `x` element-wise. - *

- * Given an input tensor, this function computes hyperbolic tangent of every - * element in the tensor. Input range is `[-inf, inf]` and - * output range is `[-1,1]`. - *

- * >>> x = tf.constant([-float("inf"), -5, -0.5, 1, 1.2, 2, 3, float("inf")]) - * >>> tf.math.tanh(x) - * - * - * - * @param data type for {@code y()} output + * Computes hyperbolic tangent of {@code x} element-wise. + * Given an input tensor, this function computes hyperbolic tangent of every + * element in the tensor. Input range is {@code [-inf, inf]} and + * output range is {@code [-1,1]}. + *

+ *
+ *
+ *

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, -0.99990916, -0.46211717, 0.7615942 , 0.8336547 , + * 0.9640276 , 0.9950547 , 1.0], dtype=float32)> + *

+ *
+ *
*/ -@Operator(group = "math") +@OpMetadata( + opType = Tanh.OP_NAME, + inputsClass = Tanh.Inputs.class +) +@Operator( + group = "math" +) public final class Tanh extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Tanh"; + + private Output y; + + public Tanh(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Tanh operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Tanh} output and operands * @return a new instance of Tanh */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Tanh create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Tanh", scope.makeOpName("Tanh")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Tanh"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Tanh(opBuilder.build()); + return new Tanh<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Tanh"; - - private Output y; - - private Tanh(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 8b292523cce..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,62 +17,106 @@ 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 `x` wrt its input. - *

- * Specifically, `grad = dy (1 - yy)`, where `y = tanh(x)`, and `dy` + * 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 + */ + public static final String OP_NAME = "TanhGrad"; + + private Output z; + + public TanhGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TanhGrad operation. - * + * * @param scope current scope - * @param y - * @param dy + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TanhGrad create(Scope scope, Operand y, Operand dy) { - OperationBuilder opBuilder = scope.env().opBuilder("TanhGrad", scope.makeOpName("TanhGrad")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TanhGrad"); opBuilder.addInput(y.asOutput()); opBuilder.addInput(dy.asOutput()); - opBuilder = scope.apply(opBuilder); - return new TanhGrad(opBuilder.build()); + return new TanhGrad<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TanhGrad"; - - private Output z; - - private TanhGrad(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 5902ad64c3f..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,68 +17,110 @@ 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 `FloorDiv` for a division function that matches + * than Python semantics. See {@code FloorDiv} for a division function that matches * Python Semantics. - *

- * NOTE: `math.TruncateDiv` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - * - * @param data type for {@code z()} output + *

NOTE: {@code math.TruncateDiv} supports broadcasting. More about broadcasting + * here */ -@Operator(group = "math") +@OpMetadata( + opType = TruncateDiv.OP_NAME, + inputsClass = TruncateDiv.Inputs.class +) +@Operator( + group = "math" +) public final class TruncateDiv extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TruncateDiv"; + + private Output z; + + public TruncateDiv(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TruncateDiv operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TruncateDiv create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("TruncateDiv", scope.makeOpName("TruncateDiv")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TruncateDiv"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new TruncateDiv(opBuilder.build()); + return new TruncateDiv<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TruncateDiv"; - - private Output z; - - private TruncateDiv(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 9419e0db0e4..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,66 +17,107 @@ 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. This emulates C semantics in that - *

- * the result here is consistent with a truncating divide. E.g. `truncate(x / y) * - * y + truncate_mod(x, y) = x`. - *

- * NOTE: `math.TruncateMod` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - * - * @param data type for {@code z()} output + * 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 */ -@Operator(group = "math") +@OpMetadata( + opType = TruncateMod.OP_NAME, + inputsClass = TruncateMod.Inputs.class +) +@Operator( + group = "math" +) public final class TruncateMod extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TruncateMod"; + + private Output z; + + public TruncateMod(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TruncateMod operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TruncateMod create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("TruncateMod", scope.makeOpName("TruncateMod")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TruncateMod"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new TruncateMod(opBuilder.build()); + return new TruncateMod<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TruncateMod"; - - private Output z; - - private TruncateMod(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 cdfc300c790..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,96 +17,165 @@ 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 maximum along segments of a tensor. - *

* Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * the section on segmentation * for an explanation of segments. - *

- * This operator is similar to the unsorted segment sum operator found - * [(here)](../../../api_docs/python/math_ops.md#UnsortedSegmentSum). + *

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 `j...` such - * that `segment_ids[j...] == i`. - *

- * If the maximum is empty for a given segment ID `i`, it outputs the smallest + *

\(output_i = \max_{j...} data[j...]\) where max is over tuples {@code j...} such + * that {@code segment_ids[j...] == i}. + *

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

- * If the given segment ID `i` is negative, then the corresponding value is + * {@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: - *

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

For example: + *

+ *
+ *
+ *

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

+ *
+ *
*/ -@Operator(group = "math") +@OpMetadata( + opType = UnsortedSegmentMax.OP_NAME, + inputsClass = UnsortedSegmentMax.Inputs.class +) +@Operator( + group = "math" +) public final class UnsortedSegmentMax extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UnsortedSegmentMax"; + + private Output output; + + public UnsortedSegmentMax(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new UnsortedSegmentMax operation. - * + * * @param scope current scope - * @param data - * @param segmentIds A tensor whose shape is a prefix of `data.shape`. - * @param numSegments + * @param data The data value + * @param segmentIds 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. + * @param numSegments The numSegments value + * @param data type for {@code UnsortedSegmentMax} output and operands * @return a new instance of UnsortedSegmentMax */ - @Endpoint(describeByClass = true) - public static UnsortedSegmentMax create(Scope scope, Operand data, Operand segmentIds, Operand numSegments) { - OperationBuilder opBuilder = scope.env().opBuilder("UnsortedSegmentMax", scope.makeOpName("UnsortedSegmentMax")); + @Endpoint( + describeByClass = true + ) + public static UnsortedSegmentMax create(Scope scope, Operand data, + Operand segmentIds, Operand numSegments) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UnsortedSegmentMax"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder.addInput(numSegments.asOutput()); - opBuilder = scope.apply(opBuilder); - return new UnsortedSegmentMax(opBuilder.build()); + return new UnsortedSegmentMax<>(opBuilder.build()); } - + /** - * Has same shape as data, except for the first `segment_ids.rank` + * Gets output. + * Has same shape as data, except for the first {@code segment_ids.rank} * dimensions, which are replaced with a single dimension which has size - * `num_segments`. + * {@code num_segments}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnsortedSegmentMax"; - - private Output output; - - private UnsortedSegmentMax(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 080e45d9608..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,90 +17,162 @@ 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 minimum along segments of a tensor. - *

* Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * the section on segmentation * for an explanation of segments. - *

- * This operator is similar to the unsorted segment sum operator found - * [(here)](../../../api_docs/python/math_ops.md#UnsortedSegmentSum). + *

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 `j...` such - * that `segment_ids[j...] == i`. - *

- * If the minimum is empty for a given segment ID `i`, it outputs the largest + *

\(output_i = \min_{j...} data_[j...]\) where min is over tuples {@code j...} such + * that {@code segment_ids[j...] == i}. + *

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

- * For example: - *

{@code
- * 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]]
- * }
- * If the given segment ID `i` is negative, then the corresponding value is + * {@code output[i] = numeric_limits::max()}. + *

For example: + *

+ *
+ *
+ *

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. */ -@Operator(group = "math") +@OpMetadata( + opType = UnsortedSegmentMin.OP_NAME, + inputsClass = UnsortedSegmentMin.Inputs.class +) +@Operator( + group = "math" +) public final class UnsortedSegmentMin extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UnsortedSegmentMin"; + + private Output output; + + public UnsortedSegmentMin(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new UnsortedSegmentMin operation. - * + * * @param scope current scope - * @param data - * @param segmentIds A tensor whose shape is a prefix of `data.shape`. - * @param numSegments + * @param data The data value + * @param segmentIds 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. + * @param numSegments The numSegments value + * @param data type for {@code UnsortedSegmentMin} output and operands * @return a new instance of UnsortedSegmentMin */ - @Endpoint(describeByClass = true) - public static UnsortedSegmentMin create(Scope scope, Operand data, Operand segmentIds, Operand numSegments) { - OperationBuilder opBuilder = scope.env().opBuilder("UnsortedSegmentMin", scope.makeOpName("UnsortedSegmentMin")); + @Endpoint( + describeByClass = true + ) + public static UnsortedSegmentMin create(Scope scope, Operand data, + Operand segmentIds, Operand numSegments) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UnsortedSegmentMin"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder.addInput(numSegments.asOutput()); - opBuilder = scope.apply(opBuilder); - return new UnsortedSegmentMin(opBuilder.build()); + return new UnsortedSegmentMin<>(opBuilder.build()); } - + /** - * Has same shape as data, except for the first `segment_ids.rank` + * Gets output. + * Has same shape as data, except for the first {@code segment_ids.rank} * dimensions, which are replaced with a single dimension which has size - * `num_segments`. + * {@code num_segments}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnsortedSegmentMin"; - - private Output output; - - private UnsortedSegmentMin(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 992f1863978..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,90 +17,162 @@ 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; /** * Computes the product along segments of a tensor. - *

* Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * the section on segmentation * for an explanation of segments. - *

- * This operator is similar to the unsorted segment sum operator found - * [(here)](../../../api_docs/python/math_ops.md#UnsortedSegmentSum). + *

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 - * `j...` such that `segment_ids[j...] == i`. - *

- * For example: - *

{@code
- * 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]]
- * }
- * If there is no entry for a given segment ID `i`, it outputs 1. - *

- * If the given segment ID `i` is negative, then the corresponding value is + *

\(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.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. */ -@Operator(group = "math") +@OpMetadata( + opType = UnsortedSegmentProd.OP_NAME, + inputsClass = UnsortedSegmentProd.Inputs.class +) +@Operator( + group = "math" +) public final class UnsortedSegmentProd extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UnsortedSegmentProd"; + + private Output output; + + public UnsortedSegmentProd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new UnsortedSegmentProd operation. - * + * * @param scope current scope - * @param data - * @param segmentIds A tensor whose shape is a prefix of `data.shape`. - * @param numSegments + * @param data The data value + * @param segmentIds 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. + * @param numSegments The numSegments value + * @param data type for {@code UnsortedSegmentProd} output and operands * @return a new instance of UnsortedSegmentProd */ - @Endpoint(describeByClass = true) - public static UnsortedSegmentProd create(Scope scope, Operand data, Operand segmentIds, Operand numSegments) { - OperationBuilder opBuilder = scope.env().opBuilder("UnsortedSegmentProd", scope.makeOpName("UnsortedSegmentProd")); + @Endpoint( + describeByClass = true + ) + public static UnsortedSegmentProd create(Scope scope, Operand data, + Operand segmentIds, Operand numSegments) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UnsortedSegmentProd"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder.addInput(numSegments.asOutput()); - opBuilder = scope.apply(opBuilder); - return new UnsortedSegmentProd(opBuilder.build()); + return new UnsortedSegmentProd<>(opBuilder.build()); } - + /** - * Has same shape as data, except for the first `segment_ids.rank` + * Gets output. + * Has same shape as data, except for the first {@code segment_ids.rank} * dimensions, which are replaced with a single dimension which has size - * `num_segments`. + * {@code num_segments}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnsortedSegmentProd"; - - private Output output; - - private UnsortedSegmentProd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 a5fbc0acbe2..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,93 +17,165 @@ 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; /** * Computes the sum along segments of a tensor. - *

* Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * the section on segmentation * for an explanation of segments. - *

- * Computes a tensor such that - * \\(output[i] = \sum_{j...} data[j...]\\) where the sum is over tuples `j...` such - * that `segment_ids[j...] == i`. Unlike `SegmentSum`, `segment_ids` + *

Computes a tensor such that + * \(output[i] = \sum_{j...} data[j...]\) where the sum is over tuples {@code j...} such + * that {@code segment_ids[j...] == i}. Unlike {@code SegmentSum}, {@code segment_ids} * need not be sorted and need not cover all values in the full * range of valid values. - *

- * If the sum is empty for a given segment ID `i`, `output[i] = 0`. - * If the given segment ID `i` is negative, the value is dropped and will not be + *

If the sum is empty for a given segment ID {@code i}, {@code output[i] = 0}. + * If the given segment ID {@code i} is negative, the value is dropped and will not be * added to the sum of the segment. - *

- * `num_segments` should equal the number of distinct segment IDs. - *

+ *

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

* *
- *
{@code
- * c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]])
- * tf.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) + *

+ *
+ *
*/ -@Operator(group = "math") +@OpMetadata( + opType = UnsortedSegmentSum.OP_NAME, + inputsClass = UnsortedSegmentSum.Inputs.class +) +@Operator( + group = "math" +) public final class UnsortedSegmentSum extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UnsortedSegmentSum"; + + private Output output; + + public UnsortedSegmentSum(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new UnsortedSegmentSum operation. - * + * * @param scope current scope - * @param data - * @param segmentIds A tensor whose shape is a prefix of `data.shape`. - * @param numSegments + * @param data The data value + * @param segmentIds 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. + * @param numSegments The numSegments value + * @param data type for {@code UnsortedSegmentSum} output and operands * @return a new instance of UnsortedSegmentSum */ - @Endpoint(describeByClass = true) - public static UnsortedSegmentSum create(Scope scope, Operand data, Operand segmentIds, Operand numSegments) { - OperationBuilder opBuilder = scope.env().opBuilder("UnsortedSegmentSum", scope.makeOpName("UnsortedSegmentSum")); + @Endpoint( + describeByClass = true + ) + public static UnsortedSegmentSum create(Scope scope, Operand data, + Operand segmentIds, Operand numSegments) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UnsortedSegmentSum"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder.addInput(numSegments.asOutput()); - opBuilder = scope.apply(opBuilder); - return new UnsortedSegmentSum(opBuilder.build()); + return new UnsortedSegmentSum<>(opBuilder.build()); } - + /** - * Has same shape as data, except for the first `segment_ids.rank` + * Gets output. + * Has same shape as data, except for the first {@code segment_ids.rank} * dimensions, which are replaced with a single dimension which has size - * `num_segments`. + * {@code num_segments}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnsortedSegmentSum"; - - private Output output; - - private UnsortedSegmentSum(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 445519d405c..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,60 +17,104 @@ 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 */ -@Operator(group = "math") +@OpMetadata( + opType = Xdivy.OP_NAME, + inputsClass = Xdivy.Inputs.class +) +@Operator( + group = "math" +) public final class Xdivy extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Xdivy"; + + private Output z; + + public Xdivy(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Xdivy operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Xdivy create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("Xdivy", scope.makeOpName("Xdivy")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Xdivy"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Xdivy(opBuilder.build()); + return new Xdivy<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Xdivy"; - - private Output z; - - private Xdivy(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 0bfd71e66b4..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,60 +17,104 @@ 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 */ -@Operator(group = "math") +@OpMetadata( + opType = Xlog1py.OP_NAME, + inputsClass = Xlog1py.Inputs.class +) +@Operator( + group = "math" +) public final class Xlog1py extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Xlog1py"; + + private Output z; + + public Xlog1py(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Xlog1py operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Xlog1py create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("Xlog1py", scope.makeOpName("Xlog1py")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Xlog1py"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Xlog1py(opBuilder.build()); + return new Xlog1py<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Xlog1py"; - - private Output z; - - private Xlog1py(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 2311fb50cf8..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,60 +17,104 @@ 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 */ -@Operator(group = "math") +@OpMetadata( + opType = Xlogy.OP_NAME, + inputsClass = Xlogy.Inputs.class +) +@Operator( + group = "math" +) public final class Xlogy extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Xlogy"; + + private Output z; + + public Xlogy(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Xlogy operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Xlogy create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.env().opBuilder("Xlogy", scope.makeOpName("Xlogy")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Xlogy"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Xlogy(opBuilder.build()); + return new Xlogy<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Xlogy"; - - private Output z; - - private Xlogy(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 73c290262c8..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,64 +17,106 @@ 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)\\). - *

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

\(\zeta(x, q) = \sum_{n=0}^{\infty} (q + n)^{-x}\) */ -@Operator(group = "math") +@OpMetadata( + opType = Zeta.OP_NAME, + inputsClass = Zeta.Inputs.class +) +@Operator( + group = "math" +) public final class Zeta extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Zeta"; + + private Output z; + + public Zeta(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Zeta operation. - * + * * @param scope current scope - * @param x - * @param q + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Zeta create(Scope scope, Operand x, Operand q) { - OperationBuilder opBuilder = scope.env().opBuilder("Zeta", scope.makeOpName("Zeta")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Zeta"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(q.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Zeta(opBuilder.build()); + return new Zeta<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Zeta"; - - private Output z; - - private Zeta(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 cfa2adab329..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,56 +17,96 @@ 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; /** - * @param data type for {@code y()} output + * The Erfinv operation */ -@Operator(group = "math") +@OpMetadata( + opType = erfinv.OP_NAME, + inputsClass = erfinv.Inputs.class +) +@Operator( + group = "math" +) public final class erfinv extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new erfinv operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Erfinv"; + + private Output y; + + public erfinv(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new Erfinv operation. + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Erfinv} output and operands * @return a new instance of erfinv */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static erfinv create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Erfinv", scope.makeOpName("erfinv")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "erfinv"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new erfinv(opBuilder.build()); + return new erfinv<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Erfinv"; - - private Output y; - - private erfinv(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 597e82504d0..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,55 +17,96 @@ 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; /** - * @param data type for {@code y()} output + * The BesselJ0 operation */ +@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 + */ + public static final String OP_NAME = "BesselJ0"; + + private Output y; + + public BesselJ0(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselJ0 operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code BesselJ0} output and operands * @return a new instance of BesselJ0 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselJ0 create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("BesselJ0", scope.makeOpName("BesselJ0")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BesselJ0"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BesselJ0(opBuilder.build()); + return new BesselJ0<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselJ0"; - - private Output y; - - private BesselJ0(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 0e05c32334d..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,55 +17,96 @@ 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; /** - * @param data type for {@code y()} output + * The BesselJ1 operation */ +@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 + */ + public static final String OP_NAME = "BesselJ1"; + + private Output y; + + public BesselJ1(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselJ1 operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code BesselJ1} output and operands * @return a new instance of BesselJ1 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselJ1 create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("BesselJ1", scope.makeOpName("BesselJ1")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BesselJ1"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BesselJ1(opBuilder.build()); + return new BesselJ1<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselJ1"; - - private Output y; - - private BesselJ1(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 ae0586d549c..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,55 +17,96 @@ 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; /** - * @param data type for {@code y()} output + * The BesselK0 operation */ +@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 + */ + public static final String OP_NAME = "BesselK0"; + + private Output y; + + public BesselK0(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselK0 operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code BesselK0} output and operands * @return a new instance of BesselK0 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselK0 create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("BesselK0", scope.makeOpName("BesselK0")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BesselK0"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BesselK0(opBuilder.build()); + return new BesselK0<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselK0"; - - private Output y; - - private BesselK0(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 e4a677d2f1a..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,55 +17,96 @@ 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; /** - * @param data type for {@code y()} output + * The BesselK0e operation */ +@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 + */ + public static final String OP_NAME = "BesselK0e"; + + private Output y; + + public BesselK0e(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselK0e operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code BesselK0e} output and operands * @return a new instance of BesselK0e */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselK0e create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("BesselK0e", scope.makeOpName("BesselK0e")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BesselK0e"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BesselK0e(opBuilder.build()); + return new BesselK0e<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselK0e"; - - private Output y; - - private BesselK0e(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 bcdd407508b..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,55 +17,96 @@ 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; /** - * @param data type for {@code y()} output + * The BesselK1 operation */ +@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 + */ + public static final String OP_NAME = "BesselK1"; + + private Output y; + + public BesselK1(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselK1 operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code BesselK1} output and operands * @return a new instance of BesselK1 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselK1 create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("BesselK1", scope.makeOpName("BesselK1")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BesselK1"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BesselK1(opBuilder.build()); + return new BesselK1<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselK1"; - - private Output y; - - private BesselK1(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 c5824c47cbd..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,55 +17,96 @@ 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; /** - * @param data type for {@code y()} output + * The BesselK1e operation */ +@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 + */ + public static final String OP_NAME = "BesselK1e"; + + private Output y; + + public BesselK1e(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselK1e operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code BesselK1e} output and operands * @return a new instance of BesselK1e */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselK1e create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("BesselK1e", scope.makeOpName("BesselK1e")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BesselK1e"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BesselK1e(opBuilder.build()); + return new BesselK1e<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselK1e"; - - private Output y; - - private BesselK1e(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 03c8c1ade60..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,55 +17,96 @@ 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; /** - * @param data type for {@code y()} output + * The BesselY0 operation */ +@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 + */ + public static final String OP_NAME = "BesselY0"; + + private Output y; + + public BesselY0(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselY0 operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code BesselY0} output and operands * @return a new instance of BesselY0 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselY0 create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("BesselY0", scope.makeOpName("BesselY0")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BesselY0"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BesselY0(opBuilder.build()); + return new BesselY0<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselY0"; - - private Output y; - - private BesselY0(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 92a7561ee8a..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,55 +17,96 @@ 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; /** - * @param data type for {@code y()} output + * The BesselY1 operation */ +@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 + */ + public static final String OP_NAME = "BesselY1"; + + private Output y; + + public BesselY1(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselY1 operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code BesselY1} output and operands * @return a new instance of BesselY1 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselY1 create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("BesselY1", scope.makeOpName("BesselY1")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BesselY1"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BesselY1(opBuilder.build()); + return new BesselY1<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselY1"; - - private Output y; - - private BesselY1(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 9e50d639d02..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,55 +17,96 @@ 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; /** - * @param data type for {@code y()} output + * The Dawsn operation */ +@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 + */ + public static final String OP_NAME = "Dawsn"; + + private Output y; + + public Dawsn(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Dawsn operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Dawsn} output and operands * @return a new instance of Dawsn */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Dawsn create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Dawsn", scope.makeOpName("Dawsn")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Dawsn"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Dawsn(opBuilder.build()); + return new Dawsn<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Dawsn"; - - private Output y; - - private Dawsn(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 8cff09b15c3..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,55 +17,96 @@ 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; /** - * @param data type for {@code y()} output + * The Expint operation */ +@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 + */ + public static final String OP_NAME = "Expint"; + + private Output y; + + public Expint(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Expint operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Expint} output and operands * @return a new instance of Expint */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Expint create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Expint", scope.makeOpName("Expint")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Expint"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Expint(opBuilder.build()); + return new Expint<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Expint"; - - private Output y; - - private Expint(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 f3d0848f814..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,55 +17,96 @@ 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; /** - * @param data type for {@code y()} output + * The FresnelCos operation */ +@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 + */ + public static final String OP_NAME = "FresnelCos"; + + private Output y; + + public FresnelCos(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new FresnelCos operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code FresnelCos} output and operands * @return a new instance of FresnelCos */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static FresnelCos create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("FresnelCos", scope.makeOpName("FresnelCos")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FresnelCos"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new FresnelCos(opBuilder.build()); + return new FresnelCos<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FresnelCos"; - - private Output y; - - private FresnelCos(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 33d738bf9fd..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,55 +17,96 @@ 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; /** - * @param data type for {@code y()} output + * The FresnelSin operation */ +@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 + */ + public static final String OP_NAME = "FresnelSin"; + + private Output y; + + public FresnelSin(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new FresnelSin operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code FresnelSin} output and operands * @return a new instance of FresnelSin */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static FresnelSin create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("FresnelSin", scope.makeOpName("FresnelSin")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FresnelSin"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new FresnelSin(opBuilder.build()); + return new FresnelSin<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FresnelSin"; - - private Output y; - - private FresnelSin(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 39a3c134ebb..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,55 +17,96 @@ 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; /** - * @param data type for {@code y()} output + * The Spence operation */ +@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 + */ + public static final String OP_NAME = "Spence"; + + private Output y; + + public Spence(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Spence operation. - * + * * @param scope current scope - * @param x + * @param x The x value + * @param data type for {@code Spence} output and operands * @return a new instance of Spence */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Spence create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.env().opBuilder("Spence", scope.makeOpName("Spence")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Spence"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Spence(opBuilder.build()); + return new Spence<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Spence"; - - private Output y; - - private Spence(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + @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 77fb90557ec..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,74 +17,75 @@ 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 `output` is the mean of the corresponding size `ksize` - * window in `value`. - * - * @param data type for {@code output()} output + * Each entry in {@code output} is the mean of the corresponding size {@code ksize} + * window in {@code value}. */ -@Operator(group = "nn") +@OpMetadata( + opType = AvgPool.OP_NAME, + inputsClass = AvgPool.Inputs.class +) +@Operator( + group = "nn" +) public final class AvgPool extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.AvgPool} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "AvgPool"; + + private Output output; + + public AvgPool(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new AvgPool operation. - * + * * @param scope current scope - * @param value 4-D with shape `[batch, height, width, channels]`. - * @param ksize The size of the sliding window for each dimension of `value`. - * @param strides The stride of the sliding window for each dimension of `value`. + * @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}. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code AvgPool} output and operands * @return a new instance of AvgPool */ - @Endpoint(describeByClass = true) - public static AvgPool create(Scope scope, Operand value, List ksize, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("AvgPool", scope.makeOpName("AvgPool")); + @Endpoint( + describeByClass = true + ) + public static AvgPool create(Scope scope, Operand value, + List ksize, List strides, String padding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AvgPool"); opBuilder.addInput(value.asOutput()); - opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + 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) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -96,40 +97,109 @@ public static AvgPool create(Scope scope, Operand valu } } } - return new AvgPool(opBuilder.build()); + return new AvgPool<>(opBuilder.build()); } - + /** + * 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]. + * 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); } - + /** + * Gets output. * The average pooled output tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AvgPool"; - - private Output output; - - private AvgPool(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.AvgPool} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * 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; + } + } + + @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 b75ad74af9a..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,76 +17,77 @@ 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 `output` is the mean of the corresponding size `ksize` window in - * `value`. - * - * @param data type for {@code output()} output + * Each entry in {@code output} is the mean of the corresponding size {@code ksize} window in + * {@code value}. */ -@Operator(group = "nn") +@OpMetadata( + opType = AvgPool3d.OP_NAME, + inputsClass = AvgPool3d.Inputs.class +) +@Operator( + group = "nn" +) public final class AvgPool3d extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.AvgPool3d} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat 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 Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "AvgPool3D"; + + private Output output; + + public AvgPool3d(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new AvgPool3d operation. - * + * Factory method to create a class wrapping a new AvgPool3D operation. + * * @param scope current scope - * @param input Shape `[batch, depth, rows, cols, channels]` tensor to pool over. + * @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 `ksize[0] = ksize[4] = 1`. + * the input tensor. Must have {@code ksize[0] = ksize[4] = 1}. * @param strides 1-D tensor of length 5. The stride of the sliding window for each - * dimension of `input`. Must have `strides[0] = strides[4] = 1`. + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code AvgPool3D} output and operands * @return a new instance of AvgPool3d */ - @Endpoint(describeByClass = true) - public static AvgPool3d create(Scope scope, Operand input, List ksize, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("AvgPool3D", scope.makeOpName("AvgPool3d")); + @Endpoint( + describeByClass = true + ) + public static AvgPool3d create(Scope scope, Operand input, + List ksize, List strides, String padding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AvgPool3d"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + 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) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -98,40 +99,111 @@ public static AvgPool3d create(Scope scope, Operand in } } } - return new AvgPool3d(opBuilder.build()); + return new AvgPool3d<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat 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]. + * 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]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Gets output. * The average pooled output tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AvgPool3D"; - - private Output output; - - private AvgPool3d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.AvgPool3d} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat 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]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = 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 96ad463e8aa..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,76 +17,79 @@ 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 */ -@Operator(group = "nn") +@OpMetadata( + opType = AvgPool3dGrad.OP_NAME, + inputsClass = AvgPool3dGrad.Inputs.class +) +@Operator( + group = "nn" +) public final class AvgPool3dGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.AvgPool3dGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat 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 Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "AvgPool3DGrad"; + + private Output output; + + public AvgPool3dGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new AvgPool3dGrad operation. - * + * Factory method to create a class wrapping a new AvgPool3DGrad operation. + * * @param scope current scope * @param origInputShape The original input dimensions. - * @param grad Output backprop of shape `[batch, depth, rows, cols, channels]`. + * @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 - * the input tensor. Must have `ksize[0] = ksize[4] = 1`. + * the input tensor. Must have {@code ksize[0] = ksize[4] = 1}. * @param strides 1-D tensor of length 5. The stride of the sliding window for each - * dimension of `input`. Must have `strides[0] = strides[4] = 1`. + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code AvgPool3DGrad} output and operands * @return a new instance of AvgPool3dGrad */ - @Endpoint(describeByClass = true) - public static AvgPool3dGrad create(Scope scope, Operand origInputShape, Operand grad, List ksize, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("AvgPool3DGrad", scope.makeOpName("AvgPool3dGrad")); + @Endpoint( + describeByClass = true + ) + public static AvgPool3dGrad create(Scope scope, + Operand origInputShape, Operand grad, List ksize, List strides, + String padding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AvgPool3dGrad"); opBuilder.addInput(origInputShape.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + 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) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -98,40 +101,117 @@ public static AvgPool3dGrad create(Scope scope, Operand(opBuilder.build()); + return new AvgPool3dGrad<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat 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]. + * 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]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Gets output. * The backprop for input. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AvgPool3DGrad"; - - private Output output; - - private AvgPool3dGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.AvgPool3dGrad} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat 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]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = 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 585f72414e1..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,74 +17,78 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.nn.AvgPoolGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "AvgPoolGrad"; + + private Output output; + + public AvgPoolGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new AvgPoolGrad operation. - * + * * @param scope current scope - * @param origInputShape 1-D. Shape of the original input to `avg_pool`. - * @param grad 4-D with shape `[batch, height, width, channels]`. Gradients w.r.t. - * the output of `avg_pool`. + * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code AvgPoolGrad} output and operands * @return a new instance of AvgPoolGrad */ - @Endpoint(describeByClass = true) - public static AvgPoolGrad create(Scope scope, Operand origInputShape, Operand grad, List ksize, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("AvgPoolGrad", scope.makeOpName("AvgPoolGrad")); + @Endpoint( + describeByClass = true + ) + public static AvgPoolGrad create(Scope scope, + Operand origInputShape, Operand grad, List ksize, List strides, + String padding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AvgPoolGrad"); opBuilder.addInput(origInputShape.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + 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) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -96,40 +100,116 @@ public static AvgPoolGrad create(Scope scope, Operand(opBuilder.build()); + return new AvgPoolGrad<>(opBuilder.build()); } - + /** + * 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]. + * 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); } - + /** - * 4-D. Gradients w.r.t. the input of `avg_pool`. + * Gets output. + * 4-D. Gradients w.r.t. the input of {@code avg_pool}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AvgPoolGrad"; - - private Output output; - - private AvgPoolGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.AvgPoolGrad} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * 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; + } + } + + @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 18ad9cf60ee..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,29 +17,50 @@ 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 `tf.nn.batch_normalization`. - * - * @param data type for {@code result()} output + * This op is deprecated. Prefer {@code tf.nn.batch_normalization}. */ -@Operator(group = "nn") +@OpMetadata( + opType = BatchNormWithGlobalNormalization.OP_NAME, + inputsClass = BatchNormWithGlobalNormalization.Inputs.class +) +@Operator( + group = "nn" +) public final class BatchNormWithGlobalNormalization extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchNormWithGlobalNormalization"; + + private Output result; + + public BatchNormWithGlobalNormalization(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + result = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BatchNormWithGlobalNormalization operation. - * + * * @param scope current scope * @param t A 4D input Tensor. * @param m A 1D mean Tensor with size matching the last dimension of t. @@ -51,46 +72,108 @@ public final class BatchNormWithGlobalNormalization extends Raw * @param beta A 1D beta Tensor with size matching the last dimension of t. * An offset to be added to the normalized tensor. * @param gamma A 1D gamma Tensor with size matching the last dimension of t. - * If "scale_after_normalization" is true, this tensor will be multiplied + * If "scale_after_normalization" is true, this tensor will be multiplied * with the normalized tensor. * @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. + * @param data type for {@code BatchNormWithGlobalNormalization} output and operands * @return a new instance of BatchNormWithGlobalNormalization */ - @Endpoint(describeByClass = true) - public static BatchNormWithGlobalNormalization create(Scope scope, Operand t, Operand m, Operand v, Operand beta, Operand gamma, Float varianceEpsilon, Boolean scaleAfterNormalization) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchNormWithGlobalNormalization", scope.makeOpName("BatchNormWithGlobalNormalization")); + @Endpoint( + describeByClass = true + ) + public static BatchNormWithGlobalNormalization create(Scope scope, + Operand t, Operand m, Operand v, Operand beta, Operand gamma, + Float varianceEpsilon, Boolean scaleAfterNormalization) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchNormWithGlobalNormalization"); opBuilder.addInput(t.asOutput()); opBuilder.addInput(m.asOutput()); opBuilder.addInput(v.asOutput()); opBuilder.addInput(beta.asOutput()); opBuilder.addInput(gamma.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("variance_epsilon", varianceEpsilon); opBuilder.setAttr("scale_after_normalization", scaleAfterNormalization); - return new BatchNormWithGlobalNormalization(opBuilder.build()); + return new BatchNormWithGlobalNormalization<>(opBuilder.build()); } - + /** + * Gets result. + * + * @return result. */ public Output result() { return result; } - + @Override public Output asOutput() { return result; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchNormWithGlobalNormalization"; - - private Output result; - - private BatchNormWithGlobalNormalization(Operation operation) { - super(operation); - int outputIdx = 0; - result = operation.output(outputIdx++); + + @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 31819d472e9..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,29 +17,62 @@ 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 `tf.nn.batch_normalization`. - * - * @param data type for {@code dx()} output + * This op is deprecated. See {@code tf.nn.batch_normalization}. */ -@Operator(group = "nn") +@OpMetadata( + opType = BatchNormWithGlobalNormalizationGrad.OP_NAME, + inputsClass = BatchNormWithGlobalNormalizationGrad.Inputs.class +) +@Operator( + group = "nn" +) public final class BatchNormWithGlobalNormalizationGrad extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchNormWithGlobalNormalizationGrad"; + + private Output dx; + + private Output dm; + + private Output dv; + + private Output db; + + private Output dg; + + public BatchNormWithGlobalNormalizationGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + dx = operation.output(outputIdx++); + dm = operation.output(outputIdx++); + dv = operation.output(outputIdx++); + db = operation.output(outputIdx++); + dg = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BatchNormWithGlobalNormalizationGrad operation. - * + * * @param scope current scope * @param t A 4D input Tensor. * @param m A 1D mean Tensor with size matching the last dimension of t. @@ -49,79 +82,139 @@ public final class BatchNormWithGlobalNormalizationGrad extends * This is the second output from tf.nn.moments, * or a saved moving average thereof. * @param gamma A 1D gamma Tensor with size matching the last dimension of t. - * If "scale_after_normalization" is true, this Tensor will be multiplied + * If "scale_after_normalization" is true, this Tensor will be multiplied * with the normalized Tensor. * @param backprop 4D backprop Tensor. * @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. + * @param data type for {@code BatchNormWithGlobalNormalizationGrad} output and operands * @return a new instance of BatchNormWithGlobalNormalizationGrad */ - @Endpoint(describeByClass = true) - public static BatchNormWithGlobalNormalizationGrad create(Scope scope, Operand t, Operand m, Operand v, Operand gamma, Operand backprop, Float varianceEpsilon, Boolean scaleAfterNormalization) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchNormWithGlobalNormalizationGrad", scope.makeOpName("BatchNormWithGlobalNormalizationGrad")); + @Endpoint( + describeByClass = true + ) + public static BatchNormWithGlobalNormalizationGrad create(Scope scope, + Operand t, Operand m, Operand v, Operand gamma, Operand backprop, + Float varianceEpsilon, Boolean scaleAfterNormalization) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchNormWithGlobalNormalizationGrad"); opBuilder.addInput(t.asOutput()); opBuilder.addInput(m.asOutput()); opBuilder.addInput(v.asOutput()); opBuilder.addInput(gamma.asOutput()); opBuilder.addInput(backprop.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("variance_epsilon", varianceEpsilon); opBuilder.setAttr("scale_after_normalization", scaleAfterNormalization); - return new BatchNormWithGlobalNormalizationGrad(opBuilder.build()); + return new BatchNormWithGlobalNormalizationGrad<>(opBuilder.build()); } - + /** + * Gets dx. * 4D backprop tensor for input. + * @return dx. */ public Output dx() { return dx; } - + /** + * Gets dm. * 1D backprop tensor for mean. + * @return dm. */ public Output dm() { return dm; } - + /** + * Gets dv. * 1D backprop tensor for variance. + * @return dv. */ public Output dv() { return dv; } - + /** + * Gets db. * 1D backprop tensor for beta. + * @return db. */ public Output db() { return db; } - + /** + * Gets dg. * 1D backprop tensor for gamma. + * @return dg. */ public Output dg() { return dg; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchNormWithGlobalNormalizationGrad"; - - private Output dx; - private Output dm; - private Output dv; - private Output db; - private Output dg; - - private BatchNormWithGlobalNormalizationGrad(Operation operation) { - super(operation); - int outputIdx = 0; - dx = operation.output(outputIdx++); - dm = operation.output(outputIdx++); - dv = operation.output(outputIdx++); - db = operation.output(outputIdx++); - dg = operation.output(outputIdx++); + + @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 2d402e4b608..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,67 +17,66 @@ 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 `bias` to `value`. - *

- * This is a special case of `tf.add` where `bias` is restricted to be 1-D. - * Broadcasting is supported, so `value` may have any number of dimensions. - * - * @param data type for {@code output()} output + * 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. */ -@Operator(group = "nn") +@OpMetadata( + opType = BiasAdd.OP_NAME, + inputsClass = BiasAdd.Inputs.class +) +@Operator( + group = "nn" +) public final class BiasAdd extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.BiasAdd} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat 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 Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "BiasAdd"; + + private Output output; + + public BiasAdd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new BiasAdd operation. - * + * * @param scope current scope * @param value Any number of dimensions. - * @param bias 1-D with size the last dimension of `value`. - * @param options carries optional attributes values + * @param bias 1-D with size the last dimension of {@code value}. + * @param options carries optional attribute values + * @param data type for {@code BiasAdd} output and operands * @return a new instance of BiasAdd */ - @Endpoint(describeByClass = true) - public static BiasAdd create(Scope scope, Operand value, Operand bias, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("BiasAdd", scope.makeOpName("BiasAdd")); + @Endpoint( + describeByClass = true + ) + public static BiasAdd create(Scope scope, Operand value, Operand bias, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BiasAdd"); opBuilder.addInput(value.asOutput()); opBuilder.addInput(bias.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.dataFormat != null) { @@ -85,42 +84,103 @@ public static BiasAdd create(Scope scope, Operand value, } } } - return new BiasAdd(opBuilder.build()); + return new BiasAdd<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat 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 + * 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. + * 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. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** - * Broadcasted sum of `value` and `bias`. + * Gets output. + * Broadcasted sum of {@code value} and {@code bias}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BiasAdd"; - - private Output output; - - private BiasAdd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.BiasAdd} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat 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. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = 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 05b7cad74b7..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,66 +17,65 @@ 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; /** - * The backward operation for "BiasAdd" on the "bias" tensor. - *

+ * The backward operation for "BiasAdd" on the "bias" tensor. * 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 */ -@Operator(group = "nn") +@OpMetadata( + opType = BiasAddGrad.OP_NAME, + inputsClass = BiasAddGrad.Inputs.class +) +@Operator( + group = "nn" +) public final class BiasAddGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.BiasAddGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat 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 Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "BiasAddGrad"; + + private Output output; + + public BiasAddGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new BiasAddGrad operation. - * + * * @param scope current scope * @param outBackprop Any number of dimensions. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code BiasAddGrad} output and operands * @return a new instance of BiasAddGrad */ - @Endpoint(describeByClass = true) - public static BiasAddGrad create(Scope scope, Operand outBackprop, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("BiasAddGrad", scope.makeOpName("BiasAddGrad")); + @Endpoint( + describeByClass = true + ) + public static BiasAddGrad create(Scope scope, Operand outBackprop, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BiasAddGrad"); opBuilder.addInput(outBackprop.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.dataFormat != null) { @@ -84,42 +83,97 @@ public static BiasAddGrad create(Scope scope, Operand ou } } } - return new BiasAddGrad(opBuilder.build()); + return new BiasAddGrad<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat 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 + * 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. + * 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. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** - * 1-D with size the feature dimension of `out_backprop`. + * Gets output. + * 1-D with size the feature dimension of {@code out_backprop}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BiasAddGrad"; - - private Output output; - - private BiasAddGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.BiasAddGrad} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat 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. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = 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 9b1b33daee8..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,22 +17,27 @@ 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 forward propagation for all the time steps. - *

* This is equivalent to applying LSTMBlockCell in a loop, like so: - *

{@code
+ * 
  * for x1 in unpack(x):
  *   i1, cs1, f1, o1, ci1, co1, h1 = LSTMBlock(
  *     x1, cs_prev, h_prev, w, wci, wcf, wco, b)
@@ -46,48 +51,54 @@
  *   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 data type for {@code i()} output + *
*/ +@OpMetadata( + opType = BlockLSTM.OP_NAME, + inputsClass = BlockLSTM.Inputs.class +) +@Operator( + group = "nn" +) public final class BlockLSTM extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.BlockLSTM} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param cellClip Value to clip the 'cs' value to. - */ - public Options cellClip(Float cellClip) { - this.cellClip = cellClip; - return this; - } - - /** - * @param usePeephole Whether to use peephole weights. - */ - public Options usePeephole(Boolean usePeephole) { - this.usePeephole = usePeephole; - return this; - } - - private Float cellClip; - private Boolean usePeephole; - - private Options() { - } + public static final String OP_NAME = "BlockLSTMV2"; + + private Output i; + + private Output cs; + + private Output f; + + private Output o; + + private Output ci; + + private Output co; + + private Output h; + + public BlockLSTM(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + i = operation.output(outputIdx++); + cs = operation.output(outputIdx++); + f = operation.output(outputIdx++); + o = operation.output(outputIdx++); + ci = operation.output(outputIdx++); + co = operation.output(outputIdx++); + h = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new BlockLSTM operation. - * + * Factory method to create a class wrapping a new BlockLSTMV2 operation. + * * @param scope current scope * @param seqLenMax Maximum time length actually used by this input. Outputs are padded * with zeros beyond this length. @@ -99,12 +110,17 @@ private Options() { * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code BlockLSTMV2} output and operands * @return a new instance of BlockLSTM */ - @Endpoint(describeByClass = true) - public static BlockLSTM create(Scope scope, Operand seqLenMax, Operand x, Operand csPrev, Operand hPrev, Operand w, Operand wci, Operand wcf, Operand wco, Operand b, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("BlockLSTMV2", scope.makeOpName("BlockLSTM")); + @Endpoint( + describeByClass = true + ) + public static BlockLSTM create(Scope scope, Operand seqLenMax, + Operand x, Operand csPrev, Operand hPrev, Operand w, Operand wci, + Operand wcf, Operand wco, Operand b, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BlockLSTM"); opBuilder.addInput(seqLenMax.asOutput()); opBuilder.addInput(x.asOutput()); opBuilder.addInput(csPrev.asOutput()); @@ -114,7 +130,6 @@ public static BlockLSTM create(Scope scope, Operand BlockLSTM create(Scope scope, Operand(opBuilder.build()); + return new BlockLSTM<>(opBuilder.build()); } - + /** + * Sets the cellClip option. + * * @param cellClip Value to clip the 'cs' value to. + * @return this Options instance. */ public static Options cellClip(Float cellClip) { return new Options().cellClip(cellClip); } - + /** + * Sets the usePeephole option. + * * @param usePeephole Whether to use peephole weights. + * @return this Options instance. */ public static Options usePeephole(Boolean usePeephole) { return new Options().usePeephole(usePeephole); } - + /** + * Gets i. * The input gate over the whole time sequence. + * @return i. */ public Output i() { return i; } - + /** + * Gets cs. * The cell state before the tanh over the whole time sequence. + * @return cs. */ public Output cs() { return cs; } - + /** + * Gets f. * The forget gate over the whole time sequence. + * @return f. */ public Output f() { return f; } - + /** + * Gets o. * The output gate over the whole time sequence. + * @return o. */ public Output o() { return o; } - + /** + * Gets ci. * The cell input over the whole time sequence. + * @return ci. */ public Output ci() { return ci; } - + /** + * Gets co. * The cell after the tanh over the whole time sequence. + * @return co. */ public Output co() { return co; } - + /** + * Gets h. * The output h vector over the whole time sequence. + * @return h. */ public Output h() { return h; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BlockLSTMV2"; - - private Output i; - private Output cs; - private Output f; - private Output o; - private Output ci; - private Output co; - private Output h; - - private BlockLSTM(Operation operation) { - super(operation); - int outputIdx = 0; - i = operation.output(outputIdx++); - cs = operation.output(outputIdx++); - f = operation.output(outputIdx++); - o = operation.output(outputIdx++); - ci = operation.output(outputIdx++); - co = operation.output(outputIdx++); - h = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.BlockLSTM} + */ + public static class Options { + private Float cellClip; + + private Boolean usePeephole; + + private Options() { + } + + /** + * Sets the cellClip option. + * + * @param cellClip Value to clip the 'cs' value to. + * @return this Options instance. + */ + public Options cellClip(Float cellClip) { + this.cellClip = cellClip; + return this; + } + + /** + * Sets the usePeephole option. + * + * @param usePeephole Whether to use peephole weights. + * @return this Options instance. + */ + public Options usePeephole(Boolean usePeephole) { + this.usePeephole = 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 f7f0c2449d4..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,29 +17,72 @@ 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 xGrad()} output */ +@OpMetadata( + opType = BlockLSTMGrad.OP_NAME, + inputsClass = BlockLSTMGrad.Inputs.class +) +@Operator( + group = "nn" +) public final class BlockLSTMGrad extends RawOp { - /** - * Factory method to create a class wrapping a new BlockLSTMGrad operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BlockLSTMGradV2"; + + private Output xGrad; + + private Output csPrevGrad; + + private Output hPrevGrad; + + private Output wGrad; + + private Output wciGrad; + + private Output wcfGrad; + + private Output wcoGrad; + + private Output bGrad; + + public BlockLSTMGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + xGrad = operation.output(outputIdx++); + csPrevGrad = operation.output(outputIdx++); + hPrevGrad = operation.output(outputIdx++); + wGrad = operation.output(outputIdx++); + wciGrad = operation.output(outputIdx++); + wcfGrad = operation.output(outputIdx++); + wcoGrad = operation.output(outputIdx++); + bGrad = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new BlockLSTMGradV2 operation. + * * @param scope current scope * @param seqLenMax Maximum time length actually used by this input. Outputs are padded * with zeros beyond this length. @@ -61,11 +104,18 @@ public final class BlockLSTMGrad extends RawOp { * @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 */ - @Endpoint(describeByClass = true) - public static BlockLSTMGrad create(Scope scope, 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) { - OperationBuilder opBuilder = scope.env().opBuilder("BlockLSTMGradV2", scope.makeOpName("BlockLSTMGrad")); + @Endpoint( + describeByClass = true + ) + public static BlockLSTMGrad create(Scope scope, 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) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BlockLSTMGrad"); opBuilder.addInput(seqLenMax.asOutput()); opBuilder.addInput(x.asOutput()); opBuilder.addInput(csPrev.asOutput()); @@ -84,89 +134,210 @@ public static BlockLSTMGrad create(Scope scope, Operand(opBuilder.build()); + return new BlockLSTMGrad<>(opBuilder.build()); } - + /** + * Gets xGrad. * The gradient of x to be back-propped. + * @return xGrad. */ public Output xGrad() { return xGrad; } - + /** + * Gets csPrevGrad. * The gradient of cs_prev to be back-propped. + * @return csPrevGrad. */ public Output csPrevGrad() { return csPrevGrad; } - + /** + * Gets hPrevGrad. * The gradient of h_prev to be back-propped. + * @return hPrevGrad. */ public Output hPrevGrad() { return hPrevGrad; } - + /** + * Gets wGrad. * The gradient for w to be back-propped. + * @return wGrad. */ public Output wGrad() { return wGrad; } - + /** + * Gets wciGrad. * The gradient for wci to be back-propped. + * @return wciGrad. */ public Output wciGrad() { return wciGrad; } - + /** + * Gets wcfGrad. * The gradient for wcf to be back-propped. + * @return wcfGrad. */ public Output wcfGrad() { return wcfGrad; } - + /** + * Gets wcoGrad. * The gradient for wco to be back-propped. + * @return wcoGrad. */ public Output wcoGrad() { return wcoGrad; } - + /** + * Gets bGrad. * The gradient for w to be back-propped. + * @return bGrad. */ public Output bGrad() { return bGrad; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BlockLSTMGradV2"; - - private Output xGrad; - private Output csPrevGrad; - private Output hPrevGrad; - private Output wGrad; - private Output wciGrad; - private Output wcfGrad; - private Output wcoGrad; - private Output bGrad; - - private BlockLSTMGrad(Operation operation) { - super(operation); - int outputIdx = 0; - xGrad = operation.output(outputIdx++); - csPrevGrad = operation.output(outputIdx++); - hPrevGrad = operation.output(outputIdx++); - wGrad = operation.output(outputIdx++); - wciGrad = operation.output(outputIdx++); - wcfGrad = operation.output(outputIdx++); - wcoGrad = operation.output(outputIdx++); - bGrad = operation.output(outputIdx++); + + @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 b39d4bfeba5..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,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; @@ -31,76 +36,58 @@ /** * 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. */ +@OpMetadata( + opType = CTCLossV2.OP_NAME, + inputsClass = CTCLossV2.Inputs.class +) +@Operator( + group = "nn" +) public final class CTCLossV2 extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.CTCLossV2} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param preprocessCollapseRepeated Scalar, if true then repeated labels are - * collapsed prior to the CTC calculation. - */ - public Options preprocessCollapseRepeated(Boolean preprocessCollapseRepeated) { - this.preprocessCollapseRepeated = preprocessCollapseRepeated; - return this; - } - - /** - * @param ctcMergeRepeated 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 Options ctcMergeRepeated(Boolean ctcMergeRepeated) { - this.ctcMergeRepeated = ctcMergeRepeated; - return this; - } - - /** - * @param ignoreLongerOutputsThanInputs 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 Options ignoreLongerOutputsThanInputs(Boolean ignoreLongerOutputsThanInputs) { - this.ignoreLongerOutputsThanInputs = ignoreLongerOutputsThanInputs; - return this; - } - - private Boolean preprocessCollapseRepeated; - private Boolean ctcMergeRepeated; - private Boolean ignoreLongerOutputsThanInputs; - - private Options() { - } + public static final String OP_NAME = "CTCLossV2"; + + private Output loss; + + private Output gradient; + + public CTCLossV2(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + loss = operation.output(outputIdx++); + gradient = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new CTCLossV2 operation. - * + * * @param scope current scope - * @param inputs 3-D, shape: `(max_time x batch_size x num_classes)`, the logits. Default blank + * @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 `SparseTensor`. - * `labels_indices(i, :) == [b, t]` means `labels_values(i)` stores the id for - * `(batch b, time t)`. + * @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 attributes values + * @param options carries optional attribute values * @return a new instance of CTCLossV2 */ - @Endpoint(describeByClass = true) - public static CTCLossV2 create(Scope scope, Operand inputs, Operand labelsIndices, Operand labelsValues, Operand sequenceLength, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("CTCLossV2", scope.makeOpName("CTCLossV2")); + @Endpoint( + describeByClass = true + ) + public static CTCLossV2 create(Scope scope, Operand inputs, + Operand labelsIndices, Operand labelsValues, Operand sequenceLength, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CTCLossV2"); opBuilder.addInput(inputs.asOutput()); opBuilder.addInput(labelsIndices.asOutput()); opBuilder.addInput(labelsValues.asOutput()); opBuilder.addInput(sequenceLength.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.preprocessCollapseRepeated != null) { @@ -116,58 +103,170 @@ public static CTCLossV2 create(Scope scope, Operand inputs, Operandduring CTC calculation + * Sets the ctcMergeRepeated option. + * + * @param ctcMergeRepeated 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. + * @return this Options instance. */ public static Options ctcMergeRepeated(Boolean ctcMergeRepeated) { return new Options().ctcMergeRepeated(ctcMergeRepeated); } - + /** + * Sets the ignoreLongerOutputsThanInputs option. + * * @param ignoreLongerOutputsThanInputs 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. + * @return this Options instance. */ public static Options ignoreLongerOutputsThanInputs(Boolean ignoreLongerOutputsThanInputs) { return new Options().ignoreLongerOutputsThanInputs(ignoreLongerOutputsThanInputs); } - + /** + * Gets loss. * A vector (batch) containing log-probabilities. + * @return loss. */ public Output loss() { return loss; } - + /** - * The gradient of `loss`. 3-D, shape: - * `(max_time x batch_size x num_classes)`. + * Gets gradient. + * The gradient of {@code loss}. 3-D, shape: + * {@code (max_time x batch_size x num_classes)}. + * @return gradient. */ public Output gradient() { return gradient; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CTCLossV2"; - - private Output loss; - private Output gradient; - - private CTCLossV2(Operation operation) { - super(operation); - int outputIdx = 0; - loss = operation.output(outputIdx++); - gradient = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.CTCLossV2} + */ + public static class Options { + private Boolean preprocessCollapseRepeated; + + private Boolean ctcMergeRepeated; + + private Boolean ignoreLongerOutputsThanInputs; + + private Options() { + } + + /** + * Sets the preprocessCollapseRepeated option. + * + * @param preprocessCollapseRepeated Scalar, if true then repeated labels are + * collapsed prior to the CTC calculation. + * @return this Options instance. + */ + public Options preprocessCollapseRepeated(Boolean preprocessCollapseRepeated) { + this.preprocessCollapseRepeated = preprocessCollapseRepeated; + return this; + } + + /** + * Sets the ctcMergeRepeated option. + * + * @param ctcMergeRepeated 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. + * @return this Options instance. + */ + public Options ctcMergeRepeated(Boolean ctcMergeRepeated) { + this.ctcMergeRepeated = ctcMergeRepeated; + return this; + } + + /** + * Sets the ignoreLongerOutputsThanInputs option. + * + * @param ignoreLongerOutputsThanInputs 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. + * @return this Options instance. + */ + public Options ignoreLongerOutputsThanInputs(Boolean ignoreLongerOutputsThanInputs) { + this.ignoreLongerOutputsThanInputs = ignoreLongerOutputsThanInputs; + 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 1007ad691ff..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; @@ -31,61 +36,56 @@ /** * 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 * SparseToDense op, then added to the logits of the sampled candidates. This has * the effect of 'removing' the sampled labels that match the true labels by * making the classifier sure that they are sampled labels. */ -@Operator(group = "nn") +@OpMetadata( + opType = ComputeAccidentalHits.OP_NAME, + inputsClass = ComputeAccidentalHits.Inputs.class +) +@Operator( + group = "nn" +) public final class ComputeAccidentalHits extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.ComputeAccidentalHits} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 An second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "ComputeAccidentalHits"; + + private Output indices; + + private Output ids; + + private Output weights; + + public ComputeAccidentalHits(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + indices = operation.output(outputIdx++); + ids = operation.output(outputIdx++); + weights = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ComputeAccidentalHits operation. - * + * * @param scope current scope * @param trueClasses The true_classes output of UnpackSparseLabels. * @param sampledCandidates The sampled_candidates output of CandidateSampler. * @param numTrue Number of true labels per context. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ComputeAccidentalHits */ - @Endpoint(describeByClass = true) - public static ComputeAccidentalHits create(Scope scope, Operand trueClasses, Operand sampledCandidates, Long numTrue, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ComputeAccidentalHits", scope.makeOpName("ComputeAccidentalHits")); + @Endpoint( + describeByClass = true + ) + public static ComputeAccidentalHits create(Scope scope, Operand trueClasses, + Operand sampledCandidates, Long numTrue, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ComputeAccidentalHits"); opBuilder.addInput(trueClasses.asOutput()); opBuilder.addInput(sampledCandidates.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_true", numTrue); if (options != null) { for (Options opts : options) { @@ -99,58 +99,133 @@ public static ComputeAccidentalHits create(Scope scope, Operand trueClas } return new ComputeAccidentalHits(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 indices. * A vector of indices corresponding to rows of true_candidates. + * @return indices. */ public Output indices() { return indices; } - + /** + * Gets ids. * A vector of IDs of positions in sampled_candidates that match a true_label * for the row with the corresponding index in indices. + * @return ids. */ public Output ids() { return ids; } - + /** + * Gets weights. * A vector of the same length as indices and ids, in which each element * is -FLOAT_MAX. + * @return weights. */ public Output weights() { return weights; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ComputeAccidentalHits"; - - private Output indices; - private Output ids; - private Output weights; - - private ComputeAccidentalHits(Operation operation) { - super(operation); - int outputIdx = 0; - indices = operation.output(outputIdx++); - ids = operation.output(outputIdx++); - weights = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.ComputeAccidentalHits} + */ + 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 = 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 e3d98fe0882..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. @@ -17,127 +17,93 @@ 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 2-D convolution given 4-D `input` and `filter` tensors. - *

- * Given an input tensor of shape `[batch, in_height, in_width, in_channels]` + * 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]} * and a filter / kernel tensor of shape - * `[filter_height, filter_width, in_channels, out_channels]`, this op + * {@code [filter_height, filter_width, in_channels, out_channels]}, this op * performs the following: - *

- * 1. Flattens the filter to a 2-D matrix with shape - * `[filter_height * filter_width * in_channels, output_channels]`. - * 2. Extracts image patches from the input tensor to form a virtual - * tensor of shape `[batch, out_height, out_width, - * filter_height * filter_width * in_channels]`. - * 3. For each patch, right-multiplies the filter matrix and the image patch - * vector. - *

- * In detail, with the default NHWC format, - *

- * output[b, i, j, k] = - * sum_{di, dj, q} input[b, strides[1] * i + di, strides[2] * j + dj, q] * - * filter[di, dj, q, k] - *

- * Must have `strides[0] = strides[3] = 1`. For the most common case of the same - * horizontal and vertices strides, `strides = [1, stride, stride, 1]`. - * - * @param data type for {@code output()} output + *

    + *
  1. Flattens the filter to a 2-D matrix with shape + * {@code [filter_height * filter_width * in_channels, output_channels]}.
  2. + *
  3. Extracts image patches from the input tensor to form a virtual + * tensor of shape {@code [batch, out_height, out_width, filter_height * filter_width * in_channels]}.
  4. + *
  5. For each patch, right-multiplies the filter matrix and the image patch + * vector.
  6. + *
+ *

In detail, with the default NHWC format, + *

+ * output[b, i, j, k] =
+ *     sum_{di, dj, q} input[b, strides[1] * i + di, strides[2] * j + dj, q] *
+ *                     filter[di, dj, q, k]
+ * 
+ *

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]}. */ -@Operator(group = "nn") +@OpMetadata( + opType = Conv2d.OP_NAME, + inputsClass = Conv2d.Inputs.class +) +@Operator( + group = "nn" +) public final class Conv2d extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.Conv2d} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useCudnnOnGpu - */ - public Options useCudnnOnGpu(Boolean useCudnnOnGpu) { - this.useCudnnOnGpu = useCudnnOnGpu; - return this; - } - - /** - * @param explicitPaddings If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith - * dimension, the amount of padding inserted before and after the dimension is - * `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If - * `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty. - */ - public Options explicitPaddings(List explicitPaddings) { - this.explicitPaddings = explicitPaddings; - return this; - } - - /** - * @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, height, width, channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, channels, height, width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of - * `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 `data_format`, see above for details. Dilations in the batch and - * depth dimensions must be 1. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private Boolean useCudnnOnGpu; - private List explicitPaddings; - private String dataFormat; - private List dilations; - - private Options() { - } + public static final String OP_NAME = "Conv2D"; + + private Output output; + + public Conv2d(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Conv2d operation. - * + * Factory method to create a class wrapping a new Conv2D operation. + * * @param scope current scope * @param input A 4-D tensor. The dimension order is interpreted according to the value - * of `data_format`, see below for details. + * of {@code data_format}, see below for details. * @param filter A 4-D tensor of shape - * `[filter_height, filter_width, in_channels, out_channels]` + * {@code [filter_height, filter_width, in_channels, out_channels]} * @param strides 1-D tensor of length 4. The stride of the sliding window for each - * dimension of `input`. The dimension order is determined by the value of - * `data_format`, see below for details. + * dimension of {@code input}. The dimension order is determined by the value of + * {@code data_format}, see below for details. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Conv2D} output and operands * @return a new instance of Conv2d */ - @Endpoint(describeByClass = true) - public static Conv2d create(Scope scope, Operand input, Operand filter, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Conv2D", scope.makeOpName("Conv2d")); + @Endpoint( + describeByClass = true + ) + public static Conv2d create(Scope scope, Operand input, + Operand filter, List strides, String padding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Conv2d"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); - opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -149,7 +115,7 @@ public static Conv2d create(Scope scope, Operand input } if (opts.explicitPaddings != null) { long[] explicitPaddingsArray = new long[opts.explicitPaddings.size()]; - for (int i = 0; i < explicitPaddingsArray.length; ++i) { + for (int i = 0 ; i < explicitPaddingsArray.length ; i++) { explicitPaddingsArray[i] = opts.explicitPaddings.get(i); } opBuilder.setAttr("explicit_paddings", explicitPaddingsArray); @@ -159,76 +125,285 @@ public static Conv2d create(Scope scope, Operand input } if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new Conv2d(opBuilder.build()); + return new Conv2d<>(opBuilder.build()); } - + /** - * @param useCudnnOnGpu + * Sets the useCudnnOnGpu option. + * + * @param useCudnnOnGpu the useCudnnOnGpu option + * @return this Options instance. */ public static Options useCudnnOnGpu(Boolean useCudnnOnGpu) { return new Options().useCudnnOnGpu(useCudnnOnGpu); } - + /** - * @param explicitPaddings If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith + * 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 - * `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If - * `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty. + * {@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, height, width, channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, channels, height, width]. + * 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]. + * @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 - * `input`. If set to k > 1, there will be k-1 skipped cells between each + * {@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 `data_format`, see above for details. Dilations in the batch and + * 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. * A 4-D tensor. The dimension order is determined by the value of - * `data_format`, see below for details. + * {@code data_format}, see below for details. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Conv2D"; - - private Output output; - - private Conv2d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.Conv2d} + */ + 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, height, width, channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, channels, height, 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 = 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 bc282d8b349..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. @@ -17,109 +17,78 @@ 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 the gradients of convolution with respect to the filter. - * - * @param data type for {@code output()} output */ -@Operator(group = "nn") +@OpMetadata( + opType = Conv2dBackpropFilter.OP_NAME, + inputsClass = Conv2dBackpropFilter.Inputs.class +) +@Operator( + group = "nn" +) public final class Conv2dBackpropFilter extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.Conv2dBackpropFilter} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useCudnnOnGpu - */ - public Options useCudnnOnGpu(Boolean useCudnnOnGpu) { - this.useCudnnOnGpu = useCudnnOnGpu; - return this; - } - - /** - * @param explicitPaddings If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith - * dimension, the amount of padding inserted before and after the dimension is - * `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If - * `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty. - */ - public Options explicitPaddings(List explicitPaddings) { - this.explicitPaddings = explicitPaddings; - return this; - } - - /** - * @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]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of - * `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 - * `data_format`, see above for details. Dilations in the batch and depth - * dimensions must be 1. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private Boolean useCudnnOnGpu; - private List explicitPaddings; - private String dataFormat; - private List dilations; - - private Options() { - } + public static final String OP_NAME = "Conv2DBackpropFilter"; + + private Output output; + + public Conv2dBackpropFilter(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Conv2dBackpropFilter operation. - * + * Factory method to create a class wrapping a new Conv2DBackpropFilter operation. + * * @param scope current scope - * @param input 4-D with shape `[batch, in_height, in_width, in_channels]`. - * @param filterSizes An integer vector representing the tensor shape of `filter`, - * where `filter` is a 4-D - * `[filter_height, filter_width, in_channels, out_channels]` tensor. - * @param outBackprop 4-D with shape `[batch, out_height, out_width, out_channels]`. + * @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 + * {@code [filter_height, filter_width, in_channels, out_channels]} tensor. + * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code Conv2DBackpropFilter} output and operands * @return a new instance of Conv2dBackpropFilter */ - @Endpoint(describeByClass = true) - public static Conv2dBackpropFilter create(Scope scope, Operand input, Operand filterSizes, Operand outBackprop, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Conv2DBackpropFilter", scope.makeOpName("Conv2dBackpropFilter")); + @Endpoint( + describeByClass = true + ) + public static Conv2dBackpropFilter create(Scope scope, Operand input, + Operand filterSizes, Operand outBackprop, List strides, String padding, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Conv2dBackpropFilter"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filterSizes.asOutput()); opBuilder.addInput(outBackprop.asOutput()); - opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -131,7 +100,7 @@ public static Conv2dBackpropFilter create(Scope scope, Op } if (opts.explicitPaddings != null) { long[] explicitPaddingsArray = new long[opts.explicitPaddings.size()]; - for (int i = 0; i < explicitPaddingsArray.length; ++i) { + for (int i = 0 ; i < explicitPaddingsArray.length ; i++) { explicitPaddingsArray[i] = opts.explicitPaddings.get(i); } opBuilder.setAttr("explicit_paddings", explicitPaddingsArray); @@ -141,77 +110,293 @@ public static Conv2dBackpropFilter create(Scope scope, Op } if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new Conv2dBackpropFilter(opBuilder.build()); + return new Conv2dBackpropFilter<>(opBuilder.build()); } - + /** - * @param useCudnnOnGpu + * Sets the useCudnnOnGpu option. + * + * @param useCudnnOnGpu the useCudnnOnGpu option + * @return this Options instance. */ public static Options useCudnnOnGpu(Boolean useCudnnOnGpu) { return new Options().useCudnnOnGpu(useCudnnOnGpu); } - + /** - * @param explicitPaddings If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith + * 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 - * `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If - * `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty. + * {@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]. + * 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 - * `input`. If set to k > 1, there will be k-1 skipped cells between each filter + * {@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 - * `data_format`, see above for details. Dilations in the batch and depth + * {@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 - * `[filter_height, filter_width, in_channels, out_channels]`. Gradient w.r.t. - * the `filter` input of the convolution. + * {@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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Conv2DBackpropFilter"; - - private Output output; - - private Conv2dBackpropFilter(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.Conv2dBackpropFilter} + */ + 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 = 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 3b43fa3301d..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. @@ -17,109 +17,78 @@ 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 the gradients of convolution with respect to the input. - * - * @param data type for {@code output()} output */ -@Operator(group = "nn") +@OpMetadata( + opType = Conv2dBackpropInput.OP_NAME, + inputsClass = Conv2dBackpropInput.Inputs.class +) +@Operator( + group = "nn" +) public final class Conv2dBackpropInput extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.Conv2dBackpropInput} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useCudnnOnGpu - */ - public Options useCudnnOnGpu(Boolean useCudnnOnGpu) { - this.useCudnnOnGpu = useCudnnOnGpu; - return this; - } - - /** - * @param explicitPaddings If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith - * dimension, the amount of padding inserted before and after the dimension is - * `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If - * `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty. - */ - public Options explicitPaddings(List explicitPaddings) { - this.explicitPaddings = explicitPaddings; - return this; - } - - /** - * @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]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of - * `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 - * `data_format`, see above for details. Dilations in the batch and depth - * dimensions must be 1. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private Boolean useCudnnOnGpu; - private List explicitPaddings; - private String dataFormat; - private List dilations; - - private Options() { - } + public static final String OP_NAME = "Conv2DBackpropInput"; + + private Output output; + + public Conv2dBackpropInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Conv2dBackpropInput operation. - * + * Factory method to create a class wrapping a new Conv2DBackpropInput operation. + * * @param scope current scope - * @param inputSizes An integer vector representing the shape of `input`, - * where `input` is a 4-D `[batch, height, width, channels]` tensor. + * @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 - * `[filter_height, filter_width, in_channels, out_channels]`. - * @param outBackprop 4-D with shape `[batch, out_height, out_width, out_channels]`. + * {@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 attributes values + * @param options carries optional attribute values + * @param data type for {@code Conv2DBackpropInput} output and operands * @return a new instance of Conv2dBackpropInput */ - @Endpoint(describeByClass = true) - public static Conv2dBackpropInput create(Scope scope, Operand inputSizes, Operand filter, Operand outBackprop, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Conv2DBackpropInput", scope.makeOpName("Conv2dBackpropInput")); + @Endpoint( + describeByClass = true + ) + public static Conv2dBackpropInput create(Scope scope, + Operand inputSizes, Operand filter, Operand outBackprop, List strides, + String padding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Conv2dBackpropInput"); opBuilder.addInput(inputSizes.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(outBackprop.asOutput()); - opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -131,7 +100,7 @@ public static Conv2dBackpropInput create(Scope scope, Ope } if (opts.explicitPaddings != null) { long[] explicitPaddingsArray = new long[opts.explicitPaddings.size()]; - for (int i = 0; i < explicitPaddingsArray.length; ++i) { + for (int i = 0 ; i < explicitPaddingsArray.length ; i++) { explicitPaddingsArray[i] = opts.explicitPaddings.get(i); } opBuilder.setAttr("explicit_paddings", explicitPaddingsArray); @@ -141,76 +110,292 @@ public static Conv2dBackpropInput create(Scope scope, Ope } if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new Conv2dBackpropInput(opBuilder.build()); + return new Conv2dBackpropInput<>(opBuilder.build()); } - + /** - * @param useCudnnOnGpu + * Sets the useCudnnOnGpu option. + * + * @param useCudnnOnGpu the useCudnnOnGpu option + * @return this Options instance. */ public static Options useCudnnOnGpu(Boolean useCudnnOnGpu) { return new Options().useCudnnOnGpu(useCudnnOnGpu); } - + /** - * @param explicitPaddings If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith + * 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 - * `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If - * `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty. + * {@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]. + * 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 - * `input`. If set to k > 1, there will be k-1 skipped cells between each filter + * {@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 - * `data_format`, see above for details. Dilations in the batch and depth + * {@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); + } + /** - * 4-D with shape `[batch, in_height, in_width, in_channels]`. Gradient + * 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Conv2DBackpropInput"; - - private Output output; - - private Conv2dBackpropInput(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.Conv2dBackpropInput} + */ + 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 = 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 b778819c0ce..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. @@ -17,88 +17,74 @@ 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 3-D convolution given 5-D `input` and `filter` tensors. - *

+ * Computes a 3-D convolution given 5-D {@code input} and {@code filter} tensors. * In signal processing, cross-correlation is a measure of similarity of * 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 + *

Our Conv3D implements a form of cross-correlation. */ -@Operator(group = "nn") +@OpMetadata( + opType = Conv3d.OP_NAME, + inputsClass = Conv3d.Inputs.class +) +@Operator( + group = "nn" +) public final class Conv3d extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.Conv3d} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat 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 Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * @param dilations 1-D tensor of length 5. The dilation factor for each dimension of - * `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 `data_format`, see above for details. Dilations in the batch and - * depth dimensions must be 1. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private String dataFormat; - private List dilations; - - private Options() { - } + public static final String OP_NAME = "Conv3D"; + + private Output output; + + public Conv3d(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Conv3d operation. - * + * Factory method to create a class wrapping a new Conv3D operation. + * * @param scope current scope - * @param input Shape `[batch, in_depth, in_height, in_width, in_channels]`. - * @param filter Shape `[filter_depth, filter_height, filter_width, in_channels, - * out_channels]`. `in_channels` must match between `input` and `filter`. + * @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 - * dimension of `input`. Must have `strides[0] = strides[4] = 1`. + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Conv3D} output and operands * @return a new instance of Conv3d */ - @Endpoint(describeByClass = true) - public static Conv3d create(Scope scope, Operand input, Operand filter, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Conv3D", scope.makeOpName("Conv3d")); + @Endpoint( + describeByClass = true + ) + public static Conv3d create(Scope scope, Operand input, + Operand filter, List strides, String padding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Conv3d"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); - opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -110,57 +96,187 @@ public static Conv3d create(Scope scope, Operand input } if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new Conv3d(opBuilder.build()); + return new Conv3d<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat 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]. + * 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]. + * @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 5. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each + * {@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 `data_format`, see above for details. Dilations in the batch and + * 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 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. + * @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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Conv3D"; - - private Output output; - - private Conv3d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.Conv3d} + */ + public static class Options { + private String dataFormat; + + private List dilations; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat 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]. + * @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 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. + * @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 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. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(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 6ec7dd5b71a..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. @@ -17,88 +17,77 @@ 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 the gradients of 3-D convolution with respect to the filter. - * - * @param data type for {@code output()} output */ -@Operator(group = "nn") +@OpMetadata( + opType = Conv3dBackpropFilter.OP_NAME, + inputsClass = Conv3dBackpropFilter.Inputs.class +) +@Operator( + group = "nn" +) public final class Conv3dBackpropFilter extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.Conv3dBackpropFilter} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat 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 Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * @param dilations 1-D tensor of length 5. The dilation factor for each dimension of - * `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 `data_format`, see above for details. Dilations in the batch and - * depth dimensions must be 1. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private String dataFormat; - private List dilations; - - private Options() { - } + public static final String OP_NAME = "Conv3DBackpropFilterV2"; + + private Output output; + + public Conv3dBackpropFilter(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Conv3dBackpropFilter operation. - * + * Factory method to create a class wrapping a new Conv3DBackpropFilterV2 operation. + * * @param scope current scope - * @param input Shape `[batch, depth, rows, cols, in_channels]`. - * @param filterSizes An integer vector representing the tensor shape of `filter`, - * where `filter` is a 5-D - * `[filter_depth, filter_height, filter_width, in_channels, out_channels]` + * @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 + * {@code [filter_depth, filter_height, filter_width, in_channels, out_channels]} * tensor. - * @param outBackprop Backprop signal of shape `[batch, out_depth, out_rows, out_cols, - * out_channels]`. + * @param outBackprop Backprop signal of shape {@code [batch, out_depth, out_rows, out_cols, out_channels]}. * @param strides 1-D tensor of length 5. The stride of the sliding window for each - * dimension of `input`. Must have `strides[0] = strides[4] = 1`. + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Conv3DBackpropFilterV2} output and operands * @return a new instance of Conv3dBackpropFilter */ - @Endpoint(describeByClass = true) - public static Conv3dBackpropFilter create(Scope scope, Operand input, Operand filterSizes, Operand outBackprop, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Conv3DBackpropFilterV2", scope.makeOpName("Conv3dBackpropFilter")); + @Endpoint( + describeByClass = true + ) + public static Conv3dBackpropFilter create(Scope scope, Operand input, + Operand filterSizes, Operand outBackprop, List strides, String padding, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Conv3dBackpropFilter"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filterSizes.asOutput()); opBuilder.addInput(outBackprop.asOutput()); - opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -110,57 +99,196 @@ public static Conv3dBackpropFilter create(Scope scope, Op } if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new Conv3dBackpropFilter(opBuilder.build()); + return new Conv3dBackpropFilter<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat 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]. + * 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]. + * @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 5. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each + * {@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 `data_format`, see above for details. Dilations in the batch and + * 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 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. + * @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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Conv3DBackpropFilterV2"; - - private Output output; - - private Conv3dBackpropFilter(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.Conv3dBackpropFilter} + */ + public static class Options { + private String dataFormat; + + private List dilations; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat 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]. + * @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 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. + * @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 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. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(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 eb4a0460a65..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. @@ -17,87 +17,76 @@ 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 gradients of 3-D convolution with respect to the input. - * - * @param data type for {@code output()} output */ -@Operator(group = "nn") +@OpMetadata( + opType = Conv3dBackpropInput.OP_NAME, + inputsClass = Conv3dBackpropInput.Inputs.class +) +@Operator( + group = "nn" +) public final class Conv3dBackpropInput extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.Conv3dBackpropInput} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat 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 Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * @param dilations 1-D tensor of length 5. The dilation factor for each dimension of - * `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 `data_format`, see above for details. Dilations in the batch and - * depth dimensions must be 1. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private String dataFormat; - private List dilations; - - private Options() { - } + public static final String OP_NAME = "Conv3DBackpropInputV2"; + + private Output output; + + public Conv3dBackpropInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Conv3dBackpropInput operation. - * + * Factory method to create a class wrapping a new Conv3DBackpropInputV2 operation. + * * @param scope current scope - * @param inputSizes An integer vector representing the tensor shape of `input`, - * where `input` is a 5-D - * `[batch, depth, rows, cols, in_channels]` tensor. - * @param filter Shape `[depth, rows, cols, in_channels, out_channels]`. - * `in_channels` must match between `input` and `filter`. - * @param outBackprop Backprop signal of shape `[batch, out_depth, out_rows, out_cols, - * out_channels]`. + * @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. + * @param filter Shape {@code [depth, rows, cols, in_channels, out_channels]}. + * {@code in_channels} must match between {@code input} and {@code filter}. + * @param outBackprop Backprop signal of shape {@code [batch, out_depth, out_rows, out_cols, out_channels]}. * @param strides 1-D tensor of length 5. The stride of the sliding window for each - * dimension of `input`. Must have `strides[0] = strides[4] = 1`. + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Conv3DBackpropInputV2} output and operands * @return a new instance of Conv3dBackpropInput */ - @Endpoint(describeByClass = true) - public static Conv3dBackpropInput create(Scope scope, Operand inputSizes, Operand filter, Operand outBackprop, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Conv3DBackpropInputV2", scope.makeOpName("Conv3dBackpropInput")); + @Endpoint( + describeByClass = true + ) + public static Conv3dBackpropInput create(Scope scope, + Operand inputSizes, Operand filter, Operand outBackprop, + List strides, String padding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Conv3dBackpropInput"); opBuilder.addInput(inputSizes.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(outBackprop.asOutput()); - opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -109,57 +98,202 @@ public static Conv3dBackpropInput create(Scope scope, Ope } if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new Conv3dBackpropInput(opBuilder.build()); + return new Conv3dBackpropInput<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat 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]. + * 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]. + * @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 5. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each + * {@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 `data_format`, see above for details. Dilations in the batch and + * 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 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. + * @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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Conv3DBackpropInputV2"; - - private Output output; - - private Conv3dBackpropInput(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.Conv3dBackpropInput} + */ + public static class Options { + private String dataFormat; + + private List dilations; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat 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]. + * @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 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. + * @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 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. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(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 6fb3ae265f4..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,68 +19,88 @@ 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; /** * Performs beam search decoding on the logits given in input. - *

* A note about the attribute merge_repeated: For the beam search decoder, * this means that if consecutive entries in a beam are the same, only - * 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 + * 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 logProbability()} output */ -@Operator(group = "nn") +@OpMetadata( + opType = CtcBeamSearchDecoder.OP_NAME, + inputsClass = CtcBeamSearchDecoder.Inputs.class +) +@Operator( + group = "nn" +) public final class CtcBeamSearchDecoder extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.CtcBeamSearchDecoder} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param mergeRepeated If true, merge repeated classes in output. - */ - public Options mergeRepeated(Boolean mergeRepeated) { - this.mergeRepeated = mergeRepeated; - return this; - } - - private Boolean mergeRepeated; - - private Options() { - } + public static final String OP_NAME = "CTCBeamSearchDecoder"; + + private List> decodedIndices; + + private List> decodedValues; + + private List> decodedShape; + + private Output logProbability; + + @SuppressWarnings("unchecked") + 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)); + outputIdx += decodedIndicesLength; + int decodedValuesLength = operation.outputListLength("decoded_values"); + decodedValues = Arrays.asList((Output[]) operation.outputList(outputIdx, decodedValuesLength)); + outputIdx += decodedValuesLength; + int decodedShapeLength = operation.outputListLength("decoded_shape"); + decodedShape = Arrays.asList((Output[]) operation.outputList(outputIdx, decodedShapeLength)); + outputIdx += decodedShapeLength; + logProbability = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new CtcBeamSearchDecoder operation. - * + * Factory method to create a class wrapping a new CTCBeamSearchDecoder operation. + * * @param scope current scope - * @param inputs 3-D, shape: `(max_time x batch_size x num_classes)`, the logits. - * @param sequenceLength A vector containing sequence lengths, size `(batch)`. - * @param beamWidth A scalar >= 0 (beam search beam width). - * @param topPaths A scalar >= 0, <= beam_width (controls output size). - * @param options carries optional attributes values + * @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). + * @param topPaths A scalar >= 0, <= beam_width (controls output size). + * @param options carries optional attribute values + * @param data type for {@code CTCBeamSearchDecoder} output and operands * @return a new instance of CtcBeamSearchDecoder */ - @Endpoint(describeByClass = true) - public static CtcBeamSearchDecoder create(Scope scope, Operand inputs, Operand sequenceLength, Long beamWidth, Long topPaths, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("CTCBeamSearchDecoder", scope.makeOpName("CtcBeamSearchDecoder")); + @Endpoint( + describeByClass = true + ) + public static CtcBeamSearchDecoder create(Scope scope, Operand inputs, + Operand sequenceLength, Long beamWidth, Long topPaths, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CtcBeamSearchDecoder"); opBuilder.addInput(inputs.asOutput()); opBuilder.addInput(sequenceLength.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("beam_width", beamWidth); opBuilder.setAttr("top_paths", topPaths); if (options != null) { @@ -90,72 +110,120 @@ public static CtcBeamSearchDecoder create(Scope scope, Op } } } - return new CtcBeamSearchDecoder(opBuilder.build()); + return new CtcBeamSearchDecoder<>(opBuilder.build()); } - + /** + * Sets the mergeRepeated option. + * * @param mergeRepeated If true, merge repeated classes in output. + * @return this Options instance. */ public static Options mergeRepeated(Boolean mergeRepeated) { return new Options().mergeRepeated(mergeRepeated); } - + /** + * Gets decodedIndices. * A list (length: top_paths) of indices matrices. Matrix j, - * size `(total_decoded_outputs[j] x 2)`, has indices of a - * `SparseTensor`. The rows store: [batch, time]. + * size {@code (total_decoded_outputs[j] x 2)}, has indices of a + * {@code SparseTensor}. The rows store: [batch, time]. + * @return decodedIndices. */ public List> decodedIndices() { return decodedIndices; } - + /** + * Gets decodedValues. * A list (length: top_paths) of values vectors. Vector j, - * size `(length total_decoded_outputs[j])`, has the values of a - * `SparseTensor`. The vector stores the decoded classes for beam j. + * size {@code (length total_decoded_outputs[j])}, has the values of a + * {@code SparseTensor}. The vector stores the decoded classes for beam j. + * @return decodedValues. */ public List> decodedValues() { return decodedValues; } - + /** + * Gets decodedShape. * A list (length: top_paths) of shape vector. Vector j, - * size `(2)`, stores the shape of the decoded `SparseTensor[j]`. - * Its values are: `[batch_size, max_decoded_length[j]]`. + * size {@code (2)}, stores the shape of the decoded {@code SparseTensor[j]}. + * Its values are: {@code [batch_size, max_decoded_length[j]]}. + * @return decodedShape. */ public List> decodedShape() { return decodedShape; } - + /** - * A matrix, shaped: `(batch_size x top_paths)`. The + * Gets logProbability. + * A matrix, shaped: {@code (batch_size x top_paths)}. The * sequence log-probabilities. + * @return logProbability. */ public Output logProbability() { return logProbability; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CTCBeamSearchDecoder"; - - private List> decodedIndices; - private List> decodedValues; - private List> decodedShape; - private Output logProbability; - - @SuppressWarnings("unchecked") - private CtcBeamSearchDecoder(Operation operation) { - super(operation); - int outputIdx = 0; - int decodedIndicesLength = operation.outputListLength("decoded_indices"); - decodedIndices = Arrays.asList((Output[])operation.outputList(outputIdx, decodedIndicesLength)); - outputIdx += decodedIndicesLength; - int decodedValuesLength = operation.outputListLength("decoded_values"); - decodedValues = Arrays.asList((Output[])operation.outputList(outputIdx, decodedValuesLength)); - outputIdx += decodedValuesLength; - int decodedShapeLength = operation.outputListLength("decoded_shape"); - decodedShape = Arrays.asList((Output[])operation.outputList(outputIdx, decodedShapeLength)); - outputIdx += decodedShapeLength; - logProbability = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.CtcBeamSearchDecoder} + */ + public static class Options { + private Boolean mergeRepeated; + + private Options() { + } + + /** + * Sets the mergeRepeated option. + * + * @param mergeRepeated If true, merge repeated classes in output. + * @return this Options instance. + */ + public Options mergeRepeated(Boolean mergeRepeated) { + this.mergeRepeated = 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 2e22105a783..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,133 +17,227 @@ 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; /** * Performs greedy decoding on the logits given in inputs. - *

* A note about the attribute merge_repeated: if enabled, when * consecutive logits' maximum indices are the same, only the first of - * these is emitted. Labeling the blank '*', the sequence "A B B * B B" - * becomes "A B B" if merge_repeated = True and "A B B B B" if + * these is emitted. Labeling the blank '*', the sequence "A B B * B B" + * becomes "A B B" if merge_repeated = True and "A B B B B" if * merge_repeated = False. - *

- * Regardless of the value of merge_repeated, if the maximum index of a given - * time and batch corresponds to the blank, index `(num_classes - 1)`, no new + *

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 logProbability()} output */ -@Operator(group = "nn") +@OpMetadata( + opType = CtcGreedyDecoder.OP_NAME, + inputsClass = CtcGreedyDecoder.Inputs.class +) +@Operator( + group = "nn" +) public final class CtcGreedyDecoder extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.CtcGreedyDecoder} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param mergeRepeated If True, merge repeated classes in output. - */ - public Options mergeRepeated(Boolean mergeRepeated) { - this.mergeRepeated = mergeRepeated; - return this; - } - - private Boolean mergeRepeated; - - private Options() { - } + public static final String OP_NAME = "CTCGreedyDecoder"; + + private Output decodedIndices; + + private Output decodedValues; + + private Output decodedShape; + + private Output logProbability; + + public CtcGreedyDecoder(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + decodedIndices = operation.output(outputIdx++); + decodedValues = operation.output(outputIdx++); + decodedShape = operation.output(outputIdx++); + logProbability = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new CtcGreedyDecoder operation. - * + * Factory method to create a class wrapping a new CTCGreedyDecoder operation. + * * @param scope current scope - * @param inputs 3-D, shape: `(max_time x batch_size x num_classes)`, the logits. - * @param sequenceLength A vector containing sequence lengths, size `(batch_size)`. - * @param options carries optional attributes values + * @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 + * @param data type for {@code CTCGreedyDecoder} output and operands * @return a new instance of CtcGreedyDecoder */ - @Endpoint(describeByClass = true) - public static CtcGreedyDecoder create(Scope scope, Operand inputs, Operand sequenceLength, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("CTCGreedyDecoder", scope.makeOpName("CtcGreedyDecoder")); + @Endpoint( + describeByClass = true + ) + public static CtcGreedyDecoder create(Scope scope, Operand inputs, + Operand sequenceLength, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CtcGreedyDecoder"); opBuilder.addInput(inputs.asOutput()); opBuilder.addInput(sequenceLength.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.mergeRepeated != null) { opBuilder.setAttr("merge_repeated", opts.mergeRepeated); } + if (opts.blankIndex != null) { + opBuilder.setAttr("blank_index", opts.blankIndex); + } } } - return new CtcGreedyDecoder(opBuilder.build()); + return new CtcGreedyDecoder<>(opBuilder.build()); } - + /** + * Sets the mergeRepeated option. + * * @param mergeRepeated If True, merge repeated classes in output. + * @return this Options instance. */ public static Options mergeRepeated(Boolean mergeRepeated) { return new Options().mergeRepeated(mergeRepeated); } - + + /** + * Sets the blankIndex option. + * + * @param blankIndex the blankIndex option + * @return this Options instance. + */ + public static Options blankIndex(Long blankIndex) { + return new Options().blankIndex(blankIndex); + } + /** - * Indices matrix, size `(total_decoded_outputs x 2)`, - * of a `SparseTensor`. The rows store: [batch, time]. + * Gets decodedIndices. + * Indices matrix, size {@code (total_decoded_outputs x 2)}, + * of a {@code SparseTensor}. The rows store: [batch, time]. + * @return decodedIndices. */ public Output decodedIndices() { return decodedIndices; } - + /** - * Values vector, size: `(total_decoded_outputs)`, - * of a `SparseTensor`. The vector stores the decoded classes. + * Gets decodedValues. + * Values vector, size: {@code (total_decoded_outputs)}, + * of a {@code SparseTensor}. The vector stores the decoded classes. + * @return decodedValues. */ public Output decodedValues() { return decodedValues; } - + /** - * Shape vector, size `(2)`, of the decoded SparseTensor. - * Values are: `[batch_size, max_decoded_length]`. + * Gets decodedShape. + * Shape vector, size {@code (2)}, of the decoded SparseTensor. + * Values are: {@code [batch_size, max_decoded_length]}. + * @return decodedShape. */ public Output decodedShape() { return decodedShape; } - + /** - * Matrix, size `(batch_size x 1)`, containing sequence + * Gets logProbability. + * Matrix, size {@code (batch_size x 1)}, containing sequence * log-probabilities. + * @return logProbability. */ public Output logProbability() { return logProbability; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CTCGreedyDecoder"; - - private Output decodedIndices; - private Output decodedValues; - private Output decodedShape; - private Output logProbability; - - private CtcGreedyDecoder(Operation operation) { - super(operation); - int outputIdx = 0; - decodedIndices = operation.output(outputIdx++); - decodedValues = operation.output(outputIdx++); - decodedShape = operation.output(outputIdx++); - logProbability = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.CtcGreedyDecoder} + */ + public static class Options { + private Boolean mergeRepeated; + + private Long blankIndex; + + private Options() { + } + + /** + * Sets the mergeRepeated option. + * + * @param mergeRepeated If True, merge repeated classes in output. + * @return this Options instance. + */ + public Options mergeRepeated(Boolean mergeRepeated) { + this.mergeRepeated = mergeRepeated; + return this; + } + + /** + * Sets the blankIndex option. + * + * @param blankIndex the blankIndex option + * @return this Options instance. + */ + public Options blankIndex(Long blankIndex) { + this.blankIndex = 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 1ea61f47a0b..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,92 +17,78 @@ 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; /** * 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 */ -@Operator(group = "nn") +@OpMetadata( + opType = CtcLoss.OP_NAME, + inputsClass = CtcLoss.Inputs.class +) +@Operator( + group = "nn" +) public final class CtcLoss extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.CtcLoss} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param preprocessCollapseRepeated Scalar, if true then repeated labels are - * collapsed prior to the CTC calculation. - */ - public Options preprocessCollapseRepeated(Boolean preprocessCollapseRepeated) { - this.preprocessCollapseRepeated = preprocessCollapseRepeated; - return this; - } - - /** - * @param ctcMergeRepeated 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 Options ctcMergeRepeated(Boolean ctcMergeRepeated) { - this.ctcMergeRepeated = ctcMergeRepeated; - return this; - } - - /** - * @param ignoreLongerOutputsThanInputs 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 Options ignoreLongerOutputsThanInputs(Boolean ignoreLongerOutputsThanInputs) { - this.ignoreLongerOutputsThanInputs = ignoreLongerOutputsThanInputs; - return this; - } - - private Boolean preprocessCollapseRepeated; - private Boolean ctcMergeRepeated; - private Boolean ignoreLongerOutputsThanInputs; - - private Options() { - } + public static final String OP_NAME = "CTCLoss"; + + private Output loss; + + private Output gradient; + + public CtcLoss(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + loss = operation.output(outputIdx++); + gradient = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new CtcLoss operation. - * + * Factory method to create a class wrapping a new CTCLoss operation. + * * @param scope current scope - * @param inputs 3-D, shape: `(max_time x batch_size x num_classes)`, the logits. - * @param labelsIndices The indices of a `SparseTensor`. - * `labels_indices(i, :) == [b, t]` means `labels_values(i)` stores the id for - * `(batch b, time t)`. + * @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 + * {@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 attributes values + * @param options carries optional attribute values + * @param data type for {@code CTCLoss} output and operands * @return a new instance of CtcLoss */ - @Endpoint(describeByClass = true) - public static CtcLoss create(Scope scope, Operand inputs, Operand labelsIndices, Operand labelsValues, Operand sequenceLength, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("CTCLoss", scope.makeOpName("CtcLoss")); + @Endpoint( + describeByClass = true + ) + public static CtcLoss create(Scope scope, Operand inputs, + Operand labelsIndices, Operand labelsValues, Operand sequenceLength, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CtcLoss"); opBuilder.addInput(inputs.asOutput()); opBuilder.addInput(labelsIndices.asOutput()); opBuilder.addInput(labelsValues.asOutput()); opBuilder.addInput(sequenceLength.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.preprocessCollapseRepeated != null) { @@ -116,60 +102,177 @@ public static CtcLoss create(Scope scope, Operand inpu } } } - return new CtcLoss(opBuilder.build()); + return new CtcLoss<>(opBuilder.build()); } - + /** + * Sets the preprocessCollapseRepeated option. + * * @param preprocessCollapseRepeated Scalar, if true then repeated labels are * collapsed prior to the CTC calculation. + * @return this Options instance. */ public static Options preprocessCollapseRepeated(Boolean preprocessCollapseRepeated) { return new Options().preprocessCollapseRepeated(preprocessCollapseRepeated); } - + /** - * @param ctcMergeRepeated Scalar. If set to false, during CTC calculation + * Sets the ctcMergeRepeated option. + * + * @param ctcMergeRepeated 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. + * @return this Options instance. */ public static Options ctcMergeRepeated(Boolean ctcMergeRepeated) { return new Options().ctcMergeRepeated(ctcMergeRepeated); } - + /** + * Sets the ignoreLongerOutputsThanInputs option. + * * @param ignoreLongerOutputsThanInputs 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. + * @return this Options instance. */ public static Options ignoreLongerOutputsThanInputs(Boolean ignoreLongerOutputsThanInputs) { return new Options().ignoreLongerOutputsThanInputs(ignoreLongerOutputsThanInputs); } - + /** + * Gets loss. * A vector (batch) containing log-probabilities. + * @return loss. */ public Output loss() { return loss; } - + /** - * The gradient of `loss`. 3-D, shape: - * `(max_time x batch_size x num_classes)`. + * Gets gradient. + * The gradient of {@code loss}. 3-D, shape: + * {@code (max_time x batch_size x num_classes)}. + * @return gradient. */ public Output gradient() { return gradient; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CTCLoss"; - - private Output loss; - private Output gradient; - - private CtcLoss(Operation operation) { - super(operation); - int outputIdx = 0; - loss = operation.output(outputIdx++); - gradient = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.CtcLoss} + */ + public static class Options { + private Boolean preprocessCollapseRepeated; + + private Boolean ctcMergeRepeated; + + private Boolean ignoreLongerOutputsThanInputs; + + private Options() { + } + + /** + * Sets the preprocessCollapseRepeated option. + * + * @param preprocessCollapseRepeated Scalar, if true then repeated labels are + * collapsed prior to the CTC calculation. + * @return this Options instance. + */ + public Options preprocessCollapseRepeated(Boolean preprocessCollapseRepeated) { + this.preprocessCollapseRepeated = preprocessCollapseRepeated; + return this; + } + + /** + * Sets the ctcMergeRepeated option. + * + * @param ctcMergeRepeated 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. + * @return this Options instance. + */ + public Options ctcMergeRepeated(Boolean ctcMergeRepeated) { + this.ctcMergeRepeated = ctcMergeRepeated; + return this; + } + + /** + * Sets the ignoreLongerOutputsThanInputs option. + * + * @param ignoreLongerOutputsThanInputs 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. + * @return this Options instance. + */ + public Options ignoreLongerOutputsThanInputs(Boolean ignoreLongerOutputsThanInputs) { + this.ignoreLongerOutputsThanInputs = ignoreLongerOutputsThanInputs; + 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 12e94a102f6..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,174 +17,122 @@ 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; /** * 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. + * 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'. + * 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". + * "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]. + * [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]. + * [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. + * [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 + * 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]. + * [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. + * training. * time_major: Indicates whether the input/output format is time major or batch - * major. + * 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 + * is only produced if is_training is true. */ +@OpMetadata( + opType = CudnnRNN.OP_NAME, + inputsClass = CudnnRNN.Inputs.class +) +@Operator( + group = "nn" +) public final class CudnnRNN extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.CudnnRNN} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param rnnMode - */ - public Options rnnMode(String rnnMode) { - this.rnnMode = rnnMode; - return this; - } - - /** - * @param inputMode - */ - public Options inputMode(String inputMode) { - this.inputMode = inputMode; - return this; - } - - /** - * @param direction - */ - public Options direction(String direction) { - this.direction = direction; - return this; - } - - /** - * @param dropout - */ - public Options dropout(Float dropout) { - this.dropout = dropout; - return this; - } - - /** - * @param seed - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - /** - * @param numProj - */ - public Options numProj(Long numProj) { - this.numProj = numProj; - return this; - } - - /** - * @param isTraining - */ - public Options isTraining(Boolean isTraining) { - this.isTraining = isTraining; - return this; - } - - /** - * @param timeMajor - */ - public Options timeMajor(Boolean timeMajor) { - this.timeMajor = timeMajor; - return this; - } - - private String rnnMode; - private String inputMode; - private String direction; - private Float dropout; - private Long seed; - private Long seed2; - private Long numProj; - private Boolean isTraining; - private Boolean timeMajor; - - private Options() { - } + public static final String OP_NAME = "CudnnRNNV3"; + + private Output output; + + private Output outputH; + + private Output outputC; + + private Output reserveSpace; + + private Output hostReserved; + + @SuppressWarnings("unchecked") + public CudnnRNN(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + outputH = operation.output(outputIdx++); + outputC = operation.output(outputIdx++); + reserveSpace = operation.output(outputIdx++); + hostReserved = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new CudnnRNN operation. - * + * Factory method to create a class wrapping a new CudnnRNNV3 operation. + * * @param scope current scope - * @param input - * @param inputH - * @param inputC - * @param params - * @param sequenceLengths - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static CudnnRNN create(Scope scope, Operand input, Operand inputH, Operand inputC, Operand params, Operand sequenceLengths, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("CudnnRNNV3", scope.makeOpName("CudnnRNN")); + @Endpoint( + describeByClass = true + ) + public static CudnnRNN create(Scope scope, Operand input, + Operand inputH, Operand inputC, Operand params, Operand sequenceLengths, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CudnnRNN"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputH.asOutput()); opBuilder.addInput(inputC.asOutput()); opBuilder.addInput(params.asOutput()); opBuilder.addInput(sequenceLengths.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.rnnMode != null) { @@ -216,118 +164,366 @@ public static CudnnRNN create(Scope scope, Operand inp } } } - return new CudnnRNN(opBuilder.build()); + return new CudnnRNN<>(opBuilder.build()); } - + /** - * @param rnnMode + * Sets the rnnMode option. + * + * @param rnnMode the rnnMode option + * @return this Options instance. */ public static Options rnnMode(String rnnMode) { return new Options().rnnMode(rnnMode); } - + /** - * @param inputMode + * Sets the inputMode option. + * + * @param inputMode the inputMode option + * @return this Options instance. */ public static Options inputMode(String inputMode) { return new Options().inputMode(inputMode); } - + /** - * @param direction + * Sets the direction option. + * + * @param direction the direction option + * @return this Options instance. */ public static Options direction(String direction) { return new Options().direction(direction); } - + /** - * @param dropout + * Sets the dropout option. + * + * @param dropout the dropout option + * @return this Options instance. */ public static Options dropout(Float dropout) { return new Options().dropout(dropout); } - + /** - * @param seed + * Sets the seed option. + * + * @param seed the seed option + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** - * @param seed2 + * Sets the seed2 option. + * + * @param seed2 the seed2 option + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** - * @param numProj + * Sets the numProj option. + * + * @param numProj the numProj option + * @return this Options instance. */ public static Options numProj(Long numProj) { return new Options().numProj(numProj); } - + /** - * @param isTraining + * Sets the isTraining option. + * + * @param isTraining the isTraining option + * @return this Options instance. */ public static Options isTraining(Boolean isTraining) { return new Options().isTraining(isTraining); } - + /** - * @param timeMajor + * Sets the timeMajor option. + * + * @param timeMajor the timeMajor option + * @return this Options instance. */ public static Options timeMajor(Boolean timeMajor) { return new Options().timeMajor(timeMajor); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets outputH. + * + * @return outputH. */ public Output outputH() { return outputH; } - + /** + * Gets outputC. + * + * @return outputC. */ public Output outputC() { return outputC; } - + /** + * Gets reserveSpace. + * + * @return reserveSpace. */ public Output reserveSpace() { return reserveSpace; } - + /** + * Gets hostReserved. + * + * @return hostReserved. */ - public Output hostReserved() { + public Output hostReserved() { return hostReserved; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CudnnRNNV3"; - - private Output output; - private Output outputH; - private Output outputC; - private Output reserveSpace; - private Output hostReserved; - - private CudnnRNN(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - outputH = operation.output(outputIdx++); - outputC = operation.output(outputIdx++); - reserveSpace = operation.output(outputIdx++); - hostReserved = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.CudnnRNN} + */ + public static class Options { + private String rnnMode; + + private String inputMode; + + private String direction; + + private Float dropout; + + private Long seed; + + private Long seed2; + + private Long numProj; + + private Boolean isTraining; + + private Boolean timeMajor; + + private Options() { + } + + /** + * Sets the rnnMode option. + * + * @param rnnMode the rnnMode option + * @return this Options instance. + */ + public Options rnnMode(String rnnMode) { + this.rnnMode = rnnMode; + return this; + } + + /** + * Sets the inputMode option. + * + * @param inputMode the inputMode option + * @return this Options instance. + */ + public Options inputMode(String inputMode) { + this.inputMode = inputMode; + return this; + } + + /** + * Sets the direction option. + * + * @param direction the direction option + * @return this Options instance. + */ + public Options direction(String direction) { + this.direction = direction; + return this; + } + + /** + * Sets the dropout option. + * + * @param dropout the dropout option + * @return this Options instance. + */ + public Options dropout(Float dropout) { + this.dropout = dropout; + return this; + } + + /** + * Sets the seed option. + * + * @param seed the seed option + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 the seed2 option + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } + + /** + * Sets the numProj option. + * + * @param numProj the numProj option + * @return this Options instance. + */ + public Options numProj(Long numProj) { + this.numProj = numProj; + return this; + } + + /** + * Sets the isTraining option. + * + * @param isTraining the isTraining option + * @return this Options instance. + */ + public Options isTraining(Boolean isTraining) { + this.isTraining = isTraining; + return this; + } + + /** + * Sets the timeMajor option. + * + * @param timeMajor the timeMajor option + * @return this Options instance. + */ + public Options timeMajor(Boolean timeMajor) { + this.timeMajor = 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 78a08d58328..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,177 +17,133 @@ 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; /** * 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. + * "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'. + * 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". + * "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]. + * [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]. + * [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. + * [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 + * 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]. + * [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. + * pass. * output_c_backprop: A 3-D tensor with the same shape as output_c in the forward - * pass. + * pass. * time_major: Indicates whether the input/output format is time major or batch - * major. + * 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. + * as input. * input_h_backprop: The backprop to input_h in the forward pass. Has the same - * shape as input_h. + * shape as input_h. * input_c_backprop: The backprop to input_c in the forward pass. Has the same - * shape as input_c. + * 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 inputBackprop()} output + * same shape as params. */ +@OpMetadata( + opType = CudnnRNNBackprop.OP_NAME, + inputsClass = CudnnRNNBackprop.Inputs.class +) +@Operator( + group = "nn" +) public final class CudnnRNNBackprop extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.CudnnRNNBackprop} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param rnnMode - */ - public Options rnnMode(String rnnMode) { - this.rnnMode = rnnMode; - return this; - } - - /** - * @param inputMode - */ - public Options inputMode(String inputMode) { - this.inputMode = inputMode; - return this; - } - - /** - * @param direction - */ - public Options direction(String direction) { - this.direction = direction; - return this; - } - - /** - * @param dropout - */ - public Options dropout(Float dropout) { - this.dropout = dropout; - return this; - } - - /** - * @param seed - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - /** - * @param numProj - */ - public Options numProj(Long numProj) { - this.numProj = numProj; - return this; - } - - /** - * @param timeMajor - */ - public Options timeMajor(Boolean timeMajor) { - this.timeMajor = timeMajor; - return this; - } - - private String rnnMode; - private String inputMode; - private String direction; - private Float dropout; - private Long seed; - private Long seed2; - private Long numProj; - private Boolean timeMajor; - - private Options() { - } + public static final String OP_NAME = "CudnnRNNBackpropV3"; + + private Output inputBackprop; + + private Output inputHBackprop; + + private Output inputCBackprop; + + private Output paramsBackprop; + + public CudnnRNNBackprop(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + inputBackprop = operation.output(outputIdx++); + inputHBackprop = operation.output(outputIdx++); + inputCBackprop = operation.output(outputIdx++); + paramsBackprop = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new CudnnRNNBackprop operation. - * + * Factory method to create a class wrapping a new CudnnRNNBackpropV3 operation. + * * @param scope current scope - * @param input - * @param inputH - * @param inputC - * @param params - * @param sequenceLengths - * @param output - * @param outputH - * @param outputC - * @param outputBackprop - * @param outputHBackprop - * @param outputCBackprop - * @param reserveSpace - * @param hostReserved - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static CudnnRNNBackprop create(Scope scope, 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, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("CudnnRNNBackpropV3", scope.makeOpName("CudnnRNNBackprop")); + @Endpoint( + describeByClass = true + ) + public static CudnnRNNBackprop create(Scope scope, 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, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CudnnRNNBackprop"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputH.asOutput()); opBuilder.addInput(inputC.asOutput()); @@ -201,7 +157,6 @@ public static CudnnRNNBackprop create(Scope scope, Operan opBuilder.addInput(outputCBackprop.asOutput()); opBuilder.addInput(reserveSpace.asOutput()); opBuilder.addInput(hostReserved.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.rnnMode != null) { @@ -230,103 +185,376 @@ public static CudnnRNNBackprop create(Scope scope, Operan } } } - return new CudnnRNNBackprop(opBuilder.build()); + return new CudnnRNNBackprop<>(opBuilder.build()); } - + /** - * @param rnnMode + * Sets the rnnMode option. + * + * @param rnnMode the rnnMode option + * @return this Options instance. */ public static Options rnnMode(String rnnMode) { return new Options().rnnMode(rnnMode); } - + /** - * @param inputMode + * Sets the inputMode option. + * + * @param inputMode the inputMode option + * @return this Options instance. */ public static Options inputMode(String inputMode) { return new Options().inputMode(inputMode); } - + /** - * @param direction + * Sets the direction option. + * + * @param direction the direction option + * @return this Options instance. */ public static Options direction(String direction) { return new Options().direction(direction); } - + /** - * @param dropout + * Sets the dropout option. + * + * @param dropout the dropout option + * @return this Options instance. */ public static Options dropout(Float dropout) { return new Options().dropout(dropout); } - + /** - * @param seed + * Sets the seed option. + * + * @param seed the seed option + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** - * @param seed2 + * Sets the seed2 option. + * + * @param seed2 the seed2 option + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** - * @param numProj + * Sets the numProj option. + * + * @param numProj the numProj option + * @return this Options instance. */ public static Options numProj(Long numProj) { return new Options().numProj(numProj); } - + /** - * @param timeMajor + * Sets the timeMajor option. + * + * @param timeMajor the timeMajor option + * @return this Options instance. */ public static Options timeMajor(Boolean timeMajor) { return new Options().timeMajor(timeMajor); } - + /** + * Gets inputBackprop. + * + * @return inputBackprop. */ public Output inputBackprop() { return inputBackprop; } - + /** + * Gets inputHBackprop. + * + * @return inputHBackprop. */ public Output inputHBackprop() { return inputHBackprop; } - + /** + * Gets inputCBackprop. + * + * @return inputCBackprop. */ public Output inputCBackprop() { return inputCBackprop; } - + /** + * Gets paramsBackprop. + * + * @return paramsBackprop. */ public Output paramsBackprop() { return paramsBackprop; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CudnnRNNBackpropV3"; - - private Output inputBackprop; - private Output inputHBackprop; - private Output inputCBackprop; - private Output paramsBackprop; - - private CudnnRNNBackprop(Operation operation) { - super(operation); - int outputIdx = 0; - inputBackprop = operation.output(outputIdx++); - inputHBackprop = operation.output(outputIdx++); - inputCBackprop = operation.output(outputIdx++); - paramsBackprop = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.CudnnRNNBackprop} + */ + public static class Options { + private String rnnMode; + + private String inputMode; + + private String direction; + + private Float dropout; + + private Long seed; + + private Long seed2; + + private Long numProj; + + private Boolean timeMajor; + + private Options() { + } + + /** + * Sets the rnnMode option. + * + * @param rnnMode the rnnMode option + * @return this Options instance. + */ + public Options rnnMode(String rnnMode) { + this.rnnMode = rnnMode; + return this; + } + + /** + * Sets the inputMode option. + * + * @param inputMode the inputMode option + * @return this Options instance. + */ + public Options inputMode(String inputMode) { + this.inputMode = inputMode; + return this; + } + + /** + * Sets the direction option. + * + * @param direction the direction option + * @return this Options instance. + */ + public Options direction(String direction) { + this.direction = direction; + return this; + } + + /** + * Sets the dropout option. + * + * @param dropout the dropout option + * @return this Options instance. + */ + public Options dropout(Float dropout) { + this.dropout = dropout; + return this; + } + + /** + * Sets the seed option. + * + * @param seed the seed option + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 the seed2 option + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } + + /** + * Sets the numProj option. + * + * @param numProj the numProj option + * @return this Options instance. + */ + public Options numProj(Long numProj) { + this.numProj = numProj; + return this; + } + + /** + * Sets the timeMajor option. + * + * @param timeMajor the timeMajor option + * @return this Options instance. + */ + public Options timeMajor(Boolean timeMajor) { + this.timeMajor = 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 2c5c451fac8..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,151 +17,101 @@ 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; /** * 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 * upcoming training or inferences. - *

- * Note that the params buffer may not be compatible across different GPUs. So any + *

Note that the params buffer may not be compatible across different GPUs. So any * save and restoration should be converted to and from the canonical weights and * biases. - *

- * num_layers: Specifies the number of layers in the RNN model. + *

num_layers: Specifies the number of layers in the RNN model. * num_units: Specifies the size of the hidden state. * input_size: Specifies the size of the input state. * weights: the canonical form of weights that can be used for saving - * and restoration. They are more likely to be compatible across different - * generations. + * and restoration. They are more likely to be compatible across different + * generations. * biases: the canonical form of biases that can be used for saving - * and restoration. They are more likely to be compatible across different - * generations. + * and restoration. They are more likely to be compatible across different + * generations. * num_params_weights: number of weight parameter matrix for all layers. * num_params_biases: number of bias parameter vector for all layers. * rnn_mode: Indicates the type of the RNN model. * input_mode: Indicate 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'. + * 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. - * dir = (direction == bidirectional) ? 2 : 1 + * dir = (direction == bidirectional) ? 2 : 1 * 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. * num_proj: The output dimensionality for the projection matrices. If None or 0, - * no projection is performed. - * - * @param data type for {@code params()} output + * no projection is performed. */ -@Operator(group = "nn") +@OpMetadata( + opType = CudnnRNNCanonicalToParams.OP_NAME, + inputsClass = CudnnRNNCanonicalToParams.Inputs.class +) +@Operator( + group = "nn" +) public final class CudnnRNNCanonicalToParams extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.CudnnRNNCanonicalToParams} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param rnnMode - */ - public Options rnnMode(String rnnMode) { - this.rnnMode = rnnMode; - return this; - } - - /** - * @param inputMode - */ - public Options inputMode(String inputMode) { - this.inputMode = inputMode; - return this; - } - - /** - * @param direction - */ - public Options direction(String direction) { - this.direction = direction; - return this; - } - - /** - * @param dropout - */ - public Options dropout(Float dropout) { - this.dropout = dropout; - return this; - } - - /** - * @param seed - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - /** - * @param numProj - */ - public Options numProj(Long numProj) { - this.numProj = numProj; - return this; - } - - private String rnnMode; - private String inputMode; - private String direction; - private Float dropout; - private Long seed; - private Long seed2; - private Long numProj; - - private Options() { - } + public static final String OP_NAME = "CudnnRNNCanonicalToParamsV2"; + + private Output params; + + public CudnnRNNCanonicalToParams(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + params = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new CudnnRNNCanonicalToParams operation. - * + * Factory method to create a class wrapping a new CudnnRNNCanonicalToParamsV2 operation. + * * @param scope current scope - * @param numLayers - * @param numUnits - * @param inputSize - * @param weights - * @param biases - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static CudnnRNNCanonicalToParams create(Scope scope, Operand numLayers, Operand numUnits, Operand inputSize, Iterable> weights, Iterable> biases, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("CudnnRNNCanonicalToParamsV2", scope.makeOpName("CudnnRNNCanonicalToParams")); + @Endpoint( + describeByClass = true + ) + public static CudnnRNNCanonicalToParams create(Scope scope, + Operand numLayers, Operand numUnits, Operand inputSize, + Iterable> weights, Iterable> biases, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CudnnRNNCanonicalToParams"); opBuilder.addInput(numLayers.asOutput()); opBuilder.addInput(numUnits.asOutput()); opBuilder.addInput(inputSize.asOutput()); opBuilder.addInputList(Operands.asOutputs(weights)); opBuilder.addInputList(Operands.asOutputs(biases)); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.rnnMode != null) { @@ -187,77 +137,281 @@ public static CudnnRNNCanonicalToParams create(Scope scop } } } - return new CudnnRNNCanonicalToParams(opBuilder.build()); + return new CudnnRNNCanonicalToParams<>(opBuilder.build()); } - + /** - * @param rnnMode + * Sets the rnnMode option. + * + * @param rnnMode the rnnMode option + * @return this Options instance. */ public static Options rnnMode(String rnnMode) { return new Options().rnnMode(rnnMode); } - + /** - * @param inputMode + * Sets the inputMode option. + * + * @param inputMode the inputMode option + * @return this Options instance. */ public static Options inputMode(String inputMode) { return new Options().inputMode(inputMode); } - + /** - * @param direction + * Sets the direction option. + * + * @param direction the direction option + * @return this Options instance. */ public static Options direction(String direction) { return new Options().direction(direction); } - + /** - * @param dropout + * Sets the dropout option. + * + * @param dropout the dropout option + * @return this Options instance. */ public static Options dropout(Float dropout) { return new Options().dropout(dropout); } - + /** - * @param seed + * Sets the seed option. + * + * @param seed the seed option + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** - * @param seed2 + * Sets the seed2 option. + * + * @param seed2 the seed2 option + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** - * @param numProj + * Sets the numProj option. + * + * @param numProj the numProj option + * @return this Options instance. */ public static Options numProj(Long numProj) { return new Options().numProj(numProj); } - + /** + * Gets params. + * + * @return params. */ public Output params() { return params; } - + @Override public Output asOutput() { return params; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CudnnRNNCanonicalToParamsV2"; - - private Output params; - - private CudnnRNNCanonicalToParams(Operation operation) { - super(operation); - int outputIdx = 0; - params = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.CudnnRNNCanonicalToParams} + */ + public static class Options { + private String rnnMode; + + private String inputMode; + + private String direction; + + private Float dropout; + + private Long seed; + + private Long seed2; + + private Long numProj; + + private Options() { + } + + /** + * Sets the rnnMode option. + * + * @param rnnMode the rnnMode option + * @return this Options instance. + */ + public Options rnnMode(String rnnMode) { + this.rnnMode = rnnMode; + return this; + } + + /** + * Sets the inputMode option. + * + * @param inputMode the inputMode option + * @return this Options instance. + */ + public Options inputMode(String inputMode) { + this.inputMode = inputMode; + return this; + } + + /** + * Sets the direction option. + * + * @param direction the direction option + * @return this Options instance. + */ + public Options direction(String direction) { + this.direction = direction; + return this; + } + + /** + * Sets the dropout option. + * + * @param dropout the dropout option + * @return this Options instance. + */ + public Options dropout(Float dropout) { + this.dropout = dropout; + return this; + } + + /** + * Sets the seed option. + * + * @param seed the seed option + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 the seed2 option + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } + + /** + * Sets the numProj option. + * + * @param numProj the numProj option + * @return this Options instance. + */ + public Options numProj(Long numProj) { + this.numProj = 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 adf30df3312..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,150 +19,107 @@ 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; /** * Retrieves CudnnRNN params in canonical form. It supports the projection in LSTM. - *

* Retrieves a set of weights from the opaque params buffer that can be saved and * restored in a way compatible with future runs. - *

- * Note that the params buffer may not be compatible across different GPUs. So any + *

Note that the params buffer may not be compatible across different GPUs. So any * save and restoration should be converted to and from the canonical weights and * biases. - *

- * num_layers: Specifies the number of layers in the RNN model. + *

num_layers: Specifies the number of layers in the RNN model. * num_units: Specifies the size of the hidden state. * input_size: Specifies the size of the input state. * num_params_weights: number of weight parameter matrix for all layers. * num_params_biases: number of bias parameter vector for all layers. * weights: the canonical form of weights that can be used for saving - * and restoration. They are more likely to be compatible across different - * generations. + * and restoration. They are more likely to be compatible across different + * generations. * biases: the canonical form of biases that can be used for saving - * and restoration. They are more likely to be compatible across different - * generations. + * and restoration. They are more likely to be compatible across different + * generations. * rnn_mode: Indicates the type of the RNN model. * input_mode: Indicate 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'. + * 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. - * dir = (direction == bidirectional) ? 2 : 1 + * dir = (direction == bidirectional) ? 2 : 1 * 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. * num_proj: The output dimensionality for the projection matrices. If None or 0, - * no projection is performed. - * - * @param data type for {@code weights()} output + * no projection is performed. */ -@Operator(group = "nn") +@OpMetadata( + opType = CudnnRNNParamsToCanonical.OP_NAME, + inputsClass = CudnnRNNParamsToCanonical.Inputs.class +) +@Operator( + group = "nn" +) public final class CudnnRNNParamsToCanonical extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.CudnnRNNParamsToCanonical} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param rnnMode - */ - public Options rnnMode(String rnnMode) { - this.rnnMode = rnnMode; - return this; - } - - /** - * @param inputMode - */ - public Options inputMode(String inputMode) { - this.inputMode = inputMode; - return this; - } - - /** - * @param direction - */ - public Options direction(String direction) { - this.direction = direction; - return this; - } - - /** - * @param dropout - */ - public Options dropout(Float dropout) { - this.dropout = dropout; - return this; - } - - /** - * @param seed - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - /** - * @param numProj - */ - public Options numProj(Long numProj) { - this.numProj = numProj; - return this; - } - - private String rnnMode; - private String inputMode; - private String direction; - private Float dropout; - private Long seed; - private Long seed2; - private Long numProj; - - private Options() { - } + public static final String OP_NAME = "CudnnRNNParamsToCanonicalV2"; + + private List> weights; + + private List> biases; + + @SuppressWarnings("unchecked") + public CudnnRNNParamsToCanonical(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int weightsLength = operation.outputListLength("weights"); + weights = Arrays.asList((Output[]) operation.outputList(outputIdx, weightsLength)); + outputIdx += weightsLength; + int biasesLength = operation.outputListLength("biases"); + biases = Arrays.asList((Output[]) operation.outputList(outputIdx, biasesLength)); + outputIdx += biasesLength; } - + /** - * Factory method to create a class wrapping a new CudnnRNNParamsToCanonical operation. - * + * Factory method to create a class wrapping a new CudnnRNNParamsToCanonicalV2 operation. + * * @param scope current scope - * @param numLayers - * @param numUnits - * @param inputSize - * @param params - * @param numParamsWeights - * @param numParamsBiases - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static CudnnRNNParamsToCanonical create(Scope scope, Operand numLayers, Operand numUnits, Operand inputSize, Operand params, Long numParamsWeights, Long numParamsBiases, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("CudnnRNNParamsToCanonicalV2", scope.makeOpName("CudnnRNNParamsToCanonical")); + @Endpoint( + describeByClass = true + ) + public static CudnnRNNParamsToCanonical create(Scope scope, + Operand numLayers, Operand numUnits, Operand inputSize, + Operand params, Long numParamsWeights, Long numParamsBiases, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CudnnRNNParamsToCanonical"); opBuilder.addInput(numLayers.asOutput()); opBuilder.addInput(numUnits.asOutput()); opBuilder.addInput(inputSize.asOutput()); opBuilder.addInput(params.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_params_weights", numParamsWeights); opBuilder.setAttr("num_params_biases", numParamsBiases); if (options != null) { @@ -190,85 +147,275 @@ public static CudnnRNNParamsToCanonical create(Scope scop } } } - return new CudnnRNNParamsToCanonical(opBuilder.build()); + return new CudnnRNNParamsToCanonical<>(opBuilder.build()); } - + /** - * @param rnnMode + * Sets the rnnMode option. + * + * @param rnnMode the rnnMode option + * @return this Options instance. */ public static Options rnnMode(String rnnMode) { return new Options().rnnMode(rnnMode); } - + /** - * @param inputMode + * Sets the inputMode option. + * + * @param inputMode the inputMode option + * @return this Options instance. */ public static Options inputMode(String inputMode) { return new Options().inputMode(inputMode); } - + /** - * @param direction + * Sets the direction option. + * + * @param direction the direction option + * @return this Options instance. */ public static Options direction(String direction) { return new Options().direction(direction); } - + /** - * @param dropout + * Sets the dropout option. + * + * @param dropout the dropout option + * @return this Options instance. */ public static Options dropout(Float dropout) { return new Options().dropout(dropout); } - + /** - * @param seed + * Sets the seed option. + * + * @param seed the seed option + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** - * @param seed2 + * Sets the seed2 option. + * + * @param seed2 the seed2 option + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** - * @param numProj + * Sets the numProj option. + * + * @param numProj the numProj option + * @return this Options instance. */ public static Options numProj(Long numProj) { return new Options().numProj(numProj); } - + /** + * Gets weights. + * + * @return weights. */ public List> weights() { return weights; } - + /** + * Gets biases. + * + * @return biases. */ public List> biases() { return biases; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CudnnRNNParamsToCanonicalV2"; - - private List> weights; - private List> biases; - - @SuppressWarnings("unchecked") - private CudnnRNNParamsToCanonical(Operation operation) { - super(operation); - int outputIdx = 0; - int weightsLength = operation.outputListLength("weights"); - weights = Arrays.asList((Output[])operation.outputList(outputIdx, weightsLength)); - outputIdx += weightsLength; - int biasesLength = operation.outputListLength("biases"); - biases = Arrays.asList((Output[])operation.outputList(outputIdx, biasesLength)); - outputIdx += biasesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.nn.CudnnRNNParamsToCanonical} + */ + public static class Options { + private String rnnMode; + + private String inputMode; + + private String direction; + + private Float dropout; + + private Long seed; + + private Long seed2; + + private Long numProj; + + private Options() { + } + + /** + * Sets the rnnMode option. + * + * @param rnnMode the rnnMode option + * @return this Options instance. + */ + public Options rnnMode(String rnnMode) { + this.rnnMode = rnnMode; + return this; + } + + /** + * Sets the inputMode option. + * + * @param inputMode the inputMode option + * @return this Options instance. + */ + public Options inputMode(String inputMode) { + this.inputMode = inputMode; + return this; + } + + /** + * Sets the direction option. + * + * @param direction the direction option + * @return this Options instance. + */ + public Options direction(String direction) { + this.direction = direction; + return this; + } + + /** + * Sets the dropout option. + * + * @param dropout the dropout option + * @return this Options instance. + */ + public Options dropout(Float dropout) { + this.dropout = dropout; + return this; + } + + /** + * Sets the seed option. + * + * @param seed the seed option + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 the seed2 option + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } + + /** + * Sets the numProj option. + * + * @param numProj the numProj option + * @return this Options instance. + */ + public Options numProj(Long numProj) { + this.numProj = 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 14dcc23a10e..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,140 +17,92 @@ 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; /** * Computes size of weights that can be used by a Cudnn RNN model. - *

* Return the params size that can be used by the Cudnn RNN model. Subsequent * weight allocation and initialization should use this size. - *

- * num_layers: Specifies the number of layers in the RNN model. + *

num_layers: Specifies the number of layers in the RNN model. * num_units: Specifies the size of the hidden state. * input_size: Specifies the size of the input state. * rnn_mode: Indicates the type of the RNN model. * input_mode: Indicate 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'. + * 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. - * dir = (direction == bidirectional) ? 2 : 1 + * dir = (direction == bidirectional) ? 2 : 1 * 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. * params_size: The size of the params buffer that should be allocated and - * initialized for this RNN model. Note that this params buffer may not be - * 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 paramsSize()} output + * initialized for this RNN model. Note that this params buffer may not be + * compatible across GPUs. Please use CudnnRNNParamsWeights and + * CudnnRNNParamsBiases to save and restore them in a way that is compatible + * across different runs. */ -@Operator(group = "nn") -public final class CudnnRnnParamsSize extends RawOp implements Operand { - +@OpMetadata( + opType = CudnnRnnParamsSize.OP_NAME, + inputsClass = CudnnRnnParamsSize.Inputs.class +) +@Operator( + group = "nn" +) +public final class CudnnRnnParamsSize extends RawOp implements Operand { /** - * Optional attributes for {@link org.tensorflow.op.nn.CudnnRnnParamsSize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param rnnMode - */ - public Options rnnMode(String rnnMode) { - this.rnnMode = rnnMode; - return this; - } - - /** - * @param inputMode - */ - public Options inputMode(String inputMode) { - this.inputMode = inputMode; - return this; - } - - /** - * @param direction - */ - public Options direction(String direction) { - this.direction = direction; - return this; - } - - /** - * @param dropout - */ - public Options dropout(Float dropout) { - this.dropout = dropout; - return this; - } - - /** - * @param seed - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - /** - * @param numProj - */ - public Options numProj(Long numProj) { - this.numProj = numProj; - return this; - } - - private String rnnMode; - private String inputMode; - private String direction; - private Float dropout; - private Long seed; - private Long seed2; - private Long numProj; - - private Options() { - } + public static final String OP_NAME = "CudnnRNNParamsSize"; + + private Output paramsSize; + + public CudnnRnnParamsSize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + paramsSize = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new CudnnRnnParamsSize operation. - * + * Factory method to create a class wrapping a new CudnnRNNParamsSize operation. + * * @param scope current scope - * @param numLayers - * @param numUnits - * @param inputSize - * @param T - * @param S - * @param options carries optional attributes values + * @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 * @return a new instance of CudnnRnnParamsSize */ - @Endpoint(describeByClass = true) - public static CudnnRnnParamsSize create(Scope scope, Operand numLayers, Operand numUnits, Operand inputSize, Class T, Class S, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("CudnnRNNParamsSize", scope.makeOpName("CudnnRnnParamsSize")); + @Endpoint( + describeByClass = true + ) + public static CudnnRnnParamsSize create(Scope scope, + Operand numLayers, Operand numUnits, Operand inputSize, Class T, + Class S, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CudnnRnnParamsSize"); opBuilder.addInput(numLayers.asOutput()); opBuilder.addInput(numUnits.asOutput()); opBuilder.addInput(inputSize.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("T", Operands.toDataType(T)); opBuilder.setAttr("S", Operands.toDataType(S)); if (options != null) { @@ -178,77 +130,271 @@ public static CudnnRnnParamsSize creat } } } - return new CudnnRnnParamsSize(opBuilder.build()); + return new CudnnRnnParamsSize<>(opBuilder.build()); } - + /** - * @param rnnMode + * Sets the rnnMode option. + * + * @param rnnMode the rnnMode option + * @return this Options instance. */ public static Options rnnMode(String rnnMode) { return new Options().rnnMode(rnnMode); } - + /** - * @param inputMode + * Sets the inputMode option. + * + * @param inputMode the inputMode option + * @return this Options instance. */ public static Options inputMode(String inputMode) { return new Options().inputMode(inputMode); } - + /** - * @param direction + * Sets the direction option. + * + * @param direction the direction option + * @return this Options instance. */ public static Options direction(String direction) { return new Options().direction(direction); } - + /** - * @param dropout + * Sets the dropout option. + * + * @param dropout the dropout option + * @return this Options instance. */ public static Options dropout(Float dropout) { return new Options().dropout(dropout); } - + /** - * @param seed + * Sets the seed option. + * + * @param seed the seed option + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** - * @param seed2 + * Sets the seed2 option. + * + * @param seed2 the seed2 option + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** - * @param numProj + * Sets the numProj option. + * + * @param numProj the numProj option + * @return this Options instance. */ public static Options numProj(Long numProj) { return new Options().numProj(numProj); } - + /** + * Gets paramsSize. + * + * @return paramsSize. */ - public Output paramsSize() { + public Output paramsSize() { return paramsSize; } - + @Override - public Output asOutput() { + public Output asOutput() { return paramsSize; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CudnnRNNParamsSize"; - - private Output paramsSize; - - private CudnnRnnParamsSize(Operation operation) { - super(operation); - int outputIdx = 0; - paramsSize = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.CudnnRnnParamsSize} + */ + public static class Options { + private String rnnMode; + + private String inputMode; + + private String direction; + + private Float dropout; + + private Long seed; + + private Long seed2; + + private Long numProj; + + private Options() { + } + + /** + * Sets the rnnMode option. + * + * @param rnnMode the rnnMode option + * @return this Options instance. + */ + public Options rnnMode(String rnnMode) { + this.rnnMode = rnnMode; + return this; + } + + /** + * Sets the inputMode option. + * + * @param inputMode the inputMode option + * @return this Options instance. + */ + public Options inputMode(String inputMode) { + this.inputMode = inputMode; + return this; + } + + /** + * Sets the direction option. + * + * @param direction the direction option + * @return this Options instance. + */ + public Options direction(String direction) { + this.direction = direction; + return this; + } + + /** + * Sets the dropout option. + * + * @param dropout the dropout option + * @return this Options instance. + */ + public Options dropout(Float dropout) { + this.dropout = dropout; + return this; + } + + /** + * Sets the seed option. + * + * @param seed the seed option + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 the seed2 option + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } + + /** + * Sets the numProj option. + * + * @param numProj the numProj option + * @return this Options instance. + */ + public Options numProj(Long numProj) { + this.numProj = 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 115a5bb12d8..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,68 +17,64 @@ 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 */ -@Operator(group = "nn") +@OpMetadata( + opType = DataFormatDimMap.OP_NAME, + inputsClass = DataFormatDimMap.Inputs.class +) +@Operator( + group = "nn" +) public final class DataFormatDimMap extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.DataFormatDimMap} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param srcFormat source data format. - */ - public Options srcFormat(String srcFormat) { - this.srcFormat = srcFormat; - return this; - } - - /** - * @param dstFormat destination data format. - */ - public Options dstFormat(String dstFormat) { - this.dstFormat = dstFormat; - return this; - } - - private String srcFormat; - private String dstFormat; - - private Options() { - } + public static final String OP_NAME = "DataFormatDimMap"; + + private Output y; + + public DataFormatDimMap(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DataFormatDimMap operation. - * + * * @param scope current scope * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code DataFormatDimMap} output and operands * @return a new instance of DataFormatDimMap */ - @Endpoint(describeByClass = true) - public static DataFormatDimMap create(Scope scope, Operand x, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DataFormatDimMap", scope.makeOpName("DataFormatDimMap")); + @Endpoint( + describeByClass = true + ) + public static DataFormatDimMap create(Scope scope, Operand x, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DataFormatDimMap"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.srcFormat != null) { @@ -89,43 +85,109 @@ public static DataFormatDimMap create(Scope scope, Operan } } } - return new DataFormatDimMap(opBuilder.build()); + return new DataFormatDimMap<>(opBuilder.build()); } - + /** + * Sets the srcFormat option. + * * @param srcFormat source data format. + * @return this Options instance. */ public static Options srcFormat(String srcFormat) { return new Options().srcFormat(srcFormat); } - + /** + * Sets the dstFormat option. + * * @param dstFormat destination data format. + * @return this Options instance. */ public static Options dstFormat(String dstFormat) { return new Options().dstFormat(dstFormat); } - + /** + * Gets y. * A Tensor with each element as a dimension index in destination data format. + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DataFormatDimMap"; - - private Output y; - - private DataFormatDimMap(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.DataFormatDimMap} + */ + public static class Options { + private String srcFormat; + + private String dstFormat; + + private Options() { + } + + /** + * Sets the srcFormat option. + * + * @param srcFormat source data format. + * @return this Options instance. + */ + public Options srcFormat(String srcFormat) { + this.srcFormat = srcFormat; + return this; + } + + /** + * Sets the dstFormat option. + * + * @param dstFormat destination data format. + * @return this Options instance. + */ + public Options dstFormat(String dstFormat) { + this.dstFormat = 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 78f640b17f1..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,87 +17,91 @@ 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 `src_format` to `dst_format`. - *

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

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

{@code
+ * Permute input tensor from {@code src_format} to {@code dst_format}.
+ * 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 - *
{@code
- * [[1, 2, 3, 4],
- *  [5, 6, 7, 8]]
- * }
- * , the outputs will be (respectively): - *
{@code
+ * 
+ *

, the output will be: + *

  * [1, 4, 2, 3]
- * }
- * and - *
{@code
- * [[1, 4, 2, 3],
- *  [5, 8, 6, 7]]
- * }
- * - * - * @param data type for {@code y()} output + *
+ *

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

+ * [[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]
+ * 
+ *

, the output will be: + *

+ * [1, 2]
+ * 
*/ -@Operator(group = "nn") +@OpMetadata( + opType = DataFormatVecPermute.OP_NAME, + inputsClass = DataFormatVecPermute.Inputs.class +) +@Operator( + group = "nn" +) public final class DataFormatVecPermute extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.DataFormatVecPermute} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param srcFormat source data format. - */ - public Options srcFormat(String srcFormat) { - this.srcFormat = srcFormat; - return this; - } - - /** - * @param dstFormat destination data format. - */ - public Options dstFormat(String dstFormat) { - this.dstFormat = dstFormat; - return this; - } - - private String srcFormat; - private String dstFormat; - - private Options() { - } + public static final String OP_NAME = "DataFormatVecPermute"; + + private Output y; + + public DataFormatVecPermute(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); } - + /** * 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 options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static DataFormatVecPermute create(Scope scope, Operand x, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DataFormatVecPermute", scope.makeOpName("DataFormatVecPermute")); + @Endpoint( + describeByClass = true + ) + public static DataFormatVecPermute create(Scope scope, Operand x, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DataFormatVecPermute"); opBuilder.addInput(x.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.srcFormat != null) { @@ -108,43 +112,108 @@ public static DataFormatVecPermute create(Scope scope, Op } } } - return new DataFormatVecPermute(opBuilder.build()); + return new DataFormatVecPermute<>(opBuilder.build()); } - + /** + * Sets the srcFormat option. + * * @param srcFormat source data format. + * @return this Options instance. */ public static Options srcFormat(String srcFormat) { return new Options().srcFormat(srcFormat); } - + /** + * Sets the dstFormat option. + * * @param dstFormat destination data format. + * @return this Options instance. */ public static Options dstFormat(String dstFormat) { return new Options().dstFormat(dstFormat); } - + /** - * Vector of size 4 or Tensor of shape (4, 2) in destination data format. + * Gets y. + * Tensor of rank 1 or 2 in destination data format. + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DataFormatVecPermute"; - - private Output y; - - private DataFormatVecPermute(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.DataFormatVecPermute} + */ + public static class Options { + private String srcFormat; + + private String dstFormat; + + private Options() { + } + + /** + * Sets the srcFormat option. + * + * @param srcFormat source data format. + * @return this Options instance. + */ + public Options srcFormat(String srcFormat) { + this.srcFormat = srcFormat; + return this; + } + + /** + * Sets the dstFormat option. + * + * @param dstFormat destination data format. + * @return this Options instance. + */ + public Options dstFormat(String dstFormat) { + this.dstFormat = 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 2f95879ddd7..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,137 +17,137 @@ 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; /** * DepthToSpace for tensors of type T. - *

* Rearranges data from depth into blocks of spatial data. * This is the reverse transformation of SpaceToDepth. More specifically, - * this op outputs a copy of the input tensor where values from the `depth` - * dimension are moved in spatial blocks to the `height` and `width` dimensions. - * The attr `block_size` indicates the input block size and how the data is moved. - *

- * * Chunks of data of size `block_size * block_size` from depth are rearranged - * into non-overlapping blocks of size `block_size x block_size` - * * The width the output tensor is `input_depth * block_size`, whereas the - * height is `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. - * * The depth of the input tensor must be divisible by - * `block_size * block_size`. - *

- * The `data_format` attr specifies the layout of the input and output tensors + * this op outputs a copy of the input tensor where values from the {@code depth} + * dimension are moved in spatial blocks to the {@code height} and {@code width} dimensions. + * The attr {@code block_size} indicates the input block size and how the data is moved. + *

    + *
  • 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 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.
  • + *
  • The depth of the input tensor must be divisible by + * {@code block_size * block_size}.
  • + *
+ *

The {@code data_format} attr specifies the layout of the input and output tensors * with the following options: - * "NHWC": `[ batch, height, width, channels ]` - * "NCHW": `[ batch, channels, height, width ]` - * "NCHW_VECT_C": - * `qint8 [ batch, channels / 4, height, width, 4 ]` - *

- * It is useful to consider the operation as transforming a 6-D Tensor. + * "NHWC": {@code [ batch, height, width, channels ]} + * "NCHW": {@code [ batch, channels, height, width ]} + * "NCHW_VECT_C": + * {@code qint8 [ batch, channels / 4, height, width, 4 ]} + *

It is useful to consider the operation as transforming a 6-D Tensor. * e.g. for data_format = NHWC, - * Each element in the input tensor can be specified via 6 coordinates, - * ordered by decreasing memory layout significance as: - * n,iY,iX,bY,bX,oC (where n=batch index, iX, iY means X or Y coordinates - * within the input image, bX, bY means coordinates - * within the output block, oC means output channels). - * The output would be the input transposed to the following layout: - * n,iY,bY,iX,bX,oC - *

- * This operation is useful for resizing the activations between convolutions + * Each element in the input tensor can be specified via 6 coordinates, + * ordered by decreasing memory layout significance as: + * n,iY,iX,bY,bX,oC (where n=batch index, iX, iY means X or Y coordinates + * within the input image, bX, bY means coordinates + * within the output block, oC means output channels). + * The output would be the input transposed to the following layout: + * n,iY,bY,iX,bX,oC + *

This operation is useful for resizing the activations between convolutions * (but keeping all data), e.g. instead of pooling. It is also useful for training * purely convolutional models. - *

- * For example, given an input of shape `[1, 1, 1, 4]`, data_format = "NHWC" and + *

For example, given an input of shape {@code [1, 1, 1, 4]}, data_format = "NHWC" and * block_size = 2: - *

{@code
+ * 
  * x = [[[[1, 2, 3, 4]]]]
- * 
- * }
- * This operation will output a tensor of shape `[1, 2, 2, 1]`: - *
{@code
+ *
+ * 
+ *

This operation will output a tensor of shape {@code [1, 2, 2, 1]}: + *

  *    [[[[1], [2]],
  *      [[3], [4]]]]
- * }
- * Here, the input has a batch of 1 and each batch element has shape `[1, 1, 4]`, + *
+ *

Here, the input has a batch of 1 and each batch element has shape {@code [1, 1, 4]}, * the corresponding output will have 2x2 elements and will have a depth of - * 1 channel (1 = `4 / (block_size * block_size)`). - * The output element shape is `[2, 2, 1]`. - *

- * For an input tensor with larger depth, here of shape `[1, 1, 1, 12]`, e.g. - *

{@code
+ * 1 channel (1 = {@code 4 / (block_size * block_size)}).
+ * The output element shape is {@code [2, 2, 1]}.
+ * 

For an input tensor with larger depth, here of shape {@code [1, 1, 1, 12]}, e.g. + *

  * x = [[[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]]]]
- * }
- * This operation, for block size of 2, will return the following tensor of shape - * `[1, 2, 2, 3]` - *
{@code
+ * 
+ *

This operation, for block size of 2, will return the following tensor of shape + * {@code [1, 2, 2, 3]} + *

  *    [[[[1, 2, 3], [4, 5, 6]],
  *      [[7, 8, 9], [10, 11, 12]]]]
- * 
- * }
- * Similarly, for the following input of shape `[1 2 2 4]`, and a block size of 2: - *
{@code
+ *
+ * 
+ *

Similarly, for the following input of shape {@code [1 2 2 4]}, and a block size of 2: + *

  * x =  [[[[1, 2, 3, 4],
  *        [5, 6, 7, 8]],
  *       [[9, 10, 11, 12],
  *        [13, 14, 15, 16]]]]
- * }
- * the operator will return the following tensor of shape `[1 4 4 1]`: - *
{@code
+ * 
+ *

the operator will return the following tensor of shape {@code [1 4 4 1]}: + *

  * x = [[[ [1],   [2],  [5],  [6]],
  *       [ [3],   [4],  [7],  [8]],
  *       [ [9],  [10], [13],  [14]],
  *       [ [11], [12], [15],  [16]]]]
- * 
- * }
- * - * - * @param data type for {@code output()} output + * + *
*/ -@Operator(group = "nn") +@OpMetadata( + opType = DepthToSpace.OP_NAME, + inputsClass = DepthToSpace.Inputs.class +) +@Operator( + group = "nn" +) public final class DepthToSpace extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.DepthToSpace} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "DepthToSpace"; + + private Output output; + + public DepthToSpace(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DepthToSpace operation. - * + * * @param scope current scope - * @param input + * @param input The input value * @param blockSize The size of the spatial block, same as in Space2Depth. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code DepthToSpace} output and operands * @return a new instance of DepthToSpace */ - @Endpoint(describeByClass = true) - public static DepthToSpace create(Scope scope, Operand input, Long blockSize, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DepthToSpace", scope.makeOpName("DepthToSpace")); + @Endpoint( + describeByClass = true + ) + public static DepthToSpace create(Scope scope, Operand input, + Long blockSize, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DepthToSpace"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("block_size", blockSize); if (options != null) { for (Options opts : options) { @@ -156,35 +156,85 @@ public static DepthToSpace create(Scope scope, Operand i } } } - return new DepthToSpace(opBuilder.build()); + return new DepthToSpace<>(opBuilder.build()); } - + /** - * @param dataFormat + * 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DepthToSpace"; - - private Output output; - - private DepthToSpace(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.DepthToSpace} + */ + 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; + } + } + + @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 8420a6524dc..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. @@ -17,107 +17,86 @@ 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 2-D depthwise convolution given 4-D `input` and `filter` tensors. - *

- * Given an input tensor of shape `[batch, in_height, in_width, in_channels]` + * Computes a 2-D depthwise convolution given 4-D {@code input} and {@code filter} tensors. + * Given an input tensor of shape {@code [batch, in_height, in_width, in_channels]} * and a filter / kernel tensor of shape - * `[filter_height, filter_width, in_channels, channel_multiplier]`, containing - * `in_channels` convolutional filters of depth 1, `depthwise_conv2d` applies + * {@code [filter_height, filter_width, in_channels, channel_multiplier]}, containing + * {@code in_channels} convolutional filters of depth 1, {@code depthwise_conv2d} applies * a different filter to each input channel (expanding from 1 channel to - * `channel_multiplier` channels for each), then concatenates the results - * together. Thus, the output has `in_channels * channel_multiplier` channels. - *

{@code
+ * {@code channel_multiplier} channels for each), then concatenates the results
+ * together. Thus, the output has {@code in_channels * channel_multiplier} channels.
+ * 
  * for k in 0..in_channels-1
  *   for q in 0..channel_multiplier-1
  *     output[b, i, j, k * channel_multiplier + q] =
  *       sum_{di, dj} input[b, strides[1] * i + di, strides[2] * j + dj, k] *
  *                         filter[di, dj, k, q]
- * }
- * Must have `strides[0] = strides[3] = 1`. For the most common case of the same - * horizontal and vertices strides, `strides = [1, stride, stride, 1]`. - * - * @param data type for {@code output()} output + *
+ *

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]}. */ -@Operator(group = "nn") +@OpMetadata( + opType = DepthwiseConv2dNative.OP_NAME, + inputsClass = DepthwiseConv2dNative.Inputs.class +) +@Operator( + group = "nn" +) public final class DepthwiseConv2dNative extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.DepthwiseConv2dNative} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param explicitPaddings - */ - public Options explicitPaddings(List explicitPaddings) { - this.explicitPaddings = explicitPaddings; - return this; - } - - /** - * @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, height, width, channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, channels, height, width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of - * `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 - * `data_format`, see above for details. Dilations in the batch and depth - * dimensions must be 1. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private List explicitPaddings; - private String dataFormat; - private List dilations; - - private Options() { - } + public static final String OP_NAME = "DepthwiseConv2dNative"; + + private Output output; + + public DepthwiseConv2dNative(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DepthwiseConv2dNative operation. - * + * * @param scope current scope - * @param input - * @param filter + * @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 `input`. + * of {@code input}. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code DepthwiseConv2dNative} output and operands * @return a new instance of DepthwiseConv2dNative */ - @Endpoint(describeByClass = true) - public static DepthwiseConv2dNative create(Scope scope, Operand input, Operand filter, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DepthwiseConv2dNative", scope.makeOpName("DepthwiseConv2dNative")); + @Endpoint( + describeByClass = true + ) + public static DepthwiseConv2dNative create(Scope scope, Operand input, + Operand filter, List strides, String padding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DepthwiseConv2dNative"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); - opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -126,7 +105,7 @@ public static DepthwiseConv2dNative create(Scope scope, O for (Options opts : options) { if (opts.explicitPaddings != null) { long[] explicitPaddingsArray = new long[opts.explicitPaddings.size()]; - for (int i = 0; i < explicitPaddingsArray.length; ++i) { + for (int i = 0 ; i < explicitPaddingsArray.length ; i++) { explicitPaddingsArray[i] = opts.explicitPaddings.get(i); } opBuilder.setAttr("explicit_paddings", explicitPaddingsArray); @@ -136,64 +115,237 @@ public static DepthwiseConv2dNative create(Scope scope, O } if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new DepthwiseConv2dNative(opBuilder.build()); + return new DepthwiseConv2dNative<>(opBuilder.build()); } - + /** - * @param explicitPaddings + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @return this Options instance. */ public static Options explicitPaddings(List explicitPaddings) { return new Options().explicitPaddings(explicitPaddings); } - + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @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, height, width, channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, channels, height, width]. + * 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]. + * @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 - * `input`. If set to k > 1, there will be k-1 skipped cells between each filter + * {@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 - * `data_format`, see above for details. Dilations in the batch and depth + * {@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. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DepthwiseConv2dNative"; - - private Output output; - - private DepthwiseConv2dNative(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.DepthwiseConv2dNative} + */ + public static class Options { + private List explicitPaddings; + + private String dataFormat; + + private List dilations; + + private Options() { + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @return this Options instance. + */ + public Options explicitPaddings(List explicitPaddings) { + this.explicitPaddings = explicitPaddings; + return this; + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @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, height, width, channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, channels, height, 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 = 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 3825826677b..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. @@ -17,100 +17,80 @@ 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 the gradients of depthwise convolution with respect to the filter. - * - * @param data type for {@code output()} output */ -@Operator(group = "nn") +@OpMetadata( + opType = DepthwiseConv2dNativeBackpropFilter.OP_NAME, + inputsClass = DepthwiseConv2dNativeBackpropFilter.Inputs.class +) +@Operator( + group = "nn" +) public final class DepthwiseConv2dNativeBackpropFilter extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.DepthwiseConv2dNativeBackpropFilter} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param explicitPaddings - */ - public Options explicitPaddings(List explicitPaddings) { - this.explicitPaddings = explicitPaddings; - return this; - } - - /** - * @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, height, width, channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, channels, height, width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of - * `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 - * `data_format`, see above for details. Dilations in the batch and depth - * dimensions must be 1. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private List explicitPaddings; - private String dataFormat; - private List dilations; - - private Options() { - } + public static final String OP_NAME = "DepthwiseConv2dNativeBackpropFilter"; + + private Output output; + + public DepthwiseConv2dNativeBackpropFilter(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DepthwiseConv2dNativeBackpropFilter operation. - * + * * @param scope current scope - * @param input 4-D with shape based on `data_format`. For example, if - * `data_format` is 'NHWC' then `input` is a 4-D `[batch, in_height, - * in_width, in_channels]` tensor. - * @param filterSizes An integer vector representing the tensor shape of `filter`, - * where `filter` is a 4-D - * `[filter_height, filter_width, in_channels, depthwise_multiplier]` tensor. - * @param outBackprop 4-D with shape based on `data_format`. - * For example, if `data_format` is 'NHWC' then - * out_backprop shape is `[batch, out_height, out_width, out_channels]`. + * @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}, + * where {@code filter} is a 4-D + * {@code [filter_height, filter_width, in_channels, depthwise_multiplier]} tensor. + * @param outBackprop 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. * @param strides The stride of the sliding window for each dimension of the input * of the convolution. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code DepthwiseConv2dNativeBackpropFilter} output and operands * @return a new instance of DepthwiseConv2dNativeBackpropFilter */ - @Endpoint(describeByClass = true) - public static DepthwiseConv2dNativeBackpropFilter create(Scope scope, Operand input, Operand filterSizes, Operand outBackprop, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DepthwiseConv2dNativeBackpropFilter", scope.makeOpName("DepthwiseConv2dNativeBackpropFilter")); + @Endpoint( + describeByClass = true + ) + public static DepthwiseConv2dNativeBackpropFilter create(Scope scope, + Operand input, Operand filterSizes, Operand outBackprop, List strides, + String padding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DepthwiseConv2dNativeBackpropFilter"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filterSizes.asOutput()); opBuilder.addInput(outBackprop.asOutput()); - opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -119,7 +99,7 @@ public static DepthwiseConv2dNativeBackpropFilter create( for (Options opts : options) { if (opts.explicitPaddings != null) { long[] explicitPaddingsArray = new long[opts.explicitPaddings.size()]; - for (int i = 0; i < explicitPaddingsArray.length; ++i) { + for (int i = 0 ; i < explicitPaddingsArray.length ; i++) { explicitPaddingsArray[i] = opts.explicitPaddings.get(i); } opBuilder.setAttr("explicit_paddings", explicitPaddingsArray); @@ -129,67 +109,251 @@ public static DepthwiseConv2dNativeBackpropFilter create( } if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new DepthwiseConv2dNativeBackpropFilter(opBuilder.build()); + return new DepthwiseConv2dNativeBackpropFilter<>(opBuilder.build()); } - + /** - * @param explicitPaddings + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @return this Options instance. */ public static Options explicitPaddings(List explicitPaddings) { return new Options().explicitPaddings(explicitPaddings); } - + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @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, height, width, channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, channels, height, width]. + * 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]. + * @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 - * `input`. If set to k > 1, there will be k-1 skipped cells between each filter + * {@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 - * `data_format`, see above for details. Dilations in the batch and depth + * {@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 - * `[filter_height, filter_width, in_channels, out_channels]`. Gradient w.r.t. - * the `filter` input of the convolution. + * {@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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DepthwiseConv2dNativeBackpropFilter"; - - private Output output; - - private DepthwiseConv2dNativeBackpropFilter(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.DepthwiseConv2dNativeBackpropFilter} + */ + public static class Options { + private List explicitPaddings; + + private String dataFormat; + + private List dilations; + + private Options() { + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @return this Options instance. + */ + public Options explicitPaddings(List explicitPaddings) { + this.explicitPaddings = explicitPaddings; + return this; + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @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, height, width, channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, channels, height, 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 = 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 35f10aaed5d..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. @@ -17,99 +17,80 @@ 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 the gradients of depthwise convolution with respect to the input. - * - * @param data type for {@code output()} output */ -@Operator(group = "nn") +@OpMetadata( + opType = DepthwiseConv2dNativeBackpropInput.OP_NAME, + inputsClass = DepthwiseConv2dNativeBackpropInput.Inputs.class +) +@Operator( + group = "nn" +) public final class DepthwiseConv2dNativeBackpropInput extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.DepthwiseConv2dNativeBackpropInput} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param explicitPaddings - */ - public Options explicitPaddings(List explicitPaddings) { - this.explicitPaddings = explicitPaddings; - return this; - } - - /** - * @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, height, width, channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, channels, height, width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of - * `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 - * `data_format`, see above for details. Dilations in the batch and depth - * dimensions must be 1. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private List explicitPaddings; - private String dataFormat; - private List dilations; - - private Options() { - } + public static final String OP_NAME = "DepthwiseConv2dNativeBackpropInput"; + + private Output output; + + public DepthwiseConv2dNativeBackpropInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DepthwiseConv2dNativeBackpropInput operation. - * + * * @param scope current scope - * @param inputSizes An integer vector representing the shape of `input`, based - * on `data_format`. For example, if `data_format` is 'NHWC' then - * `input` is a 4-D `[batch, height, width, channels]` tensor. + * @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. * @param filter 4-D with shape - * `[filter_height, filter_width, in_channels, depthwise_multiplier]`. - * @param outBackprop 4-D with shape based on `data_format`. - * For example, if `data_format` is 'NHWC' then - * out_backprop shape is `[batch, out_height, out_width, out_channels]`. + * {@code [filter_height, filter_width, in_channels, depthwise_multiplier]}. + * @param outBackprop 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. * @param strides The stride of the sliding window for each dimension of the input * of the convolution. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code DepthwiseConv2dNativeBackpropInput} output and operands * @return a new instance of DepthwiseConv2dNativeBackpropInput */ - @Endpoint(describeByClass = true) - public static DepthwiseConv2dNativeBackpropInput create(Scope scope, Operand inputSizes, Operand filter, Operand outBackprop, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DepthwiseConv2dNativeBackpropInput", scope.makeOpName("DepthwiseConv2dNativeBackpropInput")); + @Endpoint( + describeByClass = true + ) + public static DepthwiseConv2dNativeBackpropInput create(Scope scope, + Operand inputSizes, Operand filter, Operand outBackprop, List strides, + String padding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DepthwiseConv2dNativeBackpropInput"); opBuilder.addInput(inputSizes.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(outBackprop.asOutput()); - opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -118,7 +99,7 @@ public static DepthwiseConv2dNativeBackpropInput create(S for (Options opts : options) { if (opts.explicitPaddings != null) { long[] explicitPaddingsArray = new long[opts.explicitPaddings.size()]; - for (int i = 0; i < explicitPaddingsArray.length; ++i) { + for (int i = 0 ; i < explicitPaddingsArray.length ; i++) { explicitPaddingsArray[i] = opts.explicitPaddings.get(i); } opBuilder.setAttr("explicit_paddings", explicitPaddingsArray); @@ -128,68 +109,251 @@ public static DepthwiseConv2dNativeBackpropInput create(S } if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new DepthwiseConv2dNativeBackpropInput(opBuilder.build()); + return new DepthwiseConv2dNativeBackpropInput<>(opBuilder.build()); } - + /** - * @param explicitPaddings + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @return this Options instance. */ public static Options explicitPaddings(List explicitPaddings) { return new Options().explicitPaddings(explicitPaddings); } - + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @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, height, width, channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, channels, height, width]. + * 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]. + * @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 - * `input`. If set to k > 1, there will be k-1 skipped cells between each filter + * {@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 - * `data_format`, see above for details. Dilations in the batch and depth + * {@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); + } + /** - * 4-D with shape according to `data_format`. For example, if - * `data_format` is 'NHWC', output shape is `[batch, in_height, - * in_width, in_channels]`. Gradient w.r.t. the input of the + * Gets output. + * 4-D with shape according to {@code data_format}. For example, if + * {@code data_format} is 'NHWC', output shape is {@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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DepthwiseConv2dNativeBackpropInput"; - - private Output output; - - private DepthwiseConv2dNativeBackpropInput(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.DepthwiseConv2dNativeBackpropInput} + */ + public static class Options { + private List explicitPaddings; + + private String dataFormat; + + private List dilations; + + private Options() { + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @return this Options instance. + */ + public Options explicitPaddings(List explicitPaddings) { + this.explicitPaddings = explicitPaddings; + return this; + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @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, height, width, channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, channels, height, 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 = 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 d87f33ca07f..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,102 +17,163 @@ 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 grayscale dilation of 4-D `input` and 3-D `filter` tensors. - *

- * The `input` tensor has shape `[batch, in_height, in_width, depth]` and the - * `filter` tensor has shape `[filter_height, filter_width, depth]`, i.e., each + * Computes the grayscale dilation of 4-D {@code input} and 3-D {@code filter} tensors. + * The {@code input} tensor has shape {@code [batch, in_height, in_width, depth]} and the + * {@code filter} tensor has shape {@code [filter_height, filter_width, depth]}, i.e., each * input channel is processed independently of the others with its own structuring - * function. The `output` tensor has shape - * `[batch, out_height, out_width, depth]`. The spatial dimensions of the output - * tensor depend on the `padding` algorithm. We currently only support the default - * "NHWC" `data_format`. - *

- * In detail, the grayscale morphological 2-D dilation is the max-sum correlation - * (for consistency with `conv2d`, we use unmirrored filters): - *

- * output[b, y, x, c] = - * max_{dy, dx} input[b, - * strides[1] * y + rates[1] * dy, - * strides[2] * x + rates[2] * dx, - * c] + - * filter[dy, dx, c] - *

- * Max-pooling is a special case when the filter has size equal to the pooling + * function. The {@code output} tensor has shape + * {@code [batch, out_height, out_width, depth]}. The spatial dimensions of the output + * tensor depend on the {@code padding} algorithm. We currently only support the default + * "NHWC" {@code data_format}. + *

In detail, the grayscale morphological 2-D dilation is the max-sum correlation + * (for consistency with {@code conv2d}, we use unmirrored filters): + *

+ * output[b, y, x, c] =
+ *    max_{dy, dx} input[b,
+ *                       strides[1] * y + rates[1] * dy,
+ *                       strides[2] * x + rates[2] * dx,
+ *                       c] +
+ *                 filter[dy, dx, c]
+ * 
+ *

Max-pooling is a special case when the filter has size equal to the pooling * kernel size and contains all zeros. - *

- * Note on duality: The dilation of `input` by the `filter` is equal to the - * negation of the erosion of `-input` by the reflected `filter`. - * - * @param data type for {@code output()} output + *

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}. */ -@Operator(group = "nn") +@OpMetadata( + opType = Dilation2d.OP_NAME, + inputsClass = Dilation2d.Inputs.class +) +@Operator( + group = "nn" +) public final class Dilation2d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Dilation2d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Dilation2D"; + + private Output output; + + public Dilation2d(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new Dilation2D operation. + * * @param scope current scope - * @param input 4-D with shape `[batch, in_height, in_width, depth]`. - * @param filter 3-D with shape `[filter_height, filter_width, depth]`. + * @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 - * tensor. Must be: `[1, stride_height, stride_width, 1]`. + * tensor. Must be: {@code [1, stride_height, stride_width, 1]}. * @param rates The input stride for atrous morphological dilation. Must be: - * `[1, rate_height, rate_width, 1]`. + * {@code [1, rate_height, rate_width, 1]}. * @param padding The type of padding algorithm to use. + * @param data type for {@code Dilation2D} output and operands * @return a new instance of Dilation2d */ - @Endpoint(describeByClass = true) - public static Dilation2d create(Scope scope, Operand input, Operand filter, List strides, List rates, String padding) { - OperationBuilder opBuilder = scope.env().opBuilder("Dilation2D", scope.makeOpName("Dilation2d")); + @Endpoint( + describeByClass = true + ) + public static Dilation2d create(Scope scope, Operand input, + Operand filter, List strides, List rates, String padding) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Dilation2d"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); - opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); long[] ratesArray = new long[rates.size()]; - for (int i = 0; i < ratesArray.length; ++i) { + for (int i = 0 ; i < ratesArray.length ; i++) { ratesArray[i] = rates.get(i); } opBuilder.setAttr("rates", ratesArray); opBuilder.setAttr("padding", padding); - return new Dilation2d(opBuilder.build()); + return new Dilation2d<>(opBuilder.build()); } - + /** - * 4-D with shape `[batch, out_height, out_width, depth]`. + * Gets output. + * 4-D with shape {@code [batch, out_height, out_width, depth]}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Dilation2D"; - - private Output output; - - private Dilation2d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 c4e1d45a440..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,80 +17,151 @@ 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 filterBackprop()} output */ -@Operator(group = "nn") +@OpMetadata( + opType = Dilation2dBackpropFilter.OP_NAME, + inputsClass = Dilation2dBackpropFilter.Inputs.class +) +@Operator( + group = "nn" +) public final class Dilation2dBackpropFilter extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Dilation2dBackpropFilter operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Dilation2DBackpropFilter"; + + private Output filterBackprop; + + public Dilation2dBackpropFilter(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + filterBackprop = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new Dilation2DBackpropFilter operation. + * * @param scope current scope - * @param input 4-D with shape `[batch, in_height, in_width, depth]`. - * @param filter 3-D with shape `[filter_height, filter_width, depth]`. - * @param outBackprop 4-D with shape `[batch, out_height, out_width, depth]`. + * @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]}. * @param strides 1-D of length 4. The stride of the sliding window for each dimension of - * the input tensor. Must be: `[1, stride_height, stride_width, 1]`. + * the input tensor. Must be: {@code [1, stride_height, stride_width, 1]}. * @param rates 1-D of length 4. The input stride for atrous morphological dilation. - * Must be: `[1, rate_height, rate_width, 1]`. + * Must be: {@code [1, rate_height, rate_width, 1]}. * @param padding The type of padding algorithm to use. + * @param data type for {@code Dilation2DBackpropFilter} output and operands * @return a new instance of Dilation2dBackpropFilter */ - @Endpoint(describeByClass = true) - public static Dilation2dBackpropFilter create(Scope scope, Operand input, Operand filter, Operand outBackprop, List strides, List rates, String padding) { - OperationBuilder opBuilder = scope.env().opBuilder("Dilation2DBackpropFilter", scope.makeOpName("Dilation2dBackpropFilter")); + @Endpoint( + describeByClass = true + ) + public static Dilation2dBackpropFilter create(Scope scope, + Operand input, Operand filter, Operand outBackprop, List strides, + List rates, String padding) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Dilation2dBackpropFilter"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(outBackprop.asOutput()); - opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); long[] ratesArray = new long[rates.size()]; - for (int i = 0; i < ratesArray.length; ++i) { + for (int i = 0 ; i < ratesArray.length ; i++) { ratesArray[i] = rates.get(i); } opBuilder.setAttr("rates", ratesArray); opBuilder.setAttr("padding", padding); - return new Dilation2dBackpropFilter(opBuilder.build()); + return new Dilation2dBackpropFilter<>(opBuilder.build()); } - + /** - * 3-D with shape `[filter_height, filter_width, depth]`. + * Gets filterBackprop. + * 3-D with shape {@code [filter_height, filter_width, depth]}. + * @return filterBackprop. */ public Output filterBackprop() { return filterBackprop; } - + @Override public Output asOutput() { return filterBackprop; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Dilation2DBackpropFilter"; - - private Output filterBackprop; - - private Dilation2dBackpropFilter(Operation operation) { - super(operation); - int outputIdx = 0; - filterBackprop = operation.output(outputIdx++); + + @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 3f6bb100bc5..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,80 +17,151 @@ 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 inBackprop()} output */ -@Operator(group = "nn") +@OpMetadata( + opType = Dilation2dBackpropInput.OP_NAME, + inputsClass = Dilation2dBackpropInput.Inputs.class +) +@Operator( + group = "nn" +) public final class Dilation2dBackpropInput extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Dilation2dBackpropInput operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Dilation2DBackpropInput"; + + private Output inBackprop; + + public Dilation2dBackpropInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + inBackprop = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new Dilation2DBackpropInput operation. + * * @param scope current scope - * @param input 4-D with shape `[batch, in_height, in_width, depth]`. - * @param filter 3-D with shape `[filter_height, filter_width, depth]`. - * @param outBackprop 4-D with shape `[batch, out_height, out_width, depth]`. + * @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]}. * @param strides 1-D of length 4. The stride of the sliding window for each dimension of - * the input tensor. Must be: `[1, stride_height, stride_width, 1]`. + * the input tensor. Must be: {@code [1, stride_height, stride_width, 1]}. * @param rates 1-D of length 4. The input stride for atrous morphological dilation. - * Must be: `[1, rate_height, rate_width, 1]`. + * Must be: {@code [1, rate_height, rate_width, 1]}. * @param padding The type of padding algorithm to use. + * @param data type for {@code Dilation2DBackpropInput} output and operands * @return a new instance of Dilation2dBackpropInput */ - @Endpoint(describeByClass = true) - public static Dilation2dBackpropInput create(Scope scope, Operand input, Operand filter, Operand outBackprop, List strides, List rates, String padding) { - OperationBuilder opBuilder = scope.env().opBuilder("Dilation2DBackpropInput", scope.makeOpName("Dilation2dBackpropInput")); + @Endpoint( + describeByClass = true + ) + public static Dilation2dBackpropInput create(Scope scope, Operand input, + Operand filter, Operand outBackprop, List strides, List rates, + String padding) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Dilation2dBackpropInput"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(outBackprop.asOutput()); - opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); long[] ratesArray = new long[rates.size()]; - for (int i = 0; i < ratesArray.length; ++i) { + for (int i = 0 ; i < ratesArray.length ; i++) { ratesArray[i] = rates.get(i); } opBuilder.setAttr("rates", ratesArray); opBuilder.setAttr("padding", padding); - return new Dilation2dBackpropInput(opBuilder.build()); + return new Dilation2dBackpropInput<>(opBuilder.build()); } - + /** - * 4-D with shape `[batch, in_height, in_width, depth]`. + * Gets inBackprop. + * 4-D with shape {@code [batch, in_height, in_width, depth]}. + * @return inBackprop. */ public Output inBackprop() { return inBackprop; } - + @Override public Output asOutput() { return inBackprop; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Dilation2DBackpropInput"; - - private Output inBackprop; - - private Dilation2dBackpropInput(Operation operation) { - super(operation); - int outputIdx = 0; - inBackprop = operation.output(outputIdx++); + + @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 86012a4c4ef..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,61 +17,116 @@ 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 exponential linear: `exp(features) - 1` if < 0, `features` otherwise. - *

- * See [Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs) - * ](http://arxiv.org/abs/1511.07289) - * - * @param data type for {@code activations()} output + * Computes the exponential linear function. + * The ELU function is defined as: + *

    + *
  • $ e ^ x - 1 $ if $ x < 0 $
  • + *
  • $ x $ if $ x >= 0 $
  • + *
+ *

Examples: + *

+ *
+ *
+ *

tf.nn.elu(1.0) + * <tf.Tensor: shape=(), dtype=float32, numpy=1.0> + * tf.nn.elu(0.0) + * <tf.Tensor: shape=(), dtype=float32, numpy=0.0> + * tf.nn.elu(-1000.0) + * <tf.Tensor: shape=(), dtype=float32, numpy=-1.0> + *

+ *
+ *
+ *

See Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs) + * */ -@Operator(group = "nn") +@OpMetadata( + opType = Elu.OP_NAME, + inputsClass = Elu.Inputs.class +) +@Operator( + group = "nn" +) public final class Elu extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Elu"; + + private Output activations; + + public Elu(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + activations = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Elu operation. - * + * * @param scope current scope - * @param features + * @param features The features value + * @param data type for {@code Elu} output and operands * @return a new instance of Elu */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Elu create(Scope scope, Operand features) { - OperationBuilder opBuilder = scope.env().opBuilder("Elu", scope.makeOpName("Elu")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Elu"); opBuilder.addInput(features.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Elu(opBuilder.build()); + return new Elu<>(opBuilder.build()); } - + /** + * Gets activations. + * + * @return activations. */ public Output activations() { return activations; } - + @Override public Output asOutput() { return activations; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Elu"; - - private Output activations; - - private Elu(Operation operation) { - super(operation); - int outputIdx = 0; - activations = operation.output(outputIdx++); + + @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 4771374123e..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,61 +17,106 @@ 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 + */ + public static final String OP_NAME = "EluGrad"; + + private Output backprops; + + public EluGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + backprops = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new EluGrad operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static EluGrad create(Scope scope, Operand gradients, Operand outputs) { - OperationBuilder opBuilder = scope.env().opBuilder("EluGrad", scope.makeOpName("EluGrad")); + @Endpoint( + describeByClass = true + ) + public static EluGrad create(Scope scope, Operand gradients, + Operand outputs) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "EluGrad"); opBuilder.addInput(gradients.asOutput()); opBuilder.addInput(outputs.asOutput()); - opBuilder = scope.apply(opBuilder); - return new EluGrad(opBuilder.build()); + return new EluGrad<>(opBuilder.build()); } - + /** - * The gradients: `gradients * (outputs + 1)` if outputs < 0, - * `gradients` otherwise. + * Gets backprops. + * The gradients: {@code gradients * (outputs + 1)} if outputs < 0, + * {@code gradients} otherwise. + * @return backprops. */ public Output backprops() { return backprops; } - + @Override public Output asOutput() { return backprops; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EluGrad"; - - private Output backprops; - - private EluGrad(Operation operation) { - super(operation); - int outputIdx = 0; - backprops = operation.output(outputIdx++); + + @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 6e72e03eb38..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. @@ -17,143 +17,67 @@ 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.types.TFloat32; import org.tensorflow.types.TInt64; /** * Generates labels for candidate sampling with a learned unigram distribution. - *

* A unigram sampler could use a fixed unigram distribution read from a * file or passed in as an in-memory array instead of building up the distribution * from data on the fly. There is also an option to skew the distribution by * applying a distortion power to the weights. - *

- * The vocabulary file should be in CSV-like format, with the last field + *

The vocabulary file should be in CSV-like format, with the last field * being the weight associated with the word. - *

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

- * The advantages of sampling candidates per-batch are simplicity and the + *

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. */ -@Operator(group = "nn") +@OpMetadata( + opType = FixedUnigramCandidateSampler.OP_NAME, + inputsClass = FixedUnigramCandidateSampler.Inputs.class +) +@Operator( + group = "nn" +) public final class FixedUnigramCandidateSampler extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.FixedUnigramCandidateSampler} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param vocabFile 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 Options vocabFile(String vocabFile) { - this.vocabFile = vocabFile; - return this; - } - - /** - * @param distortion 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 Options distortion(Float distortion) { - this.distortion = distortion; - return this; - } - - /** - * @param numReservedIds 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 Options numReservedIds(Long numReservedIds) { - this.numReservedIds = numReservedIds; - return this; - } - - /** - * @param 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 'shard') indicates the number of partitions that are being - * used in the overall computation. - */ - public Options numShards(Long numShards) { - this.numShards = numShards; - return this; - } - - /** - * @param shard 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 Options shard(Long shard) { - this.shard = shard; - return this; - } - - /** - * @param unigrams 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 Options unigrams(List unigrams) { - this.unigrams = unigrams; - return this; - } - - /** - * @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. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 An second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private String vocabFile; - private Float distortion; - private Long numReservedIds; - private Long numShards; - private Long shard; - private List unigrams; - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "FixedUnigramCandidateSampler"; + + private Output sampledCandidates; + + private Output trueExpectedCount; + + private Output sampledExpectedCount; + + public FixedUnigramCandidateSampler(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 FixedUnigramCandidateSampler 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. @@ -163,14 +87,16 @@ private Options() { * 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 attributes values + * @param options carries optional attribute values * @return a new instance of FixedUnigramCandidateSampler */ - @Endpoint(describeByClass = true) - public static FixedUnigramCandidateSampler create(Scope scope, Operand trueClasses, Long numTrue, Long numSampled, Boolean unique, Long rangeMax, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("FixedUnigramCandidateSampler", scope.makeOpName("FixedUnigramCandidateSampler")); + @Endpoint( + describeByClass = true + ) + public static FixedUnigramCandidateSampler create(Scope scope, Operand trueClasses, + Long numTrue, Long numSampled, Boolean unique, Long rangeMax, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FixedUnigramCandidateSampler"); opBuilder.addInput(trueClasses.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_true", numTrue); opBuilder.setAttr("num_sampled", numSampled); opBuilder.setAttr("unique", unique); @@ -194,7 +120,7 @@ public static FixedUnigramCandidateSampler create(Scope scope, Operand t } if (opts.unigrams != null) { float[] unigramsArray = new float[opts.unigrams.size()]; - for (int i = 0; i < unigramsArray.length; ++i) { + for (int i = 0 ; i < unigramsArray.length ; i++) { unigramsArray[i] = opts.unigrams.get(i); } opBuilder.setAttr("unigrams", unigramsArray); @@ -209,121 +135,400 @@ public static FixedUnigramCandidateSampler create(Scope scope, Operand t } return new FixedUnigramCandidateSampler(opBuilder.build()); } - + /** + * Sets the vocabFile option. + * * @param vocabFile 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. + * @return this Options instance. */ public static Options vocabFile(String vocabFile) { return new Options().vocabFile(vocabFile); } - + /** + * Sets the distortion option. + * * @param distortion 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. + * @return this Options instance. */ public static Options distortion(Float distortion) { return new Options().distortion(distortion); } - + /** + * Sets the numReservedIds option. + * * @param numReservedIds 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. + * @return this Options instance. */ public static Options numReservedIds(Long numReservedIds) { return new Options().numReservedIds(numReservedIds); } - + /** + * Sets the numShards option. + * * @param 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 'shard') indicates the number of partitions that are being * used in the overall computation. + * @return this Options instance. */ public static Options numShards(Long numShards) { return new Options().numShards(numShards); } - + /** + * Sets the shard option. + * * @param shard 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. + * @return this Options instance. */ public static Options shard(Long shard) { return new Options().shard(shard); } - + /** + * Sets the unigrams option. + * * @param unigrams 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. + * @return this Options instance. */ public static Options unigrams(List unigrams) { return new Options().unigrams(unigrams); } - + /** + * Sets the unigrams option. + * + * @param unigrams 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. + * @return this Options instance. + */ + public static Options unigrams(Float... unigrams) { + return new Options().unigrams(unigrams); + } + + /** + * 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FixedUnigramCandidateSampler"; - - private Output sampledCandidates; - private Output trueExpectedCount; - private Output sampledExpectedCount; - - private FixedUnigramCandidateSampler(Operation operation) { - super(operation); - int outputIdx = 0; - sampledCandidates = operation.output(outputIdx++); - trueExpectedCount = operation.output(outputIdx++); - sampledExpectedCount = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.FixedUnigramCandidateSampler} + */ + public static class Options { + private String vocabFile; + + private Float distortion; + + private Long numReservedIds; + + private Long numShards; + + private Long shard; + + private List unigrams; + + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the vocabFile option. + * + * @param vocabFile 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. + * @return this Options instance. + */ + public Options vocabFile(String vocabFile) { + this.vocabFile = vocabFile; + return this; + } + + /** + * Sets the distortion option. + * + * @param distortion 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. + * @return this Options instance. + */ + public Options distortion(Float distortion) { + this.distortion = distortion; + return this; + } + + /** + * Sets the numReservedIds option. + * + * @param numReservedIds 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. + * @return this Options instance. + */ + public Options numReservedIds(Long numReservedIds) { + this.numReservedIds = numReservedIds; + return this; + } + + /** + * Sets the numShards option. + * + * @param 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 'shard') indicates the number of partitions that are being + * used in the overall computation. + * @return this Options instance. + */ + public Options numShards(Long numShards) { + this.numShards = numShards; + return this; + } + + /** + * Sets the shard option. + * + * @param shard 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. + * @return this Options instance. + */ + public Options shard(Long shard) { + this.shard = shard; + return this; + } + + /** + * Sets the unigrams option. + * + * @param unigrams 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. + * @return this Options instance. + */ + public Options unigrams(List unigrams) { + this.unigrams = unigrams; + return this; + } + + /** + * Sets the unigrams option. + * + * @param unigrams 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. + * @return this Options instance. + */ + public Options unigrams(Float... unigrams) { + this.unigrams = Arrays.asList(unigrams); + return this; + } + + /** + * 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 = 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 a9bddf8774c..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,122 +17,82 @@ 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; /** * Performs fractional average pooling on the input. - *

* Fractional average pooling is similar to Fractional max pooling in the pooling * region generation step. The only difference is that after pooling regions are * generated, a mean operation is performed instead of a max operation in each * pooling region. - * - * @param data type for {@code output()} output */ -@Operator(group = "nn") +@OpMetadata( + opType = FractionalAvgPool.OP_NAME, + inputsClass = FractionalAvgPool.Inputs.class +) +@Operator( + group = "nn" +) public final class FractionalAvgPool extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.FractionalAvgPool} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param pseudoRandom When set to True, generates the pooling sequence in a - * pseudorandom fashion, otherwise, in a random fashion. Check paper [Benjamin - * Graham, Fractional Max-Pooling](http://arxiv.org/abs/1412.6071) for - * difference between pseudorandom and random. - */ - public Options pseudoRandom(Boolean pseudoRandom) { - this.pseudoRandom = pseudoRandom; - return this; - } - - /** - * @param overlapping When set to True, it means when pooling, the values at the boundary - * of adjacent pooling cells are used by both cells. For example: - *

- * `index 0 1 2 3 4` - *

- * `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 Options overlapping(Boolean overlapping) { - this.overlapping = overlapping; - return this; - } - - /** - * @param deterministic 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 Options deterministic(Boolean deterministic) { - this.deterministic = deterministic; - return this; - } - - /** - * @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. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 An second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Boolean pseudoRandom; - private Boolean overlapping; - private Boolean deterministic; - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "FractionalAvgPool"; + + private Output output; + + private Output rowPoolingSequence; + + private Output colPoolingSequence; + + public FractionalAvgPool(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + rowPoolingSequence = operation.output(outputIdx++); + colPoolingSequence = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new FractionalAvgPool operation. - * + * * @param scope current scope - * @param value 4-D with shape `[batch, height, width, channels]`. - * @param poolingRatio Pooling ratio for each dimension of `value`, currently only - * supports row and col dimension and should be >= 1.0. For example, a valid + * @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 * 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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code FractionalAvgPool} output and operands * @return a new instance of FractionalAvgPool */ - @Endpoint(describeByClass = true) - public static FractionalAvgPool create(Scope scope, Operand value, List poolingRatio, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("FractionalAvgPool", scope.makeOpName("FractionalAvgPool")); + @Endpoint( + describeByClass = true + ) + public static FractionalAvgPool create(Scope scope, Operand value, + List poolingRatio, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FractionalAvgPool"); opBuilder.addInput(value.asOutput()); - opBuilder = scope.apply(opBuilder); float[] poolingRatioArray = new float[poolingRatio.size()]; - for (int i = 0; i < poolingRatioArray.length; ++i) { + for (int i = 0 ; i < poolingRatioArray.length ; i++) { poolingRatioArray[i] = poolingRatio.get(i); } opBuilder.setAttr("pooling_ratio", poolingRatioArray); @@ -155,92 +115,255 @@ public static FractionalAvgPool create(Scope scope, Opera } } } - return new FractionalAvgPool(opBuilder.build()); + return new FractionalAvgPool<>(opBuilder.build()); } - + /** + * Sets the pseudoRandom option. + * * @param pseudoRandom When set to True, generates the pooling sequence in a - * pseudorandom fashion, otherwise, in a random fashion. Check paper [Benjamin - * Graham, Fractional Max-Pooling](http://arxiv.org/abs/1412.6071) for + * pseudorandom fashion, otherwise, in a random fashion. Check paper Benjamin + * Graham, Fractional Max-Pooling for * difference between pseudorandom and random. + * @return this Options instance. */ public static Options pseudoRandom(Boolean pseudoRandom) { return new Options().pseudoRandom(pseudoRandom); } - + /** + * Sets the overlapping option. + * * @param overlapping When set to True, it means when pooling, the values at the boundary * of adjacent pooling cells are used by both cells. For example: - *

- * `index 0 1 2 3 4` - *

- * `value 20 5 16 3 7` - *

- * If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. + *

{@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. + * @return this Options instance. */ public static Options overlapping(Boolean overlapping) { return new Options().overlapping(overlapping); } - + /** + * Sets the deterministic option. + * * @param deterministic 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. + * @return this Options instance. */ public static Options deterministic(Boolean deterministic) { return new Options().deterministic(deterministic); } - + /** + * 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 output. * output tensor after fractional avg pooling. + * @return output. */ public Output output() { return output; } - + /** + * Gets rowPoolingSequence. * row pooling sequence, needed to calculate gradient. + * @return rowPoolingSequence. */ public Output rowPoolingSequence() { return rowPoolingSequence; } - + /** + * Gets colPoolingSequence. * column pooling sequence, needed to calculate gradient. + * @return colPoolingSequence. */ public Output colPoolingSequence() { return colPoolingSequence; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FractionalAvgPool"; - - private Output output; - private Output rowPoolingSequence; - private Output colPoolingSequence; - - private FractionalAvgPool(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - rowPoolingSequence = operation.output(outputIdx++); - colPoolingSequence = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.FractionalAvgPool} + */ + public static class Options { + private Boolean pseudoRandom; + + private Boolean overlapping; + + private Boolean deterministic; + + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the pseudoRandom option. + * + * @param pseudoRandom 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. + * @return this Options instance. + */ + public Options pseudoRandom(Boolean pseudoRandom) { + this.pseudoRandom = pseudoRandom; + return this; + } + + /** + * Sets the overlapping option. + * + * @param overlapping 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. + * @return this Options instance. + */ + public Options overlapping(Boolean overlapping) { + this.overlapping = overlapping; + return this; + } + + /** + * Sets the deterministic option. + * + * @param deterministic 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. + * @return this Options instance. + */ + public Options deterministic(Boolean deterministic) { + this.deterministic = deterministic; + return this; + } + + /** + * 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 = 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 094ce640a09..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,79 +17,78 @@ 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 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 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 { - /** - * Optional attributes for {@link org.tensorflow.op.nn.FractionalAvgPoolGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param overlapping When set to True, it means when pooling, the values at the boundary - * of adjacent pooling cells are used by both cells. For example: - *

- * `index 0 1 2 3 4` - *

- * `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 Options overlapping(Boolean overlapping) { - this.overlapping = overlapping; - return this; - } - - private Boolean overlapping; - - private Options() { - } + public static final String OP_NAME = "FractionalAvgPoolGrad"; + + private Output output; + + public FractionalAvgPoolGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new FractionalAvgPoolGrad operation. - * + * * @param scope current scope - * @param origInputTensorShape Original input tensor shape for `fractional_avg_pool` - * @param outBackprop 4-D with shape `[batch, height, width, channels]`. Gradients - * w.r.t. the output of `fractional_avg_pool`. + * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code FractionalAvgPoolGrad} output and operands * @return a new instance of FractionalAvgPoolGrad */ - @Endpoint(describeByClass = true) - public static FractionalAvgPoolGrad create(Scope scope, Operand origInputTensorShape, Operand outBackprop, Operand rowPoolingSequence, Operand colPoolingSequence, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("FractionalAvgPoolGrad", scope.makeOpName("FractionalAvgPoolGrad")); + @Endpoint( + describeByClass = true + ) + public static FractionalAvgPoolGrad create(Scope scope, + Operand origInputTensorShape, Operand outBackprop, + Operand rowPoolingSequence, Operand colPoolingSequence, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FractionalAvgPoolGrad"); opBuilder.addInput(origInputTensorShape.asOutput()); opBuilder.addInput(outBackprop.asOutput()); opBuilder.addInput(rowPoolingSequence.asOutput()); opBuilder.addInput(colPoolingSequence.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.overlapping != null) { @@ -97,44 +96,115 @@ public static FractionalAvgPoolGrad create(Scope scope, O } } } - return new FractionalAvgPoolGrad(opBuilder.build()); + return new FractionalAvgPoolGrad<>(opBuilder.build()); } - + /** + * Sets the overlapping option. + * * @param overlapping When set to True, it means when pooling, the values at the boundary * of adjacent pooling cells are used by both cells. For example: - *

- * `index 0 1 2 3 4` - *

- * `value 20 5 16 3 7` - *

- * If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. + *

{@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. + * @return this Options instance. */ public static Options overlapping(Boolean overlapping) { return new Options().overlapping(overlapping); } - + /** - * 4-D. Gradients w.r.t. the input of `fractional_avg_pool`. + * Gets output. + * 4-D. Gradients w.r.t. the input of {@code fractional_avg_pool}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FractionalAvgPoolGrad"; - - private Output output; - - private FractionalAvgPoolGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.FractionalAvgPoolGrad} + */ + public static class Options { + private Boolean overlapping; + + private Options() { + } + + /** + * Sets the overlapping option. + * + * @param overlapping 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. + * @return this Options instance. + */ + public Options overlapping(Boolean overlapping) { + this.overlapping = 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 86c7e204757..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,146 +17,104 @@ 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; /** * Performs fractional max pooling on the input. - *

* Fractional max pooling is slightly different than regular max pooling. In * regular max pooling, you downsize an input set by taking the maximum value of * smaller N x N subsections of the set (often 2x2), and try to reduce the set by * a factor of N, where N is an integer. Fractional max pooling, as you might - * expect from the word "fractional", means that the overall reduction ratio N + * expect from the word "fractional", means that the overall reduction ratio N * does not have to be an integer. - *

- * The sizes of the pooling regions are generated randomly but are fairly uniform. + *

The sizes of the pooling regions are generated randomly but are fairly uniform. * For example, let's look at the height dimension, and the constraints on the * list of rows that will be pool boundaries. - *

- * First we define the following: - *

- * 1. input_row_length : the number of rows from the input set - * 2. output_row_length : which will be smaller than the input - * 3. alpha = input_row_length / output_row_length : our reduction ratio - * 4. K = floor(alpha) - * 5. row_pooling_sequence : this is the result list of pool boundary rows - *

- * Then, row_pooling_sequence should satisfy: - *

- * 1. a[0] = 0 : the first value of the sequence is 0 - * 2. a[end] = input_row_length : the last value of the sequence is the size - * 3. K <= (a[i+1] - a[i]) <= K+1 : all intervals are K or K+1 size - * 4. length(row_pooling_sequence) = output_row_length+1 - *

- * For more details on fractional max pooling, see this paper: - * [Benjamin Graham, Fractional Max-Pooling](http://arxiv.org/abs/1412.6071) - * - * @param data type for {@code output()} output + *

First we define the following: + *

    + *
  1. input_row_length : the number of rows from the input set
  2. + *
  3. output_row_length : which will be smaller than the input
  4. + *
  5. alpha = input_row_length / output_row_length : our reduction ratio
  6. + *
  7. K = floor(alpha)
  8. + *
  9. row_pooling_sequence : this is the result list of pool boundary rows
  10. + *
+ *

Then, row_pooling_sequence should satisfy: + *

    + *
  1. a[0] = 0 : the first value of the sequence is 0
  2. + *
  3. a[end] = input_row_length : the last value of the sequence is the size
  4. + *
  5. K <= (a[i+1] - a[i]) <= K+1 : all intervals are K or K+1 size
  6. + *
  7. length(row_pooling_sequence) = output_row_length+1
  8. + *
+ *

For more details on fractional max pooling, see this paper: + * Benjamin Graham, Fractional Max-Pooling */ -@Operator(group = "nn") +@OpMetadata( + opType = FractionalMaxPool.OP_NAME, + inputsClass = FractionalMaxPool.Inputs.class +) +@Operator( + group = "nn" +) public final class FractionalMaxPool extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.FractionalMaxPool} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param pseudoRandom When set to True, generates the pooling sequence in a - * pseudorandom fashion, otherwise, in a random fashion. Check paper [Benjamin - * Graham, Fractional Max-Pooling](http://arxiv.org/abs/1412.6071) for - * difference between pseudorandom and random. - */ - public Options pseudoRandom(Boolean pseudoRandom) { - this.pseudoRandom = pseudoRandom; - return this; - } - - /** - * @param overlapping When set to True, it means when pooling, the values at the boundary - * of adjacent pooling cells are used by both cells. For example: - *

- * `index 0 1 2 3 4` - *

- * `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 Options overlapping(Boolean overlapping) { - this.overlapping = overlapping; - return this; - } - - /** - * @param deterministic 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 Options deterministic(Boolean deterministic) { - this.deterministic = deterministic; - return this; - } - - /** - * @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. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 An second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Boolean pseudoRandom; - private Boolean overlapping; - private Boolean deterministic; - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "FractionalMaxPool"; + + private Output output; + + private Output rowPoolingSequence; + + private Output colPoolingSequence; + + public FractionalMaxPool(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + rowPoolingSequence = operation.output(outputIdx++); + colPoolingSequence = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new FractionalMaxPool operation. - * + * * @param scope current scope - * @param value 4-D with shape `[batch, height, width, channels]`. - * @param poolingRatio Pooling ratio for each dimension of `value`, currently only - * supports row and col dimension and should be >= 1.0. For example, a valid + * @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 * 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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code FractionalMaxPool} output and operands * @return a new instance of FractionalMaxPool */ - @Endpoint(describeByClass = true) - public static FractionalMaxPool create(Scope scope, Operand value, List poolingRatio, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("FractionalMaxPool", scope.makeOpName("FractionalMaxPool")); + @Endpoint( + describeByClass = true + ) + public static FractionalMaxPool create(Scope scope, Operand value, + List poolingRatio, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FractionalMaxPool"); opBuilder.addInput(value.asOutput()); - opBuilder = scope.apply(opBuilder); float[] poolingRatioArray = new float[poolingRatio.size()]; - for (int i = 0; i < poolingRatioArray.length; ++i) { + for (int i = 0 ; i < poolingRatioArray.length ; i++) { poolingRatioArray[i] = poolingRatio.get(i); } opBuilder.setAttr("pooling_ratio", poolingRatioArray); @@ -179,92 +137,255 @@ public static FractionalMaxPool create(Scope scope, Opera } } } - return new FractionalMaxPool(opBuilder.build()); + return new FractionalMaxPool<>(opBuilder.build()); } - + /** + * Sets the pseudoRandom option. + * * @param pseudoRandom When set to True, generates the pooling sequence in a - * pseudorandom fashion, otherwise, in a random fashion. Check paper [Benjamin - * Graham, Fractional Max-Pooling](http://arxiv.org/abs/1412.6071) for + * pseudorandom fashion, otherwise, in a random fashion. Check paper Benjamin + * Graham, Fractional Max-Pooling for * difference between pseudorandom and random. + * @return this Options instance. */ public static Options pseudoRandom(Boolean pseudoRandom) { return new Options().pseudoRandom(pseudoRandom); } - + /** + * Sets the overlapping option. + * * @param overlapping When set to True, it means when pooling, the values at the boundary * of adjacent pooling cells are used by both cells. For example: - *

- * `index 0 1 2 3 4` - *

- * `value 20 5 16 3 7` - *

- * If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. + *

{@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. + * @return this Options instance. */ public static Options overlapping(Boolean overlapping) { return new Options().overlapping(overlapping); } - + /** + * Sets the deterministic option. + * * @param deterministic 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. + * @return this Options instance. */ public static Options deterministic(Boolean deterministic) { return new Options().deterministic(deterministic); } - + /** + * 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 output. * output tensor after fractional max pooling. + * @return output. */ public Output output() { return output; } - + /** + * Gets rowPoolingSequence. * row pooling sequence, needed to calculate gradient. + * @return rowPoolingSequence. */ public Output rowPoolingSequence() { return rowPoolingSequence; } - + /** + * Gets colPoolingSequence. * column pooling sequence, needed to calculate gradient. + * @return colPoolingSequence. */ public Output colPoolingSequence() { return colPoolingSequence; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FractionalMaxPool"; - - private Output output; - private Output rowPoolingSequence; - private Output colPoolingSequence; - - private FractionalMaxPool(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - rowPoolingSequence = operation.output(outputIdx++); - colPoolingSequence = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.FractionalMaxPool} + */ + public static class Options { + private Boolean pseudoRandom; + + private Boolean overlapping; + + private Boolean deterministic; + + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the pseudoRandom option. + * + * @param pseudoRandom 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. + * @return this Options instance. + */ + public Options pseudoRandom(Boolean pseudoRandom) { + this.pseudoRandom = pseudoRandom; + return this; + } + + /** + * Sets the overlapping option. + * + * @param overlapping 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. + * @return this Options instance. + */ + public Options overlapping(Boolean overlapping) { + this.overlapping = overlapping; + return this; + } + + /** + * Sets the deterministic option. + * + * @param deterministic 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. + * @return this Options instance. + */ + public Options deterministic(Boolean deterministic) { + this.deterministic = deterministic; + return this; + } + + /** + * 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 = 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 e059e233e05..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,75 +17,75 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.nn.FractionalMaxPoolGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param overlapping When set to True, it means when pooling, the values at the boundary - * of adjacent pooling cells are used by both cells. For example: - *

- * `index 0 1 2 3 4` - *

- * `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 Options overlapping(Boolean overlapping) { - this.overlapping = overlapping; - return this; - } - - private Boolean overlapping; - - private Options() { - } + public static final String OP_NAME = "FractionalMaxPoolGrad"; + + private Output output; + + public FractionalMaxPoolGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new FractionalMaxPoolGrad operation. - * + * * @param scope current scope - * @param origInput Original input for `fractional_max_pool` - * @param origOutput Original output for `fractional_max_pool` - * @param outBackprop 4-D with shape `[batch, height, width, channels]`. Gradients - * w.r.t. the output of `fractional_max_pool`. + * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code FractionalMaxPoolGrad} output and operands * @return a new instance of FractionalMaxPoolGrad */ - @Endpoint(describeByClass = true) - public static FractionalMaxPoolGrad create(Scope scope, Operand origInput, Operand origOutput, Operand outBackprop, Operand rowPoolingSequence, Operand colPoolingSequence, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("FractionalMaxPoolGrad", scope.makeOpName("FractionalMaxPoolGrad")); + @Endpoint( + describeByClass = true + ) + public static FractionalMaxPoolGrad create(Scope scope, + Operand origInput, Operand origOutput, Operand outBackprop, + Operand rowPoolingSequence, Operand colPoolingSequence, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FractionalMaxPoolGrad"); opBuilder.addInput(origInput.asOutput()); opBuilder.addInput(origOutput.asOutput()); opBuilder.addInput(outBackprop.asOutput()); opBuilder.addInput(rowPoolingSequence.asOutput()); opBuilder.addInput(colPoolingSequence.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.overlapping != null) { @@ -93,44 +93,121 @@ public static FractionalMaxPoolGrad create(Scope scope, O } } } - return new FractionalMaxPoolGrad(opBuilder.build()); + return new FractionalMaxPoolGrad<>(opBuilder.build()); } - + /** + * Sets the overlapping option. + * * @param overlapping When set to True, it means when pooling, the values at the boundary * of adjacent pooling cells are used by both cells. For example: - *

- * `index 0 1 2 3 4` - *

- * `value 20 5 16 3 7` - *

- * If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. + *

{@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. + * @return this Options instance. */ public static Options overlapping(Boolean overlapping) { return new Options().overlapping(overlapping); } - + /** - * 4-D. Gradients w.r.t. the input of `fractional_max_pool`. + * Gets output. + * 4-D. Gradients w.r.t. the input of {@code fractional_max_pool}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FractionalMaxPoolGrad"; - - private Output output; - - private FractionalMaxPoolGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.FractionalMaxPoolGrad} + */ + public static class Options { + private Boolean overlapping; + + private Options() { + } + + /** + * Sets the overlapping option. + * + * @param overlapping 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. + * @return this Options instance. + */ + public Options overlapping(Boolean overlapping) { + this.overlapping = 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 29a6c2bdad3..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,78 +17,66 @@ 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". + * 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 batchMean()} output */ -@Operator(group = "nn") +@OpMetadata( + opType = FusedBatchNorm.OP_NAME, + inputsClass = FusedBatchNorm.Inputs.class +) +@Operator( + group = "nn" +) public final class FusedBatchNorm extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.FusedBatchNorm} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param epsilon A small float number added to the variance of x. - */ - public Options epsilon(Float epsilon) { - this.epsilon = epsilon; - return this; - } - - /** - * @param exponentialAvgFactor - */ - public Options exponentialAvgFactor(Float exponentialAvgFactor) { - this.exponentialAvgFactor = exponentialAvgFactor; - return this; - } - - /** - * @param dataFormat The data format for x and y. Either "NHWC" (default) or "NCHW". - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * @param isTraining A bool value to indicate the operation is for training (default) - * or inference. - */ - public Options isTraining(Boolean isTraining) { - this.isTraining = isTraining; - return this; - } - - private Float epsilon; - private Float exponentialAvgFactor; - private String dataFormat; - private Boolean isTraining; - - private Options() { - } + public static final String OP_NAME = "FusedBatchNormV3"; + + private Output y; + + private Output batchMean; + + private Output batchVariance; + + private Output reserveSpace1; + + private Output reserveSpace2; + + private Output reserveSpace3; + + public FusedBatchNorm(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + batchMean = operation.output(outputIdx++); + batchVariance = operation.output(outputIdx++); + reserveSpace1 = operation.output(outputIdx++); + reserveSpace2 = operation.output(outputIdx++); + reserveSpace3 = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new FusedBatchNorm operation. - * + * Factory method to create a class wrapping a new FusedBatchNormV3 operation. + * * @param scope current scope * @param x A 4D Tensor for input data. * @param scale A 1D Tensor for scaling factor, to scale the normalized x. @@ -97,18 +85,23 @@ private Options() { * must be empty for training. * @param variance A 1D Tensor for population variance. Used for inference only; * must be empty for training. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code FusedBatchNormV3} output and operands + * @param data type for {@code FusedBatchNormV3} output and operands * @return a new instance of FusedBatchNorm */ - @Endpoint(describeByClass = true) - public static FusedBatchNorm create(Scope scope, Operand x, Operand scale, Operand offset, Operand mean, Operand variance, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("FusedBatchNormV3", scope.makeOpName("FusedBatchNorm")); + @Endpoint( + describeByClass = true + ) + public static FusedBatchNorm create(Scope scope, + Operand x, Operand scale, Operand offset, Operand mean, Operand variance, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FusedBatchNorm"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(scale.asOutput()); opBuilder.addInput(offset.asOutput()); opBuilder.addInput(mean.asOutput()); opBuilder.addInput(variance.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.epsilon != null) { @@ -125,103 +118,246 @@ public static FusedBatchNorm create } } } - return new FusedBatchNorm(opBuilder.build()); + return new FusedBatchNorm<>(opBuilder.build()); } - + /** + * Sets the epsilon option. + * * @param epsilon A small float number added to the variance of x. + * @return this Options instance. */ public static Options epsilon(Float epsilon) { return new Options().epsilon(epsilon); } - + /** - * @param exponentialAvgFactor + * Sets the exponentialAvgFactor option. + * + * @param exponentialAvgFactor the exponentialAvgFactor option + * @return this Options instance. */ public static Options exponentialAvgFactor(Float exponentialAvgFactor) { return new Options().exponentialAvgFactor(exponentialAvgFactor); } - + /** - * @param dataFormat The data format for x and y. Either "NHWC" (default) or "NCHW". + * Sets the dataFormat option. + * + * @param dataFormat The data format for x and y. Either "NHWC" (default) or "NCHW". + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Sets the isTraining option. + * * @param isTraining A bool value to indicate the operation is for training (default) * or inference. + * @return this Options instance. */ public static Options isTraining(Boolean isTraining) { return new Options().isTraining(isTraining); } - + /** + * Gets y. * A 4D Tensor for output data. + * @return y. */ public Output y() { return y; } - + /** + * Gets batchMean. * A 1D Tensor for the computed batch mean, to be used by TensorFlow * to compute the running mean. + * @return batchMean. */ public Output batchMean() { return batchMean; } - + /** + * Gets batchVariance. * A 1D Tensor for the computed batch variance, to be used by * TensorFlow to compute the running variance. + * @return batchVariance. */ public Output batchVariance() { return batchVariance; } - + /** + * Gets reserveSpace1. * A 1D Tensor for the computed batch mean, to be reused * in the gradient computation. + * @return reserveSpace1. */ public Output reserveSpace1() { return reserveSpace1; } - + /** + * Gets reserveSpace2. * A 1D Tensor for the computed batch variance (inverted variance * in the cuDNN case), to be reused in the gradient computation. + * @return reserveSpace2. */ public Output reserveSpace2() { return reserveSpace2; } - + /** + * Gets reserveSpace3. * A 1D Tensor for some intermediate results, to be reused in the gradient * computation for better efficiency. + * @return reserveSpace3. */ public Output reserveSpace3() { return reserveSpace3; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FusedBatchNormV3"; - - private Output y; - private Output batchMean; - private Output batchVariance; - private Output reserveSpace1; - private Output reserveSpace2; - private Output reserveSpace3; - - private FusedBatchNorm(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - batchMean = operation.output(outputIdx++); - batchVariance = operation.output(outputIdx++); - reserveSpace1 = operation.output(outputIdx++); - reserveSpace2 = operation.output(outputIdx++); - reserveSpace3 = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.FusedBatchNorm} + */ + public static class Options { + private Float epsilon; + + private Float exponentialAvgFactor; + + private String dataFormat; + + private Boolean isTraining; + + private Options() { + } + + /** + * Sets the epsilon option. + * + * @param epsilon A small float number added to the variance of x. + * @return this Options instance. + */ + public Options epsilon(Float epsilon) { + this.epsilon = epsilon; + return this; + } + + /** + * Sets the exponentialAvgFactor option. + * + * @param exponentialAvgFactor the exponentialAvgFactor option + * @return this Options instance. + */ + public Options exponentialAvgFactor(Float exponentialAvgFactor) { + this.exponentialAvgFactor = exponentialAvgFactor; + return this; + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat The data format for x and y. Either "NHWC" (default) or "NCHW". + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Sets the isTraining option. + * + * @param isTraining A bool value to indicate the operation is for training (default) + * or inference. + * @return this Options instance. + */ + public Options isTraining(Boolean isTraining) { + this.isTraining = 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 aa8d3b94b99..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,71 +17,64 @@ 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; /** * Gradient for batch normalization. - *

- * Note that the size of 4D Tensors are defined by either "NHWC" or "NCHW". + * 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 xBackprop()} output - * @param data type for {@code scaleBackprop()} output */ -@Operator(group = "nn") +@OpMetadata( + opType = FusedBatchNormGrad.OP_NAME, + inputsClass = FusedBatchNormGrad.Inputs.class +) +@Operator( + group = "nn" +) public final class FusedBatchNormGrad extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.FusedBatchNormGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param epsilon A small float number added to the variance of x. - */ - public Options epsilon(Float epsilon) { - this.epsilon = epsilon; - return this; - } - - /** - * @param dataFormat The data format for y_backprop, x, x_backprop. - * Either "NHWC" (default) or "NCHW". - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * @param isTraining A bool value to indicate the operation is for training (default) - * or inference. - */ - public Options isTraining(Boolean isTraining) { - this.isTraining = isTraining; - return this; - } - - private Float epsilon; - private String dataFormat; - private Boolean isTraining; - - private Options() { - } + public static final String OP_NAME = "FusedBatchNormGradV3"; + + private Output xBackprop; + + private Output scaleBackprop; + + private Output offsetBackprop; + + private Output reserveSpace4; + + private Output reserveSpace5; + + public FusedBatchNormGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + xBackprop = operation.output(outputIdx++); + scaleBackprop = operation.output(outputIdx++); + offsetBackprop = operation.output(outputIdx++); + reserveSpace4 = operation.output(outputIdx++); + reserveSpace5 = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new FusedBatchNormGrad operation. - * + * Factory method to create a class wrapping a new FusedBatchNormGradV3 operation. + * * @param scope current scope * @param yBackprop A 4D Tensor for the gradient with respect to y. * @param x A 4D Tensor for input data. @@ -98,19 +91,24 @@ private Options() { * @param reserveSpace3 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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code FusedBatchNormGradV3} output and operands + * @param data type for {@code FusedBatchNormGradV3} output and operands * @return a new instance of FusedBatchNormGrad */ - @Endpoint(describeByClass = true) - public static FusedBatchNormGrad create(Scope scope, Operand yBackprop, Operand x, Operand scale, Operand reserveSpace1, Operand reserveSpace2, Operand reserveSpace3, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("FusedBatchNormGradV3", scope.makeOpName("FusedBatchNormGrad")); + @Endpoint( + describeByClass = true + ) + public static FusedBatchNormGrad create(Scope scope, + Operand yBackprop, Operand x, Operand scale, Operand reserveSpace1, + Operand reserveSpace2, Operand reserveSpace3, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FusedBatchNormGrad"); opBuilder.addInput(yBackprop.asOutput()); opBuilder.addInput(x.asOutput()); opBuilder.addInput(scale.asOutput()); opBuilder.addInput(reserveSpace1.asOutput()); opBuilder.addInput(reserveSpace2.asOutput()); opBuilder.addInput(reserveSpace3.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.epsilon != null) { @@ -124,84 +122,220 @@ public static FusedBatchNormGrad cr } } } - return new FusedBatchNormGrad(opBuilder.build()); + return new FusedBatchNormGrad<>(opBuilder.build()); } - + /** + * Sets the epsilon option. + * * @param epsilon A small float number added to the variance of x. + * @return this Options instance. */ public static Options epsilon(Float epsilon) { return new Options().epsilon(epsilon); } - + /** + * Sets the dataFormat option. + * * @param dataFormat The data format for y_backprop, x, x_backprop. - * Either "NHWC" (default) or "NCHW". + * Either "NHWC" (default) or "NCHW". + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Sets the isTraining option. + * * @param isTraining A bool value to indicate the operation is for training (default) * or inference. + * @return this Options instance. */ public static Options isTraining(Boolean isTraining) { return new Options().isTraining(isTraining); } - + /** + * Gets xBackprop. * A 4D Tensor for the gradient with respect to x. + * @return xBackprop. */ public Output xBackprop() { return xBackprop; } - + /** + * Gets scaleBackprop. * A 1D Tensor for the gradient with respect to scale. + * @return scaleBackprop. */ public Output scaleBackprop() { return scaleBackprop; } - + /** + * Gets offsetBackprop. * A 1D Tensor for the gradient with respect to offset. + * @return offsetBackprop. */ public Output offsetBackprop() { return offsetBackprop; } - + /** + * Gets reserveSpace4. * Unused placeholder to match the mean input in FusedBatchNorm. + * @return reserveSpace4. */ public Output reserveSpace4() { return reserveSpace4; } - + /** + * Gets reserveSpace5. * Unused placeholder to match the variance input * in FusedBatchNorm. + * @return reserveSpace5. */ public Output reserveSpace5() { return reserveSpace5; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FusedBatchNormGradV3"; - - private Output xBackprop; - private Output scaleBackprop; - private Output offsetBackprop; - private Output reserveSpace4; - private Output reserveSpace5; - - private FusedBatchNormGrad(Operation operation) { - super(operation); - int outputIdx = 0; - xBackprop = operation.output(outputIdx++); - scaleBackprop = operation.output(outputIdx++); - offsetBackprop = operation.output(outputIdx++); - reserveSpace4 = operation.output(outputIdx++); - reserveSpace5 = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.FusedBatchNormGrad} + */ + public static class Options { + private Float epsilon; + + private String dataFormat; + + private Boolean isTraining; + + private Options() { + } + + /** + * Sets the epsilon option. + * + * @param epsilon A small float number added to the variance of x. + * @return this Options instance. + */ + public Options epsilon(Float epsilon) { + this.epsilon = epsilon; + return this; + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat The data format for y_backprop, x, x_backprop. + * Either "NHWC" (default) or "NCHW". + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Sets the isTraining option. + * + * @param isTraining A bool value to indicate the operation is for training (default) + * or inference. + * @return this Options instance. + */ + public Options isTraining(Boolean isTraining) { + this.isTraining = 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 db1a7dac897..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,21 +17,26 @@ 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; /** * Performs a padding as a preprocess during a convolution. - *

* Similar to FusedResizeAndPadConv2d, this op allows for an optimized * implementation where the spatial padding transformation stage is fused with the * im2col lookup, but in this case without the bilinear filtering required for @@ -43,63 +48,130 @@ * 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 */ -@Operator(group = "nn") +@OpMetadata( + opType = FusedPadConv2d.OP_NAME, + inputsClass = FusedPadConv2d.Inputs.class +) +@Operator( + group = "nn" +) public final class FusedPadConv2d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new FusedPadConv2d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FusedPadConv2D"; + + private Output output; + + public FusedPadConv2d(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new FusedPadConv2D operation. + * * @param scope current scope - * @param input 4-D with shape `[batch, in_height, in_width, in_channels]`. + * @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 `input`. + * rows must be the same as the rank of {@code input}. * @param filter 4-D with shape - * `[filter_height, filter_width, in_channels, out_channels]`. - * @param mode + * {@code [filter_height, filter_width, in_channels, out_channels]}. + * @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 `input`. Must be in the same order as the dimension specified with format. + * of {@code input}. Must be in the same order as the dimension specified with format. * @param padding The type of padding algorithm to use. + * @param data type for {@code FusedPadConv2D} output and operands * @return a new instance of FusedPadConv2d */ - @Endpoint(describeByClass = true) - public static FusedPadConv2d create(Scope scope, Operand input, Operand paddings, Operand filter, String mode, List strides, String padding) { - OperationBuilder opBuilder = scope.env().opBuilder("FusedPadConv2D", scope.makeOpName("FusedPadConv2d")); + @Endpoint( + describeByClass = true + ) + public static FusedPadConv2d create(Scope scope, Operand input, + Operand paddings, Operand filter, String mode, List strides, + String padding) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FusedPadConv2d"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(paddings.asOutput()); opBuilder.addInput(filter.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("mode", mode); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); opBuilder.setAttr("padding", padding); - return new FusedPadConv2d(opBuilder.build()); + return new FusedPadConv2d<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FusedPadConv2D"; - - private Output output; - - private FusedPadConv2d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 1bc106ee063..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,21 +17,26 @@ 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; /** * Performs a resize and padding as a preprocess during a convolution. - *

* It's often possible to do spatial transformations more efficiently as part of * the packing stage of a convolution, so this op allows for an optimized * implementation where these stages are fused together. This prevents the need to @@ -42,61 +47,61 @@ * 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 */ -@Operator(group = "nn") +@OpMetadata( + opType = FusedResizeAndPadConv2d.OP_NAME, + inputsClass = FusedResizeAndPadConv2d.Inputs.class +) +@Operator( + group = "nn" +) public final class FusedResizeAndPadConv2d extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.FusedResizeAndPadConv2d} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param resizeAlignCorners 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 Options resizeAlignCorners(Boolean resizeAlignCorners) { - this.resizeAlignCorners = resizeAlignCorners; - return this; - } - - private Boolean resizeAlignCorners; - - private Options() { - } + public static final String OP_NAME = "FusedResizeAndPadConv2D"; + + private Output output; + + public FusedResizeAndPadConv2d(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new FusedResizeAndPadConv2d operation. - * + * Factory method to create a class wrapping a new FusedResizeAndPadConv2D operation. + * * @param scope current scope - * @param input 4-D with shape `[batch, in_height, in_width, in_channels]`. - * @param size A 1-D int32 Tensor of 2 elements: `new_height, new_width`. The + * @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. * @param paddings A two-column matrix specifying the padding sizes. The number of - * rows must be the same as the rank of `input`. + * rows must be the same as the rank of {@code input}. * @param filter 4-D with shape - * `[filter_height, filter_width, in_channels, out_channels]`. - * @param mode + * {@code [filter_height, filter_width, in_channels, out_channels]}. + * @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 `input`. Must be in the same order as the dimension specified with format. + * of {@code input}. 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code FusedResizeAndPadConv2D} output and operands * @return a new instance of FusedResizeAndPadConv2d */ - @Endpoint(describeByClass = true) - public static FusedResizeAndPadConv2d create(Scope scope, Operand input, Operand size, Operand paddings, Operand filter, String mode, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("FusedResizeAndPadConv2D", scope.makeOpName("FusedResizeAndPadConv2d")); + @Endpoint( + describeByClass = true + ) + public static FusedResizeAndPadConv2d create(Scope scope, Operand input, + Operand sizeOutput, Operand paddings, Operand filter, String mode, + List strides, String padding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FusedResizeAndPadConv2d"); opBuilder.addInput(input.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder.addInput(paddings.asOutput()); opBuilder.addInput(filter.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("mode", mode); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -108,36 +113,122 @@ public static FusedResizeAndPadConv2d create(Scope scope, } } } - return new FusedResizeAndPadConv2d(opBuilder.build()); + return new FusedResizeAndPadConv2d<>(opBuilder.build()); } - + /** + * Sets the resizeAlignCorners option. + * * @param resizeAlignCorners 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. + * @return this Options instance. */ public static Options resizeAlignCorners(Boolean resizeAlignCorners) { return new Options().resizeAlignCorners(resizeAlignCorners); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FusedResizeAndPadConv2D"; - - private Output output; - - private FusedResizeAndPadConv2d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.FusedResizeAndPadConv2d} + */ + public static class Options { + private Boolean resizeAlignCorners; + + private Options() { + } + + /** + * Sets the resizeAlignCorners option. + * + * @param resizeAlignCorners 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. + * @return this Options instance. + */ + public Options resizeAlignCorners(Boolean resizeAlignCorners) { + this.resizeAlignCorners = 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 19ee4709eb8..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,131 +17,206 @@ 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 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 + * 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 : - * `b_ru` - constant_initializer(1.0) - * `b_c` - constant_initializer(0.0) - *

- * This kernel op implements the following mathematical equations: - *

{@code
+ * 

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 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 + */ + public static final String OP_NAME = "GRUBlockCell"; + + private Output r; + + private Output u; + + private Output c; + + private Output h; + + public GRUBlockCell(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + r = operation.output(outputIdx++); + u = operation.output(outputIdx++); + c = operation.output(outputIdx++); + h = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new GRUBlockCell operation. - * + * * @param scope current scope - * @param x - * @param hPrev - * @param wRu - * @param wC - * @param bRu - * @param bC + * @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 */ - @Endpoint(describeByClass = true) - public static GRUBlockCell create(Scope scope, Operand x, Operand hPrev, Operand wRu, Operand wC, Operand bRu, Operand bC) { - OperationBuilder opBuilder = scope.env().opBuilder("GRUBlockCell", scope.makeOpName("GRUBlockCell")); + @Endpoint( + describeByClass = true + ) + public static GRUBlockCell create(Scope scope, Operand x, + Operand hPrev, Operand wRu, Operand wC, Operand bRu, Operand bC) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GRUBlockCell"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(hPrev.asOutput()); opBuilder.addInput(wRu.asOutput()); opBuilder.addInput(wC.asOutput()); opBuilder.addInput(bRu.asOutput()); opBuilder.addInput(bC.asOutput()); - opBuilder = scope.apply(opBuilder); - return new GRUBlockCell(opBuilder.build()); + return new GRUBlockCell<>(opBuilder.build()); } - + /** + * Gets r. + * + * @return r. */ public Output r() { return r; } - + /** + * Gets u. + * + * @return u. */ public Output u() { return u; } - + /** + * Gets c. + * + * @return c. */ public Output c() { return c; } - + /** + * Gets h. + * + * @return h. */ public Output h() { return h; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "GRUBlockCell"; - - private Output r; - private Output u; - private Output c; - private Output h; - - private GRUBlockCell(Operation operation) { - super(operation); - int outputIdx = 0; - r = operation.output(outputIdx++); - u = operation.output(outputIdx++); - c = operation.output(outputIdx++); - h = operation.output(outputIdx++); + + @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 16d2efc3dd5..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,123 +17,152 @@ 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 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 + * 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: - *

- * `w_ru` can be segmented into 4 different matrices. - *

{@code
+ * 

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, `w_c` can be segmented into 2 different matrices. - *
{@code
+ * 
+ *

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

  * w_c = [w_c_x w_c_h_prevr]
- * }
- * Same goes for biases. - *
{@code
+ * 
+ *

Same goes for biases. + *

  * b_ru = [b_ru_x b_ru_h]
  * b_c = [b_c_x b_c_h]
- * }
- * Another note on notation: - *
{@code
+ * 
+ *

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

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

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

{@code
+ * 
  * 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 data type for {@code dX()} 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 + */ + public static final String OP_NAME = "GRUBlockCellGrad"; + + private Output dX; + + private Output dHPrev; + + private Output dCBar; + + private Output dRBarUBar; + + public GRUBlockCellGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + dX = operation.output(outputIdx++); + dHPrev = operation.output(outputIdx++); + dCBar = operation.output(outputIdx++); + dRBarUBar = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new GRUBlockCellGrad operation. - * + * * @param scope current scope - * @param x - * @param hPrev - * @param wRu - * @param wC - * @param bRu - * @param bC - * @param r - * @param u - * @param c - * @param dH + * @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 */ - @Endpoint(describeByClass = true) - public static GRUBlockCellGrad create(Scope scope, Operand x, Operand hPrev, Operand wRu, Operand wC, Operand bRu, Operand bC, Operand r, Operand u, Operand c, Operand dH) { - OperationBuilder opBuilder = scope.env().opBuilder("GRUBlockCellGrad", scope.makeOpName("GRUBlockCellGrad")); + @Endpoint( + describeByClass = true + ) + public static GRUBlockCellGrad create(Scope scope, Operand x, + Operand hPrev, Operand wRu, Operand wC, Operand bRu, Operand bC, Operand r, + Operand u, Operand c, Operand dH) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GRUBlockCellGrad"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(hPrev.asOutput()); opBuilder.addInput(wRu.asOutput()); @@ -144,48 +173,118 @@ public static GRUBlockCellGrad create(Scope scope, Operan opBuilder.addInput(u.asOutput()); opBuilder.addInput(c.asOutput()); opBuilder.addInput(dH.asOutput()); - opBuilder = scope.apply(opBuilder); - return new GRUBlockCellGrad(opBuilder.build()); + return new GRUBlockCellGrad<>(opBuilder.build()); } - + /** + * Gets dX. + * + * @return dX. */ public Output dX() { return dX; } - + /** + * Gets dHPrev. + * + * @return dHPrev. */ public Output dHPrev() { return dHPrev; } - + /** + * Gets dCBar. + * + * @return dCBar. */ public Output dCBar() { return dCBar; } - + /** + * Gets dRBarUBar. + * + * @return dRBarUBar. */ public Output dRBarUBar() { return dRBarUBar; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "GRUBlockCellGrad"; - - private Output dX; - private Output dHPrev; - private Output dCBar; - private Output dRBarUBar; - - private GRUBlockCellGrad(Operation operation) { - super(operation); - int outputIdx = 0; - dX = operation.output(outputIdx++); - dHPrev = operation.output(outputIdx++); - dCBar = operation.output(outputIdx++); - dRBarUBar = operation.output(outputIdx++); + + @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 bdf5f761d1a..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,78 +17,126 @@ 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; /** - * Says whether the targets are in the top `K` predictions. - *

- * This outputs a `batch_size` bool array, an entry `out[i]` is `true` if the - * prediction for the target class is among the top `k` predictions among - * all predictions for example `i`. Note that the behavior of `InTopK` differs - * from the `TopK` op in its handling of ties; if multiple classes have the - * same prediction value and straddle the top-`k` boundary, all of those - * classes are considered to be in the top `k`. - *

- * More formally, let - *

- * \\(predictions_i\\) be the predictions for all classes for example `i`, - * \\(targets_i\\) be the target class for example `i`, - * \\(out_i\\) be the output for example `i`, - *

- * $$out_i = predictions_{i, targets_i} \in TopKIncludingTies(predictions_i)$$ + * 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 + * prediction for the target class is among the top {@code k} predictions among + * all predictions for example {@code i}. Note that the behavior of {@code InTopK} differs + * from the {@code TopK} op in its handling of ties; if multiple classes have the + * same prediction value and straddle the top-{@code k} boundary, all of those + * classes are considered to be in the top {@code k}. + *

More formally, let + *

\(predictions_i\) be the predictions for all classes for example {@code i}, + * \(targets_i\) be the target class for example {@code i}, + * \(out_i\) be the output for example {@code i}, + *

$$out_i = predictions_{i, targets_i} \in TopKIncludingTies(predictions_i)$$ */ -@Operator(group = "nn") +@OpMetadata( + opType = InTopK.OP_NAME, + inputsClass = InTopK.Inputs.class +) +@Operator( + group = "nn" +) public final class InTopK extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new InTopK operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "InTopKV2"; + + private Output precision; + + public InTopK(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + precision = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new InTopKV2 operation. + * * @param scope current scope - * @param predictions A `batch_size` x `classes` tensor. - * @param targets A `batch_size` vector of class ids. + * @param predictions A {@code batch_size} x {@code classes} tensor. + * @param targets A {@code batch_size} vector of class ids. * @param k Number of top elements to look at for computing precision. + * @param data type for {@code InTopKV2} output and operands * @return a new instance of InTopK */ - @Endpoint(describeByClass = true) - public static InTopK create(Scope scope, Operand predictions, Operand targets, Operand k) { - OperationBuilder opBuilder = scope.env().opBuilder("InTopKV2", scope.makeOpName("InTopK")); + @Endpoint( + describeByClass = true + ) + public static InTopK create(Scope scope, Operand predictions, + Operand targets, Operand k) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "InTopK"); opBuilder.addInput(predictions.asOutput()); opBuilder.addInput(targets.asOutput()); opBuilder.addInput(k.asOutput()); - opBuilder = scope.apply(opBuilder); return new InTopK(opBuilder.build()); } - + /** - * Computed precision at `k` as a `bool Tensor`. + * Gets precision. + * Computed precision at {@code k} as a {@code bool Tensor}. + * @return precision. */ public Output precision() { return precision; } - + @Override public Output asOutput() { return precision; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InTopKV2"; - - private Output precision; - - private InTopK(Operation operation) { - super(operation); - int outputIdx = 0; - precision = operation.output(outputIdx++); + + @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 97c79db904a..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,62 +17,106 @@ 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 `x` wrt its input. - *

- * Specifically, `grad = -dy yy`, where `y = 1/x`, and `dy` + * 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 + */ + public static final String OP_NAME = "InvGrad"; + + private Output z; + + public InvGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new InvGrad operation. - * + * * @param scope current scope - * @param y - * @param dy + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static InvGrad create(Scope scope, Operand y, Operand dy) { - OperationBuilder opBuilder = scope.env().opBuilder("InvGrad", scope.makeOpName("InvGrad")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "InvGrad"); opBuilder.addInput(y.asOutput()); opBuilder.addInput(dy.asOutput()); - opBuilder = scope.apply(opBuilder); - return new InvGrad(opBuilder.build()); + return new InvGrad<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InvGrad"; - - private Output z; - - private InvGrad(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + @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 d6ebf48bd75..73ea2a63c84 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,79 +17,145 @@ 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 + */ + public static final String OP_NAME = "IsotonicRegression"; + + private Output output; + + private Output segments; + + public IsotonicRegression(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + segments = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new IsotonicRegression operation. - * + * * @param scope current scope * @param input A (batch_size, dim)-tensor holding a batch of inputs. - * @param outputDtype Dtype of output. + * @param outputDtype Dtype of the output tensor. + *

Note on supported input-output type combinations: + *

    + *
  • For floating-point types, the output has the same dtype as the input.
  • + *
  • For 8-bit and 16-bit integer inputs, the output is a 32-bit float.
  • + *
  • For 32-bit and 64-bit integer inputs, the output is a 64-bit float.
  • + *
+ *

Using unsupported dtype pairs (for example, input=float64 with output=float32) + * will result in a "Could not find device for node" error. + * @param data type for {@code IsotonicRegression} output and operands * @return a new instance of IsotonicRegression */ - @Endpoint(describeByClass = true) - public static IsotonicRegression create(Scope scope, Operand input, Class outputDtype) { - OperationBuilder opBuilder = scope.env().opBuilder("IsotonicRegression", scope.makeOpName("IsotonicRegression")); + @Endpoint( + describeByClass = true + ) + public static IsotonicRegression create(Scope scope, + Operand input, Class outputDtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IsotonicRegression"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_dtype", Operands.toDataType(outputDtype)); - return new IsotonicRegression(opBuilder.build()); + return new IsotonicRegression<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new IsotonicRegression operation using default output types. - * + * Factory method to create a class wrapping a new IsotonicRegression operation, with the default output types. + * * @param scope current scope * @param input A (batch_size, dim)-tensor holding a batch of inputs. - * @return a new instance of IsotonicRegression + * @return a new instance of IsotonicRegression, with default output types */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static IsotonicRegression create(Scope scope, Operand input) { return create(scope, input, TFloat32.class); } - + /** + * Gets output. * A (batch_size, dim)-tensor holding the per-batch element solutions. + * @return output. */ public Output output() { return output; } - + /** + * Gets segments. * An int32 (batch_size, dim)-tensor with the segments. + * @return segments. */ public Output segments() { return segments; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IsotonicRegression"; - - private Output output; - private Output segments; - - private IsotonicRegression(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - segments = operation.output(outputIdx++); + + @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 the output tensor. + *

Note on supported input-output type combinations: + *

    + *
  • For floating-point types, the output has the same dtype as the input.
  • + *
  • For 8-bit and 16-bit integer inputs, the output is a 32-bit float.
  • + *
  • For 32-bit and 64-bit integer inputs, the output is a 64-bit float.
  • + *
+ *

Using unsupported dtype pairs (for example, input=float64 with output=float32) + * will result in a "Could not find device for node" error. + */ + 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 45856e6c255..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,63 +17,100 @@ 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; /** * L2 Loss. - *

- * Computes half the L2 norm of a tensor without the `sqrt`: - *

- * output = sum(t ** 2) / 2 - * - * @param data type for {@code output()} output + * Computes half the L2 norm of a tensor without the {@code sqrt}: + *

+ * output = sum(t ** 2) / 2
+ * 
*/ -@Operator(group = "nn") +@OpMetadata( + opType = L2Loss.OP_NAME, + inputsClass = L2Loss.Inputs.class +) +@Operator( + group = "nn" +) public final class L2Loss extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "L2Loss"; + + private Output output; + + public L2Loss(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new L2Loss operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static L2Loss create(Scope scope, Operand t) { - OperationBuilder opBuilder = scope.env().opBuilder("L2Loss", scope.makeOpName("L2Loss")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "L2Loss"); opBuilder.addInput(t.asOutput()); - opBuilder = scope.apply(opBuilder); - return new L2Loss(opBuilder.build()); + return new L2Loss<>(opBuilder.build()); } - + /** + * Gets output. * 0-D. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "L2Loss"; - - private Output output; - - private L2Loss(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 ad144fed082..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,88 +17,89 @@ 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 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: - *

{@code
+ * 

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 data type for {@code i()} output + *
*/ +@OpMetadata( + opType = LSTMBlockCell.OP_NAME, + inputsClass = LSTMBlockCell.Inputs.class +) +@Operator( + group = "nn" +) public final class LSTMBlockCell extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.LSTMBlockCell} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param forgetBias The forget gate bias. - */ - public Options forgetBias(Float forgetBias) { - this.forgetBias = forgetBias; - return this; - } - - /** - * @param cellClip Value to clip the 'cs' value to. - */ - public Options cellClip(Float cellClip) { - this.cellClip = cellClip; - return this; - } - - /** - * @param usePeephole Whether to use peephole weights. - */ - public Options usePeephole(Boolean usePeephole) { - this.usePeephole = usePeephole; - return this; - } - - private Float forgetBias; - private Float cellClip; - private Boolean usePeephole; - - private Options() { - } + public static final String OP_NAME = "LSTMBlockCell"; + + private Output i; + + private Output cs; + + private Output f; + + private Output o; + + private Output ci; + + private Output co; + + private Output h; + + public LSTMBlockCell(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + i = operation.output(outputIdx++); + cs = operation.output(outputIdx++); + f = operation.output(outputIdx++); + o = operation.output(outputIdx++); + ci = operation.output(outputIdx++); + co = operation.output(outputIdx++); + h = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new LSTMBlockCell operation. - * + * * @param scope current scope * @param x The input to the LSTM cell, shape (batch_size, num_inputs). * @param csPrev Value of the cell state at previous time step. @@ -108,12 +109,17 @@ private Options() { * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code LSTMBlockCell} output and operands * @return a new instance of LSTMBlockCell */ - @Endpoint(describeByClass = true) - public static LSTMBlockCell create(Scope scope, Operand x, Operand csPrev, Operand hPrev, Operand w, Operand wci, Operand wcf, Operand wco, Operand b, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("LSTMBlockCell", scope.makeOpName("LSTMBlockCell")); + @Endpoint( + describeByClass = true + ) + public static LSTMBlockCell create(Scope scope, Operand x, + Operand csPrev, Operand hPrev, Operand w, Operand wci, Operand wcf, + Operand wco, Operand b, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LSTMBlockCell"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(csPrev.asOutput()); opBuilder.addInput(hPrev.asOutput()); @@ -122,7 +128,6 @@ public static LSTMBlockCell create(Scope scope, Operand LSTMBlockCell create(Scope scope, Operand(opBuilder.build()); + return new LSTMBlockCell<>(opBuilder.build()); } - + /** + * Sets the forgetBias option. + * * @param forgetBias The forget gate bias. + * @return this Options instance. */ public static Options forgetBias(Float forgetBias) { return new Options().forgetBias(forgetBias); } - + /** + * Sets the cellClip option. + * * @param cellClip Value to clip the 'cs' value to. + * @return this Options instance. */ public static Options cellClip(Float cellClip) { return new Options().cellClip(cellClip); } - + /** + * Sets the usePeephole option. + * * @param usePeephole Whether to use peephole weights. + * @return this Options instance. */ public static Options usePeephole(Boolean usePeephole) { return new Options().usePeephole(usePeephole); } - + /** + * Gets i. * The input gate. + * @return i. */ public Output i() { return i; } - + /** + * Gets cs. * The cell state before the tanh. + * @return cs. */ public Output cs() { return cs; } - + /** + * Gets f. * The forget gate. + * @return f. */ public Output f() { return f; } - + /** + * Gets o. * The output gate. + * @return o. */ public Output o() { return o; } - + /** + * Gets ci. * The cell input. + * @return ci. */ public Output ci() { return ci; } - + /** + * Gets co. * The cell after the tanh. + * @return co. */ public Output co() { return co; } - + /** + * Gets h. * The output h vector. + * @return h. */ public Output h() { return h; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LSTMBlockCell"; - - private Output i; - private Output cs; - private Output f; - private Output o; - private Output ci; - private Output co; - private Output h; - - private LSTMBlockCell(Operation operation) { - super(operation); - int outputIdx = 0; - i = operation.output(outputIdx++); - cs = operation.output(outputIdx++); - f = operation.output(outputIdx++); - o = operation.output(outputIdx++); - ci = operation.output(outputIdx++); - co = operation.output(outputIdx++); - h = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.LSTMBlockCell} + */ + public static class Options { + private Float forgetBias; + + private Float cellClip; + + private Boolean usePeephole; + + private Options() { + } + + /** + * Sets the forgetBias option. + * + * @param forgetBias The forget gate bias. + * @return this Options instance. + */ + public Options forgetBias(Float forgetBias) { + this.forgetBias = forgetBias; + return this; + } + + /** + * Sets the cellClip option. + * + * @param cellClip Value to clip the 'cs' value to. + * @return this Options instance. + */ + public Options cellClip(Float cellClip) { + this.cellClip = cellClip; + return this; + } + + /** + * Sets the usePeephole option. + * + * @param usePeephole Whether to use peephole weights. + * @return this Options instance. + */ + public Options usePeephole(Boolean usePeephole) { + this.usePeephole = 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 6bcf274af61..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,28 +17,62 @@ 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 csPrevGrad()} 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 + */ + public static final String OP_NAME = "LSTMBlockCellGrad"; + + private Output csPrevGrad; + + private Output dicfo; + + private Output wciGrad; + + private Output wcfGrad; + + private Output wcoGrad; + + public LSTMBlockCellGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + csPrevGrad = operation.output(outputIdx++); + dicfo = operation.output(outputIdx++); + wciGrad = operation.output(outputIdx++); + wcfGrad = operation.output(outputIdx++); + wcoGrad = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LSTMBlockCellGrad operation. - * + * * @param scope current scope * @param x The input to the LSTM cell, shape (batch_size, num_inputs). * @param csPrev The previous cell state. @@ -57,11 +91,17 @@ public final class LSTMBlockCellGrad extends RawOp { * @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 */ - @Endpoint(describeByClass = true) - public static LSTMBlockCellGrad create(Scope scope, 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) { - OperationBuilder opBuilder = scope.env().opBuilder("LSTMBlockCellGrad", scope.makeOpName("LSTMBlockCellGrad")); + @Endpoint( + describeByClass = true + ) + public static LSTMBlockCellGrad create(Scope scope, 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) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LSTMBlockCellGrad"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(csPrev.asOutput()); opBuilder.addInput(hPrev.asOutput()); @@ -78,62 +118,170 @@ public static LSTMBlockCellGrad create(Scope scope, Opera opBuilder.addInput(co.asOutput()); opBuilder.addInput(csGrad.asOutput()); opBuilder.addInput(hGrad.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("use_peephole", usePeephole); - return new LSTMBlockCellGrad(opBuilder.build()); + return new LSTMBlockCellGrad<>(opBuilder.build()); } - + /** + * Gets csPrevGrad. * The gradient of cs to be back-propped. + * @return csPrevGrad. */ public Output csPrevGrad() { return csPrevGrad; } - + /** + * Gets dicfo. * The derivative wrt to [i, cs, f, o]. + * @return dicfo. */ public Output dicfo() { return dicfo; } - + /** + * Gets wciGrad. * The gradient for wci to be back-propped. + * @return wciGrad. */ public Output wciGrad() { return wciGrad; } - + /** + * Gets wcfGrad. * The gradient for wcf to be back-propped. + * @return wcfGrad. */ public Output wcfGrad() { return wcfGrad; } - + /** + * Gets wcoGrad. * The gradient for wco to be back-propped. + * @return wcoGrad. */ public Output wcoGrad() { return wcoGrad; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LSTMBlockCellGrad"; - - private Output csPrevGrad; - private Output dicfo; - private Output wciGrad; - private Output wcfGrad; - private Output wcoGrad; - - private LSTMBlockCellGrad(Operation operation) { - super(operation); - int outputIdx = 0; - csPrevGrad = operation.output(outputIdx++); - dicfo = operation.output(outputIdx++); - wciGrad = operation.output(outputIdx++); - wcfGrad = operation.output(outputIdx++); - wcoGrad = operation.output(outputIdx++); + + @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 2016d3a6abb..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,56 +17,62 @@ 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: `max(features, features * alpha)`. - * - * @param data type for {@code activations()} output + * Computes rectified linear: {@code max(features, features * alpha)}. */ -@Operator(group = "nn") +@OpMetadata( + opType = LeakyRelu.OP_NAME, + inputsClass = LeakyRelu.Inputs.class +) +@Operator( + group = "nn" +) public final class LeakyRelu extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.LeakyRelu} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param alpha - */ - public Options alpha(Float alpha) { - this.alpha = alpha; - return this; - } - - private Float alpha; - - private Options() { - } + public static final String OP_NAME = "LeakyRelu"; + + private Output activations; + + public LeakyRelu(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + activations = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new LeakyRelu operation. - * + * * @param scope current scope - * @param features - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static LeakyRelu create(Scope scope, Operand features, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("LeakyRelu", scope.makeOpName("LeakyRelu")); + @Endpoint( + describeByClass = true + ) + public static LeakyRelu create(Scope scope, Operand features, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LeakyRelu"); opBuilder.addInput(features.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.alpha != null) { @@ -74,35 +80,79 @@ public static LeakyRelu create(Scope scope, Operand fe } } } - return new LeakyRelu(opBuilder.build()); + return new LeakyRelu<>(opBuilder.build()); } - + /** - * @param alpha + * Sets the alpha option. + * + * @param alpha the alpha option + * @return this Options instance. */ public static Options alpha(Float alpha) { return new Options().alpha(alpha); } - + /** + * Gets activations. + * + * @return activations. */ public Output activations() { return activations; } - + @Override public Output asOutput() { return activations; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LeakyRelu"; - - private Output activations; - - private LeakyRelu(Operation operation) { - super(operation); - int outputIdx = 0; - activations = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.LeakyRelu} + */ + public static class Options { + private Float alpha; + + private Options() { + } + + /** + * Sets the alpha option. + * + * @param alpha the alpha option + * @return this Options instance. + */ + public Options alpha(Float alpha) { + this.alpha = 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 fdd595e76cf..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,66 +17,62 @@ 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; /** * 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 + *

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. */ -@Operator(group = "nn") +@OpMetadata( + opType = LearnedUnigramCandidateSampler.OP_NAME, + inputsClass = LearnedUnigramCandidateSampler.Inputs.class +) +@Operator( + group = "nn" +) public final class LearnedUnigramCandidateSampler extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.LearnedUnigramCandidateSampler} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 An second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "LearnedUnigramCandidateSampler"; + + private Output sampledCandidates; + + private Output trueExpectedCount; + + private Output sampledExpectedCount; + + public LearnedUnigramCandidateSampler(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 LearnedUnigramCandidateSampler 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. @@ -86,14 +82,16 @@ private Options() { * 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 attributes values + * @param options carries optional attribute values * @return a new instance of LearnedUnigramCandidateSampler */ - @Endpoint(describeByClass = true) - public static LearnedUnigramCandidateSampler create(Scope scope, Operand trueClasses, Long numTrue, Long numSampled, Boolean unique, Long rangeMax, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("LearnedUnigramCandidateSampler", scope.makeOpName("LearnedUnigramCandidateSampler")); + @Endpoint( + describeByClass = true + ) + public static LearnedUnigramCandidateSampler create(Scope scope, Operand trueClasses, + Long numTrue, Long numSampled, Boolean unique, Long rangeMax, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LearnedUnigramCandidateSampler"); opBuilder.addInput(trueClasses.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_true", numTrue); opBuilder.setAttr("num_sampled", numSampled); opBuilder.setAttr("unique", unique); @@ -110,62 +108,152 @@ public static LearnedUnigramCandidateSampler create(Scope scope, Operand } return new LearnedUnigramCandidateSampler(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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LearnedUnigramCandidateSampler"; - - private Output sampledCandidates; - private Output trueExpectedCount; - private Output sampledExpectedCount; - - private LearnedUnigramCandidateSampler(Operation operation) { - super(operation); - int outputIdx = 0; - sampledCandidates = operation.output(outputIdx++); - trueExpectedCount = operation.output(outputIdx++); - sampledExpectedCount = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.LearnedUnigramCandidateSampler} + */ + 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 = 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 1e28dd0ee14..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,95 +17,73 @@ 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; /** * Local Response Normalization. - *

- * The 4-D `input` tensor is treated as a 3-D array of 1-D vectors (along the last + * The 4-D {@code input} tensor is treated as a 3-D array of 1-D vectors (along the last * dimension), and each vector is normalized independently. Within a given vector, * each component is divided by the weighted, squared sum of inputs within - * `depth_radius`. In detail, - *

- * sqr_sum[a, b, c, d] = - * sum(input[a, b, c, d - depth_radius : d + depth_radius + 1] ** 2) - * output = input / (bias + alpha * sqr_sum) ** beta - *

- * For details, see [Krizhevsky et al., ImageNet classification with deep - * convolutional neural networks (NIPS 2012)](http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks). - * - * @param data type for {@code output()} output + * {@code depth_radius}. In detail, + *

+ * sqr_sum[a, b, c, d] =
+ *     sum(input[a, b, c, d - depth_radius : d + depth_radius + 1] ** 2)
+ * output = input / (bias + alpha * sqr_sum) ** beta
+ * 
+ *

For details, see Krizhevsky et al., ImageNet classification with deep + * convolutional neural networks (NIPS 2012) . */ -@Operator(group = "nn") +@OpMetadata( + opType = LocalResponseNormalization.OP_NAME, + inputsClass = LocalResponseNormalization.Inputs.class +) +@Operator( + group = "nn" +) public final class LocalResponseNormalization extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.LocalResponseNormalization} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param depthRadius 0-D. Half-width of the 1-D normalization window. - */ - public Options depthRadius(Long depthRadius) { - this.depthRadius = depthRadius; - return this; - } - - /** - * @param bias An offset (usually positive to avoid dividing by 0). - */ - public Options bias(Float bias) { - this.bias = bias; - return this; - } - - /** - * @param alpha A scale factor, usually positive. - */ - public Options alpha(Float alpha) { - this.alpha = alpha; - return this; - } - - /** - * @param beta An exponent. - */ - public Options beta(Float beta) { - this.beta = beta; - return this; - } - - private Long depthRadius; - private Float bias; - private Float alpha; - private Float beta; - - private Options() { - } + public static final String OP_NAME = "LRN"; + + private Output output; + + public LocalResponseNormalization(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new LocalResponseNormalization operation. - * + * Factory method to create a class wrapping a new LRN operation. + * * @param scope current scope * @param input 4-D. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code LRN} output and operands * @return a new instance of LocalResponseNormalization */ - @Endpoint(describeByClass = true) - public static LocalResponseNormalization create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("LRN", scope.makeOpName("LocalResponseNormalization")); + @Endpoint( + describeByClass = true + ) + public static LocalResponseNormalization create(Scope scope, + Operand input, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LocalResponseNormalization"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.depthRadius != null) { @@ -122,56 +100,166 @@ public static LocalResponseNormalization create(Scope sco } } } - return new LocalResponseNormalization(opBuilder.build()); + return new LocalResponseNormalization<>(opBuilder.build()); } - + /** + * Sets the depthRadius option. + * * @param depthRadius 0-D. Half-width of the 1-D normalization window. + * @return this Options instance. */ public static Options depthRadius(Long depthRadius) { return new Options().depthRadius(depthRadius); } - + /** + * Sets the bias option. + * * @param bias An offset (usually positive to avoid dividing by 0). + * @return this Options instance. */ public static Options bias(Float bias) { return new Options().bias(bias); } - + /** + * Sets the alpha option. + * * @param alpha A scale factor, usually positive. + * @return this Options instance. */ public static Options alpha(Float alpha) { return new Options().alpha(alpha); } - + /** + * Sets the beta option. + * * @param beta An exponent. + * @return this Options instance. */ public static Options beta(Float beta) { return new Options().beta(beta); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LRN"; - - private Output output; - - private LocalResponseNormalization(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.LocalResponseNormalization} + */ + public static class Options { + private Long depthRadius; + + private Float bias; + + private Float alpha; + + private Float beta; + + private Options() { + } + + /** + * Sets the depthRadius option. + * + * @param depthRadius 0-D. Half-width of the 1-D normalization window. + * @return this Options instance. + */ + public Options depthRadius(Long depthRadius) { + this.depthRadius = depthRadius; + return this; + } + + /** + * Sets the bias option. + * + * @param bias An offset (usually positive to avoid dividing by 0). + * @return this Options instance. + */ + public Options bias(Float bias) { + this.bias = bias; + return this; + } + + /** + * Sets the alpha option. + * + * @param alpha A scale factor, usually positive. + * @return this Options instance. + */ + public Options alpha(Float alpha) { + this.alpha = alpha; + return this; + } + + /** + * Sets the beta option. + * + * @param beta An exponent. + * @return this Options instance. + */ + public Options beta(Float beta) { + this.beta = 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 51915dc43a7..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,86 +17,66 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.nn.LocalResponseNormalizationGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param depthRadius A depth radius. - */ - public Options depthRadius(Long depthRadius) { - this.depthRadius = depthRadius; - return this; - } - - /** - * @param bias An offset (usually > 0 to avoid dividing by 0). - */ - public Options bias(Float bias) { - this.bias = bias; - return this; - } - - /** - * @param alpha A scale factor, usually positive. - */ - public Options alpha(Float alpha) { - this.alpha = alpha; - return this; - } - - /** - * @param beta An exponent. - */ - public Options beta(Float beta) { - this.beta = beta; - return this; - } - - private Long depthRadius; - private Float bias; - private Float alpha; - private Float beta; - - private Options() { - } + public static final String OP_NAME = "LRNGrad"; + + private Output output; + + public LocalResponseNormalizationGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new LocalResponseNormalizationGrad operation. - * + * Factory method to create a class wrapping a new LRNGrad operation. + * * @param scope current scope - * @param inputGrads 4-D with shape `[batch, height, width, channels]`. - * @param inputImage 4-D with shape `[batch, height, width, channels]`. - * @param outputImage 4-D with shape `[batch, height, width, channels]`. - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static LocalResponseNormalizationGrad create(Scope scope, Operand inputGrads, Operand inputImage, Operand outputImage, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("LRNGrad", scope.makeOpName("LocalResponseNormalizationGrad")); + @Endpoint( + describeByClass = true + ) + public static LocalResponseNormalizationGrad create(Scope scope, + Operand inputGrads, Operand inputImage, Operand outputImage, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LocalResponseNormalizationGrad"); opBuilder.addInput(inputGrads.asOutput()); opBuilder.addInput(inputImage.asOutput()); opBuilder.addInput(outputImage.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.depthRadius != null) { @@ -113,57 +93,178 @@ public static LocalResponseNormalizationGrad create(Scope } } } - return new LocalResponseNormalizationGrad(opBuilder.build()); + return new LocalResponseNormalizationGrad<>(opBuilder.build()); } - + /** + * Sets the depthRadius option. + * * @param depthRadius A depth radius. + * @return this Options instance. */ public static Options depthRadius(Long depthRadius) { return new Options().depthRadius(depthRadius); } - + /** - * @param bias An offset (usually > 0 to avoid dividing by 0). + * Sets the bias option. + * + * @param bias An offset (usually > 0 to avoid dividing by 0). + * @return this Options instance. */ public static Options bias(Float bias) { return new Options().bias(bias); } - + /** + * Sets the alpha option. + * * @param alpha A scale factor, usually positive. + * @return this Options instance. */ public static Options alpha(Float alpha) { return new Options().alpha(alpha); } - + /** + * Sets the beta option. + * * @param beta An exponent. + * @return this Options instance. */ public static Options beta(Float beta) { return new Options().beta(beta); } - + /** + * Gets output. * The gradients for LRN. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LRNGrad"; - - private Output output; - - private LocalResponseNormalizationGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.LocalResponseNormalizationGrad} + */ + public static class Options { + private Long depthRadius; + + private Float bias; + + private Float alpha; + + private Float beta; + + private Options() { + } + + /** + * Sets the depthRadius option. + * + * @param depthRadius A depth radius. + * @return this Options instance. + */ + public Options depthRadius(Long depthRadius) { + this.depthRadius = depthRadius; + return this; + } + + /** + * Sets the bias option. + * + * @param bias An offset (usually > 0 to avoid dividing by 0). + * @return this Options instance. + */ + public Options bias(Float bias) { + this.bias = bias; + return this; + } + + /** + * Sets the alpha option. + * + * @param alpha A scale factor, usually positive. + * @return this Options instance. + */ + public Options alpha(Float alpha) { + this.alpha = alpha; + return this; + } + + /** + * Sets the beta option. + * + * @param beta An exponent. + * @return this Options instance. + */ + public Options beta(Float beta) { + this.beta = 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 75addd4b6a8..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,63 +17,100 @@ 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 log softmax activations. - *

- * For each batch `i` and class `j` we have - *

- * logsoftmax[i, j] = logits[i, j] - log(sum(exp(logits[i]))) - * - * @param data type for {@code logsoftmax()} output + * For each batch {@code i} and class {@code j} we have + *

+ * logsoftmax[i, j] = logits[i, j] - log(sum(exp(logits[i])))
+ * 
*/ -@Operator(group = "nn") +@OpMetadata( + opType = LogSoftmax.OP_NAME, + inputsClass = LogSoftmax.Inputs.class +) +@Operator( + group = "nn" +) public final class LogSoftmax extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LogSoftmax"; + + private Output logsoftmax; + + public LogSoftmax(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + logsoftmax = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LogSoftmax operation. - * + * * @param scope current scope - * @param logits 2-D with shape `[batch_size, num_classes]`. + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static LogSoftmax create(Scope scope, Operand logits) { - OperationBuilder opBuilder = scope.env().opBuilder("LogSoftmax", scope.makeOpName("LogSoftmax")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LogSoftmax"); opBuilder.addInput(logits.asOutput()); - opBuilder = scope.apply(opBuilder); - return new LogSoftmax(opBuilder.build()); + return new LogSoftmax<>(opBuilder.build()); } - + /** - * Same shape as `logits`. + * Gets logsoftmax. + * Same shape as {@code logits}. + * @return logsoftmax. */ public Output logsoftmax() { return logsoftmax; } - + @Override public Output asOutput() { return logsoftmax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LogSoftmax"; - - private Output logsoftmax; - - private LogSoftmax(Operation operation) { - super(operation); - int outputIdx = 0; - logsoftmax = operation.output(outputIdx++); + + @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 ad87046045e..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,67 +17,69 @@ 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.TType; +import org.tensorflow.types.family.TNumber; /** * Performs max pooling on the input. - * - * @param data type for {@code output()} output */ -@Operator(group = "nn") -public final class MaxPool extends RawOp implements Operand { - +@OpMetadata( + opType = MaxPool.OP_NAME, + inputsClass = MaxPool.Inputs.class +) +@Operator( + group = "nn" +) +public final class MaxPool extends RawOp implements Operand { /** - * Optional attributes for {@link org.tensorflow.op.nn.MaxPool} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "MaxPoolV2"; + + private Output output; + + public MaxPool(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new MaxPool operation. - * + * Factory method to create a class wrapping a new MaxPoolV2 operation. + * * @param scope current scope * @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 * input tensor. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MaxPoolV2} output and operands * @return a new instance of MaxPool */ - @Endpoint(describeByClass = true) - public static MaxPool create(Scope scope, Operand input, Operand ksize, Operand strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MaxPoolV2", scope.makeOpName("MaxPool")); + @Endpoint( + describeByClass = true + ) + public static MaxPool create(Scope scope, Operand input, + Operand ksize, Operand strides, String padding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MaxPool"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(ksize.asOutput()); opBuilder.addInput(strides.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("padding", padding); if (options != null) { for (Options opts : options) { @@ -86,40 +88,110 @@ public static MaxPool create(Scope scope, Operand input, } } } - return new MaxPool(opBuilder.build()); + return new MaxPool<>(opBuilder.build()); } - + /** + * 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]. + * 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); } - + /** + * Gets output. * The max pooled output tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MaxPoolV2"; - - private Output output; - - private MaxPool(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.MaxPool} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * 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; + } + } + + @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 bb802045fc4..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,73 +17,75 @@ 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 */ -@Operator(group = "nn") +@OpMetadata( + opType = MaxPool3d.OP_NAME, + inputsClass = MaxPool3d.Inputs.class +) +@Operator( + group = "nn" +) public final class MaxPool3d extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.MaxPool3d} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat 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 Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "MaxPool3D"; + + private Output output; + + public MaxPool3d(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new MaxPool3d operation. - * + * Factory method to create a class wrapping a new MaxPool3D operation. + * * @param scope current scope - * @param input Shape `[batch, depth, rows, cols, channels]` tensor to pool over. + * @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 `ksize[0] = ksize[4] = 1`. + * the input tensor. Must have {@code ksize[0] = ksize[4] = 1}. * @param strides 1-D tensor of length 5. The stride of the sliding window for each - * dimension of `input`. Must have `strides[0] = strides[4] = 1`. + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MaxPool3D} output and operands * @return a new instance of MaxPool3d */ - @Endpoint(describeByClass = true) - public static MaxPool3d create(Scope scope, Operand input, List ksize, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MaxPool3D", scope.makeOpName("MaxPool3d")); + @Endpoint( + describeByClass = true + ) + public static MaxPool3d create(Scope scope, Operand input, + List ksize, List strides, String padding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MaxPool3d"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + 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) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -95,40 +97,111 @@ public static MaxPool3d create(Scope scope, Operand in } } } - return new MaxPool3d(opBuilder.build()); + return new MaxPool3d<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat 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]. + * 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]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Gets output. * The max pooled output tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MaxPool3D"; - - private Output output; - - private MaxPool3d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.MaxPool3d} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat 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]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = 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 12966ef1c04..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,77 +17,81 @@ 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 */ -@Operator(group = "nn") +@OpMetadata( + opType = MaxPool3dGrad.OP_NAME, + inputsClass = MaxPool3dGrad.Inputs.class +) +@Operator( + group = "nn" +) public final class MaxPool3dGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.MaxPool3dGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat 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 Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "MaxPool3DGrad"; + + private Output output; + + public MaxPool3dGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new MaxPool3dGrad operation. - * + * Factory method to create a class wrapping a new MaxPool3DGrad operation. + * * @param scope current scope * @param origInput The original input tensor. * @param origOutput The original output tensor. - * @param grad Output backprop of shape `[batch, depth, rows, cols, channels]`. + * @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 - * the input tensor. Must have `ksize[0] = ksize[4] = 1`. + * the input tensor. Must have {@code ksize[0] = ksize[4] = 1}. * @param strides 1-D tensor of length 5. The stride of the sliding window for each - * dimension of `input`. Must have `strides[0] = strides[4] = 1`. + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MaxPool3DGrad} output and operands + * @param data type for {@code MaxPool3DGrad} output and operands * @return a new instance of MaxPool3dGrad */ - @Endpoint(describeByClass = true) - public static MaxPool3dGrad create(Scope scope, Operand origInput, Operand origOutput, Operand grad, List ksize, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MaxPool3DGrad", scope.makeOpName("MaxPool3dGrad")); + @Endpoint( + describeByClass = true + ) + public static MaxPool3dGrad create(Scope scope, + Operand origInput, Operand origOutput, Operand grad, List ksize, + List strides, String padding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MaxPool3dGrad"); opBuilder.addInput(origInput.asOutput()); opBuilder.addInput(origOutput.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + 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) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -99,39 +103,129 @@ public static MaxPool3dGrad create(Sco } } } - return new MaxPool3dGrad(opBuilder.build()); + return new MaxPool3dGrad<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat 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]. + * 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]. + * @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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MaxPool3DGrad"; - - private Output output; - - private MaxPool3dGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.MaxPool3dGrad} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat 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]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = 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 1153cc1fb68..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,77 +17,80 @@ 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 */ -@Operator(group = "nn") +@OpMetadata( + opType = MaxPool3dGradGrad.OP_NAME, + inputsClass = MaxPool3dGradGrad.Inputs.class +) +@Operator( + group = "nn" +) public final class MaxPool3dGradGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.MaxPool3dGradGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat 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 Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "MaxPool3DGradGrad"; + + private Output output; + + public MaxPool3dGradGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new MaxPool3dGradGrad operation. - * + * Factory method to create a class wrapping a new MaxPool3DGradGrad operation. + * * @param scope current scope * @param origInput The original input tensor. * @param origOutput The original output tensor. - * @param grad Output backprop of shape `[batch, depth, rows, cols, channels]`. + * @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 - * the input tensor. Must have `ksize[0] = ksize[4] = 1`. + * the input tensor. Must have {@code ksize[0] = ksize[4] = 1}. * @param strides 1-D tensor of length 5. The stride of the sliding window for each - * dimension of `input`. Must have `strides[0] = strides[4] = 1`. + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MaxPool3DGradGrad} output and operands * @return a new instance of MaxPool3dGradGrad */ - @Endpoint(describeByClass = true) - public static MaxPool3dGradGrad create(Scope scope, Operand origInput, Operand origOutput, Operand grad, List ksize, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MaxPool3DGradGrad", scope.makeOpName("MaxPool3dGradGrad")); + @Endpoint( + describeByClass = true + ) + public static MaxPool3dGradGrad create(Scope scope, Operand origInput, + Operand origOutput, Operand grad, List ksize, List strides, String padding, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MaxPool3dGradGrad"); opBuilder.addInput(origInput.asOutput()); opBuilder.addInput(origOutput.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + 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) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -99,40 +102,123 @@ public static MaxPool3dGradGrad create(Scope scope, Opera } } } - return new MaxPool3dGradGrad(opBuilder.build()); + return new MaxPool3dGradGrad<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat 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]. + * 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]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** - * Gradients of gradients w.r.t. the input to `max_pool`. + * Gets output. + * Gradients of gradients w.r.t. the input to {@code max_pool}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MaxPool3DGradGrad"; - - private Output output; - - private MaxPool3dGradGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.MaxPool3dGradGrad} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat 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]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = 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 58bcd623533..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,71 +17,74 @@ 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 */ -@Operator(group = "nn") +@OpMetadata( + opType = MaxPoolGrad.OP_NAME, + inputsClass = MaxPoolGrad.Inputs.class +) +@Operator( + group = "nn" +) public final class MaxPoolGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "MaxPoolGradV2"; + + private Output output; + + public MaxPoolGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new MaxPoolGrad operation. - * + * Factory method to create a class wrapping a new MaxPoolGradV2 operation. + * * @param scope current scope * @param origInput The original input tensor. * @param origOutput The original output tensor. - * @param grad 4-D. Gradients w.r.t. the output of `max_pool`. + * @param grad 4-D. Gradients w.r.t. the 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code MaxPoolGradV2} output and operands * @return a new instance of MaxPoolGrad */ - @Endpoint(describeByClass = true) - public static MaxPoolGrad create(Scope scope, Operand origInput, Operand origOutput, Operand grad, Operand ksize, Operand strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MaxPoolGradV2", scope.makeOpName("MaxPoolGrad")); + @Endpoint( + describeByClass = true + ) + public static MaxPoolGrad create(Scope scope, Operand origInput, + Operand origOutput, Operand grad, Operand ksize, Operand strides, + String padding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MaxPoolGrad"); opBuilder.addInput(origInput.asOutput()); opBuilder.addInput(origOutput.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(ksize.asOutput()); opBuilder.addInput(strides.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("padding", padding); if (options != null) { for (Options opts : options) { @@ -90,40 +93,122 @@ public static MaxPoolGrad create(Scope scope, Operand } } } - return new MaxPoolGrad(opBuilder.build()); + return new MaxPoolGrad<>(opBuilder.build()); } - + /** + * 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]. + * 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); } - + /** - * Gradients w.r.t. the input to `max_pool`. + * Gets output. + * Gradients w.r.t. the input to {@code max_pool}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MaxPoolGradV2"; - - private Output output; - - private MaxPoolGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolGrad} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * 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; + } + } + + @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 84ad249f82d..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,71 +17,74 @@ 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 */ -@Operator(group = "nn") +@OpMetadata( + opType = MaxPoolGradGrad.OP_NAME, + inputsClass = MaxPoolGradGrad.Inputs.class +) +@Operator( + group = "nn" +) public final class MaxPoolGradGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolGradGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "MaxPoolGradGradV2"; + + private Output output; + + public MaxPoolGradGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new MaxPoolGradGrad operation. - * + * Factory method to create a class wrapping a new MaxPoolGradGradV2 operation. + * * @param scope current scope * @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 `max_pool`. + * @param grad 4-D. Gradients of gradients w.r.t. the input 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code MaxPoolGradGradV2} output and operands * @return a new instance of MaxPoolGradGrad */ - @Endpoint(describeByClass = true) - public static MaxPoolGradGrad create(Scope scope, Operand origInput, Operand origOutput, Operand grad, Operand ksize, Operand strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MaxPoolGradGradV2", scope.makeOpName("MaxPoolGradGrad")); + @Endpoint( + describeByClass = true + ) + public static MaxPoolGradGrad create(Scope scope, Operand origInput, + Operand origOutput, Operand grad, Operand ksize, Operand strides, + String padding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MaxPoolGradGrad"); opBuilder.addInput(origInput.asOutput()); opBuilder.addInput(origOutput.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(ksize.asOutput()); opBuilder.addInput(strides.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("padding", padding); if (options != null) { for (Options opts : options) { @@ -90,40 +93,122 @@ public static MaxPoolGradGrad create(Scope scope, Operand } } } - return new MaxPoolGradGrad(opBuilder.build()); + return new MaxPoolGradGrad<>(opBuilder.build()); } - + /** + * 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]. + * 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); } - + /** - * Gradients of gradients w.r.t. the input to `max_pool`. + * Gets output. + * Gradients of gradients w.r.t. the input to {@code max_pool}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MaxPoolGradGradV2"; - - private Output output; - - private MaxPoolGradGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolGradGrad} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * 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; + } + } + + @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 9c01c23db6d..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,73 +17,80 @@ 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 */ -@Operator(group = "nn") +@OpMetadata( + opType = MaxPoolGradGradWithArgmax.OP_NAME, + inputsClass = MaxPoolGradGradWithArgmax.Inputs.class +) +@Operator( + group = "nn" +) public final class MaxPoolGradGradWithArgmax extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolGradGradWithArgmax} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param includeBatchInIndex Whether to include batch dimension in flattened index of `argmax`. - */ - public Options includeBatchInIndex(Boolean includeBatchInIndex) { - this.includeBatchInIndex = includeBatchInIndex; - return this; - } - - private Boolean includeBatchInIndex; - - private Options() { - } + public static final String OP_NAME = "MaxPoolGradGradWithArgmax"; + + private Output output; + + public MaxPoolGradGradWithArgmax(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new MaxPoolGradGradWithArgmax operation. - * + * * @param scope current scope * @param input The original input. - * @param grad 4-D with shape `[batch, height, width, channels]`. Gradients w.r.t. the - * input of `max_pool`. - * @param argmax The indices of the maximum values chosen for each output of `max_pool`. + * @param grad 4-D with shape {@code [batch, height, width, channels]}. Gradients w.r.t. the + * input 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code MaxPoolGradGradWithArgmax} output and operands * @return a new instance of MaxPoolGradGradWithArgmax */ - @Endpoint(describeByClass = true) - public static MaxPoolGradGradWithArgmax create(Scope scope, Operand input, Operand grad, Operand argmax, List ksize, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MaxPoolGradGradWithArgmax", scope.makeOpName("MaxPoolGradGradWithArgmax")); + @Endpoint( + describeByClass = true + ) + public static MaxPoolGradGradWithArgmax create(Scope scope, + Operand input, Operand grad, Operand argmax, List ksize, + List strides, String padding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MaxPoolGradGradWithArgmax"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(argmax.asOutput()); - opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + 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) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -95,36 +102,117 @@ public static MaxPoolGradGradWithArgmax create(Scope scop } } } - return new MaxPoolGradGradWithArgmax(opBuilder.build()); + return new MaxPoolGradGradWithArgmax<>(opBuilder.build()); } - + /** - * @param includeBatchInIndex Whether to include batch dimension in flattened index of `argmax`. + * Sets the includeBatchInIndex option. + * + * @param includeBatchInIndex Whether to include batch dimension in flattened index of {@code argmax}. + * @return this Options instance. */ public static Options includeBatchInIndex(Boolean includeBatchInIndex) { return new Options().includeBatchInIndex(includeBatchInIndex); } - + /** - * Gradients of gradients w.r.t. the input of `max_pool`. + * Gets output. + * Gradients of gradients w.r.t. the input of {@code max_pool}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MaxPoolGradGradWithArgmax"; - - private Output output; - - private MaxPoolGradGradWithArgmax(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolGradGradWithArgmax} + */ + public static class Options { + private Boolean includeBatchInIndex; + + private Options() { + } + + /** + * Sets the includeBatchInIndex option. + * + * @param includeBatchInIndex Whether to include batch dimension in flattened index of {@code argmax}. + * @return this Options instance. + */ + public Options includeBatchInIndex(Boolean includeBatchInIndex) { + this.includeBatchInIndex = 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 c07cb6f16a5..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,72 +17,80 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolGradWithArgmax} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param includeBatchInIndex Whether to include batch dimension in flattened index of `argmax`. - */ - public Options includeBatchInIndex(Boolean includeBatchInIndex) { - this.includeBatchInIndex = includeBatchInIndex; - return this; - } - - private Boolean includeBatchInIndex; - - private Options() { - } + public static final String OP_NAME = "MaxPoolGradWithArgmax"; + + private Output output; + + public MaxPoolGradWithArgmax(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new MaxPoolGradWithArgmax operation. - * + * * @param scope current scope * @param input The original input. - * @param grad 4-D with shape `[batch, height, width, channels]`. Gradients w.r.t. the - * output of `max_pool`. - * @param argmax The indices of the maximum values chosen for each output of `max_pool`. + * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code MaxPoolGradWithArgmax} output and operands * @return a new instance of MaxPoolGradWithArgmax */ - @Endpoint(describeByClass = true) - public static MaxPoolGradWithArgmax create(Scope scope, Operand input, Operand grad, Operand argmax, List ksize, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MaxPoolGradWithArgmax", scope.makeOpName("MaxPoolGradWithArgmax")); + @Endpoint( + describeByClass = true + ) + public static MaxPoolGradWithArgmax create(Scope scope, Operand input, + Operand grad, Operand argmax, List ksize, List strides, + String padding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MaxPoolGradWithArgmax"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(argmax.asOutput()); - opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + 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) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -94,36 +102,117 @@ public static MaxPoolGradWithArgmax create(Scope scope, O } } } - return new MaxPoolGradWithArgmax(opBuilder.build()); + return new MaxPoolGradWithArgmax<>(opBuilder.build()); } - + /** - * @param includeBatchInIndex Whether to include batch dimension in flattened index of `argmax`. + * Sets the includeBatchInIndex option. + * + * @param includeBatchInIndex Whether to include batch dimension in flattened index of {@code argmax}. + * @return this Options instance. */ public static Options includeBatchInIndex(Boolean includeBatchInIndex) { return new Options().includeBatchInIndex(includeBatchInIndex); } - + /** - * Gradients w.r.t. the input of `max_pool`. + * Gets output. + * Gradients w.r.t. the input of {@code max_pool}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MaxPoolGradWithArgmax"; - - private Output output; - - private MaxPoolGradWithArgmax(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolGradWithArgmax} + */ + public static class Options { + private Boolean includeBatchInIndex; + + private Options() { + } + + /** + * Sets the includeBatchInIndex option. + * + * @param includeBatchInIndex Whether to include batch dimension in flattened index of {@code argmax}. + * @return this Options instance. + */ + public Options includeBatchInIndex(Boolean includeBatchInIndex) { + this.includeBatchInIndex = 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 f269753c21b..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,82 +17,90 @@ 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; /** * Performs max pooling on the input and outputs both max values and indices. - *

- * The indices in `argmax` are flattened, so that a maximum value at position - * `[b, y, x, c]` becomes flattened index: - * `(y * width + x) * channels + c` if `include_batch_in_index` is False; - * `((b * height + y) * width + x) * channels + c` if `include_batch_in_index` is True. - *

- * The indices returned are always in `[0, height) x [0, width)` before flattening, + * The indices in {@code argmax} are flattened, so that a maximum value at position + * {@code [b, y, x, c]} becomes flattened index: + * {@code (y * width + x) * channels + c} if {@code include_batch_in_index} is False; + * {@code ((b * height + y) * width + x) * channels + c} if {@code include_batch_in_index} is True. + *

The indices returned are always in {@code [0, height) x [0, width)} before flattening, * 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 */ -@Operator(group = "nn") +@OpMetadata( + opType = MaxPoolWithArgmax.OP_NAME, + inputsClass = MaxPoolWithArgmax.Inputs.class +) +@Operator( + group = "nn" +) public final class MaxPoolWithArgmax extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolWithArgmax} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param includeBatchInIndex Whether to include batch dimension in flattened index of `argmax`. - */ - public Options includeBatchInIndex(Boolean includeBatchInIndex) { - this.includeBatchInIndex = includeBatchInIndex; - return this; - } - - private Boolean includeBatchInIndex; - - private Options() { - } + public static final String OP_NAME = "MaxPoolWithArgmax"; + + private Output output; + + private Output argmax; + + public MaxPoolWithArgmax(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + argmax = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new MaxPoolWithArgmax operation. - * + * * @param scope current scope - * @param input 4-D with shape `[batch, height, width, channels]`. Input to pool over. + * @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 + * @param Targmax The value of the Targmax attribute * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MaxPoolWithArgmax} output and operands + * @param data type for {@code MaxPoolWithArgmax} output and operands * @return a new instance of MaxPoolWithArgmax */ - @Endpoint(describeByClass = true) - public static MaxPoolWithArgmax create(Scope scope, Operand input, List ksize, List strides, Class Targmax, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MaxPoolWithArgmax", scope.makeOpName("MaxPoolWithArgmax")); + @Endpoint( + describeByClass = true + ) + public static MaxPoolWithArgmax create(Scope scope, + Operand input, List ksize, List strides, Class Targmax, String padding, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MaxPoolWithArgmax"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + 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) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -105,57 +113,129 @@ public static MaxPoolWithArgmax cre } } } - return new MaxPoolWithArgmax(opBuilder.build()); + return new MaxPoolWithArgmax<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new MaxPoolWithArgmax operation using default output types. - * + * Factory method to create a class wrapping a new MaxPoolWithArgmax operation, with the default output types. + * * @param scope current scope - * @param input 4-D with shape `[batch, height, width, channels]`. Input to pool over. + * @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 padding The type of padding algorithm to use. - * @param options carries optional attributes values - * @return a new instance of MaxPoolWithArgmax + * @param options carries optional attribute values + * @param data type for {@code MaxPoolWithArgmax} output and operands + * @return a new instance of MaxPoolWithArgmax, with default output types */ - @Endpoint(describeByClass = true) - public static MaxPoolWithArgmax create(Scope scope, Operand input, List ksize, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MaxPoolWithArgmax create(Scope scope, + Operand input, List ksize, List strides, String padding, Options... options) { return create(scope, input, ksize, strides, TInt64.class, padding, options); } - + /** - * @param includeBatchInIndex Whether to include batch dimension in flattened index of `argmax`. + * Sets the includeBatchInIndex option. + * + * @param includeBatchInIndex Whether to include batch dimension in flattened index of {@code argmax}. + * @return this Options instance. */ public static Options includeBatchInIndex(Boolean includeBatchInIndex) { return new Options().includeBatchInIndex(includeBatchInIndex); } - + /** + * Gets output. * The max pooled output tensor. + * @return output. */ public Output output() { return output; } - + /** + * Gets argmax. * 4-D. The flattened indices of the max values chosen for each output. + * @return argmax. */ public Output argmax() { return argmax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MaxPoolWithArgmax"; - - private Output output; - private Output argmax; - - private MaxPoolWithArgmax(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - argmax = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolWithArgmax} + */ + public static class Options { + private Boolean includeBatchInIndex; + + private Options() { + } + + /** + * Sets the includeBatchInIndex option. + * + * @param includeBatchInIndex Whether to include batch dimension in flattened index of {@code argmax}. + * @return this Options instance. + */ + public Options includeBatchInIndex(Boolean includeBatchInIndex) { + this.includeBatchInIndex = 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 9ea182bb4e5..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,69 +17,73 @@ 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; /** - * Finds values of the `n`-th order statistic for the last dimension. - *

+ * Finds values of the {@code n}-th order statistic for the last dimension. * If the input is a vector (rank-1), finds the entries which is the nth-smallest * value in the vector and outputs their values as scalar tensor. - *

- * For matrices (resp. higher rank input), computes the entries which is the + *

For matrices (resp. higher rank input), computes the entries which is the * nth-smallest value in each row (resp. vector along the last dimension). Thus, - *

- * values.shape = input.shape[:-1] - * - * @param data type for {@code values()} output + *

+ * values.shape = input.shape[:-1]
+ * 
*/ -@Operator(group = "nn") +@OpMetadata( + opType = NthElement.OP_NAME, + inputsClass = NthElement.Inputs.class +) +@Operator( + group = "nn" +) public final class NthElement extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.NthElement} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param reverse When set to True, find the nth-largest value in the vector and vice - * versa. - */ - public Options reverse(Boolean reverse) { - this.reverse = reverse; - return this; - } - - private Boolean reverse; - - private Options() { - } + public static final String OP_NAME = "NthElement"; + + private Output values; + + public NthElement(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + values = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new NthElement operation. - * + * * @param scope current scope - * @param input 1-D or higher with last dimension at least `n+1`. + * @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 `[0, input.shape[:-1])` - * @param options carries optional attributes values + * each row for matrices). Valid range of n is {@code [0, input.shape[:-1])} + * @param options carries optional attribute values + * @param data type for {@code NthElement} output and operands * @return a new instance of NthElement */ - @Endpoint(describeByClass = true) - public static NthElement create(Scope scope, Operand input, Operand n, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("NthElement", scope.makeOpName("NthElement")); + @Endpoint( + describeByClass = true + ) + public static NthElement create(Scope scope, Operand input, + Operand n, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "NthElement"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(n.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.reverse != null) { @@ -87,37 +91,89 @@ public static NthElement create(Scope scope, Operand i } } } - return new NthElement(opBuilder.build()); + return new NthElement<>(opBuilder.build()); } - + /** + * Sets the reverse option. + * * @param reverse When set to True, find the nth-largest value in the vector and vice * versa. + * @return this Options instance. */ public static Options reverse(Boolean reverse) { return new Options().reverse(reverse); } - + /** - * The `n`-th order statistic along each last dimensional slice. + * Gets values. + * The {@code n}-th order statistic along each last dimensional slice. + * @return values. */ public Output values() { return values; } - + @Override public Output asOutput() { return values; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NthElement"; - - private Output values; - - private NthElement(Operation operation) { - super(operation); - int outputIdx = 0; - values = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.NthElement} + */ + public static class Options { + private Boolean reverse; + + private Options() { + } + + /** + * Sets the reverse option. + * + * @param reverse When set to True, find the nth-largest value in the vector and vice + * versa. + * @return this Options instance. + */ + public Options reverse(Boolean reverse) { + this.reverse = 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 1548219e9e0..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,31 +17,59 @@ 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.TType; +import org.tensorflow.types.family.TNumber; /** * Produces the average pool of the input tensor for quantized types. - * - * @param data type for {@code output()} output */ -@Operator(group = "nn") -public final class QuantizedAvgPool extends RawOp { - +@OpMetadata( + opType = QuantizedAvgPool.OP_NAME, + inputsClass = QuantizedAvgPool.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedAvgPool extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizedAvgPool"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + public QuantizedAvgPool(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizedAvgPool operation. - * + * * @param scope current scope - * @param input 4-D with shape `[batch, height, width, channels]`. + * @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. * @param ksize The size of the window for each dimension of the input tensor. @@ -49,61 +77,111 @@ public final class QuantizedAvgPool extends RawOp { * @param strides 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. * @param padding The type of padding algorithm to use. + * @param data type for {@code QuantizedAvgPool} output and operands * @return a new instance of QuantizedAvgPool */ - @Endpoint(describeByClass = true) - public static QuantizedAvgPool create(Scope scope, Operand input, Operand minInput, Operand maxInput, List ksize, List strides, String padding) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedAvgPool", scope.makeOpName("QuantizedAvgPool")); + @Endpoint( + describeByClass = true + ) + public static QuantizedAvgPool create(Scope scope, Operand input, + Operand minInput, Operand maxInput, List ksize, List strides, + String padding) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedAvgPool"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(minInput.asOutput()); opBuilder.addInput(maxInput.asOutput()); - opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + 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) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); opBuilder.setAttr("padding", padding); - return new QuantizedAvgPool(opBuilder.build()); + return new QuantizedAvgPool<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. * The float value that the lowest quantized output value represents. + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. * The float value that the highest quantized output value represents. + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedAvgPool"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedAvgPool(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + @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 60f242ef636..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,32 +17,59 @@ 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.TType; +import org.tensorflow.types.family.TNumber; /** * Quantized Batch normalization. - *

* This op is deprecated and will be removed in the future. Prefer - * `tf.nn.batch_normalization`. - * - * @param data type for {@code result()} output + * {@code tf.nn.batch_normalization}. */ -@Operator(group = "nn") -public final class QuantizedBatchNormWithGlobalNormalization extends RawOp { - +@OpMetadata( + opType = QuantizedBatchNormWithGlobalNormalization.OP_NAME, + inputsClass = QuantizedBatchNormWithGlobalNormalization.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedBatchNormWithGlobalNormalization extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizedBatchNormWithGlobalNormalization"; + + private Output result; + + private Output resultMin; + + private Output resultMax; + + public QuantizedBatchNormWithGlobalNormalization(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + result = operation.output(outputIdx++); + resultMin = operation.output(outputIdx++); + resultMax = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizedBatchNormWithGlobalNormalization operation. - * + * * @param scope current scope * @param t A 4D input Tensor. * @param tMin The value represented by the lowest quantized input. @@ -62,19 +89,28 @@ public final class QuantizedBatchNormWithGlobalNormalization ex * @param betaMin The value represented by the lowest quantized offset. * @param betaMax The value represented by the highest quantized offset. * @param gamma A 1D gamma Tensor with size matching the last dimension of t. - * If "scale_after_normalization" is true, this tensor will be multiplied + * If "scale_after_normalization" is true, this tensor will be multiplied * 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 + * @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. + * @param data type for {@code QuantizedBatchNormWithGlobalNormalization} output and operands + * @param data type for {@code QuantizedBatchNormWithGlobalNormalization} output and operands * @return a new instance of QuantizedBatchNormWithGlobalNormalization */ - @Endpoint(describeByClass = true) - public static QuantizedBatchNormWithGlobalNormalization create(Scope scope, Operand t, Operand tMin, Operand tMax, Operand m, Operand mMin, Operand mMax, Operand v, Operand vMin, Operand vMax, Operand beta, Operand betaMin, Operand betaMax, Operand gamma, Operand gammaMin, Operand gammaMax, Class outType, Float varianceEpsilon, Boolean scaleAfterNormalization) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedBatchNormWithGlobalNormalization", scope.makeOpName("QuantizedBatchNormWithGlobalNormalization")); + @Endpoint( + describeByClass = true + ) + public static QuantizedBatchNormWithGlobalNormalization create( + Scope scope, Operand t, Operand tMin, Operand tMax, Operand m, + Operand mMin, Operand mMax, Operand v, Operand vMin, + Operand vMax, Operand beta, Operand betaMin, Operand betaMax, + Operand gamma, Operand gammaMin, Operand gammaMax, Class outType, + Float varianceEpsilon, Boolean scaleAfterNormalization) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedBatchNormWithGlobalNormalization"); opBuilder.addInput(t.asOutput()); opBuilder.addInput(tMin.asOutput()); opBuilder.addInput(tMax.asOutput()); @@ -90,43 +126,168 @@ public static QuantizedBatchNormWithGlobalNor opBuilder.addInput(gamma.asOutput()); opBuilder.addInput(gammaMin.asOutput()); opBuilder.addInput(gammaMax.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); opBuilder.setAttr("variance_epsilon", varianceEpsilon); opBuilder.setAttr("scale_after_normalization", scaleAfterNormalization); - return new QuantizedBatchNormWithGlobalNormalization(opBuilder.build()); + return new QuantizedBatchNormWithGlobalNormalization<>(opBuilder.build()); } - + /** + * Gets result. + * + * @return result. */ public Output result() { return result; } - + /** + * Gets resultMin. + * + * @return resultMin. */ public Output resultMin() { return resultMin; } - + /** + * Gets resultMax. + * + * @return resultMax. */ public Output resultMax() { return resultMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedBatchNormWithGlobalNormalization"; - - private Output result; - private Output resultMin; - private Output resultMax; - - private QuantizedBatchNormWithGlobalNormalization(Operation operation) { - super(operation); - int outputIdx = 0; - result = operation.output(outputIdx++); - resultMin = operation.output(outputIdx++); - resultMax = operation.output(outputIdx++); + + @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 b0aeac360c4..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,87 +17,175 @@ 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.TType; +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 */ -@Operator(group = "nn") -public final class QuantizedBiasAdd extends RawOp { - +@OpMetadata( + opType = QuantizedBiasAdd.OP_NAME, + inputsClass = QuantizedBiasAdd.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedBiasAdd extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizedBiasAdd"; + + private Output output; + + private Output minOut; + + private Output maxOut; + + public QuantizedBiasAdd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOut = operation.output(outputIdx++); + maxOut = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizedBiasAdd operation. - * + * * @param scope current scope - * @param input + * @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 + * @param outType The value of the outType attribute + * @param data type for {@code QuantizedBiasAdd} output and operands * @return a new instance of QuantizedBiasAdd */ - @Endpoint(describeByClass = true) - public static QuantizedBiasAdd create(Scope scope, Operand input, Operand bias, Operand minInput, Operand maxInput, Operand minBias, Operand maxBias, Class outType) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedBiasAdd", scope.makeOpName("QuantizedBiasAdd")); + @Endpoint( + describeByClass = true + ) + public static QuantizedBiasAdd create(Scope scope, + Operand input, Operand bias, Operand minInput, + Operand maxInput, Operand minBias, Operand maxBias, + Class outType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedBiasAdd"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(bias.asOutput()); opBuilder.addInput(minInput.asOutput()); opBuilder.addInput(maxInput.asOutput()); opBuilder.addInput(minBias.asOutput()); opBuilder.addInput(maxBias.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new QuantizedBiasAdd(opBuilder.build()); + return new QuantizedBiasAdd<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOut. * The float value that the lowest quantized output value represents. + * @return minOut. */ public Output minOut() { return minOut; } - + /** + * Gets maxOut. * The float value that the highest quantized output value represents. + * @return maxOut. */ public Output maxOut() { return maxOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedBiasAdd"; - - private Output output; - private Output minOut; - private Output maxOut; - - private QuantizedBiasAdd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOut = operation.output(outputIdx++); - maxOut = operation.output(outputIdx++); + + @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 fecb450e7da..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. @@ -17,81 +17,90 @@ 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.family.TType; +import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The QuantizedConv2DAndRelu operation */ -public final class QuantizedConv2DAndRelu extends RawOp { - +@OpMetadata( + opType = QuantizedConv2DAndRelu.OP_NAME, + inputsClass = QuantizedConv2DAndRelu.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedConv2DAndRelu extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DAndRelu} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2DAndRelu"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + public QuantizedConv2DAndRelu(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedConv2DAndRelu operation. - * + * * @param scope current scope - * @param input - * @param filter - * @param minInput - * @param maxInput - * @param minFilter - * @param maxFilter - * @param outType - * @param strides - * @param padding - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedConv2DAndRelu create(Scope scope, Operand input, Operand filter, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Class outType, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DAndRelu", scope.makeOpName("QuantizedConv2DAndRelu")); + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2DAndRelu create(Scope scope, + Operand input, Operand filter, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedConv2DAndRelu"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(minInput.asOutput()); opBuilder.addInput(maxInput.asOutput()); opBuilder.addInput(minFilter.asOutput()); opBuilder.addInput(maxFilter.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -100,67 +109,231 @@ public static QuantizedConv2DAndRelu create(Scope scope, Op for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } if (opts.paddingList != null) { long[] paddingListArray = new long[opts.paddingList.size()]; - for (int i = 0; i < paddingListArray.length; ++i) { + for (int i = 0 ; i < paddingListArray.length ; i++) { paddingListArray[i] = opts.paddingList.get(i); } opBuilder.setAttr("padding_list", paddingListArray); } } } - return new QuantizedConv2DAndRelu(opBuilder.build()); + return new QuantizedConv2DAndRelu<>(opBuilder.build()); } - + /** - * @param dilations + * 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); + } + /** - * @param paddingList + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long... paddingList) { + return new Options().paddingList(paddingList); + } + + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. + * + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. + * + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2DAndRelu"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2DAndRelu(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DAndRelu} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * 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; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(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 b1408decd0f..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. @@ -17,73 +17,84 @@ 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.family.TType; +import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The QuantizedConv2DAndReluAndRequantize operation */ -public final class QuantizedConv2DAndReluAndRequantize extends RawOp { - +@OpMetadata( + opType = QuantizedConv2DAndReluAndRequantize.OP_NAME, + inputsClass = QuantizedConv2DAndReluAndRequantize.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedConv2DAndReluAndRequantize extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DAndReluAndRequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2DAndReluAndRequantize"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + public QuantizedConv2DAndReluAndRequantize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedConv2DAndReluAndRequantize operation. - * + * * @param scope current scope - * @param input - * @param filter - * @param minInput - * @param maxInput - * @param minFilter - * @param maxFilter - * @param minFreezedOutput - * @param maxFreezedOutput - * @param outType - * @param strides - * @param padding - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedConv2DAndReluAndRequantize create(Scope scope, Operand input, Operand filter, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Operand minFreezedOutput, Operand maxFreezedOutput, Class outType, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DAndReluAndRequantize", scope.makeOpName("QuantizedConv2DAndReluAndRequantize")); + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2DAndReluAndRequantize create(Scope scope, + Operand input, Operand filter, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Operand minFreezedOutput, + Operand maxFreezedOutput, Class outType, List strides, String padding, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedConv2DAndReluAndRequantize"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(minInput.asOutput()); @@ -92,10 +103,9 @@ public static QuantizedConv2DAndReluAndRequantize create(Sc opBuilder.addInput(maxFilter.asOutput()); opBuilder.addInput(minFreezedOutput.asOutput()); opBuilder.addInput(maxFreezedOutput.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -104,67 +114,243 @@ public static QuantizedConv2DAndReluAndRequantize create(Sc for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } if (opts.paddingList != null) { long[] paddingListArray = new long[opts.paddingList.size()]; - for (int i = 0; i < paddingListArray.length; ++i) { + for (int i = 0 ; i < paddingListArray.length ; i++) { paddingListArray[i] = opts.paddingList.get(i); } opBuilder.setAttr("padding_list", paddingListArray); } } } - return new QuantizedConv2DAndReluAndRequantize(opBuilder.build()); + return new QuantizedConv2DAndReluAndRequantize<>(opBuilder.build()); } - + /** - * @param dilations + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + /** - * @param paddingList + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public static Options dilations(Long... dilations) { + return new Options().dilations(dilations); + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long... paddingList) { + return new Options().paddingList(paddingList); + } + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. + * + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. + * + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2DAndReluAndRequantize"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2DAndReluAndRequantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DAndReluAndRequantize} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * 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; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(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 5ed39bd2375..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. @@ -17,73 +17,84 @@ 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.family.TType; +import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The QuantizedConv2DAndRequantize operation */ -public final class QuantizedConv2DAndRequantize extends RawOp { - +@OpMetadata( + opType = QuantizedConv2DAndRequantize.OP_NAME, + inputsClass = QuantizedConv2DAndRequantize.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedConv2DAndRequantize extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DAndRequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2DAndRequantize"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + public QuantizedConv2DAndRequantize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedConv2DAndRequantize operation. - * + * * @param scope current scope - * @param input - * @param filter - * @param minInput - * @param maxInput - * @param minFilter - * @param maxFilter - * @param minFreezedOutput - * @param maxFreezedOutput - * @param outType - * @param strides - * @param padding - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedConv2DAndRequantize create(Scope scope, Operand input, Operand filter, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Operand minFreezedOutput, Operand maxFreezedOutput, Class outType, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DAndRequantize", scope.makeOpName("QuantizedConv2DAndRequantize")); + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2DAndRequantize create(Scope scope, + Operand input, Operand filter, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Operand minFreezedOutput, + Operand maxFreezedOutput, Class outType, List strides, String padding, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedConv2DAndRequantize"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(minInput.asOutput()); @@ -92,10 +103,9 @@ public static QuantizedConv2DAndRequantize create(Scope sco opBuilder.addInput(maxFilter.asOutput()); opBuilder.addInput(minFreezedOutput.asOutput()); opBuilder.addInput(maxFreezedOutput.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -104,67 +114,243 @@ public static QuantizedConv2DAndRequantize create(Scope sco for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } if (opts.paddingList != null) { long[] paddingListArray = new long[opts.paddingList.size()]; - for (int i = 0; i < paddingListArray.length; ++i) { + for (int i = 0 ; i < paddingListArray.length ; i++) { paddingListArray[i] = opts.paddingList.get(i); } opBuilder.setAttr("padding_list", paddingListArray); } } } - return new QuantizedConv2DAndRequantize(opBuilder.build()); + return new QuantizedConv2DAndRequantize<>(opBuilder.build()); } - + /** - * @param dilations + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + /** - * @param paddingList + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public static Options dilations(Long... dilations) { + return new Options().dilations(dilations); + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long... paddingList) { + return new Options().paddingList(paddingList); + } + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. + * + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. + * + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2DAndRequantize"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2DAndRequantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DAndRequantize} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * 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; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(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 d8f5b063d73..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. @@ -17,48 +17,58 @@ 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.family.TType; +import org.tensorflow.types.family.TNumber; /** * Computes QuantizedConv2D per channel. - * - * @param data type for {@code output()} output */ -public final class QuantizedConv2DPerChannel extends RawOp { - +@OpMetadata( + opType = QuantizedConv2DPerChannel.OP_NAME, + inputsClass = QuantizedConv2DPerChannel.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedConv2DPerChannel extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DPerChannel} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations list of dilation values. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private List dilations; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2DPerChannel"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + public QuantizedConv2DPerChannel(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedConv2DPerChannel operation. - * + * * @param scope current scope * @param input The original input tensor. * @param filter The original filter tensor. @@ -68,23 +78,29 @@ private Options() { * @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 - * @param options carries optional attributes 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 */ - @Endpoint(describeByClass = true) - public static QuantizedConv2DPerChannel create(Scope scope, Operand input, Operand filter, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Class outType, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DPerChannel", scope.makeOpName("QuantizedConv2DPerChannel")); + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2DPerChannel create(Scope scope, + Operand input, Operand filter, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedConv2DPerChannel"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(minInput.asOutput()); opBuilder.addInput(maxInput.asOutput()); opBuilder.addInput(minFilter.asOutput()); opBuilder.addInput(maxFilter.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -93,56 +109,174 @@ public static QuantizedConv2DPerChannel create(Scope scope, for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new QuantizedConv2DPerChannel(opBuilder.build()); + return new QuantizedConv2DPerChannel<>(opBuilder.build()); } - + /** + * Sets the dilations option. + * * @param dilations list of dilation values. + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + /** + * Sets the dilations option. + * + * @param dilations list of dilation values. + * @return this Options instance. + */ + public static Options dilations(Long... dilations) { + return new Options().dilations(dilations); + } + + /** + * Gets output. * The output tensor. + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. * The minimum value of the final output tensor. + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. * The maximum value of the final output tensor. + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2DPerChannel"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2DPerChannel(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DPerChannel} + */ + public static class Options { + private List dilations; + + private Options() { + } + + /** + * Sets the dilations option. + * + * @param dilations list of dilation values. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations list of dilation values. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(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 4effcf06f22..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. @@ -17,72 +17,82 @@ 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.family.TType; +import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The QuantizedConv2DWithBias operation */ -public final class QuantizedConv2DWithBias extends RawOp { - +@OpMetadata( + opType = QuantizedConv2DWithBias.OP_NAME, + inputsClass = QuantizedConv2DWithBias.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedConv2DWithBias extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBias} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2DWithBias"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + public QuantizedConv2DWithBias(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedConv2DWithBias operation. - * + * * @param scope current scope - * @param input - * @param filter - * @param bias - * @param minInput - * @param maxInput - * @param minFilter - * @param maxFilter - * @param outType - * @param strides - * @param padding - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedConv2DWithBias create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Class outType, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DWithBias", scope.makeOpName("QuantizedConv2DWithBias")); + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2DWithBias create(Scope scope, + Operand input, Operand filter, Operand bias, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedConv2DWithBias"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(bias.asOutput()); @@ -90,10 +100,9 @@ public static QuantizedConv2DWithBias create(Scope scope, O opBuilder.addInput(maxInput.asOutput()); opBuilder.addInput(minFilter.asOutput()); opBuilder.addInput(maxFilter.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -102,67 +111,237 @@ public static QuantizedConv2DWithBias create(Scope scope, O for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } if (opts.paddingList != null) { long[] paddingListArray = new long[opts.paddingList.size()]; - for (int i = 0; i < paddingListArray.length; ++i) { + for (int i = 0 ; i < paddingListArray.length ; i++) { paddingListArray[i] = opts.paddingList.get(i); } opBuilder.setAttr("padding_list", paddingListArray); } } } - return new QuantizedConv2DWithBias(opBuilder.build()); + return new QuantizedConv2DWithBias<>(opBuilder.build()); } - + /** - * @param dilations + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + /** - * @param paddingList + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public static Options dilations(Long... dilations) { + return new Options().dilations(dilations); + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long... paddingList) { + return new Options().paddingList(paddingList); + } + + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. + * + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. + * + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2DWithBias"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2DWithBias(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBias} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * 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; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(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 39764e1f273..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. @@ -17,72 +17,82 @@ 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.family.TType; +import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The QuantizedConv2DWithBiasAndRelu operation */ -public final class QuantizedConv2DWithBiasAndRelu extends RawOp { - +@OpMetadata( + opType = QuantizedConv2DWithBiasAndRelu.OP_NAME, + inputsClass = QuantizedConv2DWithBiasAndRelu.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedConv2DWithBiasAndRelu extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasAndRelu} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2DWithBiasAndRelu"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + public QuantizedConv2DWithBiasAndRelu(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedConv2DWithBiasAndRelu operation. - * + * * @param scope current scope - * @param input - * @param filter - * @param bias - * @param minInput - * @param maxInput - * @param minFilter - * @param maxFilter - * @param outType - * @param strides - * @param padding - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedConv2DWithBiasAndRelu create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Class outType, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DWithBiasAndRelu", scope.makeOpName("QuantizedConv2DWithBiasAndRelu")); + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2DWithBiasAndRelu create(Scope scope, + Operand input, Operand filter, Operand bias, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedConv2DWithBiasAndRelu"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(bias.asOutput()); @@ -90,10 +100,9 @@ public static QuantizedConv2DWithBiasAndRelu create(Scope s opBuilder.addInput(maxInput.asOutput()); opBuilder.addInput(minFilter.asOutput()); opBuilder.addInput(maxFilter.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -102,67 +111,237 @@ public static QuantizedConv2DWithBiasAndRelu create(Scope s for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } if (opts.paddingList != null) { long[] paddingListArray = new long[opts.paddingList.size()]; - for (int i = 0; i < paddingListArray.length; ++i) { + for (int i = 0 ; i < paddingListArray.length ; i++) { paddingListArray[i] = opts.paddingList.get(i); } opBuilder.setAttr("padding_list", paddingListArray); } } } - return new QuantizedConv2DWithBiasAndRelu(opBuilder.build()); + return new QuantizedConv2DWithBiasAndRelu<>(opBuilder.build()); } - + /** - * @param dilations + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + /** - * @param paddingList + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public static Options dilations(Long... dilations) { + return new Options().dilations(dilations); + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long... paddingList) { + return new Options().paddingList(paddingList); + } + + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. + * + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. + * + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2DWithBiasAndRelu"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2DWithBiasAndRelu(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasAndRelu} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * 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; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(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 de31b007153..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. @@ -17,74 +17,85 @@ 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.family.TType; +import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The QuantizedConv2DWithBiasAndReluAndRequantize operation */ -public final class QuantizedConv2DWithBiasAndReluAndRequantize extends RawOp { - +@OpMetadata( + opType = QuantizedConv2DWithBiasAndReluAndRequantize.OP_NAME, + inputsClass = QuantizedConv2DWithBiasAndReluAndRequantize.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedConv2DWithBiasAndReluAndRequantize extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasAndReluAndRequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2DWithBiasAndReluAndRequantize"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + public QuantizedConv2DWithBiasAndReluAndRequantize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedConv2DWithBiasAndReluAndRequantize operation. - * + * * @param scope current scope - * @param input - * @param filter - * @param bias - * @param minInput - * @param maxInput - * @param minFilter - * @param maxFilter - * @param minFreezedOutput - * @param maxFreezedOutput - * @param outType - * @param strides - * @param padding - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedConv2DWithBiasAndReluAndRequantize create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Operand minFreezedOutput, Operand maxFreezedOutput, Class outType, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DWithBiasAndReluAndRequantize", scope.makeOpName("QuantizedConv2DWithBiasAndReluAndRequantize")); + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2DWithBiasAndReluAndRequantize create( + Scope scope, Operand input, Operand filter, + Operand bias, Operand minInput, Operand maxInput, + Operand minFilter, Operand maxFilter, Operand minFreezedOutput, + Operand maxFreezedOutput, Class outType, List strides, String padding, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedConv2DWithBiasAndReluAndRequantize"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(bias.asOutput()); @@ -94,10 +105,9 @@ public static QuantizedConv2DWithBiasAndReluAndRequantize c opBuilder.addInput(maxFilter.asOutput()); opBuilder.addInput(minFreezedOutput.asOutput()); opBuilder.addInput(maxFreezedOutput.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -106,67 +116,255 @@ public static QuantizedConv2DWithBiasAndReluAndRequantize c for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } if (opts.paddingList != null) { long[] paddingListArray = new long[opts.paddingList.size()]; - for (int i = 0; i < paddingListArray.length; ++i) { + for (int i = 0 ; i < paddingListArray.length ; i++) { paddingListArray[i] = opts.paddingList.get(i); } opBuilder.setAttr("padding_list", paddingListArray); } } } - return new QuantizedConv2DWithBiasAndReluAndRequantize(opBuilder.build()); + return new QuantizedConv2DWithBiasAndReluAndRequantize<>(opBuilder.build()); } - + /** - * @param dilations + * 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); + } + /** - * @param paddingList + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long... paddingList) { + return new Options().paddingList(paddingList); + } + + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. + * + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. + * + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2DWithBiasAndReluAndRequantize"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2DWithBiasAndReluAndRequantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasAndReluAndRequantize} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * 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; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(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 59d1f4cbfaf..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. @@ -17,74 +17,85 @@ 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.family.TType; +import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The QuantizedConv2DWithBiasAndRequantize operation */ -public final class QuantizedConv2DWithBiasAndRequantize extends RawOp { - +@OpMetadata( + opType = QuantizedConv2DWithBiasAndRequantize.OP_NAME, + inputsClass = QuantizedConv2DWithBiasAndRequantize.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedConv2DWithBiasAndRequantize extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasAndRequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2DWithBiasAndRequantize"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + public QuantizedConv2DWithBiasAndRequantize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedConv2DWithBiasAndRequantize operation. - * + * * @param scope current scope - * @param input - * @param filter - * @param bias - * @param minInput - * @param maxInput - * @param minFilter - * @param maxFilter - * @param minFreezedOutput - * @param maxFreezedOutput - * @param outType - * @param strides - * @param padding - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedConv2DWithBiasAndRequantize create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Operand minFreezedOutput, Operand maxFreezedOutput, Class outType, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DWithBiasAndRequantize", scope.makeOpName("QuantizedConv2DWithBiasAndRequantize")); + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2DWithBiasAndRequantize create(Scope scope, + Operand input, Operand filter, + Operand bias, Operand minInput, Operand maxInput, + Operand minFilter, Operand maxFilter, Operand minFreezedOutput, + Operand maxFreezedOutput, Class outType, List strides, String padding, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedConv2DWithBiasAndRequantize"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(bias.asOutput()); @@ -94,10 +105,9 @@ public static QuantizedConv2DWithBiasAndRequantize create(S opBuilder.addInput(maxFilter.asOutput()); opBuilder.addInput(minFreezedOutput.asOutput()); opBuilder.addInput(maxFreezedOutput.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -106,67 +116,255 @@ public static QuantizedConv2DWithBiasAndRequantize create(S for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } if (opts.paddingList != null) { long[] paddingListArray = new long[opts.paddingList.size()]; - for (int i = 0; i < paddingListArray.length; ++i) { + for (int i = 0 ; i < paddingListArray.length ; i++) { paddingListArray[i] = opts.paddingList.get(i); } opBuilder.setAttr("padding_list", paddingListArray); } } } - return new QuantizedConv2DWithBiasAndRequantize(opBuilder.build()); + return new QuantizedConv2DWithBiasAndRequantize<>(opBuilder.build()); } - + /** - * @param dilations + * 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); + } + /** - * @param paddingList + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long... paddingList) { + return new Options().paddingList(paddingList); + } + + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. + * + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. + * + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2DWithBiasAndRequantize"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2DWithBiasAndRequantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasAndRequantize} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * 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; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(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 e9a27a0679f..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. @@ -17,77 +17,89 @@ 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.family.TType; +import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The QuantizedConv2DWithBiasSignedSumAndReluAndRequantize operation */ -public final class QuantizedConv2DWithBiasSignedSumAndReluAndRequantize extends RawOp { - +@OpMetadata( + opType = QuantizedConv2DWithBiasSignedSumAndReluAndRequantize.OP_NAME, + inputsClass = QuantizedConv2DWithBiasSignedSumAndReluAndRequantize.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedConv2DWithBiasSignedSumAndReluAndRequantize extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasSignedSumAndReluAndRequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2DWithBiasSignedSumAndReluAndRequantize"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + public QuantizedConv2DWithBiasSignedSumAndReluAndRequantize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedConv2DWithBiasSignedSumAndReluAndRequantize operation. - * + * * @param scope current scope - * @param input - * @param filter - * @param bias - * @param minInput - * @param maxInput - * @param minFilter - * @param maxFilter - * @param minFreezedOutput - * @param maxFreezedOutput - * @param summand - * @param minSummand - * @param maxSummand - * @param outType - * @param strides - * @param padding - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedConv2DWithBiasSignedSumAndReluAndRequantize create(Scope scope, 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, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DWithBiasSignedSumAndReluAndRequantize", scope.makeOpName("QuantizedConv2DWithBiasSignedSumAndReluAndRequantize")); + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2DWithBiasSignedSumAndReluAndRequantize create( + Scope scope, 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, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedConv2DWithBiasSignedSumAndReluAndRequantize"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(bias.asOutput()); @@ -100,10 +112,9 @@ public static QuantizedConv2DWithBiasSignedSumAndReluAndRequan opBuilder.addInput(summand.asOutput()); opBuilder.addInput(minSummand.asOutput()); opBuilder.addInput(maxSummand.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -112,67 +123,279 @@ public static QuantizedConv2DWithBiasSignedSumAndReluAndRequan for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } if (opts.paddingList != null) { long[] paddingListArray = new long[opts.paddingList.size()]; - for (int i = 0; i < paddingListArray.length; ++i) { + for (int i = 0 ; i < paddingListArray.length ; i++) { paddingListArray[i] = opts.paddingList.get(i); } opBuilder.setAttr("padding_list", paddingListArray); } } } - return new QuantizedConv2DWithBiasSignedSumAndReluAndRequantize(opBuilder.build()); + return new QuantizedConv2DWithBiasSignedSumAndReluAndRequantize<>(opBuilder.build()); } - + /** - * @param dilations + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + /** - * @param paddingList + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public static Options dilations(Long... dilations) { + return new Options().dilations(dilations); + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long... paddingList) { + return new Options().paddingList(paddingList); + } + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. + * + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. + * + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2DWithBiasSignedSumAndReluAndRequantize"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2DWithBiasSignedSumAndReluAndRequantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasSignedSumAndReluAndRequantize} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * 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; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(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 7bcd90b13fd..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. @@ -17,73 +17,83 @@ 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.family.TType; +import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The QuantizedConv2DWithBiasSumAndRelu operation */ -public final class QuantizedConv2DWithBiasSumAndRelu extends RawOp { - +@OpMetadata( + opType = QuantizedConv2DWithBiasSumAndRelu.OP_NAME, + inputsClass = QuantizedConv2DWithBiasSumAndRelu.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedConv2DWithBiasSumAndRelu extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasSumAndRelu} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2DWithBiasSumAndRelu"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + public QuantizedConv2DWithBiasSumAndRelu(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedConv2DWithBiasSumAndRelu operation. - * + * * @param scope current scope - * @param input - * @param filter - * @param bias - * @param minInput - * @param maxInput - * @param minFilter - * @param maxFilter - * @param summand - * @param outType - * @param strides - * @param padding - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedConv2DWithBiasSumAndRelu create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Operand summand, Class outType, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DWithBiasSumAndRelu", scope.makeOpName("QuantizedConv2DWithBiasSumAndRelu")); + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2DWithBiasSumAndRelu create(Scope scope, + Operand input, Operand filter, Operand bias, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Operand summand, Class outType, List strides, + String padding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedConv2DWithBiasSumAndRelu"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(bias.asOutput()); @@ -92,10 +102,9 @@ public static QuantizedConv2DWithBiasSumAndRelu create(Scop opBuilder.addInput(minFilter.asOutput()); opBuilder.addInput(maxFilter.asOutput()); opBuilder.addInput(summand.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -104,67 +113,243 @@ public static QuantizedConv2DWithBiasSumAndRelu create(Scop for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } if (opts.paddingList != null) { long[] paddingListArray = new long[opts.paddingList.size()]; - for (int i = 0; i < paddingListArray.length; ++i) { + for (int i = 0 ; i < paddingListArray.length ; i++) { paddingListArray[i] = opts.paddingList.get(i); } opBuilder.setAttr("padding_list", paddingListArray); } } } - return new QuantizedConv2DWithBiasSumAndRelu(opBuilder.build()); + return new QuantizedConv2DWithBiasSumAndRelu<>(opBuilder.build()); } - + /** - * @param dilations + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + /** - * @param paddingList + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public static Options dilations(Long... dilations) { + return new Options().dilations(dilations); + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long... paddingList) { + return new Options().paddingList(paddingList); + } + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. + * + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. + * + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2DWithBiasSumAndRelu"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2DWithBiasSumAndRelu(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasSumAndRelu} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * 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; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(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 5a6d223be7c..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. @@ -17,77 +17,89 @@ 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.family.TType; +import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The QuantizedConv2DWithBiasSumAndReluAndRequantize operation */ -public final class QuantizedConv2DWithBiasSumAndReluAndRequantize extends RawOp { - +@OpMetadata( + opType = QuantizedConv2DWithBiasSumAndReluAndRequantize.OP_NAME, + inputsClass = QuantizedConv2DWithBiasSumAndReluAndRequantize.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedConv2DWithBiasSumAndReluAndRequantize extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasSumAndReluAndRequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2DWithBiasSumAndReluAndRequantize"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + public QuantizedConv2DWithBiasSumAndReluAndRequantize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedConv2DWithBiasSumAndReluAndRequantize operation. - * + * * @param scope current scope - * @param input - * @param filter - * @param bias - * @param minInput - * @param maxInput - * @param minFilter - * @param maxFilter - * @param minFreezedOutput - * @param maxFreezedOutput - * @param summand - * @param minSummand - * @param maxSummand - * @param outType - * @param strides - * @param padding - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedConv2DWithBiasSumAndReluAndRequantize create(Scope scope, 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, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DWithBiasSumAndReluAndRequantize", scope.makeOpName("QuantizedConv2DWithBiasSumAndReluAndRequantize")); + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2DWithBiasSumAndReluAndRequantize create( + Scope scope, 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, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedConv2DWithBiasSumAndReluAndRequantize"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(bias.asOutput()); @@ -100,10 +112,9 @@ public static QuantizedConv2DWithBiasSumAndReluAndRequantize QuantizedConv2DWithBiasSumAndReluAndRequantize(opBuilder.build()); + return new QuantizedConv2DWithBiasSumAndReluAndRequantize<>(opBuilder.build()); } - + /** - * @param dilations + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + /** - * @param paddingList + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public static Options dilations(Long... dilations) { + return new Options().dilations(dilations); + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long... paddingList) { + return new Options().paddingList(paddingList); + } + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. + * + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. + * + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2DWithBiasSumAndReluAndRequantize"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2DWithBiasSumAndReluAndRequantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasSumAndReluAndRequantize} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * 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; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(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 58a1a2a36e6..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. @@ -17,85 +17,95 @@ 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.family.TType; +import org.tensorflow.types.family.TNumber; /** * Computes a 2D convolution given quantized 4D input and filter tensors. - *

* The inputs are quantized tensors where the lowest value represents the real * 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 */ -@Operator(group = "nn") -public final class QuantizedConv2d extends RawOp { - +@OpMetadata( + opType = QuantizedConv2d.OP_NAME, + inputsClass = QuantizedConv2d.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedConv2d extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2d} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of - * `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 `data_format`, see above for details. Dilations in the batch and - * depth dimensions must be 1. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private List dilations; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2D"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + public QuantizedConv2d(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new QuantizedConv2d operation. - * + * Factory method to create a class wrapping a new QuantizedConv2D operation. + * * @param scope current scope - * @param input + * @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 + * @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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2D} output and operands * @return a new instance of QuantizedConv2d */ - @Endpoint(describeByClass = true) - public static QuantizedConv2d create(Scope scope, Operand input, Operand filter, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Class outType, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2D", scope.makeOpName("QuantizedConv2d")); + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2d create(Scope scope, + Operand input, Operand filter, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedConv2d"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(minInput.asOutput()); opBuilder.addInput(maxInput.asOutput()); opBuilder.addInput(minFilter.asOutput()); opBuilder.addInput(maxFilter.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -104,59 +114,195 @@ public static QuantizedConv2d create(Scope scope, Operand(opBuilder.build()); + return new QuantizedConv2d<>(opBuilder.build()); } - + /** + * Sets the dilations option. + * * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each + * {@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 `data_format`, see above for details. Dilations in the batch and + * 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. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. * The float value that the lowest quantized output value represents. + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. * The float value that the highest quantized output value represents. + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2D"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2d} + */ + public static class Options { + private List dilations; + + private Options() { + } + + /** + * 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 = 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 17695f4fb77..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. @@ -17,48 +17,58 @@ 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.family.TType; +import org.tensorflow.types.family.TNumber; /** * Computes quantized depthwise Conv2D. - * - * @param data type for {@code output()} output */ -public final class QuantizedDepthwiseConv2D extends RawOp { - +@OpMetadata( + opType = QuantizedDepthwiseConv2D.OP_NAME, + inputsClass = QuantizedDepthwiseConv2D.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedDepthwiseConv2D extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedDepthwiseConv2D} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations List of dilation values. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private List dilations; - - private Options() { - } + public static final String OP_NAME = "QuantizedDepthwiseConv2D"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + public QuantizedDepthwiseConv2D(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedDepthwiseConv2D operation. - * + * * @param scope current scope * @param input The original input tensor. * @param filter The original filter tensor. @@ -68,23 +78,29 @@ private Options() { * @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 - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedDepthwiseConv2D create(Scope scope, Operand input, Operand filter, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Class outType, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedDepthwiseConv2D", scope.makeOpName("QuantizedDepthwiseConv2D")); + @Endpoint( + describeByClass = true + ) + public static QuantizedDepthwiseConv2D create(Scope scope, + Operand input, Operand filter, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedDepthwiseConv2D"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(minInput.asOutput()); opBuilder.addInput(maxInput.asOutput()); opBuilder.addInput(minFilter.asOutput()); opBuilder.addInput(maxFilter.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -93,56 +109,174 @@ public static QuantizedDepthwiseConv2D create(Scope scope, for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new QuantizedDepthwiseConv2D(opBuilder.build()); + return new QuantizedDepthwiseConv2D<>(opBuilder.build()); } - + /** + * Sets the dilations option. + * * @param dilations List of dilation values. + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public static Options dilations(Long... dilations) { + return new Options().dilations(dilations); + } + + /** + * Gets output. * The output tensor. + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. * The float value that the minimum quantized output value represents. + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. * The float value that the maximum quantized output value represents. + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedDepthwiseConv2D"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedDepthwiseConv2D(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedDepthwiseConv2D} + */ + public static class Options { + private List dilations; + + private Options() { + } + + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(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 7f37dff79d1..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. @@ -17,48 +17,58 @@ 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.family.TType; +import org.tensorflow.types.family.TNumber; /** * Computes quantized depthwise Conv2D with Bias. - * - * @param data type for {@code output()} output */ -public final class QuantizedDepthwiseConv2DWithBias extends RawOp { - +@OpMetadata( + opType = QuantizedDepthwiseConv2DWithBias.OP_NAME, + inputsClass = QuantizedDepthwiseConv2DWithBias.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedDepthwiseConv2DWithBias extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedDepthwiseConv2DWithBias} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations List of dilation values. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private List dilations; - - private Options() { - } + public static final String OP_NAME = "QuantizedDepthwiseConv2DWithBias"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + public QuantizedDepthwiseConv2DWithBias(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedDepthwiseConv2DWithBias operation. - * + * * @param scope current scope * @param input The original input tensor. * @param filter The original filter tensor. @@ -69,13 +79,20 @@ private Options() { * @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 - * @param options carries optional attributes 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 */ - @Endpoint(describeByClass = true) - public static QuantizedDepthwiseConv2DWithBias create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Class outType, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedDepthwiseConv2DWithBias", scope.makeOpName("QuantizedDepthwiseConv2DWithBias")); + @Endpoint( + describeByClass = true + ) + public static QuantizedDepthwiseConv2DWithBias create(Scope scope, + Operand input, Operand filter, Operand bias, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedDepthwiseConv2DWithBias"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(bias.asOutput()); @@ -83,10 +100,9 @@ public static QuantizedDepthwiseConv2DWithBias create(Scope opBuilder.addInput(maxInput.asOutput()); opBuilder.addInput(minFilter.asOutput()); opBuilder.addInput(maxFilter.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -95,56 +111,180 @@ public static QuantizedDepthwiseConv2DWithBias create(Scope for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new QuantizedDepthwiseConv2DWithBias(opBuilder.build()); + return new QuantizedDepthwiseConv2DWithBias<>(opBuilder.build()); } - + /** + * Sets the dilations option. + * * @param dilations List of dilation values. + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public static Options dilations(Long... dilations) { + return new Options().dilations(dilations); + } + /** + * Gets output. * The output tensor. + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. * The float value that the minimum quantized output value represents. + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. * The float value that the maximum quantized output value represents. + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedDepthwiseConv2DWithBias"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedDepthwiseConv2DWithBias(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedDepthwiseConv2DWithBias} + */ + public static class Options { + private List dilations; + + private Options() { + } + + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(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 46c8ded50f0..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. @@ -17,57 +17,58 @@ 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.family.TType; +import org.tensorflow.types.family.TNumber; /** * Computes quantized depthwise Conv2D with Bias and Relu. - * - * @param data type for {@code output()} output */ -public final class QuantizedDepthwiseConv2DWithBiasAndRelu extends RawOp { - +@OpMetadata( + opType = QuantizedDepthwiseConv2DWithBiasAndRelu.OP_NAME, + inputsClass = QuantizedDepthwiseConv2DWithBiasAndRelu.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedDepthwiseConv2DWithBiasAndRelu extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedDepthwiseConv2DWithBiasAndRelu} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations List of dilation values. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedDepthwiseConv2DWithBiasAndRelu"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + public QuantizedDepthwiseConv2DWithBiasAndRelu(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedDepthwiseConv2DWithBiasAndRelu operation. - * + * * @param scope current scope * @param input The original input tensor. * @param filter The original filter tensor. @@ -78,13 +79,20 @@ private Options() { * @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 - * @param options carries optional attributes 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 */ - @Endpoint(describeByClass = true) - public static QuantizedDepthwiseConv2DWithBiasAndRelu create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Class outType, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedDepthwiseConv2DWithBiasAndRelu", scope.makeOpName("QuantizedDepthwiseConv2DWithBiasAndRelu")); + @Endpoint( + describeByClass = true + ) + public static QuantizedDepthwiseConv2DWithBiasAndRelu create(Scope scope, + Operand input, Operand filter, Operand bias, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedDepthwiseConv2DWithBiasAndRelu"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(bias.asOutput()); @@ -92,10 +100,9 @@ public static QuantizedDepthwiseConv2DWithBiasAndRelu creat opBuilder.addInput(maxInput.asOutput()); opBuilder.addInput(minFilter.asOutput()); opBuilder.addInput(maxFilter.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -104,70 +111,237 @@ public static QuantizedDepthwiseConv2DWithBiasAndRelu creat for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } if (opts.paddingList != null) { long[] paddingListArray = new long[opts.paddingList.size()]; - for (int i = 0; i < paddingListArray.length; ++i) { + for (int i = 0 ; i < paddingListArray.length ; i++) { paddingListArray[i] = opts.paddingList.get(i); } opBuilder.setAttr("padding_list", paddingListArray); } } } - return new QuantizedDepthwiseConv2DWithBiasAndRelu(opBuilder.build()); + return new QuantizedDepthwiseConv2DWithBiasAndRelu<>(opBuilder.build()); } - + /** + * Sets the dilations option. + * * @param dilations List of dilation values. + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + /** - * @param paddingList + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public static Options dilations(Long... dilations) { + return new Options().dilations(dilations); + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long... paddingList) { + return new Options().paddingList(paddingList); + } + + /** + * Gets output. * The output tensor. + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. * The float value that the minimum quantized output value represents. + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. * The float value that the maximum quantized output value represents. + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedDepthwiseConv2DWithBiasAndRelu"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedDepthwiseConv2DWithBiasAndRelu(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedDepthwiseConv2DWithBiasAndRelu} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(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 ee9b29129bc..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. @@ -17,57 +17,58 @@ 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.family.TType; +import org.tensorflow.types.family.TNumber; /** * Computes quantized depthwise Conv2D with Bias, Relu and Requantize. - * - * @param data type for {@code output()} output */ -public final class QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize extends RawOp { - +@OpMetadata( + opType = QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.OP_NAME, + inputsClass = QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations List of dilation values. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + public QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize operation. - * + * * @param scope current scope * @param input The original input tensor. * @param filter The original filter tensor. @@ -80,13 +81,21 @@ private Options() { * @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 - * @param options carries optional attributes 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 */ - @Endpoint(describeByClass = true) - public static QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Operand minFreezedOutput, Operand maxFreezedOutput, Class outType, List strides, String padding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize", scope.makeOpName("QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize")); + @Endpoint( + describeByClass = true + ) + public static QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize create( + Scope scope, Operand input, Operand filter, + Operand bias, Operand minInput, Operand maxInput, + Operand minFilter, Operand maxFilter, Operand minFreezedOutput, + Operand maxFreezedOutput, Class outType, List strides, String padding, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(bias.asOutput()); @@ -96,10 +105,9 @@ public static QuantizedDepthwiseConv2DWithBiasAndReluAndRequan opBuilder.addInput(maxFilter.asOutput()); opBuilder.addInput(minFreezedOutput.asOutput()); opBuilder.addInput(maxFreezedOutput.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -108,70 +116,255 @@ public static QuantizedDepthwiseConv2DWithBiasAndReluAndRequan for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } if (opts.paddingList != null) { long[] paddingListArray = new long[opts.paddingList.size()]; - for (int i = 0; i < paddingListArray.length; ++i) { + for (int i = 0 ; i < paddingListArray.length ; i++) { paddingListArray[i] = opts.paddingList.get(i); } opBuilder.setAttr("padding_list", paddingListArray); } } } - return new QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize(opBuilder.build()); + return new QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize<>(opBuilder.build()); } - + /** + * Sets the dilations option. + * * @param dilations List of dilation values. + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public static Options dilations(Long... dilations) { + return new Options().dilations(dilations); + } + /** - * @param paddingList + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long... paddingList) { + return new Options().paddingList(paddingList); + } + /** + * Gets output. * The output tensor. + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. * The float value that the minimum quantized output value represents. + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. * The float value that the maximum quantized output value represents. + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(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 f96d7cb9313..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,99 +17,73 @@ 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.TType; +import org.tensorflow.types.family.TNumber; /** * Quantized Instance normalization. - * - * @param data type for {@code y()} output */ -@Operator(group = "nn") -public final class QuantizedInstanceNorm extends RawOp { - +@OpMetadata( + opType = QuantizedInstanceNorm.OP_NAME, + inputsClass = QuantizedInstanceNorm.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedInstanceNorm extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedInstanceNorm} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param outputRangeGiven If True, `given_y_min` and `given_y_min` - * and `given_y_max` are used as the output range. Otherwise, - * the implementation computes the output range. - */ - public Options outputRangeGiven(Boolean outputRangeGiven) { - this.outputRangeGiven = outputRangeGiven; - return this; - } - - /** - * @param givenYMin Output in `y_min` if `output_range_given` is True. - */ - public Options givenYMin(Float givenYMin) { - this.givenYMin = givenYMin; - return this; - } - - /** - * @param givenYMax Output in `y_max` if `output_range_given` is True. - */ - public Options givenYMax(Float givenYMax) { - this.givenYMax = givenYMax; - return this; - } - - /** - * @param varianceEpsilon A small float number to avoid dividing by 0. - */ - public Options varianceEpsilon(Float varianceEpsilon) { - this.varianceEpsilon = varianceEpsilon; - return this; - } - - /** - * @param minSeparation Minimum value of `y_max - y_min` - */ - public Options minSeparation(Float minSeparation) { - this.minSeparation = minSeparation; - return this; - } - - private Boolean outputRangeGiven; - private Float givenYMin; - private Float givenYMax; - private Float varianceEpsilon; - private Float minSeparation; - - private Options() { - } + public static final String OP_NAME = "QuantizedInstanceNorm"; + + private Output y; + + private Output yMin; + + private Output yMax; + + public QuantizedInstanceNorm(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + y = operation.output(outputIdx++); + yMin = operation.output(outputIdx++); + yMax = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedInstanceNorm operation. - * + * * @param scope current scope * @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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code QuantizedInstanceNorm} output and operands * @return a new instance of QuantizedInstanceNorm */ - @Endpoint(describeByClass = true) - public static QuantizedInstanceNorm create(Scope scope, Operand x, Operand xMin, Operand xMax, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedInstanceNorm", scope.makeOpName("QuantizedInstanceNorm")); + @Endpoint( + describeByClass = true + ) + public static QuantizedInstanceNorm create(Scope scope, Operand x, + Operand xMin, Operand xMax, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedInstanceNorm"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(xMin.asOutput()); opBuilder.addInput(xMax.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.outputRangeGiven != null) { @@ -129,79 +103,226 @@ public static QuantizedInstanceNorm create(Scope scope, Ope } } } - return new QuantizedInstanceNorm(opBuilder.build()); + return new QuantizedInstanceNorm<>(opBuilder.build()); } - + /** - * @param outputRangeGiven If True, `given_y_min` and `given_y_min` - * and `given_y_max` are used as the output range. Otherwise, + * Sets the outputRangeGiven option. + * + * @param outputRangeGiven 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. + * @return this Options instance. */ public static Options outputRangeGiven(Boolean outputRangeGiven) { return new Options().outputRangeGiven(outputRangeGiven); } - + /** - * @param givenYMin Output in `y_min` if `output_range_given` is True. + * Sets the givenYMin option. + * + * @param givenYMin Output in {@code y_min} if {@code output_range_given} is True. + * @return this Options instance. */ public static Options givenYMin(Float givenYMin) { return new Options().givenYMin(givenYMin); } - + /** - * @param givenYMax Output in `y_max` if `output_range_given` is True. + * Sets the givenYMax option. + * + * @param givenYMax Output in {@code y_max} if {@code output_range_given} is True. + * @return this Options instance. */ public static Options givenYMax(Float givenYMax) { return new Options().givenYMax(givenYMax); } - + /** + * Sets the varianceEpsilon option. + * * @param varianceEpsilon A small float number to avoid dividing by 0. + * @return this Options instance. */ public static Options varianceEpsilon(Float varianceEpsilon) { return new Options().varianceEpsilon(varianceEpsilon); } - + /** - * @param minSeparation Minimum value of `y_max - y_min` + * Sets the minSeparation option. + * + * @param minSeparation Minimum value of {@code y_max - y_min} + * @return this Options instance. */ public static Options minSeparation(Float minSeparation) { return new Options().minSeparation(minSeparation); } - + /** + * Gets y. * A 4D Tensor. + * @return y. */ public Output y() { return y; } - + /** + * Gets yMin. * The value represented by the lowest quantized output. + * @return yMin. */ public Output yMin() { return yMin; } - + /** + * Gets yMax. * The value represented by the highest quantized output. + * @return yMax. */ public Output yMax() { return yMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedInstanceNorm"; - - private Output y; - private Output yMin; - private Output yMax; - - private QuantizedInstanceNorm(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - yMin = operation.output(outputIdx++); - yMax = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedInstanceNorm} + */ + public static class Options { + private Boolean outputRangeGiven; + + private Float givenYMin; + + private Float givenYMax; + + private Float varianceEpsilon; + + private Float minSeparation; + + private Options() { + } + + /** + * Sets the outputRangeGiven option. + * + * @param outputRangeGiven 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. + * @return this Options instance. + */ + public Options outputRangeGiven(Boolean outputRangeGiven) { + this.outputRangeGiven = outputRangeGiven; + return this; + } + + /** + * Sets the givenYMin option. + * + * @param givenYMin Output in {@code y_min} if {@code output_range_given} is True. + * @return this Options instance. + */ + public Options givenYMin(Float givenYMin) { + this.givenYMin = givenYMin; + return this; + } + + /** + * Sets the givenYMax option. + * + * @param givenYMax Output in {@code y_max} if {@code output_range_given} is True. + * @return this Options instance. + */ + public Options givenYMax(Float givenYMax) { + this.givenYMax = givenYMax; + return this; + } + + /** + * Sets the varianceEpsilon option. + * + * @param varianceEpsilon A small float number to avoid dividing by 0. + * @return this Options instance. + */ + public Options varianceEpsilon(Float varianceEpsilon) { + this.varianceEpsilon = varianceEpsilon; + return this; + } + + /** + * Sets the minSeparation option. + * + * @param minSeparation Minimum value of {@code y_max - y_min} + * @return this Options instance. + */ + public Options minSeparation(Float minSeparation) { + this.minSeparation = 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 be2c093614a..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,29 +17,57 @@ 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.TType; +import org.tensorflow.types.family.TNumber; /** * Produces the max pool of the input tensor for quantized types. - * - * @param data type for {@code output()} output */ -@Operator(group = "nn") -public final class QuantizedMaxPool extends RawOp { - +@OpMetadata( + opType = QuantizedMaxPool.OP_NAME, + inputsClass = QuantizedMaxPool.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedMaxPool extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizedMaxPool"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + public QuantizedMaxPool(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizedMaxPool operation. - * + * * @param scope current scope * @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. @@ -49,61 +77,111 @@ public final class QuantizedMaxPool extends RawOp { * @param strides 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. * @param padding The type of padding algorithm to use. + * @param data type for {@code QuantizedMaxPool} output and operands * @return a new instance of QuantizedMaxPool */ - @Endpoint(describeByClass = true) - public static QuantizedMaxPool create(Scope scope, Operand input, Operand minInput, Operand maxInput, List ksize, List strides, String padding) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedMaxPool", scope.makeOpName("QuantizedMaxPool")); + @Endpoint( + describeByClass = true + ) + public static QuantizedMaxPool create(Scope scope, Operand input, + Operand minInput, Operand maxInput, List ksize, List strides, + String padding) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedMaxPool"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(minInput.asOutput()); opBuilder.addInput(maxInput.asOutput()); - opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + 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) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); opBuilder.setAttr("padding", padding); - return new QuantizedMaxPool(opBuilder.build()); + return new QuantizedMaxPool<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. * The float value that the lowest quantized output value represents. + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. * The float value that the highest quantized output value represents. + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedMaxPool"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedMaxPool(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + @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 578b994a3d4..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,80 +17,143 @@ 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.TType; +import org.tensorflow.types.family.TNumber; /** - * Computes Quantized Rectified Linear: `max(features, 0)` - * - * @param data type for {@code activations()} output + * Computes Quantized Rectified Linear: {@code max(features, 0)} */ -@Operator(group = "nn") -public final class QuantizedRelu extends RawOp { - +@OpMetadata( + opType = QuantizedRelu.OP_NAME, + inputsClass = QuantizedRelu.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedRelu extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizedRelu"; + + private Output activations; + + private Output minActivations; + + private Output maxActivations; + + public QuantizedRelu(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + activations = operation.output(outputIdx++); + minActivations = operation.output(outputIdx++); + maxActivations = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizedRelu operation. - * + * * @param scope current scope - * @param features + * @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 + * @param outType The value of the outType attribute + * @param data type for {@code QuantizedRelu} output and operands * @return a new instance of QuantizedRelu */ - @Endpoint(describeByClass = true) - public static QuantizedRelu create(Scope scope, Operand features, Operand minFeatures, Operand maxFeatures, Class outType) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedRelu", scope.makeOpName("QuantizedRelu")); + @Endpoint( + describeByClass = true + ) + public static QuantizedRelu create(Scope scope, + Operand features, Operand minFeatures, + Operand maxFeatures, Class outType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedRelu"); opBuilder.addInput(features.asOutput()); opBuilder.addInput(minFeatures.asOutput()); opBuilder.addInput(maxFeatures.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new QuantizedRelu(opBuilder.build()); + return new QuantizedRelu<>(opBuilder.build()); } - + /** - * Has the same output shape as "features". + * Gets activations. + * Has the same output shape as "features". + * @return activations. */ public Output activations() { return activations; } - + /** + * Gets minActivations. * The float value that the lowest quantized value represents. + * @return minActivations. */ public Output minActivations() { return minActivations; } - + /** + * Gets maxActivations. * The float value that the highest quantized value represents. + * @return maxActivations. */ public Output maxActivations() { return maxActivations; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedRelu"; - - private Output activations; - private Output minActivations; - private Output maxActivations; - - private QuantizedRelu(Operation operation) { - super(operation); - int outputIdx = 0; - activations = operation.output(outputIdx++); - minActivations = operation.output(outputIdx++); - maxActivations = operation.output(outputIdx++); + + @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 4ee22f51238..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,80 +17,143 @@ 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.TType; +import org.tensorflow.types.family.TNumber; /** - * Computes Quantized Rectified Linear 6: `min(max(features, 0), 6)` - * - * @param data type for {@code activations()} output + * Computes Quantized Rectified Linear 6: {@code min(max(features, 0), 6)} */ -@Operator(group = "nn") -public final class QuantizedRelu6 extends RawOp { - +@OpMetadata( + opType = QuantizedRelu6.OP_NAME, + inputsClass = QuantizedRelu6.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedRelu6 extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizedRelu6"; + + private Output activations; + + private Output minActivations; + + private Output maxActivations; + + public QuantizedRelu6(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + activations = operation.output(outputIdx++); + minActivations = operation.output(outputIdx++); + maxActivations = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizedRelu6 operation. - * + * * @param scope current scope - * @param features + * @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 + * @param outType The value of the outType attribute + * @param data type for {@code QuantizedRelu6} output and operands * @return a new instance of QuantizedRelu6 */ - @Endpoint(describeByClass = true) - public static QuantizedRelu6 create(Scope scope, Operand features, Operand minFeatures, Operand maxFeatures, Class outType) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedRelu6", scope.makeOpName("QuantizedRelu6")); + @Endpoint( + describeByClass = true + ) + public static QuantizedRelu6 create(Scope scope, + Operand features, Operand minFeatures, + Operand maxFeatures, Class outType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedRelu6"); opBuilder.addInput(features.asOutput()); opBuilder.addInput(minFeatures.asOutput()); opBuilder.addInput(maxFeatures.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new QuantizedRelu6(opBuilder.build()); + return new QuantizedRelu6<>(opBuilder.build()); } - + /** - * Has the same output shape as "features". + * Gets activations. + * Has the same output shape as "features". + * @return activations. */ public Output activations() { return activations; } - + /** + * Gets minActivations. * The float value that the lowest quantized value represents. + * @return minActivations. */ public Output minActivations() { return minActivations; } - + /** + * Gets maxActivations. * The float value that the highest quantized value represents. + * @return maxActivations. */ public Output maxActivations() { return maxActivations; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedRelu6"; - - private Output activations; - private Output minActivations; - private Output maxActivations; - - private QuantizedRelu6(Operation operation) { - super(operation); - int outputIdx = 0; - activations = operation.output(outputIdx++); - minActivations = operation.output(outputIdx++); - maxActivations = operation.output(outputIdx++); + + @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 cf9bdc3134e..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,82 +17,151 @@ 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.TType; +import org.tensorflow.types.family.TNumber; /** - * Computes Quantized Rectified Linear X: `min(max(features, 0), max_value)` - * - * @param data type for {@code activations()} output + * Computes Quantized Rectified Linear X: {@code min(max(features, 0), max_value)} */ -@Operator(group = "nn") -public final class QuantizedReluX extends RawOp { - +@OpMetadata( + opType = QuantizedReluX.OP_NAME, + inputsClass = QuantizedReluX.Inputs.class +) +@Operator( + group = "nn" +) +public final class QuantizedReluX extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizedReluX"; + + private Output activations; + + private Output minActivations; + + private Output maxActivations; + + public QuantizedReluX(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + activations = operation.output(outputIdx++); + minActivations = operation.output(outputIdx++); + maxActivations = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizedReluX operation. - * + * * @param scope current scope - * @param features - * @param maxValue + * @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 + * @param outType The value of the outType attribute + * @param data type for {@code QuantizedReluX} output and operands * @return a new instance of QuantizedReluX */ - @Endpoint(describeByClass = true) - public static QuantizedReluX create(Scope scope, Operand features, Operand maxValue, Operand minFeatures, Operand maxFeatures, Class outType) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedReluX", scope.makeOpName("QuantizedReluX")); + @Endpoint( + describeByClass = true + ) + public static QuantizedReluX create(Scope scope, + Operand features, Operand maxValue, + Operand minFeatures, Operand maxFeatures, Class outType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedReluX"); opBuilder.addInput(features.asOutput()); opBuilder.addInput(maxValue.asOutput()); opBuilder.addInput(minFeatures.asOutput()); opBuilder.addInput(maxFeatures.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new QuantizedReluX(opBuilder.build()); + return new QuantizedReluX<>(opBuilder.build()); } - + /** - * Has the same output shape as "features". + * Gets activations. + * Has the same output shape as "features". + * @return activations. */ public Output activations() { return activations; } - + /** + * Gets minActivations. * The float value that the lowest quantized value represents. + * @return minActivations. */ public Output minActivations() { return minActivations; } - + /** + * Gets maxActivations. * The float value that the highest quantized value represents. + * @return maxActivations. */ public Output maxActivations() { return maxActivations; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedReluX"; - - private Output activations; - private Output minActivations; - private Output maxActivations; - - private QuantizedReluX(Operation operation) { - super(operation); - int outputIdx = 0; - activations = operation.output(outputIdx++); - minActivations = operation.output(outputIdx++); - maxActivations = operation.output(outputIdx++); + + @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 eb0e8957e13..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,63 +17,106 @@ 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.family.TType; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TNumber; /** - * Computes rectified linear: `max(features, 0)`. - *

+ * Computes rectified linear: {@code max(features, 0)}. * See: https://en.wikipedia.org/wiki/Rectifier_(neural_networks) * Example usage: - * >>> tf.nn.relu([-2., 0., -0., 3.]).numpy() - * array([ 0., 0., -0., 3.], dtype=float32) - * - * @param data type for {@code activations()} output + *

+ *
+ *
+ *

tf.nn.relu([-2., 0., 3.]).numpy() + * array([0., 0., 3.], dtype=float32) + *

+ *
+ *
*/ -@Operator(group = "nn") -public final class Relu extends RawOp implements Operand { - +@OpMetadata( + opType = Relu.OP_NAME, + inputsClass = Relu.Inputs.class +) +@Operator( + group = "nn" +) +public final class Relu extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Relu"; + + private Output activations; + + public Relu(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + activations = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Relu operation. - * + * * @param scope current scope - * @param features + * @param features The features value + * @param data type for {@code Relu} output and operands * @return a new instance of Relu */ - @Endpoint(describeByClass = true) - public static Relu create(Scope scope, Operand features) { - OperationBuilder opBuilder = scope.env().opBuilder("Relu", scope.makeOpName("Relu")); + @Endpoint( + describeByClass = true + ) + public static Relu create(Scope scope, Operand features) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Relu"); opBuilder.addInput(features.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Relu(opBuilder.build()); + return new Relu<>(opBuilder.build()); } - + /** + * Gets activations. + * + * @return activations. */ public Output activations() { return activations; } - + @Override public Output asOutput() { return activations; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Relu"; - - private Output activations; - - private Relu(Operation operation) { - super(operation); - int outputIdx = 0; - activations = operation.output(outputIdx++); + + @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 efb80c73be6..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,58 +17,96 @@ 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: `min(max(features, 0), 6)`. - * - * @param data type for {@code activations()} output + * Computes rectified linear 6: {@code min(max(features, 0), 6)}. */ -@Operator(group = "nn") +@OpMetadata( + opType = Relu6.OP_NAME, + inputsClass = Relu6.Inputs.class +) +@Operator( + group = "nn" +) public final class Relu6 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Relu6"; + + private Output activations; + + public Relu6(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + activations = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Relu6 operation. - * + * * @param scope current scope - * @param features + * @param features The features value + * @param data type for {@code Relu6} output and operands * @return a new instance of Relu6 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Relu6 create(Scope scope, Operand features) { - OperationBuilder opBuilder = scope.env().opBuilder("Relu6", scope.makeOpName("Relu6")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Relu6"); opBuilder.addInput(features.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Relu6(opBuilder.build()); + return new Relu6<>(opBuilder.build()); } - + /** + * Gets activations. + * + * @return activations. */ public Output activations() { return activations; } - + @Override public Output asOutput() { return activations; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Relu6"; - - private Output activations; - - private Relu6(Operation operation) { - super(operation); - int outputIdx = 0; - activations = operation.output(outputIdx++); + + @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 38e042b1635..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,62 +17,108 @@ 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 + */ + public static final String OP_NAME = "Relu6Grad"; + + private Output backprops; + + public Relu6Grad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + backprops = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Relu6Grad operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static Relu6Grad create(Scope scope, Operand gradients, Operand features) { - OperationBuilder opBuilder = scope.env().opBuilder("Relu6Grad", scope.makeOpName("Relu6Grad")); + @Endpoint( + describeByClass = true + ) + public static Relu6Grad create(Scope scope, Operand gradients, + Operand features) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Relu6Grad"); opBuilder.addInput(gradients.asOutput()); opBuilder.addInput(features.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Relu6Grad(opBuilder.build()); + return new Relu6Grad<>(opBuilder.build()); } - + /** + * Gets backprops. * The gradients: - * `gradients * (features > 0) * (features < 6)`. + * {@code gradients * (features > 0) * (features < 6)}. + * @return backprops. */ public Output backprops() { return backprops; } - + @Override public Output asOutput() { return backprops; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Relu6Grad"; - - private Output backprops; - - private Relu6Grad(Operation operation) { - super(operation); - int outputIdx = 0; - backprops = operation.output(outputIdx++); + + @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 27999096f0e..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,61 +17,107 @@ 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 + */ + public static final String OP_NAME = "ReluGrad"; + + private Output backprops; + + public ReluGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + backprops = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ReluGrad operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static ReluGrad create(Scope scope, Operand gradients, Operand features) { - OperationBuilder opBuilder = scope.env().opBuilder("ReluGrad", scope.makeOpName("ReluGrad")); + @Endpoint( + describeByClass = true + ) + public static ReluGrad create(Scope scope, Operand gradients, + Operand features) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReluGrad"); opBuilder.addInput(gradients.asOutput()); opBuilder.addInput(features.asOutput()); - opBuilder = scope.apply(opBuilder); - return new ReluGrad(opBuilder.build()); + return new ReluGrad<>(opBuilder.build()); } - + /** - * `gradients * (features > 0)`. + * Gets backprops. + * {@code gradients * (features > 0)}. + * @return backprops. */ public Output backprops() { return backprops; } - + @Override public Output asOutput() { return backprops; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReluGrad"; - - private Output backprops; - - private ReluGrad(Operation operation) { - super(operation); - int outputIdx = 0; - backprops = operation.output(outputIdx++); + + @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 0e7b45fcd6a..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,66 +17,101 @@ 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 scaled exponential linear: `scale * alpha * (exp(features) - 1)` - *

- * if < 0, `scale * features` otherwise. - *

- * To be used together with - * `initializer = tf.variance_scaling_initializer(factor=1.0, mode='FAN_IN')`. - * For correct dropout, use `tf.contrib.nn.alpha_dropout`. - *

- * See [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) - * - * @param data type for {@code activations()} output + * Computes scaled exponential linear: {@code scale * alpha * (exp(features) - 1)} + * if < 0, {@code scale * features} otherwise. + *

To be used together with + * {@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 */ -@Operator(group = "nn") +@OpMetadata( + opType = Selu.OP_NAME, + inputsClass = Selu.Inputs.class +) +@Operator( + group = "nn" +) public final class Selu extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Selu"; + + private Output activations; + + public Selu(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + activations = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Selu operation. - * + * * @param scope current scope - * @param features + * @param features The features value + * @param data type for {@code Selu} output and operands * @return a new instance of Selu */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Selu create(Scope scope, Operand features) { - OperationBuilder opBuilder = scope.env().opBuilder("Selu", scope.makeOpName("Selu")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Selu"); opBuilder.addInput(features.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Selu(opBuilder.build()); + return new Selu<>(opBuilder.build()); } - + /** + * Gets activations. + * + * @return activations. */ public Output activations() { return activations; } - + @Override public Output asOutput() { return activations; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Selu"; - - private Output activations; - - private Selu(Operation operation) { - super(operation); - int outputIdx = 0; - activations = operation.output(outputIdx++); + + @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 e80b0e7114b..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,61 +17,106 @@ 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 + */ + public static final String OP_NAME = "SeluGrad"; + + private Output backprops; + + public SeluGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + backprops = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SeluGrad operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static SeluGrad create(Scope scope, Operand gradients, Operand outputs) { - OperationBuilder opBuilder = scope.env().opBuilder("SeluGrad", scope.makeOpName("SeluGrad")); + @Endpoint( + describeByClass = true + ) + public static SeluGrad create(Scope scope, Operand gradients, + Operand outputs) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SeluGrad"); opBuilder.addInput(gradients.asOutput()); opBuilder.addInput(outputs.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SeluGrad(opBuilder.build()); + return new SeluGrad<>(opBuilder.build()); } - + /** - * The gradients: `gradients * (outputs + scale * alpha)` - * if outputs < 0, `scale * gradients` otherwise. + * Gets backprops. + * The gradients: {@code gradients * (outputs + scale * alpha)} + * if outputs < 0, {@code scale * gradients} otherwise. + * @return backprops. */ public Output backprops() { return backprops; } - + @Override public Output asOutput() { return backprops; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SeluGrad"; - - private Output backprops; - - private SeluGrad(Operation operation) { - super(operation); - int outputIdx = 0; - backprops = operation.output(outputIdx++); + + @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 d7180ef953f..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,63 +17,100 @@ 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 activations. - *

- * For each batch `i` and class `j` we have - *

- * $$softmax[i, j] = exp(logits[i, j]) / sum_j(exp(logits[i, j]))$$ - * - * @param data type for {@code softmax()} output + * For each batch {@code i} and class {@code j} we have + *

+ * $$softmax[i, j] = exp(logits[i, j]) / sum_j(exp(logits[i, j]))$$
+ * 
*/ -@Operator(group = "nn") +@OpMetadata( + opType = Softmax.OP_NAME, + inputsClass = Softmax.Inputs.class +) +@Operator( + group = "nn" +) public final class Softmax extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Softmax"; + + private Output softmax; + + public Softmax(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + softmax = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Softmax operation. - * + * * @param scope current scope - * @param logits 2-D with shape `[batch_size, num_classes]`. + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Softmax create(Scope scope, Operand logits) { - OperationBuilder opBuilder = scope.env().opBuilder("Softmax", scope.makeOpName("Softmax")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Softmax"); opBuilder.addInput(logits.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Softmax(opBuilder.build()); + return new Softmax<>(opBuilder.build()); } - + /** - * Same shape as `logits`. + * Gets softmax. + * Same shape as {@code logits}. + * @return softmax. */ public Output softmax() { return softmax; } - + @Override public Output asOutput() { return softmax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Softmax"; - - private Output softmax; - - private Softmax(Operation operation) { - super(operation); - int outputIdx = 0; - softmax = operation.output(outputIdx++); + + @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 new file mode 100644 index 00000000000..a7836f24051 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SoftmaxCrossEntropyWithLogits.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.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. + */ +@OpMetadata( + opType = SoftmaxCrossEntropyWithLogits.OP_NAME, + inputsClass = SoftmaxCrossEntropyWithLogits.Inputs.class +) +@Operator( + group = "nn" +) +public final class SoftmaxCrossEntropyWithLogits extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SoftmaxCrossEntropyWithLogits"; + + private Output loss; + + private Output backprop; + + public SoftmaxCrossEntropyWithLogits(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + loss = operation.output(outputIdx++); + backprop = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new SoftmaxCrossEntropyWithLogits operation. + * + * @param scope current scope + * @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 + * probability distribution. + * @param data type for {@code SoftmaxCrossEntropyWithLogits} output and operands + * @return a new instance of SoftmaxCrossEntropyWithLogits + */ + @Endpoint( + describeByClass = true + ) + public static SoftmaxCrossEntropyWithLogits create(Scope scope, + Operand features, Operand labels) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SoftmaxCrossEntropyWithLogits"); + opBuilder.addInput(features.asOutput()); + opBuilder.addInput(labels.asOutput()); + return new SoftmaxCrossEntropyWithLogits<>(opBuilder.build()); + } + + /** + * Gets loss. + * Per example loss (batch_size vector). + * @return loss. + */ + public Output loss() { + return loss; + } + + /** + * Gets backprop. + * backpropagated gradients (batch_size x num_classes matrix). + * @return backprop. + */ + 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 efd21d04476..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,58 +17,96 @@ 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: `features / (abs(features) + 1)`. - * - * @param data type for {@code activations()} output + * Computes softsign: {@code features / (abs(features) + 1)}. */ -@Operator(group = "nn") +@OpMetadata( + opType = Softsign.OP_NAME, + inputsClass = Softsign.Inputs.class +) +@Operator( + group = "nn" +) public final class Softsign extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Softsign"; + + private Output activations; + + public Softsign(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + activations = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Softsign operation. - * + * * @param scope current scope - * @param features + * @param features The features value + * @param data type for {@code Softsign} output and operands * @return a new instance of Softsign */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Softsign create(Scope scope, Operand features) { - OperationBuilder opBuilder = scope.env().opBuilder("Softsign", scope.makeOpName("Softsign")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Softsign"); opBuilder.addInput(features.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Softsign(opBuilder.build()); + return new Softsign<>(opBuilder.build()); } - + /** + * Gets activations. + * + * @return activations. */ public Output activations() { return activations; } - + @Override public Output asOutput() { return activations; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Softsign"; - - private Output activations; - - private Softsign(Operation operation) { - super(operation); - int outputIdx = 0; - activations = operation.output(outputIdx++); + + @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 a8d5669551d..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,60 +17,105 @@ 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 + */ + public static final String OP_NAME = "SoftsignGrad"; + + private Output backprops; + + public SoftsignGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + backprops = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SoftsignGrad operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static SoftsignGrad create(Scope scope, Operand gradients, Operand features) { - OperationBuilder opBuilder = scope.env().opBuilder("SoftsignGrad", scope.makeOpName("SoftsignGrad")); + @Endpoint( + describeByClass = true + ) + public static SoftsignGrad create(Scope scope, Operand gradients, + Operand features) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SoftsignGrad"); opBuilder.addInput(gradients.asOutput()); opBuilder.addInput(features.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SoftsignGrad(opBuilder.build()); + return new SoftsignGrad<>(opBuilder.build()); } - + /** - * The gradients: `gradients / (1 + abs(features)) ** 2`. + * Gets backprops. + * The gradients: {@code gradients / (1 + abs(features)) ** 2}. + * @return backprops. */ public Output backprops() { return backprops; } - + @Override public Output asOutput() { return backprops; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SoftsignGrad"; - - private Output backprops; - - private SoftsignGrad(Operation operation) { - super(operation); - int outputIdx = 0; - backprops = operation.output(outputIdx++); + + @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 90afda30fe4..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,139 +17,202 @@ 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; /** * SpaceToBatch for 4-D tensors of type T. - *

* This is a legacy version of the more general SpaceToBatchND. - *

- * Zero-pads and then rearranges (permutes) blocks of spatial data into batch. + *

Zero-pads and then rearranges (permutes) blocks of spatial data into batch. * More specifically, this op outputs a copy of the input tensor where values from - * the `height` and `width` dimensions are moved to the `batch` dimension. After - * the zero-padding, both `height` and `width` of the input must be divisible by the + * the {@code height} and {@code width} dimensions are moved to the {@code batch} dimension. After + * the zero-padding, both {@code height} and {@code width} of the input must be divisible by the * block size. - * - * @param data type for {@code output()} output + *

The attr {@code block_size} must be greater than one. It indicates the block size. + *

    + *
  • Non-overlapping blocks of size {@code block_size x block size} in the height and + * width dimensions are rearranged into the batch dimension at each location.
  • + *
  • The batch of the output tensor is {@code batch * block_size * block_size}.
  • + *
  • Both height_pad and width_pad must be divisible by block_size.
  • + *
+ *

The shape of the output will be: + *

+ * [batch*block_size*block_size, height_pad/block_size, width_pad/block_size,
+ *  depth]
+ * 
+ *

Some examples: + *

(1) For the following input of shape {@code [1, 2, 2, 1]} and block_size of 2: + *

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

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

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

(2) For the following input of shape {@code [1, 2, 2, 3]} and block_size of 2: + *

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

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

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

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

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

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

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

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

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

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

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

Among others, this operation is useful for reducing atrous convolution into + * regular convolution. */ -@Operator(group = "nn") +@OpMetadata( + opType = SpaceToBatch.OP_NAME, + inputsClass = SpaceToBatch.Inputs.class +) +@Operator( + group = "nn" +) public final class SpaceToBatch extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SpaceToBatch"; + + private Output output; + + public SpaceToBatch(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SpaceToBatch operation. - * + * * @param scope current scope - * @param input 4-D with shape `[batch, height, width, depth]`. - * @param paddings 2-D tensor of non-negative integers with shape `[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 - *

- * The attr `block_size` must be greater than one. It indicates the block size. - *

- * * Non-overlapping blocks of size `block_size x block size` in the height and - * width dimensions are rearranged into the batch dimension at each location. - * * The batch of the output tensor is `batch * block_size * block_size`. - * * Both height_pad and width_pad must be divisible by block_size. - *

- * The shape of the output will be: - *

- * [batchblock_sizeblock_size, height_pad/block_size, width_pad/block_size, - * depth] - *

- * Some examples: - *

- * (1) For the following input of shape `[1, 2, 2, 1]` and block_size of 2: - *

{@code
-   * x = [[[[1], [2]], [[3], [4]]]]
-   * }
- * The output tensor has shape `[4, 1, 1, 1]` and value: - *
{@code
-   * [[[[1]]], [[[2]]], [[[3]]], [[[4]]]]
-   * }
- * (2) For the following input of shape `[1, 2, 2, 3]` and block_size of 2: - *
{@code
-   * x = [[[[1, 2, 3], [4, 5, 6]],
-   *       [[7, 8, 9], [10, 11, 12]]]]
-   * }
- * The output tensor has shape `[4, 1, 1, 3]` and value: - *
{@code
-   * [[[[1, 2, 3]]], [[[4, 5, 6]]], [[[7, 8, 9]]], [[[10, 11, 12]]]]
-   * }
- * (3) For the following input of shape `[1, 4, 4, 1]` and block_size of 2: - *
{@code
-   * x = [[[[1],   [2],  [3],  [4]],
-   *       [[5],   [6],  [7],  [8]],
-   *       [[9],  [10], [11],  [12]],
-   *       [[13], [14], [15],  [16]]]]
-   * }
- * The output tensor has shape `[4, 2, 2, 1]` and value: - *
{@code
-   * x = [[[[1], [3]], [[9], [11]]],
-   *      [[[2], [4]], [[10], [12]]],
-   *      [[[5], [7]], [[13], [15]]],
-   *      [[[6], [8]], [[14], [16]]]]
-   * }
- * (4) For the following input of shape `[2, 2, 4, 1]` and block_size of 2: - *
{@code
-   * x = [[[[1],   [2],  [3],  [4]],
-   *       [[5],   [6],  [7],  [8]]],
-   *      [[[9],  [10], [11],  [12]],
-   *       [[13], [14], [15],  [16]]]]
-   * }
- * The output tensor has shape `[8, 1, 2, 1]` and value: - *
{@code
-   * x = [[[[1], [3]]], [[[9], [11]]], [[[2], [4]]], [[[10], [12]]],
-   *      [[[5], [7]]], [[[13], [15]]], [[[6], [8]]], [[[14], [16]]]]
-   * }
- * Among others, this operation is useful for reducing atrous convolution into - * regular convolution. - * @param blockSize + * @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: + *
+   *   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
+   * 
+ * @param blockSize The value of the blockSize attribute + * @param data type for {@code SpaceToBatch} output and operands * @return a new instance of SpaceToBatch */ - @Endpoint(describeByClass = true) - public static SpaceToBatch create(Scope scope, Operand input, Operand paddings, Long blockSize) { - OperationBuilder opBuilder = scope.env().opBuilder("SpaceToBatch", scope.makeOpName("SpaceToBatch")); + @Endpoint( + describeByClass = true + ) + public static SpaceToBatch create(Scope scope, Operand input, + Operand paddings, Long blockSize) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SpaceToBatch"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(paddings.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("block_size", blockSize); - return new SpaceToBatch(opBuilder.build()); + return new SpaceToBatch<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SpaceToBatch"; - - private Output output; - - private SpaceToBatch(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 6894eb287af..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,131 +17,131 @@ 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; /** * SpaceToDepth for tensors of type T. - *

* Rearranges blocks of spatial data, into depth. More specifically, - * this op outputs a copy of the input tensor where values from the `height` - * and `width` dimensions are moved to the `depth` dimension. - * The attr `block_size` indicates the input block size. - *

- * * Non-overlapping blocks of size `block_size x block size` are rearranged - * into depth at each location. - * * The depth of the output tensor is `block_size * block_size * input_depth`. - * * The Y, X coordinates within each block of the input become the high order - * component of the output channel index. - * * The input tensor's height and width must be divisible by block_size. - *

- * The `data_format` attr specifies the layout of the input and output tensors + * this op outputs a copy of the input tensor where values from the {@code height} + * and {@code width} dimensions are moved to the {@code depth} dimension. + * The attr {@code block_size} indicates the input block size. + *

    + *
  • Non-overlapping blocks of size {@code block_size x block size} are rearranged + * into depth at each location.
  • + *
  • The depth of the output tensor is {@code block_size * block_size * input_depth}.
  • + *
  • The Y, X coordinates within each block of the input become the high order + * component of the output channel index.
  • + *
  • The input tensor's height and width must be divisible by block_size.
  • + *
+ *

The {@code data_format} attr specifies the layout of the input and output tensors * with the following options: - * "NHWC": `[ batch, height, width, channels ]` - * "NCHW": `[ batch, channels, height, width ]` - * "NCHW_VECT_C": - * `qint8 [ batch, channels / 4, height, width, 4 ]` - *

- * It is useful to consider the operation as transforming a 6-D Tensor. + * "NHWC": {@code [ batch, height, width, channels ]} + * "NCHW": {@code [ batch, channels, height, width ]} + * "NCHW_VECT_C": + * {@code qint8 [ batch, channels / 4, height, width, 4 ]} + *

It is useful to consider the operation as transforming a 6-D Tensor. * e.g. for data_format = NHWC, - * Each element in the input tensor can be specified via 6 coordinates, - * ordered by decreasing memory layout significance as: - * n,oY,bY,oX,bX,iC (where n=batch index, oX, oY means X or Y coordinates - * within the output image, bX, bY means coordinates - * within the input block, iC means input channels). - * The output would be a transpose to the following layout: - * n,oY,oX,bY,bX,iC - *

- * This operation is useful for resizing the activations between convolutions + * Each element in the input tensor can be specified via 6 coordinates, + * ordered by decreasing memory layout significance as: + * n,oY,bY,oX,bX,iC (where n=batch index, oX, oY means X or Y coordinates + * within the output image, bX, bY means coordinates + * within the input block, iC means input channels). + * The output would be a transpose to the following layout: + * n,oY,oX,bY,bX,iC + *

This operation is useful for resizing the activations between convolutions * (but keeping all data), e.g. instead of pooling. It is also useful for training * purely convolutional models. - *

- * For example, given an input of shape `[1, 2, 2, 1]`, data_format = "NHWC" and + *

For example, given an input of shape {@code [1, 2, 2, 1]}, data_format = "NHWC" and * block_size = 2: - *

{@code
+ * 
  * x = [[[[1], [2]],
  *       [[3], [4]]]]
- * }
- * This operation will output a tensor of shape `[1, 1, 1, 4]`: - *
{@code
+ * 
+ *

This operation will output a tensor of shape {@code [1, 1, 1, 4]}: + *

  * [[[[1, 2, 3, 4]]]]
- * }
- * Here, the input has a batch of 1 and each batch element has shape `[2, 2, 1]`, + *
+ *

Here, the input has a batch of 1 and each batch element has shape {@code [2, 2, 1]}, * the corresponding output will have a single element (i.e. width and height are * both 1) and will have a depth of 4 channels (1 * block_size * block_size). - * The output element shape is `[1, 1, 4]`. - *

- * For an input tensor with larger depth, here of shape `[1, 2, 2, 3]`, e.g. - *

{@code
+ * The output element shape is {@code [1, 1, 4]}.
+ * 

For an input tensor with larger depth, here of shape {@code [1, 2, 2, 3]}, e.g. + *

  * x = [[[[1, 2, 3], [4, 5, 6]],
  *       [[7, 8, 9], [10, 11, 12]]]]
- * }
- * This operation, for block_size of 2, will return the following tensor of shape - * `[1, 1, 1, 12]` - *
{@code
+ * 
+ *

This operation, for block_size of 2, will return the following tensor of shape + * {@code [1, 1, 1, 12]} + *

  * [[[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]]]]
- * }
- * Similarly, for the following input of shape `[1 4 4 1]`, and a block size of 2: - *
{@code
+ * 
+ *

Similarly, for the following input of shape {@code [1 4 4 1]}, and a block size of 2: + *

  * x = [[[[1],   [2],  [5],  [6]],
  *       [[3],   [4],  [7],  [8]],
  *       [[9],  [10], [13],  [14]],
  *       [[11], [12], [15],  [16]]]]
- * }
- * the operator will return the following tensor of shape `[1 2 2 4]`: - *
{@code
+ * 
+ *

the operator will return the following tensor of shape {@code [1 2 2 4]}: + *

  * x = [[[[1, 2, 3, 4],
  *        [5, 6, 7, 8]],
  *       [[9, 10, 11, 12],
  *        [13, 14, 15, 16]]]]
- * }
- * - * - * @param data type for {@code output()} output + *
*/ -@Operator(group = "nn") +@OpMetadata( + opType = SpaceToDepth.OP_NAME, + inputsClass = SpaceToDepth.Inputs.class +) +@Operator( + group = "nn" +) public final class SpaceToDepth extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.SpaceToDepth} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "SpaceToDepth"; + + private Output output; + + public SpaceToDepth(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SpaceToDepth operation. - * + * * @param scope current scope - * @param input + * @param input The input value * @param blockSize The size of the spatial block. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SpaceToDepth} output and operands * @return a new instance of SpaceToDepth */ - @Endpoint(describeByClass = true) - public static SpaceToDepth create(Scope scope, Operand input, Long blockSize, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SpaceToDepth", scope.makeOpName("SpaceToDepth")); + @Endpoint( + describeByClass = true + ) + public static SpaceToDepth create(Scope scope, Operand input, + Long blockSize, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SpaceToDepth"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("block_size", blockSize); if (options != null) { for (Options opts : options) { @@ -150,35 +150,85 @@ public static SpaceToDepth create(Scope scope, Operand i } } } - return new SpaceToDepth(opBuilder.build()); + return new SpaceToDepth<>(opBuilder.build()); } - + /** - * @param dataFormat + * 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SpaceToDepth"; - - private Output output; - - private SpaceToDepth(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.SpaceToDepth} + */ + 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; + } + } + + @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 new file mode 100644 index 00000000000..1b7c99a694e --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SparseSoftmaxCrossEntropyWithLogits.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.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. + * Unlike {@code SoftmaxCrossEntropyWithLogits}, this operation does not accept + * a matrix of label probabilities, but rather a single label per row + * of features. This label is considered to have probability 1.0 for the + * given row. + *

Inputs are the logits, not probabilities. + */ +@OpMetadata( + opType = SparseSoftmaxCrossEntropyWithLogits.OP_NAME, + inputsClass = SparseSoftmaxCrossEntropyWithLogits.Inputs.class +) +@Operator( + group = "nn" +) +public final class SparseSoftmaxCrossEntropyWithLogits extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSoftmaxCrossEntropyWithLogits"; + + private Output loss; + + private Output backprop; + + public SparseSoftmaxCrossEntropyWithLogits(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + loss = operation.output(outputIdx++); + backprop = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new SparseSoftmaxCrossEntropyWithLogits operation. + * + * @param scope current scope + * @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. + * @param data type for {@code SparseSoftmaxCrossEntropyWithLogits} output and operands + * @return a new instance of SparseSoftmaxCrossEntropyWithLogits + */ + @Endpoint( + describeByClass = true + ) + public static SparseSoftmaxCrossEntropyWithLogits create(Scope scope, + Operand features, Operand labels) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseSoftmaxCrossEntropyWithLogits"); + opBuilder.addInput(features.asOutput()); + opBuilder.addInput(labels.asOutput()); + return new SparseSoftmaxCrossEntropyWithLogits<>(opBuilder.build()); + } + + /** + * Gets loss. + * Per example loss (batch_size vector). + * @return loss. + */ + public Output loss() { + return loss; + } + + /** + * Gets backprop. + * backpropagated gradients (batch_size x num_classes matrix). + * @return backprop. + */ + 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 d86357aa90d..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,72 +17,82 @@ 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; /** - * Finds values and indices of the `k` largest elements for the last dimension. - *

- * If the input is a vector (rank-1), finds the `k` largest entries in the vector - * and outputs their values and indices as vectors. Thus `values[j]` is the - * `j`-th largest entry in `input`, and its index is `indices[j]`. - *

- * For matrices (resp. higher rank input), computes the top `k` entries in each + * 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 data type for {@code values()} output + *

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

If two elements are equal, the lower-index element appears first. */ -@Operator(group = "nn") -public final class TopK extends RawOp { - +@OpMetadata( + opType = TopK.OP_NAME, + inputsClass = TopK.Inputs.class +) +@Operator( + group = "nn" +) +public final class TopK extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.TopK} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param sorted If true the resulting `k` elements will be sorted by the values in - * descending order. - */ - public Options sorted(Boolean sorted) { - this.sorted = sorted; - return this; - } - - private Boolean sorted; - - private Options() { - } + public static final String OP_NAME = "TopKV2"; + + private Output values; + + private Output indices; + + public TopK(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 TopK operation. - * + * Factory method to create a class wrapping a new TopKV2 operation. + * * @param scope current scope - * @param input 1-D or higher with last dimension at least `k`. + * @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 attributes values + * @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) { - OperationBuilder opBuilder = scope.env().opBuilder("TopKV2", scope.makeOpName("TopK")); + @Endpoint( + describeByClass = true + ) + 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 = scope.apply(opBuilder); + opBuilder.setAttr("index_type", Operands.toDataType(indexType)); if (options != null) { for (Options opts : options) { if (opts.sorted != null) { @@ -90,41 +100,124 @@ public static TopK create(Scope scope, Operand input, } } } - return new TopK(opBuilder.build()); + 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); } - + /** - * @param sorted If true the resulting `k` elements will be sorted by the values in + * Sets the sorted option. + * + * @param sorted If true the resulting {@code k} elements will be sorted by the values in * descending order. + * @return this Options instance. */ public static Options sorted(Boolean sorted) { return new Options().sorted(sorted); } - + /** - * The `k` largest elements along each last dimensional slice. + * Gets values. + * The {@code k} largest elements along each last dimensional slice. + * @return values. */ public Output values() { return values; } - + /** - * The indices of `values` within the last dimension of `input`. + * Gets indices. + * The indices of {@code values} within the last dimension of {@code input}. + * @return indices. */ - public Output indices() { + public Output indices() { return indices; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TopKV2"; - - private Output values; - private Output indices; - - private TopK(Operation operation) { - super(operation); - int outputIdx = 0; - values = operation.output(outputIdx++); - indices = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.TopK} + */ + public static class Options { + private Boolean sorted; + + private Options() { + } + + /** + * Sets the sorted option. + * + * @param sorted If true the resulting {@code k} elements will be sorted by the values in + * descending order. + * @return this Options instance. + */ + public Options sorted(Boolean sorted) { + this.sorted = 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/nn/raw/SoftmaxCrossEntropyWithLogits.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/raw/SoftmaxCrossEntropyWithLogits.java deleted file mode 100644 index 8032a4c2512..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/raw/SoftmaxCrossEntropyWithLogits.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.nn.raw; - -import 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; - -/** - * Computes softmax cross entropy cost and gradients to backpropagate. - *

- * Inputs are the logits, not probabilities. - * - * @param data type for {@code loss()} output - */ -@Operator(group = "nn.raw") -public final class SoftmaxCrossEntropyWithLogits extends RawOp { - - /** - * Factory method to create a class wrapping a new SoftmaxCrossEntropyWithLogits operation. - * - * @param scope current scope - * @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 - * probability distribution. - * @return a new instance of SoftmaxCrossEntropyWithLogits - */ - @Endpoint(describeByClass = true) - public static SoftmaxCrossEntropyWithLogits create(Scope scope, Operand features, Operand labels) { - OperationBuilder opBuilder = scope.env().opBuilder("SoftmaxCrossEntropyWithLogits", scope.makeOpName("SoftmaxCrossEntropyWithLogits")); - opBuilder.addInput(features.asOutput()); - opBuilder.addInput(labels.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SoftmaxCrossEntropyWithLogits(opBuilder.build()); - } - - /** - * Per example loss (batch_size vector). - */ - public Output loss() { - return loss; - } - - /** - * backpropagated gradients (batch_size x num_classes matrix). - */ - public Output backprop() { - return backprop; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SoftmaxCrossEntropyWithLogits"; - - private Output loss; - private Output backprop; - - private SoftmaxCrossEntropyWithLogits(Operation operation) { - super(operation); - int outputIdx = 0; - loss = operation.output(outputIdx++); - backprop = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/raw/SparseSoftmaxCrossEntropyWithLogits.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/raw/SparseSoftmaxCrossEntropyWithLogits.java deleted file mode 100644 index 67650760b1c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/raw/SparseSoftmaxCrossEntropyWithLogits.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.nn.raw; - -import 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; - -/** - * Computes softmax cross entropy cost and gradients to backpropagate. - *

- * Unlike `SoftmaxCrossEntropyWithLogits`, this operation does not accept - * a matrix of label probabilities, but rather a single label per row - * 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 - */ -@Operator(group = "nn.raw") -public final class SparseSoftmaxCrossEntropyWithLogits extends RawOp { - - /** - * Factory method to create a class wrapping a new SparseSoftmaxCrossEntropyWithLogits operation. - * - * @param scope current scope - * @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. - * @return a new instance of SparseSoftmaxCrossEntropyWithLogits - */ - @Endpoint(describeByClass = true) - public static SparseSoftmaxCrossEntropyWithLogits create(Scope scope, Operand features, Operand labels) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseSoftmaxCrossEntropyWithLogits", scope.makeOpName("SparseSoftmaxCrossEntropyWithLogits")); - opBuilder.addInput(features.asOutput()); - opBuilder.addInput(labels.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SparseSoftmaxCrossEntropyWithLogits(opBuilder.build()); - } - - /** - * Per example loss (batch_size vector). - */ - public Output loss() { - return loss; - } - - /** - * backpropagated gradients (batch_size x num_classes matrix). - */ - public Output backprop() { - return backprop; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSoftmaxCrossEntropyWithLogits"; - - private Output loss; - private Output backprop; - - private SparseSoftmaxCrossEntropyWithLogits(Operation operation) { - super(operation); - int outputIdx = 0; - loss = operation.output(outputIdx++); - backprop = operation.output(outputIdx++); - } -} 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 ff6b734970b..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,132 +17,114 @@ 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; -import org.tensorflow.types.family.TType; /** * Dequantize the 'input' tensor into a float or bfloat16 Tensor. - *

* [min_range, max_range] are scalar floats that specify the range for * the output. The 'mode' attribute controls exactly which calculations are * used to convert the float values to their quantized equivalents. - *

- * In 'MIN_COMBINED' mode, each value of the tensor will undergo the following: - *

{@code
+ * 

In 'MIN_COMBINED' mode, each value of the tensor will undergo the following: + *

  * if T == qint8: in[i] += (range(T) + 1)/ 2.0
  * out[i] = min_range + (in[i]* (max_range - min_range) / range(T))
- * }
- * here `range(T) = numeric_limits::max() - numeric_limits::min()` - *

- * MIN_COMBINED Mode Example - *

- * If the input comes from a QuantizedRelu6, the output type is + *

+ *

here {@code range(T) = numeric_limits::max() - numeric_limits::min()} + *

MIN_COMBINED Mode Example + *

If the input comes from a QuantizedRelu6, the output type is * quint8 (range of 0-255) but the possible range of QuantizedRelu6 is * 0-6. The min_range and max_range values are therefore 0.0 and 6.0. * Dequantize on quint8 will take each value, cast to float, and multiply * by 6 / 255. * Note that if quantizedtype is qint8, the operation will additionally add * each value by 128 prior to casting. - *

- * If the mode is 'MIN_FIRST', then this approach is used: - *

{@code
- * num_discrete_values = 1 << (# of bits in T)
+ * 

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 = range / num_discrete_values
- * const double offset_input = static_cast(input) - lowest_quantized;
- * result = range_min + ((input - numeric_limits::min()) * range_scale)
- * }
- * If the mode is `SCALED`, dequantization is performed by multiplying each + * const double offset_input = static_cast<double>(input) - lowest_quantized; + * result = range_min + ((input - numeric_limits<T>::min()) * range_scale) + *
+ *

If the mode is {@code SCALED}, dequantization is performed by multiplying each * input value by a scaling_factor. (Thus an input of 0 always maps to 0.0). - *

- * The scaling_factor is determined from `min_range`, `max_range`, and - * `narrow_range` in a way that is compatible with `QuantizeAndDequantize{V2|V3}` - * and `QuantizeV2`, using the following algorithm: - *

{@code
- *   const int min_expected_T = std::numeric_limits::min() +
+ * 

The scaling_factor is determined from {@code min_range}, {@code max_range}, and + * {@code narrow_range} in a way that is compatible with {@code QuantizeAndDequantize{V2|V3}} + * and {@code QuantizeV2}, using the following algorithm: + *

+ *
+ *   const int min_expected_T = std::numeric_limits<T>::min() +
  *     (narrow_range ? 1 : 0);
- *   const int max_expected_T = std::numeric_limits::max();
- *   const float max_expected_T = std::numeric_limits::max();
- * 
+ *   const int max_expected_T = std::numeric_limits<T>::max();
+ *   const float max_expected_T = std::numeric_limits<float>::max();
+ *
  *   const float scale_factor =
- *     (std::numeric_limits::min() == 0) ? (max_range / max_expected_T)
+ *     (std::numeric_limits<T>::min() == 0) ? (max_range / max_expected_T)
  *                                          : std::max(min_range / min_expected_T,
  *                                                     max_range / max_expected_T);
- * }
- * - * - * @param data type for {@code output()} output + *
*/ -@Operator(group = "quantization") +@OpMetadata( + opType = Dequantize.OP_NAME, + inputsClass = Dequantize.Inputs.class +) +@Operator( + group = "quantization" +) public final class Dequantize extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.Dequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param mode - */ - public Options mode(String mode) { - this.mode = mode; - return this; - } - - /** - * @param narrowRange - */ - public Options narrowRange(Boolean narrowRange) { - this.narrowRange = narrowRange; - return this; - } - - /** - * @param axis - */ - public Options axis(Long axis) { - this.axis = axis; - return this; - } - - private String mode; - private Boolean narrowRange; - private Long axis; - - private Options() { - } + public static final String OP_NAME = "Dequantize"; + + private Output output; + + public Dequantize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Dequantize operation. - * + * * @param scope current scope - * @param input + * @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. * If 'dtype' is 'bfloat16', it only supports 'MIN_COMBINED' mode. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Dequantize} output and operands * @return a new instance of Dequantize */ - @Endpoint(describeByClass = true) - public static Dequantize create(Scope scope, Operand input, Operand minRange, Operand maxRange, Class dtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Dequantize", scope.makeOpName("Dequantize")); + @Endpoint( + describeByClass = true + ) + public static Dequantize create(Scope scope, + Operand input, Operand minRange, Operand maxRange, + Class dtype, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Dequantize"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(minRange.asOutput()); opBuilder.addInput(maxRange.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); if (options != null) { for (Options opts : options) { @@ -157,64 +139,174 @@ public static Dequantize create(Scope scope, Operand(opBuilder.build()); + return new Dequantize<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Dequantize operation using default output types. - * + * Factory method to create a class wrapping a new Dequantize operation, with the default output types. + * * @param scope current scope - * @param input + * @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 attributes values - * @return a new instance of Dequantize + * @param options carries optional attribute values + * @return a new instance of Dequantize, with default output types */ - @Endpoint(describeByClass = true) - public static Dequantize create(Scope scope, Operand input, Operand minRange, Operand maxRange, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Dequantize create(Scope scope, Operand input, + Operand minRange, Operand maxRange, Options... options) { return create(scope, input, minRange, maxRange, TFloat32.class, options); } - + /** - * @param mode + * Sets the mode option. + * + * @param mode the mode option + * @return this Options instance. */ public static Options mode(String mode) { return new Options().mode(mode); } - + /** - * @param narrowRange + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. */ public static Options narrowRange(Boolean narrowRange) { return new Options().narrowRange(narrowRange); } - + /** - * @param axis + * Sets the axis option. + * + * @param axis the axis option + * @return this Options instance. */ public static Options axis(Long axis) { return new Options().axis(axis); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Dequantize"; - - private Output output; - - private Dequantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.Dequantize} + */ + public static class Options { + private String mode; + + private Boolean narrowRange; + + private Long axis; + + private Options() { + } + + /** + * Sets the mode option. + * + * @param mode the mode option + * @return this Options instance. + */ + public Options mode(String mode) { + this.mode = mode; + return this; + } + + /** + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = narrowRange; + return this; + } + + /** + * Sets the axis option. + * + * @param axis the axis option + * @return this Options instance. + */ + public Options axis(Long axis) { + this.axis = 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 671c5f0ad4f..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,114 +17,103 @@ 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 *

    - *
  • - * `[min; max]` define the clamping range for the `inputs` data. - *
  • - *
  • - * `inputs` values are quantized into the quantization range ( - * `[0; 2^num_bits - 1]` when `narrow_range` is false and `[1; 2^num_bits - 1]` - * when it is true) and then de-quantized and output as floats in `[min; max]` - * interval. - *
  • - *
  • - * `num_bits` is the bitwidth of the quantization; between 2 and 16, inclusive. - *
  • + *
  • {@code [min; max]} define the clamping range for the {@code inputs} data.
  • + *
  • {@code inputs} values are quantized into the quantization range ( + * {@code [0; 2^num_bits - 1]} when {@code narrow_range} is false and {@code [1; 2^num_bits - 1]} + * when it is true) and then de-quantized and output as floats in {@code [min; max]} + * interval.
  • + *
  • {@code num_bits} is the bitwidth of the quantization; between 2 and 16, inclusive.
  • *
- * Before quantization, `min` and `max` values are adjusted with the following + *

Before quantization, {@code min} and {@code max} values are adjusted with the following * logic. - * It is suggested to have `min <= 0 <= max`. If `0` is not in the range of values, + * It is suggested to have {@code min <= 0 <= max}. If {@code 0} is not in the range of values, * the behavior can be unexpected: *

    - *
  • - * If `0 < min < max`: `min_adj = 0` and `max_adj = max - min`. - *
  • - *
  • - * If `min < max < 0`: `min_adj = min - max` and `max_adj = 0`. - *
  • - *
  • - * If `min <= 0 <= max`: `scale = (max - min) / (2^num_bits - 1) `, - * `min_adj = scale * round(min / scale)` and `max_adj = max + min_adj - min`. + *
  • If {@code 0 < min < max}: {@code min_adj = 0} and {@code max_adj = max - min}.
  • + *
  • If {@code min < max < 0}: {@code min_adj = min - max} and {@code max_adj = 0}.
  • + *
  • 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}.
  • + *
+ *

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.
  • *
- * Quantization is called fake since the output is still in floating point. */ -@Operator(group = "quantization") +@OpMetadata( + opType = FakeQuantWithMinMaxArgs.OP_NAME, + inputsClass = FakeQuantWithMinMaxArgs.Inputs.class +) +@Operator( + group = "quantization" +) public final class FakeQuantWithMinMaxArgs extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxArgs} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param min - */ - public Options min(Float min) { - this.min = min; - return this; - } - - /** - * @param max - */ - public Options max(Float max) { - this.max = max; - return this; - } - - /** - * @param numBits - */ - public Options numBits(Long numBits) { - this.numBits = numBits; - return this; - } - - /** - * @param narrowRange - */ - public Options narrowRange(Boolean narrowRange) { - this.narrowRange = narrowRange; - return this; - } - - private Float min; - private Float max; - private Long numBits; - private Boolean narrowRange; - - private Options() { - } + public static final String OP_NAME = "FakeQuantWithMinMaxArgs"; + + private Output outputs; + + public FakeQuantWithMinMaxArgs(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputs = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new FakeQuantWithMinMaxArgs operation. - * + * * @param scope current scope - * @param inputs - * @param options carries optional attributes values + * @param inputs The inputs value + * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxArgs */ - @Endpoint(describeByClass = true) - public static FakeQuantWithMinMaxArgs create(Scope scope, Operand inputs, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("FakeQuantWithMinMaxArgs", scope.makeOpName("FakeQuantWithMinMaxArgs")); + @Endpoint( + describeByClass = true + ) + public static FakeQuantWithMinMaxArgs create(Scope scope, Operand inputs, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FakeQuantWithMinMaxArgs"); opBuilder.addInput(inputs.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.min != null) { @@ -143,54 +132,158 @@ public static FakeQuantWithMinMaxArgs create(Scope scope, Operand inpu } return new FakeQuantWithMinMaxArgs(opBuilder.build()); } - + /** - * @param min + * Sets the min option. + * + * @param min the min option + * @return this Options instance. */ public static Options min(Float min) { return new Options().min(min); } - + /** - * @param max + * Sets the max option. + * + * @param max the max option + * @return this Options instance. */ public static Options max(Float max) { return new Options().max(max); } - + /** - * @param numBits + * Sets the numBits option. + * + * @param numBits the numBits option + * @return this Options instance. */ public static Options numBits(Long numBits) { return new Options().numBits(numBits); } - + /** - * @param narrowRange + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. */ public static Options narrowRange(Boolean narrowRange) { return new Options().narrowRange(narrowRange); } - + /** + * Gets outputs. + * + * @return outputs. */ public Output outputs() { return outputs; } - + @Override public Output asOutput() { return outputs; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FakeQuantWithMinMaxArgs"; - - private Output outputs; - - private FakeQuantWithMinMaxArgs(Operation operation) { - super(operation); - int outputIdx = 0; - outputs = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxArgs} + */ + public static class Options { + private Float min; + + private Float max; + + private Long numBits; + + private Boolean narrowRange; + + private Options() { + } + + /** + * Sets the min option. + * + * @param min the min option + * @return this Options instance. + */ + public Options min(Float min) { + this.min = min; + return this; + } + + /** + * Sets the max option. + * + * @param max the max option + * @return this Options instance. + */ + public Options max(Float max) { + this.max = max; + return this; + } + + /** + * Sets the numBits option. + * + * @param numBits the numBits option + * @return this Options instance. + */ + public Options numBits(Long numBits) { + this.numBits = numBits; + return this; + } + + /** + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = 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 e44b1f9ae73..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,83 +17,62 @@ 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. */ -@Operator(group = "quantization") +@OpMetadata( + opType = FakeQuantWithMinMaxArgsGradient.OP_NAME, + inputsClass = FakeQuantWithMinMaxArgsGradient.Inputs.class +) +@Operator( + group = "quantization" +) public final class FakeQuantWithMinMaxArgsGradient extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxArgsGradient} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param min - */ - public Options min(Float min) { - this.min = min; - return this; - } - - /** - * @param max - */ - public Options max(Float max) { - this.max = max; - return this; - } - - /** - * @param numBits - */ - public Options numBits(Long numBits) { - this.numBits = numBits; - return this; - } - - /** - * @param narrowRange - */ - public Options narrowRange(Boolean narrowRange) { - this.narrowRange = narrowRange; - return this; - } - - private Float min; - private Float max; - private Long numBits; - private Boolean narrowRange; - - private Options() { - } + public static final String OP_NAME = "FakeQuantWithMinMaxArgsGradient"; + + private Output backprops; + + public FakeQuantWithMinMaxArgsGradient(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + backprops = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new FakeQuantWithMinMaxArgsGradient operation. - * + * * @param scope current scope * @param gradients Backpropagated gradients above the FakeQuantWithMinMaxArgs operation. * @param inputs Values passed as inputs to the FakeQuantWithMinMaxArgs operation. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxArgsGradient */ - @Endpoint(describeByClass = true) - public static FakeQuantWithMinMaxArgsGradient create(Scope scope, Operand gradients, Operand inputs, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("FakeQuantWithMinMaxArgsGradient", scope.makeOpName("FakeQuantWithMinMaxArgsGradient")); + @Endpoint( + describeByClass = true + ) + public static FakeQuantWithMinMaxArgsGradient create(Scope scope, Operand gradients, + Operand inputs, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FakeQuantWithMinMaxArgsGradient"); opBuilder.addInput(gradients.asOutput()); opBuilder.addInput(inputs.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.min != null) { @@ -112,56 +91,197 @@ public static FakeQuantWithMinMaxArgsGradient create(Scope scope, Operand= min && inputs <= max)`. + * {@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() { return backprops; } - + @Override public Output asOutput() { return backprops; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FakeQuantWithMinMaxArgsGradient"; - - private Output backprops; - - private FakeQuantWithMinMaxArgsGradient(Operation operation) { - super(operation); - int outputIdx = 0; - backprops = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxArgsGradient} + */ + public static class Options { + private Float min; + + private Float max; + + private Long numBits; + + private Boolean narrowRange; + + private Options() { + } + + /** + * Sets the min option. + * + * @param min the min option + * @return this Options instance. + */ + public Options min(Float min) { + this.min = min; + return this; + } + + /** + * Sets the max option. + * + * @param max the max option + * @return this Options instance. + */ + public Options max(Float max) { + this.max = max; + return this; + } + + /** + * Sets the numBits option. + * + * @param numBits the numBits option + * @return this Options instance. + */ + public Options numBits(Long numBits) { + this.numBits = numBits; + return this; + } + + /** + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = 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 cde8bdab869..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,104 +17,109 @@ 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 of type float via global float scalars - *

- * Fake-quantize the `inputs` tensor of type float via global float scalars - * `min` and `max` to `outputs` tensor of same shape as `inputs`. - *

- * Attributes + * Fake-quantize the {@code inputs} tensor of type float via global float scalars + * {@code min} and {@code max} to {@code outputs} tensor of same shape as {@code inputs}. + *

Attributes *

    - *
  • - * `[min; max]` define the clamping range for the `inputs` data. - *
  • - *
  • - * `inputs` values are quantized into the quantization range ( - * `[0; 2^num_bits - 1]` when `narrow_range` is false and `[1; 2^num_bits - 1]` - * when it is true) and then de-quantized and output as floats in `[min; max]` - * interval. - *
  • - *
  • - * `num_bits` is the bitwidth of the quantization; between 2 and 16, inclusive. - *
  • + *
  • {@code [min; max]} define the clamping range for the {@code inputs} data.
  • + *
  • {@code inputs} values are quantized into the quantization range ( + * {@code [0; 2^num_bits - 1]} when {@code narrow_range} is false and {@code [1; 2^num_bits - 1]} + * when it is true) and then de-quantized and output as floats in {@code [min; max]} + * interval.
  • + *
  • {@code num_bits} is the bitwidth of the quantization; between 2 and 16, inclusive.
  • *
- * Before quantization, `min` and `max` values are adjusted with the following + *

Before quantization, {@code min} and {@code max} values are adjusted with the following * logic. - * It is suggested to have `min <= 0 <= max`. If `0` is not in the range of values, + * It is suggested to have {@code min <= 0 <= max}. If {@code 0} is not in the range of values, * the behavior can be unexpected: *

    - *
  • - * If `0 < min < max`: `min_adj = 0` and `max_adj = max - min`. - *
  • - *
  • - * If `min < max < 0`: `min_adj = min - max` and `max_adj = 0`. - *
  • - *
  • - * If `min <= 0 <= max`: `scale = (max - min) / (2^num_bits - 1) `, - * `min_adj = scale * round(min / scale)` and `max_adj = max + min_adj - min`. - *
  • + *
  • If {@code 0 < min < max}: {@code min_adj = 0} and {@code max_adj = max - min}.
  • + *
  • If {@code min < max < 0}: {@code min_adj = min - max} and {@code max_adj = 0}.
  • + *
  • 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}.
  • *
- * This operation has a gradient and thus allows for training `min` and `max` + *

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

+ *
+ *
*/ -@Operator(group = "quantization") +@OpMetadata( + opType = FakeQuantWithMinMaxVars.OP_NAME, + inputsClass = FakeQuantWithMinMaxVars.Inputs.class +) +@Operator( + group = "quantization" +) public final class FakeQuantWithMinMaxVars extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxVars} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param numBits - */ - public Options numBits(Long numBits) { - this.numBits = numBits; - return this; - } - - /** - * @param narrowRange - */ - public Options narrowRange(Boolean narrowRange) { - this.narrowRange = narrowRange; - return this; - } - - private Long numBits; - private Boolean narrowRange; - - private Options() { - } + public static final String OP_NAME = "FakeQuantWithMinMaxVars"; + + private Output outputs; + + public FakeQuantWithMinMaxVars(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputs = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new FakeQuantWithMinMaxVars operation. - * + * * @param scope current scope - * @param inputs - * @param min - * @param max - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static FakeQuantWithMinMaxVars create(Scope scope, Operand inputs, Operand min, Operand max, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("FakeQuantWithMinMaxVars", scope.makeOpName("FakeQuantWithMinMaxVars")); + @Endpoint( + describeByClass = true + ) + public static FakeQuantWithMinMaxVars create(Scope scope, Operand inputs, + Operand min, Operand max, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FakeQuantWithMinMaxVars"); opBuilder.addInput(inputs.asOutput()); opBuilder.addInput(min.asOutput()); opBuilder.addInput(max.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.numBits != null) { @@ -127,40 +132,112 @@ public static FakeQuantWithMinMaxVars create(Scope scope, Operand inpu } return new FakeQuantWithMinMaxVars(opBuilder.build()); } - + /** - * @param numBits + * Sets the numBits option. + * + * @param numBits the numBits option + * @return this Options instance. */ public static Options numBits(Long numBits) { return new Options().numBits(numBits); } - + /** - * @param narrowRange + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. */ public static Options narrowRange(Boolean narrowRange) { return new Options().narrowRange(narrowRange); } - + /** + * Gets outputs. + * + * @return outputs. */ public Output outputs() { return outputs; } - + @Override public Output asOutput() { return outputs; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FakeQuantWithMinMaxVars"; - - private Output outputs; - - private FakeQuantWithMinMaxVars(Operation operation) { - super(operation); - int outputIdx = 0; - outputs = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxVars} + */ + public static class Options { + private Long numBits; + + private Boolean narrowRange; + + private Options() { + } + + /** + * Sets the numBits option. + * + * @param numBits the numBits option + * @return this Options instance. + */ + public Options numBits(Long numBits) { + this.numBits = numBits; + return this; + } + + /** + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = 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 fb18431f99b..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,70 +17,73 @@ 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. */ -@Operator(group = "quantization") +@OpMetadata( + opType = FakeQuantWithMinMaxVarsGradient.OP_NAME, + inputsClass = FakeQuantWithMinMaxVarsGradient.Inputs.class +) +@Operator( + group = "quantization" +) public final class FakeQuantWithMinMaxVarsGradient extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxVarsGradient} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param numBits The bitwidth of the quantization; between 2 and 8, inclusive. - */ - public Options numBits(Long numBits) { - this.numBits = numBits; - return this; - } - - /** - * @param narrowRange Whether to quantize into 2^num_bits - 1 distinct values. - */ - public Options narrowRange(Boolean narrowRange) { - this.narrowRange = narrowRange; - return this; - } - - private Long numBits; - private Boolean narrowRange; - - private Options() { - } + public static final String OP_NAME = "FakeQuantWithMinMaxVarsGradient"; + + private Output backpropsWrtInput; + + private Output backpropWrtMin; + + private Output backpropWrtMax; + + public FakeQuantWithMinMaxVarsGradient(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + backpropsWrtInput = operation.output(outputIdx++); + backpropWrtMin = operation.output(outputIdx++); + backpropWrtMax = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new FakeQuantWithMinMaxVarsGradient operation. - * + * * @param scope current scope * @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 - * @param max - * @param options carries optional attributes values + * @param min The min value + * @param max The max value + * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxVarsGradient */ - @Endpoint(describeByClass = true) - public static FakeQuantWithMinMaxVarsGradient create(Scope scope, Operand gradients, Operand inputs, Operand min, Operand max, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("FakeQuantWithMinMaxVarsGradient", scope.makeOpName("FakeQuantWithMinMaxVarsGradient")); + @Endpoint( + describeByClass = true + ) + public static FakeQuantWithMinMaxVarsGradient create(Scope scope, Operand gradients, + Operand inputs, Operand min, Operand max, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FakeQuantWithMinMaxVarsGradient"); opBuilder.addInput(gradients.asOutput()); opBuilder.addInput(inputs.asOutput()); opBuilder.addInput(min.asOutput()); opBuilder.addInput(max.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.numBits != null) { @@ -93,57 +96,135 @@ public static FakeQuantWithMinMaxVarsGradient create(Scope scope, Operand= min && inputs <= max)`. + * {@code gradients * (inputs >= min && inputs <= max)}. + * @return backpropsWrtInput. */ public Output backpropsWrtInput() { return backpropsWrtInput; } - + /** + * Gets backpropWrtMin. * Backpropagated gradients w.r.t. min parameter: - * `sum(gradients * (inputs < min))`. + * {@code sum(gradients * (inputs < min))}. + * @return backpropWrtMin. */ public Output backpropWrtMin() { return backpropWrtMin; } - + /** + * Gets backpropWrtMax. * Backpropagated gradients w.r.t. max parameter: - * `sum(gradients * (inputs > max))`. + * {@code sum(gradients * (inputs > max))}. + * @return backpropWrtMax. */ public Output backpropWrtMax() { return backpropWrtMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FakeQuantWithMinMaxVarsGradient"; - - private Output backpropsWrtInput; - private Output backpropWrtMin; - private Output backpropWrtMax; - - private FakeQuantWithMinMaxVarsGradient(Operation operation) { - super(operation); - int outputIdx = 0; - backpropsWrtInput = operation.output(outputIdx++); - backpropWrtMin = operation.output(outputIdx++); - backpropWrtMax = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxVarsGradient} + */ + public static class Options { + private Long numBits; + + private Boolean narrowRange; + + private Options() { + } + + /** + * Sets the numBits option. + * + * @param numBits The bitwidth of the quantization; between 2 and 8, inclusive. + * @return this Options instance. + */ + public Options numBits(Long numBits) { + this.numBits = numBits; + return this; + } + + /** + * Sets the narrowRange option. + * + * @param narrowRange Whether to quantize into 2^num_bits - 1 distinct values. + * @return this Options instance. + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = 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 af1d2c287b1..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,105 +17,88 @@ 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 of type float via per-channel floats - *

- * Fake-quantize the `inputs` tensor of type float per-channel and one of the - * shapes: `[d]`, `[b, d]` `[b, h, w, d]` via per-channel floats `min` and `max` - * of shape `[d]` to `outputs` tensor of same shape as `inputs`. - *

- * Attributes + * Fake-quantize the {@code inputs} tensor of type float per-channel and one of the + * shapes: {@code [d]}, {@code [b, d]} {@code [b, h, w, d]} via per-channel floats {@code min} and {@code max} + * of shape {@code [d]} to {@code outputs} tensor of same shape as {@code inputs}. + *

Attributes *

    - *
  • - * `[min; max]` define the clamping range for the `inputs` data. - *
  • - *
  • - * `inputs` values are quantized into the quantization range ( - * `[0; 2^num_bits - 1]` when `narrow_range` is false and `[1; 2^num_bits - 1]` - * when it is true) and then de-quantized and output as floats in `[min; max]` - * interval. - *
  • - *
  • - * `num_bits` is the bitwidth of the quantization; between 2 and 16, inclusive. - *
  • + *
  • {@code [min; max]} define the clamping range for the {@code inputs} data.
  • + *
  • {@code inputs} values are quantized into the quantization range ( + * {@code [0; 2^num_bits - 1]} when {@code narrow_range} is false and {@code [1; 2^num_bits - 1]} + * when it is true) and then de-quantized and output as floats in {@code [min; max]} + * interval.
  • + *
  • {@code num_bits} is the bitwidth of the quantization; between 2 and 16, inclusive.
  • *
- * Before quantization, `min` and `max` values are adjusted with the following + *

Before quantization, {@code min} and {@code max} values are adjusted with the following * logic. - * It is suggested to have `min <= 0 <= max`. If `0` is not in the range of values, + * It is suggested to have {@code min <= 0 <= max}. If {@code 0} is not in the range of values, * the behavior can be unexpected: *

    - *
  • - * If `0 < min < max`: `min_adj = 0` and `max_adj = max - min`. - *
  • - *
  • - * If `min < max < 0`: `min_adj = min - max` and `max_adj = 0`. - *
  • - *
  • - * If `min <= 0 <= max`: `scale = (max - min) / (2^num_bits - 1) `, - * `min_adj = scale * round(min / scale)` and `max_adj = max + min_adj - min`. - *
  • + *
  • If {@code 0 < min < max}: {@code min_adj = 0} and {@code max_adj = max - min}.
  • + *
  • If {@code min < max < 0}: {@code min_adj = min - max} and {@code max_adj = 0}.
  • + *
  • 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}.
  • *
- * This operation has a gradient and thus allows for training `min` and `max` + *

This operation has a gradient and thus allows for training {@code min} and {@code max} * values. */ -@Operator(group = "quantization") +@OpMetadata( + opType = FakeQuantWithMinMaxVarsPerChannel.OP_NAME, + inputsClass = FakeQuantWithMinMaxVarsPerChannel.Inputs.class +) +@Operator( + group = "quantization" +) public final class FakeQuantWithMinMaxVarsPerChannel extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxVarsPerChannel} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param numBits - */ - public Options numBits(Long numBits) { - this.numBits = numBits; - return this; - } - - /** - * @param narrowRange - */ - public Options narrowRange(Boolean narrowRange) { - this.narrowRange = narrowRange; - return this; - } - - private Long numBits; - private Boolean narrowRange; - - private Options() { - } + public static final String OP_NAME = "FakeQuantWithMinMaxVarsPerChannel"; + + private Output outputs; + + public FakeQuantWithMinMaxVarsPerChannel(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputs = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new FakeQuantWithMinMaxVarsPerChannel operation. - * + * * @param scope current scope - * @param inputs - * @param min - * @param max - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static FakeQuantWithMinMaxVarsPerChannel create(Scope scope, Operand inputs, Operand min, Operand max, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("FakeQuantWithMinMaxVarsPerChannel", scope.makeOpName("FakeQuantWithMinMaxVarsPerChannel")); + @Endpoint( + describeByClass = true + ) + public static FakeQuantWithMinMaxVarsPerChannel create(Scope scope, Operand inputs, + Operand min, Operand max, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FakeQuantWithMinMaxVarsPerChannel"); opBuilder.addInput(inputs.asOutput()); opBuilder.addInput(min.asOutput()); opBuilder.addInput(max.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.numBits != null) { @@ -128,40 +111,112 @@ public static FakeQuantWithMinMaxVarsPerChannel create(Scope scope, Operand outputs() { return outputs; } - + @Override public Output asOutput() { return outputs; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FakeQuantWithMinMaxVarsPerChannel"; - - private Output outputs; - - private FakeQuantWithMinMaxVarsPerChannel(Operation operation) { - super(operation); - int outputIdx = 0; - outputs = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxVarsPerChannel} + */ + public static class Options { + private Long numBits; + + private Boolean narrowRange; + + private Options() { + } + + /** + * Sets the numBits option. + * + * @param numBits the numBits option + * @return this Options instance. + */ + public Options numBits(Long numBits) { + this.numBits = numBits; + return this; + } + + /** + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = 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 24e1ec13e1c..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,72 +17,76 @@ 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. */ -@Operator(group = "quantization") +@OpMetadata( + opType = FakeQuantWithMinMaxVarsPerChannelGradient.OP_NAME, + inputsClass = FakeQuantWithMinMaxVarsPerChannelGradient.Inputs.class +) +@Operator( + group = "quantization" +) public final class FakeQuantWithMinMaxVarsPerChannelGradient extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxVarsPerChannelGradient} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param numBits The bitwidth of the quantization; between 2 and 16, inclusive. - */ - public Options numBits(Long numBits) { - this.numBits = numBits; - return this; - } - - /** - * @param narrowRange Whether to quantize into 2^num_bits - 1 distinct values. - */ - public Options narrowRange(Boolean narrowRange) { - this.narrowRange = narrowRange; - return this; - } - - private Long numBits; - private Boolean narrowRange; - - private Options() { - } + public static final String OP_NAME = "FakeQuantWithMinMaxVarsPerChannelGradient"; + + private Output backpropsWrtInput; + + private Output backpropWrtMin; + + private Output backpropWrtMax; + + public FakeQuantWithMinMaxVarsPerChannelGradient(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + backpropsWrtInput = operation.output(outputIdx++); + backpropWrtMin = operation.output(outputIdx++); + backpropWrtMax = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new FakeQuantWithMinMaxVarsPerChannelGradient operation. - * + * * @param scope current scope * @param gradients Backpropagated gradients above the FakeQuantWithMinMaxVars operation, - * shape one of: `[d]`, `[b, d]`, `[b, h, w, d]`. + * shape one of: {@code [d]}, {@code [b, d]}, {@code [b, h, w, d]}. * @param inputs Values passed as inputs to the FakeQuantWithMinMaxVars operation, shape - * same as `gradients`. - * min, max: Quantization interval, floats of shape `[d]`. - * @param min - * @param max - * @param options carries optional attributes values + * same as {@code gradients}. + * min, max: Quantization interval, floats of shape {@code [d]}. + * @param min The min value + * @param max The max value + * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxVarsPerChannelGradient */ - @Endpoint(describeByClass = true) - public static FakeQuantWithMinMaxVarsPerChannelGradient create(Scope scope, Operand gradients, Operand inputs, Operand min, Operand max, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("FakeQuantWithMinMaxVarsPerChannelGradient", scope.makeOpName("FakeQuantWithMinMaxVarsPerChannelGradient")); + @Endpoint( + describeByClass = true + ) + public static FakeQuantWithMinMaxVarsPerChannelGradient create(Scope scope, + Operand gradients, Operand inputs, Operand min, + Operand max, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FakeQuantWithMinMaxVarsPerChannelGradient"); opBuilder.addInput(gradients.asOutput()); opBuilder.addInput(inputs.asOutput()); opBuilder.addInput(min.asOutput()); opBuilder.addInput(max.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.numBits != null) { @@ -95,58 +99,138 @@ public static FakeQuantWithMinMaxVarsPerChannelGradient create(Scope scope, Oper } return new FakeQuantWithMinMaxVarsPerChannelGradient(opBuilder.build()); } - + /** + * Sets the numBits option. + * * @param numBits The bitwidth of the quantization; between 2 and 16, inclusive. + * @return this Options instance. */ public static Options numBits(Long numBits) { return new Options().numBits(numBits); } - + /** + * Sets the narrowRange option. + * * @param narrowRange Whether to quantize into 2^num_bits - 1 distinct values. + * @return this Options instance. */ public static Options narrowRange(Boolean narrowRange) { return new Options().narrowRange(narrowRange); } - + /** + * Gets backpropsWrtInput. * Backpropagated gradients w.r.t. inputs, shape same as - * `inputs`: - * `gradients * (inputs >= min && inputs <= max)`. + * {@code inputs}: + * {@code gradients * (inputs >= min && inputs <= max)}. + * @return backpropsWrtInput. */ public Output backpropsWrtInput() { return backpropsWrtInput; } - + /** - * Backpropagated gradients w.r.t. min parameter, shape `[d]`: - * `sum_per_d(gradients * (inputs < min))`. + * Gets backpropWrtMin. + * Backpropagated gradients w.r.t. min parameter, shape {@code [d]}: + * {@code sum_per_d(gradients * (inputs < min))}. + * @return backpropWrtMin. */ public Output backpropWrtMin() { return backpropWrtMin; } - + /** - * Backpropagated gradients w.r.t. max parameter, shape `[d]`: - * `sum_per_d(gradients * (inputs > max))`. + * Gets backpropWrtMax. + * Backpropagated gradients w.r.t. max parameter, shape {@code [d]}: + * {@code sum_per_d(gradients * (inputs > max))}. + * @return backpropWrtMax. */ public Output backpropWrtMax() { return backpropWrtMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FakeQuantWithMinMaxVarsPerChannelGradient"; - - private Output backpropsWrtInput; - private Output backpropWrtMin; - private Output backpropWrtMax; - - private FakeQuantWithMinMaxVarsPerChannelGradient(Operation operation) { - super(operation); - int outputIdx = 0; - backpropsWrtInput = operation.output(outputIdx++); - backpropWrtMin = operation.output(outputIdx++); - backpropWrtMax = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxVarsPerChannelGradient} + */ + public static class Options { + private Long numBits; + + private Boolean narrowRange; + + private Options() { + } + + /** + * Sets the numBits option. + * + * @param numBits The bitwidth of the quantization; between 2 and 16, inclusive. + * @return this Options instance. + */ + public Options numBits(Long numBits) { + this.numBits = numBits; + return this; + } + + /** + * Sets the narrowRange option. + * + * @param narrowRange Whether to quantize into 2^num_bits - 1 distinct values. + * @return this Options instance. + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = 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 edab6594b2c..e6987733af8 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,215 +17,172 @@ 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.TType; +import org.tensorflow.types.family.TNumber; /** * Quantize the 'input' tensor of type float to 'output' tensor of type 'T'. - *

* [min_range, max_range] are scalar floats that specify the range for * the 'input' data. The 'mode' attribute controls exactly which calculations are * used to convert the float values to their quantized equivalents. The * 'round_mode' attribute controls which rounding tie-breaking algorithm is used * when rounding float values to their quantized equivalents. - *

- * In 'MIN_COMBINED' mode, each value of the tensor will undergo the following: - *

{@code
+ * 

In 'MIN_COMBINED' mode, each value of the tensor will undergo the following: + *

  * out[i] = (in[i] - min_range) * range(T) / (max_range - min_range)
  * if T == qint8: out[i] -= (range(T) + 1) / 2.0
- * }
- * here `range(T) = numeric_limits::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 + *

+ *

here {@code range(T) = numeric_limits::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 + *

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: - *

{@code
- * num_discrete_values = 1 << (# of bits in T)
+ * 

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 + * numeric_limits<T>::min() + * quantized = max(quantized, numeric_limits<T>::min()) + * quantized = min(quantized, numeric_limits<T>::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 + *

SCALED mode Example + *

{@code SCALED} mode matches the quantization approach used in + * {@code QuantizeAndDequantize{V2|V3}}. + *

If the mode is {@code 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 + * The scaling_factor is determined from {@code min_range} and {@code max_range} to be as large + * as possible such that the range from {@code min_range} to {@code max_range} is representable * within values of type T. - *

{@code
- *   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 int min_T = std::numeric_limits<T>::min();
+ *   const int max_T = std::numeric_limits<T>::max();
+ *   const float max_float = std::numeric_limits<float>::max();
+ *
  *   const float scale_factor_from_min_side =
- *       (min_T * min_range > 0) ? min_T / min_range : max_float;
+ *       (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;
- * 
+ *       (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: - *
{@code
+ * 
+ *

We next use the scale_factor to adjust min_range and max_range as follows: + *

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

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: - *

{@code
+ * 

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 + * {@code min_range} to {@code max_range}, then multiplying by scale_factor as follows: + *

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

The adjusted {@code min_range} and {@code 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. + *

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

axis (int) attribute + *

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

If axis is specified, min_range and max_range + *

if {@code 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. - * - * - * @param data type for {@code output()} output */ -@Operator(group = "quantization") -public final class Quantize extends RawOp { - +@OpMetadata( + opType = Quantize.OP_NAME, + inputsClass = Quantize.Inputs.class +) +@Operator( + group = "quantization" +) +public final class Quantize extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.quantization.Quantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param mode - */ - public Options mode(String mode) { - this.mode = mode; - return this; - } - - /** - * @param roundMode - */ - public Options roundMode(String roundMode) { - this.roundMode = roundMode; - return this; - } - - /** - * @param narrowRange - */ - public Options narrowRange(Boolean narrowRange) { - this.narrowRange = narrowRange; - return this; - } - - /** - * @param axis - */ - public Options axis(Long axis) { - this.axis = axis; - return this; - } - - /** - * @param ensureMinimumRange - */ - public Options ensureMinimumRange(Float ensureMinimumRange) { - this.ensureMinimumRange = ensureMinimumRange; - return this; - } - - private String mode; - private String roundMode; - private Boolean narrowRange; - private Long axis; - private Float ensureMinimumRange; - - private Options() { - } + public static final String OP_NAME = "QuantizeV2"; + + private Output output; + + private Output outputMin; + + private Output outputMax; + + public Quantize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + outputMin = operation.output(outputIdx++); + outputMax = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Quantize operation. - * + * Factory method to create a class wrapping a new QuantizeV2 operation. + * * @param scope current scope - * @param input + * @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 `output_min`. - * If the `axis` attribute is specified, this must be a 1-D tensor whose size - * matches the `axis` dimension of the input and output tensors. + * 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. * @param maxRange 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 `output_max`. - * If the `axis` attribute is specified, this must be a 1-D tensor whose size - * matches the `axis` dimension of the input and output tensors. - * @param T - * @param options carries optional attributes values + * 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 attribute + * @param options carries optional attribute values + * @param data type for {@code QuantizeV2} output and operands * @return a new instance of Quantize */ - @Endpoint(describeByClass = true) - public static Quantize create(Scope scope, Operand input, Operand minRange, Operand maxRange, Class T, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizeV2", scope.makeOpName("Quantize")); + @Endpoint( + describeByClass = true + ) + public static Quantize create(Scope scope, Operand input, + Operand minRange, Operand maxRange, Class T, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Quantize"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(minRange.asOutput()); opBuilder.addInput(maxRange.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("T", Operands.toDataType(T)); if (options != null) { for (Options opts : options) { @@ -246,83 +203,232 @@ public static Quantize create(Scope scope, Operand(opBuilder.build()); + return new Quantize<>(opBuilder.build()); } - + /** - * @param mode + * Sets the mode option. + * + * @param mode the mode option + * @return this Options instance. */ public static Options mode(String mode) { return new Options().mode(mode); } - + /** - * @param roundMode + * Sets the roundMode option. + * + * @param roundMode {@code round_mode='HALF_TO_EVEN'} only supported for mode 'SCALED'. + * @return this Options instance. */ public static Options roundMode(String roundMode) { return new Options().roundMode(roundMode); } - + /** - * @param narrowRange + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. */ public static Options narrowRange(Boolean narrowRange) { return new Options().narrowRange(narrowRange); } - + /** - * @param axis + * Sets the axis option. + * + * @param axis the axis option + * @return this Options instance. */ public static Options axis(Long axis) { return new Options().axis(axis); } - + /** - * @param ensureMinimumRange + * Sets the ensureMinimumRange option. + * + * @param ensureMinimumRange the ensureMinimumRange option + * @return this Options instance. */ public static Options ensureMinimumRange(Float ensureMinimumRange) { return new Options().ensureMinimumRange(ensureMinimumRange); } - + /** + * Gets output. * The quantized data produced from the float input. + * @return output. */ public Output output() { return output; } - + /** + * Gets outputMin. * The final quantization range minimum, used to clip input values before scaling * and rounding them to quantized values. - * If the `axis` attribute is specified, this will be a 1-D tensor whose size - * matches the `axis` dimension of the input and output tensors. + * If the {@code axis} attribute is specified, this will be a 1-D tensor whose size + * matches the {@code axis} dimension of the input and output tensors. + * @return outputMin. */ public Output outputMin() { return outputMin; } - + /** + * Gets outputMax. * The final quantization range maximum, used to clip input values before scaling * and rounding them to quantized values. - * If the `axis` attribute is specified, this will be a 1-D tensor whose size - * matches the `axis` dimension of the input and output tensors. + * If the {@code axis} attribute is specified, this will be a 1-D tensor whose size + * matches the {@code axis} dimension of the input and output tensors. + * @return outputMax. */ public Output outputMax() { return outputMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizeV2"; - - private Output output; - private Output outputMin; - private Output outputMax; - - private Quantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - outputMin = operation.output(outputIdx++); - outputMax = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.Quantize} + */ + public static class Options { + private String mode; + + private String roundMode; + + private Boolean narrowRange; + + private Long axis; + + private Float ensureMinimumRange; + + private Options() { + } + + /** + * Sets the mode option. + * + * @param mode the mode option + * @return this Options instance. + */ + public Options mode(String mode) { + this.mode = mode; + return this; + } + + /** + * Sets the roundMode option. + * + * @param roundMode {@code round_mode='HALF_TO_EVEN'} only supported for mode 'SCALED'. + * @return this Options instance. + */ + public Options roundMode(String roundMode) { + this.roundMode = roundMode; + return this; + } + + /** + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = narrowRange; + return this; + } + + /** + * Sets the axis option. + * + * @param axis the axis option + * @return this Options instance. + */ + public Options axis(Long axis) { + this.axis = axis; + return this; + } + + /** + * Sets the ensureMinimumRange option. + * + * @param ensureMinimumRange the ensureMinimumRange option + * @return this Options instance. + */ + public Options ensureMinimumRange(Float ensureMinimumRange) { + this.ensureMinimumRange = 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; + + /** + * {@code round_mode='HALF_TO_EVEN'} only supported for mode 'SCALED'. + */ + 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 d66ff6c4871..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,93 +17,71 @@ 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; /** * Quantizes then dequantizes a tensor. - *

* This is almost identical to QuantizeAndDequantizeV2, except that num_bits is a * tensor, so its value can change during training. - * - * @param data type for {@code output()} output */ -@Operator(group = "quantization") +@OpMetadata( + opType = QuantizeAndDequantize.OP_NAME, + inputsClass = QuantizeAndDequantize.Inputs.class +) +@Operator( + group = "quantization" +) public final class QuantizeAndDequantize extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.QuantizeAndDequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param signedInput - */ - public Options signedInput(Boolean signedInput) { - this.signedInput = signedInput; - return this; - } - - /** - * @param rangeGiven - */ - public Options rangeGiven(Boolean rangeGiven) { - this.rangeGiven = rangeGiven; - return this; - } - - /** - * @param narrowRange - */ - public Options narrowRange(Boolean narrowRange) { - this.narrowRange = narrowRange; - return this; - } - - /** - * @param axis - */ - public Options axis(Long axis) { - this.axis = axis; - return this; - } - - private Boolean signedInput; - private Boolean rangeGiven; - private Boolean narrowRange; - private Long axis; - - private Options() { - } + public static final String OP_NAME = "QuantizeAndDequantizeV3"; + + private Output output; + + public QuantizeAndDequantize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new QuantizeAndDequantize operation. - * + * Factory method to create a class wrapping a new QuantizeAndDequantizeV3 operation. + * * @param scope current scope - * @param input - * @param inputMin - * @param inputMax - * @param numBits - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static QuantizeAndDequantize create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Operand numBits, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizeAndDequantizeV3", scope.makeOpName("QuantizeAndDequantize")); + @Endpoint( + describeByClass = true + ) + public static QuantizeAndDequantize create(Scope scope, Operand input, + Operand inputMin, Operand inputMax, Operand numBits, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizeAndDequantize"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputMin.asOutput()); opBuilder.addInput(inputMax.asOutput()); opBuilder.addInput(numBits.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.signedInput != null) { @@ -120,56 +98,184 @@ public static QuantizeAndDequantize create(Scope scope, O } } } - return new QuantizeAndDequantize(opBuilder.build()); + return new QuantizeAndDequantize<>(opBuilder.build()); } - + /** - * @param signedInput + * Sets the signedInput option. + * + * @param signedInput the signedInput option + * @return this Options instance. */ public static Options signedInput(Boolean signedInput) { return new Options().signedInput(signedInput); } - + /** - * @param rangeGiven + * Sets the rangeGiven option. + * + * @param rangeGiven the rangeGiven option + * @return this Options instance. */ public static Options rangeGiven(Boolean rangeGiven) { return new Options().rangeGiven(rangeGiven); } - + /** - * @param narrowRange + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. */ public static Options narrowRange(Boolean narrowRange) { return new Options().narrowRange(narrowRange); } - + /** - * @param axis + * Sets the axis option. + * + * @param axis the axis option + * @return this Options instance. */ public static Options axis(Long axis) { return new Options().axis(axis); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizeAndDequantizeV3"; - - private Output output; - - private QuantizeAndDequantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.QuantizeAndDequantize} + */ + public static class Options { + private Boolean signedInput; + + private Boolean rangeGiven; + + private Boolean narrowRange; + + private Long axis; + + private Options() { + } + + /** + * Sets the signedInput option. + * + * @param signedInput the signedInput option + * @return this Options instance. + */ + public Options signedInput(Boolean signedInput) { + this.signedInput = signedInput; + return this; + } + + /** + * Sets the rangeGiven option. + * + * @param rangeGiven the rangeGiven option + * @return this Options instance. + */ + public Options rangeGiven(Boolean rangeGiven) { + this.rangeGiven = rangeGiven; + return this; + } + + /** + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = narrowRange; + return this; + } + + /** + * Sets the axis option. + * + * @param axis the axis option + * @return this Options instance. + */ + public Options axis(Long axis) { + this.axis = 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 d91c6d89fb4..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,93 +17,71 @@ 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; /** * Quantizes then dequantizes a tensor. - *

* This is almost identical to QuantizeAndDequantizeV2, except that num_bits is a * tensor, so its value can change during training. - * - * @param data type for {@code output()} output */ -@Operator(group = "quantization") +@OpMetadata( + opType = QuantizeAndDequantizeV3.OP_NAME, + inputsClass = QuantizeAndDequantizeV3.Inputs.class +) +@Operator( + group = "quantization" +) public final class QuantizeAndDequantizeV3 extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.QuantizeAndDequantizeV3} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param signedInput - */ - public Options signedInput(Boolean signedInput) { - this.signedInput = signedInput; - return this; - } - - /** - * @param rangeGiven - */ - public Options rangeGiven(Boolean rangeGiven) { - this.rangeGiven = rangeGiven; - return this; - } - - /** - * @param narrowRange - */ - public Options narrowRange(Boolean narrowRange) { - this.narrowRange = narrowRange; - return this; - } - - /** - * @param axis - */ - public Options axis(Long axis) { - this.axis = axis; - return this; - } - - private Boolean signedInput; - private Boolean rangeGiven; - private Boolean narrowRange; - private Long axis; - - private Options() { - } + public static final String OP_NAME = "QuantizeAndDequantizeV3"; + + private Output output; + + public QuantizeAndDequantizeV3(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizeAndDequantizeV3 operation. - * + * * @param scope current scope - * @param input - * @param inputMin - * @param inputMax - * @param numBits - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static QuantizeAndDequantizeV3 create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Operand numBits, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizeAndDequantizeV3", scope.makeOpName("QuantizeAndDequantizeV3")); + @Endpoint( + describeByClass = true + ) + public static QuantizeAndDequantizeV3 create(Scope scope, Operand input, + Operand inputMin, Operand inputMax, Operand numBits, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizeAndDequantizeV3"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputMin.asOutput()); opBuilder.addInput(inputMax.asOutput()); opBuilder.addInput(numBits.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.signedInput != null) { @@ -120,56 +98,184 @@ public static QuantizeAndDequantizeV3 create(Scope scope, } } } - return new QuantizeAndDequantizeV3(opBuilder.build()); + return new QuantizeAndDequantizeV3<>(opBuilder.build()); } - + /** - * @param signedInput + * Sets the signedInput option. + * + * @param signedInput the signedInput option + * @return this Options instance. */ public static Options signedInput(Boolean signedInput) { return new Options().signedInput(signedInput); } - + /** - * @param rangeGiven + * Sets the rangeGiven option. + * + * @param rangeGiven the rangeGiven option + * @return this Options instance. */ public static Options rangeGiven(Boolean rangeGiven) { return new Options().rangeGiven(rangeGiven); } - + /** - * @param narrowRange + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. */ public static Options narrowRange(Boolean narrowRange) { return new Options().narrowRange(narrowRange); } - + /** - * @param axis + * Sets the axis option. + * + * @param axis the axis option + * @return this Options instance. */ public static Options axis(Long axis) { return new Options().axis(axis); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizeAndDequantizeV3"; - - private Output output; - - private QuantizeAndDequantizeV3(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.QuantizeAndDequantizeV3} + */ + public static class Options { + private Boolean signedInput; + + private Boolean rangeGiven; + + private Boolean narrowRange; + + private Long axis; + + private Options() { + } + + /** + * Sets the signedInput option. + * + * @param signedInput the signedInput option + * @return this Options instance. + */ + public Options signedInput(Boolean signedInput) { + this.signedInput = signedInput; + return this; + } + + /** + * Sets the rangeGiven option. + * + * @param rangeGiven the rangeGiven option + * @return this Options instance. + */ + public Options rangeGiven(Boolean rangeGiven) { + this.rangeGiven = rangeGiven; + return this; + } + + /** + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = narrowRange; + return this; + } + + /** + * Sets the axis option. + * + * @param axis the axis option + * @return this Options instance. + */ + public Options axis(Long axis) { + this.axis = 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 60517531020..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,108 +17,72 @@ 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 `quantization.QuantizeAndDequantizeV4`. - *

+ * 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 */ -@Operator(group = "quantization") +@OpMetadata( + opType = QuantizeAndDequantizeV4.OP_NAME, + inputsClass = QuantizeAndDequantizeV4.Inputs.class +) +@Operator( + group = "quantization" +) public final class QuantizeAndDequantizeV4 extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.QuantizeAndDequantizeV4} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param signedInput - */ - public Options signedInput(Boolean signedInput) { - this.signedInput = signedInput; - return this; - } - - /** - * @param numBits - */ - public Options numBits(Long numBits) { - this.numBits = numBits; - return this; - } - - /** - * @param rangeGiven - */ - public Options rangeGiven(Boolean rangeGiven) { - this.rangeGiven = rangeGiven; - return this; - } - - /** - * @param roundMode - */ - public Options roundMode(String roundMode) { - this.roundMode = roundMode; - return this; - } - - /** - * @param narrowRange - */ - public Options narrowRange(Boolean narrowRange) { - this.narrowRange = narrowRange; - return this; - } - - /** - * @param axis - */ - public Options axis(Long axis) { - this.axis = axis; - return this; - } - - private Boolean signedInput; - private Long numBits; - private Boolean rangeGiven; - private String roundMode; - private Boolean narrowRange; - private Long axis; - - private Options() { - } + public static final String OP_NAME = "QuantizeAndDequantizeV4"; + + private Output output; + + public QuantizeAndDequantizeV4(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizeAndDequantizeV4 operation. - * + * * @param scope current scope - * @param input - * @param inputMin - * @param inputMax - * @param options carries optional attributes values + * @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} + * tensor. + * @param inputMax 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. + * @param options carries optional attribute values + * @param data type for {@code QuantizeAndDequantizeV4} output and operands * @return a new instance of QuantizeAndDequantizeV4 */ - @Endpoint(describeByClass = true) - public static QuantizeAndDequantizeV4 create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizeAndDequantizeV4", scope.makeOpName("QuantizeAndDequantizeV4")); + @Endpoint( + describeByClass = true + ) + public static QuantizeAndDequantizeV4 create(Scope scope, Operand input, + Operand inputMin, Operand inputMax, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizeAndDequantizeV4"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputMin.asOutput()); opBuilder.addInput(inputMax.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.signedInput != null) { @@ -141,70 +105,273 @@ public static QuantizeAndDequantizeV4 create(Scope scope, } } } - return new QuantizeAndDequantizeV4(opBuilder.build()); + return new QuantizeAndDequantizeV4<>(opBuilder.build()); } - + /** - * @param signedInput + * Sets the signedInput option. + * + * @param signedInput Whether the quantization is signed or unsigned. (actually this parameter should + * have been called {@code signed_output}) + * @return this Options instance. */ public static Options signedInput(Boolean signedInput) { return new Options().signedInput(signedInput); } - + /** - * @param numBits + * Sets the numBits option. + * + * @param numBits The bitwidth of the quantization. + * @return this Options instance. */ public static Options numBits(Long numBits) { return new Options().numBits(numBits); } - + /** - * @param rangeGiven + * Sets the rangeGiven option. + * + * @param rangeGiven Whether the range is given or should be determined from the {@code input} tensor. + * @return this Options instance. */ public static Options rangeGiven(Boolean rangeGiven) { return new Options().rangeGiven(rangeGiven); } - + /** - * @param roundMode + * Sets the roundMode option. + * + * @param roundMode 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.
  • + *
+ * @return this Options instance. */ public static Options roundMode(String roundMode) { return new Options().roundMode(roundMode); } - + /** - * @param narrowRange + * Sets the narrowRange option. + * + * @param narrowRange 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. + * @return this Options instance. */ public static Options narrowRange(Boolean narrowRange) { return new Options().narrowRange(narrowRange); } - + /** - * @param axis + * Sets the axis option. + * + * @param axis 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. + * @return this Options instance. */ public static Options axis(Long axis) { return new Options().axis(axis); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizeAndDequantizeV4"; - - private Output output; - - private QuantizeAndDequantizeV4(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.QuantizeAndDequantizeV4} + */ + public static class Options { + private Boolean signedInput; + + private Long numBits; + + private Boolean rangeGiven; + + private String roundMode; + + private Boolean narrowRange; + + private Long axis; + + 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}) + * @return this Options instance. + */ + public Options signedInput(Boolean signedInput) { + this.signedInput = signedInput; + return this; + } + + /** + * Sets the numBits option. + * + * @param numBits The bitwidth of the quantization. + * @return this Options instance. + */ + public Options numBits(Long numBits) { + this.numBits = numBits; + return this; + } + + /** + * Sets the rangeGiven option. + * + * @param rangeGiven Whether the range is given or should be determined from the {@code input} tensor. + * @return this Options instance. + */ + public Options rangeGiven(Boolean rangeGiven) { + this.rangeGiven = rangeGiven; + return this; + } + + /** + * Sets the roundMode option. + * + * @param roundMode 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.
  • + *
+ * @return this Options instance. + */ + public Options roundMode(String roundMode) { + this.roundMode = roundMode; + return this; + } + + /** + * Sets the narrowRange option. + * + * @param narrowRange 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. + * @return this Options instance. + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = narrowRange; + return this; + } + + /** + * Sets the axis option. + * + * @param axis 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. + * @return this Options instance. + */ + public Options axis(Long axis) { + this.axis = 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 4934e23dcab..097901b206c 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,65 +17,79 @@ 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 `QuantizeAndDequantizeV4`. - *

+ * 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 inputBackprop()} output */ -@Operator(group = "quantization") +@OpMetadata( + opType = QuantizeAndDequantizeV4Grad.OP_NAME, + inputsClass = QuantizeAndDequantizeV4Grad.Inputs.class +) +@Operator( + group = "quantization" +) public final class QuantizeAndDequantizeV4Grad extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.QuantizeAndDequantizeV4Grad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param axis - */ - public Options axis(Long axis) { - this.axis = axis; - return this; - } - - private Long axis; - - private Options() { - } + public static final String OP_NAME = "QuantizeAndDequantizeV4Grad"; + + private Output inputBackprop; + + private Output inputMinBackprop; + + private Output inputMaxBackprop; + + public QuantizeAndDequantizeV4Grad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + inputBackprop = operation.output(outputIdx++); + inputMinBackprop = operation.output(outputIdx++); + inputMaxBackprop = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizeAndDequantizeV4Grad operation. - * + * * @param scope current scope - * @param gradients - * @param input - * @param inputMin - * @param inputMax - * @param options carries optional attributes values + * @param gradients The gradients value + * @param input The input value + * @param inputMin If {@code axis} is specified, the shape of the minimum input tensor + * must be rank 1. + * @param inputMax If {@code axis} is specified, the shape of the maximum input tensor + * must be rank 1. + * @param options carries optional attribute values + * @param data type for {@code QuantizeAndDequantizeV4Grad} output and operands * @return a new instance of QuantizeAndDequantizeV4Grad */ - @Endpoint(describeByClass = true) - public static QuantizeAndDequantizeV4Grad create(Scope scope, Operand gradients, Operand input, Operand inputMin, Operand inputMax, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizeAndDequantizeV4Grad", scope.makeOpName("QuantizeAndDequantizeV4Grad")); + @Endpoint( + describeByClass = true + ) + public static QuantizeAndDequantizeV4Grad create(Scope scope, + Operand gradients, Operand input, Operand inputMin, Operand inputMax, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizeAndDequantizeV4Grad"); opBuilder.addInput(gradients.asOutput()); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputMin.asOutput()); opBuilder.addInput(inputMax.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.axis != null) { @@ -83,46 +97,112 @@ public static QuantizeAndDequantizeV4Grad create(Scope sc } } } - return new QuantizeAndDequantizeV4Grad(opBuilder.build()); + return new QuantizeAndDequantizeV4Grad<>(opBuilder.build()); } - + /** - * @param axis + * Sets the axis option. + * + * @param axis the axis option + * @return this Options instance. */ public static Options axis(Long axis) { return new Options().axis(axis); } - + /** + * Gets inputBackprop. + * + * @return inputBackprop. */ public Output inputBackprop() { return inputBackprop; } - + /** + * Gets inputMinBackprop. + * + * @return inputMinBackprop. */ public Output inputMinBackprop() { return inputMinBackprop; } - + /** + * Gets inputMaxBackprop. + * + * @return inputMaxBackprop. */ public Output inputMaxBackprop() { return inputMaxBackprop; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizeAndDequantizeV4Grad"; - - private Output inputBackprop; - private Output inputMinBackprop; - private Output inputMaxBackprop; - - private QuantizeAndDequantizeV4Grad(Operation operation) { - super(operation); - int outputIdx = 0; - inputBackprop = operation.output(outputIdx++); - inputMinBackprop = operation.output(outputIdx++); - inputMaxBackprop = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.QuantizeAndDequantizeV4Grad} + */ + public static class Options { + private Long axis; + + private Options() { + } + + /** + * Sets the axis option. + * + * @param axis the axis option + * @return this Options instance. + */ + public Options axis(Long axis) { + this.axis = 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; + + /** + * If {@code axis} is specified, the shape of the minimum input tensor + * must be rank 1. + */ + public final Operand inputMin; + + /** + * If {@code axis} is specified, the shape of the maximum input tensor + * must be rank 1. + */ + 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 73f23d05195..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,102 +17,162 @@ 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.TType; +import org.tensorflow.types.family.TNumber; /** * Convert the quantized 'input' tensor into a lower-precision 'output', using the - *

* actual distribution of the values to maximize the usage of the lower bit depth * and adjusting the output min and max ranges accordingly. - *

- * [input_min, input_max] are scalar floats that specify the range for the float + *

[input_min, input_max] are scalar floats that specify the range for the float * interpretation of the 'input' data. For example, if input_min is -1.0f and * input_max is 1.0f, and we are dealing with quint16 quantized data, then a 0 * value in the 16-bit data should be interpreted as -1.0f, and a 65535 means 1.0f. - *

- * This operator tries to squeeze as much precision as possible into an output with + *

This operator tries to squeeze as much precision as possible into an output with * a lower bit depth by calculating the actual min and max values found in the * data. For example, maybe that quint16 input has no values lower than 16,384 and * none higher than 49,152. That means only half the range is actually needed, all * the float interpretations are between -0.5f and 0.5f, so if we want to compress * the data into a quint8 output, we can use that range rather than the theoretical * -1.0f to 1.0f that is suggested by the input min and max. - *

- * In practice, this is most useful for taking output from operations like + *

In practice, this is most useful for taking output from operations like * QuantizedMatMul that can produce higher bit-depth outputs than their inputs and * may have large potential output ranges, but in practice have a distribution of * 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 */ -@Operator(group = "quantization") -public final class QuantizeDownAndShrinkRange extends RawOp { - +@OpMetadata( + opType = QuantizeDownAndShrinkRange.OP_NAME, + inputsClass = QuantizeDownAndShrinkRange.Inputs.class +) +@Operator( + group = "quantization" +) +public final class QuantizeDownAndShrinkRange extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizeDownAndShrinkRange"; + + private Output output; + + private Output outputMin; + + private Output outputMax; + + public QuantizeDownAndShrinkRange(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + outputMin = operation.output(outputIdx++); + outputMax = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizeDownAndShrinkRange operation. - * + * * @param scope current scope - * @param input + * @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. + * @param data type for {@code QuantizeDownAndShrinkRange} output and operands * @return a new instance of QuantizeDownAndShrinkRange */ - @Endpoint(describeByClass = true) - public static QuantizeDownAndShrinkRange create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Class outType) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizeDownAndShrinkRange", scope.makeOpName("QuantizeDownAndShrinkRange")); + @Endpoint( + describeByClass = true + ) + public static QuantizeDownAndShrinkRange create(Scope scope, + Operand input, Operand inputMin, Operand inputMax, + Class outType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizeDownAndShrinkRange"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputMin.asOutput()); opBuilder.addInput(inputMax.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new QuantizeDownAndShrinkRange(opBuilder.build()); + return new QuantizeDownAndShrinkRange<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets outputMin. * The float value that the minimum quantized output value represents. + * @return outputMin. */ public Output outputMin() { return outputMin; } - + /** + * Gets outputMax. * The float value that the maximum quantized output value represents. + * @return outputMax. */ public Output outputMax() { return outputMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizeDownAndShrinkRange"; - - private Output output; - private Output outputMin; - private Output outputMax; - - private QuantizeDownAndShrinkRange(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - outputMin = operation.output(outputIdx++); - outputMax = operation.output(outputIdx++); + + @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 ba525886639..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,85 +17,156 @@ 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 */ -@Operator(group = "quantization") +@OpMetadata( + opType = QuantizedConcat.OP_NAME, + inputsClass = QuantizedConcat.Inputs.class +) +@Operator( + group = "quantization" +) public final class QuantizedConcat extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizedConcat"; + + private Output output; + + private Output outputMin; + + private Output outputMax; + + public QuantizedConcat(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + outputMin = operation.output(outputIdx++); + outputMax = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizedConcat operation. - * + * * @param scope current scope * @param concatDim 0-D. The dimension along which to concatenate. Must be in the * range [0, rank(values)). - * @param values The `N` Tensors to concatenate. Their ranks and types must match, - * and their sizes must match in all dimensions except `concat_dim`. + * @param values The {@code N} Tensors to concatenate. Their ranks and types must match, + * and their sizes must match in all dimensions except {@code concat_dim}. * @param inputMins The minimum scalar values for each of the input tensors. * @param inputMaxes The maximum scalar values for each of the input tensors. + * @param data type for {@code QuantizedConcat} output and operands * @return a new instance of QuantizedConcat */ - @Endpoint(describeByClass = true) - public static QuantizedConcat create(Scope scope, Operand concatDim, Iterable> values, Iterable> inputMins, Iterable> inputMaxes) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConcat", scope.makeOpName("QuantizedConcat")); + @Endpoint( + describeByClass = true + ) + public static QuantizedConcat create(Scope scope, Operand concatDim, + Iterable> values, Iterable> inputMins, + Iterable> inputMaxes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedConcat"); opBuilder.addInput(concatDim.asOutput()); opBuilder.addInputList(Operands.asOutputs(values)); opBuilder.addInputList(Operands.asOutputs(inputMins)); opBuilder.addInputList(Operands.asOutputs(inputMaxes)); - opBuilder = scope.apply(opBuilder); - return new QuantizedConcat(opBuilder.build()); + return new QuantizedConcat<>(opBuilder.build()); } - + /** - * A `Tensor` with the concatenation of values stacked along the - * `concat_dim` dimension. This tensor's shape matches that of `values` except - * in `concat_dim` where it has the sum of the sizes. + * Gets output. + * A {@code Tensor} with the concatenation of values stacked along the + * {@code concat_dim} dimension. This tensor's shape matches that of {@code values} except + * in {@code concat_dim} where it has the sum of the sizes. + * @return output. */ public Output output() { return output; } - + /** + * Gets outputMin. * The float value that the minimum quantized output value represents. + * @return outputMin. */ public Output outputMin() { return outputMin; } - + /** + * Gets outputMax. * The float value that the maximum quantized output value represents. + * @return outputMax. */ public Output outputMax() { return outputMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConcat"; - - private Output output; - private Output outputMin; - private Output outputMax; - - private QuantizedConcat(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - outputMin = operation.output(outputIdx++); - outputMax = operation.output(outputIdx++); + + @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 d603f188f71..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,81 +17,75 @@ 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; -import org.tensorflow.types.family.TType; /** - * @param data type for {@code out()} output + * The QuantizedMatMulWithBiasAndDequantize operation */ +@OpMetadata( + opType = QuantizedMatMulWithBiasAndDequantize.OP_NAME, + inputsClass = QuantizedMatMulWithBiasAndDequantize.Inputs.class +) +@Operator( + group = "quantization" +) public final class QuantizedMatMulWithBiasAndDequantize extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.QuantizedMatMulWithBiasAndDequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param transposeA - */ - public Options transposeA(Boolean transposeA) { - this.transposeA = transposeA; - return this; - } - - /** - * @param transposeB - */ - public Options transposeB(Boolean transposeB) { - this.transposeB = transposeB; - return this; - } - - /** - * @param inputQuantMode - */ - public Options inputQuantMode(String inputQuantMode) { - this.inputQuantMode = inputQuantMode; - return this; - } - - private Boolean transposeA; - private Boolean transposeB; - private String inputQuantMode; - - private Options() { - } + public static final String OP_NAME = "QuantizedMatMulWithBiasAndDequantize"; + + private Output out; + + public QuantizedMatMulWithBiasAndDequantize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedMatMulWithBiasAndDequantize operation. - * + * * @param scope current scope - * @param a - * @param b - * @param bias - * @param minA - * @param maxA - * @param minB - * @param maxB - * @param minFreezedOutput - * @param maxFreezedOutput - * @param Toutput - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedMatMulWithBiasAndDequantize create(Scope scope, Operand a, Operand b, Operand bias, Operand minA, Operand maxA, Operand minB, Operand maxB, Operand minFreezedOutput, Operand maxFreezedOutput, Class Toutput, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedMatMulWithBiasAndDequantize", scope.makeOpName("QuantizedMatMulWithBiasAndDequantize")); + @Endpoint( + describeByClass = true + ) + public static QuantizedMatMulWithBiasAndDequantize create(Scope scope, + Operand a, Operand b, Operand bias, + Operand minA, Operand maxA, Operand minB, + Operand maxB, Operand minFreezedOutput, + Operand maxFreezedOutput, Class Toutput, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedMatMulWithBiasAndDequantize"); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); opBuilder.addInput(bias.asOutput()); @@ -101,7 +95,6 @@ public static QuantizedMatMulWithBiasAndDequantize create opBuilder.addInput(maxB.asOutput()); opBuilder.addInput(minFreezedOutput.asOutput()); opBuilder.addInput(maxFreezedOutput.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Toutput", Operands.toDataType(Toutput)); if (options != null) { for (Options opts : options) { @@ -116,49 +109,203 @@ public static QuantizedMatMulWithBiasAndDequantize create } } } - return new QuantizedMatMulWithBiasAndDequantize(opBuilder.build()); + return new QuantizedMatMulWithBiasAndDequantize<>(opBuilder.build()); } - + /** - * @param transposeA + * Sets the transposeA option. + * + * @param transposeA the transposeA option + * @return this Options instance. */ public static Options transposeA(Boolean transposeA) { return new Options().transposeA(transposeA); } - + /** - * @param transposeB + * Sets the transposeB option. + * + * @param transposeB the transposeB option + * @return this Options instance. */ public static Options transposeB(Boolean transposeB) { return new Options().transposeB(transposeB); } - + /** - * @param inputQuantMode + * Sets the inputQuantMode option. + * + * @param inputQuantMode the inputQuantMode option + * @return this Options instance. */ public static Options inputQuantMode(String inputQuantMode) { return new Options().inputQuantMode(inputQuantMode); } - + /** + * Gets out. + * + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedMatMulWithBiasAndDequantize"; - - private Output out; - - private QuantizedMatMulWithBiasAndDequantize(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.QuantizedMatMulWithBiasAndDequantize} + */ + public static class Options { + private Boolean transposeA; + + private Boolean transposeB; + + private String inputQuantMode; + + 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; + } + + /** + * Sets the inputQuantMode option. + * + * @param inputQuantMode the inputQuantMode option + * @return this Options instance. + */ + public Options inputQuantMode(String inputQuantMode) { + this.inputQuantMode = 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 a4326a3618a..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,80 +17,81 @@ 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.TType; +import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code out()} output + * The QuantizedMatMulWithBiasAndRequantize operation */ -public final class QuantizedMatMulWithBiasAndRequantize extends RawOp { - +@OpMetadata( + opType = QuantizedMatMulWithBiasAndRequantize.OP_NAME, + inputsClass = QuantizedMatMulWithBiasAndRequantize.Inputs.class +) +@Operator( + group = "quantization" +) +public final class QuantizedMatMulWithBiasAndRequantize extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.quantization.QuantizedMatMulWithBiasAndRequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param transposeA - */ - public Options transposeA(Boolean transposeA) { - this.transposeA = transposeA; - return this; - } - - /** - * @param transposeB - */ - public Options transposeB(Boolean transposeB) { - this.transposeB = transposeB; - return this; - } - - /** - * @param inputQuantMode - */ - public Options inputQuantMode(String inputQuantMode) { - this.inputQuantMode = inputQuantMode; - return this; - } - - private Boolean transposeA; - private Boolean transposeB; - private String inputQuantMode; - - private Options() { - } + public static final String OP_NAME = "QuantizedMatMulWithBiasAndRequantize"; + + private Output out; + + private Output minOut; + + private Output maxOut; + + public QuantizedMatMulWithBiasAndRequantize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); + minOut = operation.output(outputIdx++); + maxOut = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedMatMulWithBiasAndRequantize operation. - * + * * @param scope current scope - * @param a - * @param b - * @param bias - * @param minA - * @param maxA - * @param minB - * @param maxB - * @param minFreezedOutput - * @param maxFreezedOutput - * @param Toutput - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedMatMulWithBiasAndRequantize create(Scope scope, Operand a, Operand b, Operand bias, Operand minA, Operand maxA, Operand minB, Operand maxB, Operand minFreezedOutput, Operand maxFreezedOutput, Class Toutput, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("QuantizedMatMulWithBiasAndRequantize", scope.makeOpName("QuantizedMatMulWithBiasAndRequantize")); + @Endpoint( + describeByClass = true + ) + public static QuantizedMatMulWithBiasAndRequantize create(Scope scope, + Operand a, Operand b, Operand bias, + Operand minA, Operand maxA, Operand minB, + Operand maxB, Operand minFreezedOutput, + Operand maxFreezedOutput, Class Toutput, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "QuantizedMatMulWithBiasAndRequantize"); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); opBuilder.addInput(bias.asOutput()); @@ -100,7 +101,6 @@ public static QuantizedMatMulWithBiasAndRequantize create(S opBuilder.addInput(maxB.asOutput()); opBuilder.addInput(minFreezedOutput.asOutput()); opBuilder.addInput(maxFreezedOutput.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Toutput", Operands.toDataType(Toutput)); if (options != null) { for (Options opts : options) { @@ -115,60 +115,216 @@ public static QuantizedMatMulWithBiasAndRequantize create(S } } } - return new QuantizedMatMulWithBiasAndRequantize(opBuilder.build()); + return new QuantizedMatMulWithBiasAndRequantize<>(opBuilder.build()); } - + /** - * @param transposeA + * Sets the transposeA option. + * + * @param transposeA the transposeA option + * @return this Options instance. */ public static Options transposeA(Boolean transposeA) { return new Options().transposeA(transposeA); } - + /** - * @param transposeB + * Sets the transposeB option. + * + * @param transposeB the transposeB option + * @return this Options instance. */ public static Options transposeB(Boolean transposeB) { return new Options().transposeB(transposeB); } - + /** - * @param inputQuantMode + * Sets the inputQuantMode option. + * + * @param inputQuantMode the inputQuantMode option + * @return this Options instance. */ public static Options inputQuantMode(String inputQuantMode) { return new Options().inputQuantMode(inputQuantMode); } - + /** + * Gets out. + * + * @return out. */ public Output out() { return out; } - + /** + * Gets minOut. + * + * @return minOut. */ public Output minOut() { return minOut; } - + /** + * Gets maxOut. + * + * @return maxOut. */ public Output maxOut() { return maxOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedMatMulWithBiasAndRequantize"; - - private Output out; - private Output minOut; - private Output maxOut; - - private QuantizedMatMulWithBiasAndRequantize(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); - minOut = operation.output(outputIdx++); - maxOut = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.QuantizedMatMulWithBiasAndRequantize} + */ + public static class Options { + private Boolean transposeA; + + private Boolean transposeB; + + private String inputQuantMode; + + 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; + } + + /** + * Sets the inputQuantMode option. + * + * @param inputQuantMode the inputQuantMode option + * @return this Options instance. + */ + public Options inputQuantMode(String inputQuantMode) { + this.inputQuantMode = 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 a38b54f2916..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,71 +17,124 @@ 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.TType; +import org.tensorflow.types.family.TNumber; /** * Computes a range that covers the actual values present in a quantized tensor. - *

- * Given a quantized tensor described by `(input, input_min, input_max)`, outputs a + * Given a quantized tensor described by {@code (input, input_min, input_max)}, outputs a * range that covers the actual values present in that tensor. This op is typically - * used to produce the `requested_output_min` and `requested_output_max` for - * `Requantize`. + * used to produce the {@code requested_output_min} and {@code requested_output_max} for + * {@code Requantize}. */ -@Operator(group = "quantization") +@OpMetadata( + opType = RequantizationRange.OP_NAME, + inputsClass = RequantizationRange.Inputs.class +) +@Operator( + group = "quantization" +) public final class RequantizationRange extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RequantizationRange"; + + private Output outputMin; + + private Output outputMax; + + public RequantizationRange(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputMin = operation.output(outputIdx++); + outputMax = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RequantizationRange operation. - * + * * @param scope current scope - * @param input + * @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 */ - @Endpoint(describeByClass = true) - public static RequantizationRange create(Scope scope, Operand input, Operand inputMin, Operand inputMax) { - OperationBuilder opBuilder = scope.env().opBuilder("RequantizationRange", scope.makeOpName("RequantizationRange")); + @Endpoint( + describeByClass = true + ) + public static RequantizationRange create(Scope scope, Operand input, + Operand inputMin, Operand inputMax) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RequantizationRange"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputMin.asOutput()); opBuilder.addInput(inputMax.asOutput()); - opBuilder = scope.apply(opBuilder); return new RequantizationRange(opBuilder.build()); } - + /** + * Gets outputMin. * The computed min output. + * @return outputMin. */ public Output outputMin() { return outputMin; } - + /** + * Gets outputMax. * the computed max output. + * @return outputMax. */ public Output outputMax() { return outputMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RequantizationRange"; - - private Output outputMin; - private Output outputMax; - - private RequantizationRange(Operation operation) { - super(operation); - int outputIdx = 0; - outputMin = operation.output(outputIdx++); - outputMax = operation.output(outputIdx++); + + @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 6a18daf69ca..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,91 +17,166 @@ 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.TType; +import org.tensorflow.types.family.TNumber; /** - * Converts the quantized `input` tensor into a lower-precision `output`. - *

- * Converts the quantized `input` tensor into a lower-precision `output`, using the - * output range specified with `requested_output_min` and `requested_output_max`. - *

- * `[input_min, input_max]` are scalar floats that specify the range for the float - * interpretation of the `input` data. For example, if `input_min` is -1.0f and - * `input_max` is 1.0f, and we are dealing with `quint16` quantized data, then a 0 + * Converts the quantized {@code input} tensor into a lower-precision {@code output}. + * Converts the quantized {@code input} tensor into a lower-precision {@code output}, using the + * output range specified with {@code requested_output_min} and {@code requested_output_max}. + *

{@code [input_min, input_max]} are scalar floats that specify the range for the float + * 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 */ -@Operator(group = "quantization") -public final class Requantize extends RawOp { - +@OpMetadata( + opType = Requantize.OP_NAME, + inputsClass = Requantize.Inputs.class +) +@Operator( + group = "quantization" +) +public final class Requantize extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Requantize"; + + private Output output; + + private Output outputMin; + + private Output outputMax; + + public Requantize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + outputMin = operation.output(outputIdx++); + outputMax = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Requantize operation. - * + * * @param scope current scope - * @param input + * @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. * @param requestedOutputMax The float value that the maximum quantized output value represents. * @param outType The type of the output. Should be a lower bit depth than Tinput. + * @param data type for {@code Requantize} output and operands * @return a new instance of Requantize */ - @Endpoint(describeByClass = true) - public static Requantize create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Operand requestedOutputMin, Operand requestedOutputMax, Class outType) { - OperationBuilder opBuilder = scope.env().opBuilder("Requantize", scope.makeOpName("Requantize")); + @Endpoint( + describeByClass = true + ) + public static Requantize create(Scope scope, + Operand input, Operand inputMin, Operand inputMax, + Operand requestedOutputMin, Operand requestedOutputMax, + Class outType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Requantize"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputMin.asOutput()); opBuilder.addInput(inputMax.asOutput()); opBuilder.addInput(requestedOutputMin.asOutput()); opBuilder.addInput(requestedOutputMax.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new Requantize(opBuilder.build()); + return new Requantize<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets outputMin. * The requested_output_min value is copied into this output. + * @return outputMin. */ public Output outputMin() { return outputMin; } - + /** + * Gets outputMax. * The requested_output_max value is copied into this output. + * @return outputMax. */ public Output outputMax() { return outputMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Requantize"; - - private Output output; - private Output outputMin; - private Output outputMax; - - private Requantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - outputMin = operation.output(outputIdx++); - outputMax = operation.output(outputIdx++); + + @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 12ca81cf3c6..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,73 +17,79 @@ 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; /** * Counts the number of occurrences of each value in an integer array. - *

- * Outputs a vector with length `size` and the same dtype as `weights`. If - * `weights` are empty, then index `i` stores the number of times the value `i` is - * counted in `arr`. If `weights` are non-empty, then index `i` stores the sum of - * the value in `weights` at each index where the corresponding value in `arr` is - * `i`. - *

- * Values in `arr` outside of the range [0, size) are ignored. - * - * @param data type for {@code output()} output + * Outputs a vector with length {@code size} and the same dtype as {@code weights}. If + * {@code weights} are empty, then index {@code i} stores the number of times the value {@code i} is + * counted in {@code arr}. If {@code weights} are non-empty, then index {@code i} stores the sum of + * 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. */ -@Operator(group = "ragged") +@OpMetadata( + opType = RaggedBincount.OP_NAME, + inputsClass = RaggedBincount.Inputs.class +) +@Operator( + group = "ragged" +) public final class RaggedBincount extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.ragged.RaggedBincount} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param binaryOutput bool; Whether the kernel should count the appearance or number of occurrences. - */ - public Options binaryOutput(Boolean binaryOutput) { - this.binaryOutput = binaryOutput; - return this; - } - - private Boolean binaryOutput; - - private Options() { - } + public static final String OP_NAME = "RaggedBincount"; + + private Output output; + + public RaggedBincount(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RaggedBincount operation. - * + * * @param scope current scope - * @param splits 1D int64 `Tensor`. - * @param values 2D int `Tensor`. - * @param size non-negative int scalar `Tensor`. - * @param weights is an int32, int64, float32, or float64 `Tensor` with the same - * shape as `input`, or a length-0 `Tensor`, in which case it acts as all weights + * @param splits 1D int64 {@code Tensor}. + * @param values 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 + * shape as {@code input}, or a length-0 {@code Tensor}, in which case it acts as all weights * equal to 1. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code RaggedBincount} output and operands + * @param data type for {@code RaggedBincount} output and operands * @return a new instance of RaggedBincount */ - @Endpoint(describeByClass = true) - public static RaggedBincount create(Scope scope, Operand splits, Operand values, Operand size, Operand weights, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RaggedBincount", scope.makeOpName("RaggedBincount")); + @Endpoint( + describeByClass = true + ) + public static RaggedBincount create(Scope scope, + Operand splits, Operand values, Operand sizeOutput, Operand weights, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RaggedBincount"); opBuilder.addInput(splits.asOutput()); opBuilder.addInput(values.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder.addInput(weights.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.binaryOutput != null) { @@ -91,37 +97,106 @@ public static RaggedBincount create(Sc } } } - return new RaggedBincount(opBuilder.build()); + return new RaggedBincount<>(opBuilder.build()); } - + /** + * Sets the binaryOutput option. + * * @param binaryOutput bool; Whether the kernel should count the appearance or number of occurrences. + * @return this Options instance. */ public static Options binaryOutput(Boolean binaryOutput) { return new Options().binaryOutput(binaryOutput); } - + /** - * 1D `Tensor` with length equal to `size` or 2D `Tensor` with [batch_size, `size`]. + * Gets output. + * 1D {@code Tensor} with length equal to {@code size} or 2D {@code Tensor} with [batch_size, {@code size}]. * The counts or summed weights for each value in the range [0, size). + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RaggedBincount"; - - private Output output; - - private RaggedBincount(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.ragged.RaggedBincount} + */ + public static class Options { + private Boolean binaryOutput; + + private Options() { + } + + /** + * Sets the binaryOutput option. + * + * @param binaryOutput bool; Whether the kernel should count the appearance or number of occurrences. + * @return this Options instance. + */ + public Options binaryOutput(Boolean binaryOutput) { + this.binaryOutput = 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 f9701def261..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,73 +17,77 @@ 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 outputValues()} output + * Counts the number of times each value occurs in the input. */ +@OpMetadata( + opType = RaggedCountSparseOutput.OP_NAME, + inputsClass = RaggedCountSparseOutput.Inputs.class +) +@Operator( + group = "ragged" +) public final class RaggedCountSparseOutput extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.ragged.RaggedCountSparseOutput} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param minlength Minimum value to count. Can be set to -1 for no minimum. - */ - public Options minlength(Long minlength) { - this.minlength = minlength; - return this; - } - - /** - * @param maxlength Maximum value to count. Can be set to -1 for no maximum. - */ - public Options maxlength(Long maxlength) { - this.maxlength = maxlength; - return this; - } - - private Long minlength; - private Long maxlength; - - private Options() { - } + public static final String OP_NAME = "RaggedCountSparseOutput"; + + private Output outputIndices; + + private Output outputValues; + + private Output outputDenseShape; + + public RaggedCountSparseOutput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + outputDenseShape = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RaggedCountSparseOutput operation. - * + * * @param scope current scope * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code RaggedCountSparseOutput} output and operands * @return a new instance of RaggedCountSparseOutput */ - @Endpoint(describeByClass = true) - public static RaggedCountSparseOutput create(Scope scope, Operand splits, Operand values, Operand weights, Boolean binaryOutput, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RaggedCountSparseOutput", scope.makeOpName("RaggedCountSparseOutput")); + @Endpoint( + describeByClass = true + ) + public static RaggedCountSparseOutput create(Scope scope, + Operand splits, Operand values, Operand weights, + Boolean binaryOutput, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RaggedCountSparseOutput"); opBuilder.addInput(splits.asOutput()); opBuilder.addInput(values.asOutput()); opBuilder.addInput(weights.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("binary_output", binaryOutput); if (options != null) { for (Options opts : options) { @@ -95,62 +99,152 @@ public static RaggedCountSparseOutput create(Scope scope, } } } - return new RaggedCountSparseOutput(opBuilder.build()); + return new RaggedCountSparseOutput<>(opBuilder.build()); } - + /** + * Sets the minlength option. + * * @param minlength Minimum value to count. Can be set to -1 for no minimum. + * @return this Options instance. */ public static Options minlength(Long minlength) { return new Options().minlength(minlength); } - + /** + * Sets the maxlength option. + * * @param maxlength Maximum value to count. Can be set to -1 for no maximum. + * @return this Options instance. */ public static Options maxlength(Long maxlength) { return new Options().maxlength(maxlength); } - + /** + * Gets outputIndices. * Indices tensor for the resulting sparse tensor object. + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** + * Gets outputValues. * Values tensor for the resulting sparse tensor object. + * @return outputValues. */ public Output outputValues() { return outputValues; } - + /** + * Gets outputDenseShape. * Shape tensor for the resulting sparse tensor object. - * END - * } - * attr { - * name: "T" - * description: < outputDenseShape() { return outputDenseShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RaggedCountSparseOutput"; - - private Output outputIndices; - private Output outputValues; - private Output outputDenseShape; - - private RaggedCountSparseOutput(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - outputDenseShape = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.ragged.RaggedCountSparseOutput} + */ + public static class Options { + private Long minlength; + + private Long maxlength; + + private Options() { + } + + /** + * Sets the minlength option. + * + * @param minlength Minimum value to count. Can be set to -1 for no minimum. + * @return this Options instance. + */ + public Options minlength(Long minlength) { + this.minlength = minlength; + return this; + } + + /** + * Sets the maxlength option. + * + * @param maxlength Maximum value to count. Can be set to -1 for no maximum. + * @return this Options instance. + */ + public Options maxlength(Long maxlength) { + this.maxlength = 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 3ad9d57582f..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,31 +17,56 @@ 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; /** * Generates a feature cross from a list of tensors, and returns it as a - * RaggedTensor. See `tf.ragged.cross` for more details. - * - * @param data type for {@code outputValues()} output - * @param data type for {@code outputRowSplits()} output + * RaggedTensor. See {@code tf.ragged.cross} for more details. */ +@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 + */ + public static final String OP_NAME = "RaggedCross"; + + private Output outputValues; + + private Output outputRowSplits; + + public RaggedCross(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputValues = operation.output(outputIdx++); + outputRowSplits = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RaggedCross operation. - * + * * @param scope current scope * @param raggedValues The values tensor for each RaggedTensor input. * @param raggedRowSplits The row_splits tensor for each RaggedTensor input. @@ -49,60 +74,180 @@ public final class RaggedCross extends RawOp * @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 `i`th character in - * this string specifies the type of the `i`th input, and is one of: 'R' (ragged), + * @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 - * @param numBuckets - * @param hashKey - * @param outValuesType - * @param outRowSplitsType + * @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 */ - @Endpoint(describeByClass = true) - public static RaggedCross create(Scope scope, Iterable> raggedValues, Iterable> raggedRowSplits, Iterable> sparseIndices, Iterable> sparseValues, Iterable> sparseShape, Iterable> denseInputs, String inputOrder, Boolean hashedOutput, Long numBuckets, Long hashKey, Class outValuesType, Class outRowSplitsType) { - OperationBuilder opBuilder = scope.env().opBuilder("RaggedCross", scope.makeOpName("RaggedCross")); + @Endpoint( + describeByClass = true + ) + public static RaggedCross create(Scope scope, + Iterable> raggedValues, Iterable> raggedRowSplits, + Iterable> sparseIndices, Iterable> sparseValues, + Iterable> sparseShape, Iterable> denseInputs, String inputOrder, + Boolean hashedOutput, Long numBuckets, Long hashKey, Class outValuesType, + Class outRowSplitsType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RaggedCross"); opBuilder.addInputList(Operands.asOutputs(raggedValues)); opBuilder.addInputList(Operands.asOutputs(raggedRowSplits)); opBuilder.addInputList(Operands.asOutputs(sparseIndices)); opBuilder.addInputList(Operands.asOutputs(sparseValues)); opBuilder.addInputList(Operands.asOutputs(sparseShape)); opBuilder.addInputList(Operands.asOutputs(denseInputs)); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("input_order", inputOrder); opBuilder.setAttr("hashed_output", hashedOutput); opBuilder.setAttr("num_buckets", numBuckets); opBuilder.setAttr("hash_key", hashKey); opBuilder.setAttr("out_values_type", Operands.toDataType(outValuesType)); opBuilder.setAttr("out_row_splits_type", Operands.toDataType(outRowSplitsType)); - return new RaggedCross(opBuilder.build()); + return new RaggedCross<>(opBuilder.build()); } - + /** - * The `values` for the returned `RaggedTensor`. + * Gets outputValues. + * The {@code values} for the returned {@code RaggedTensor}. + * @return outputValues. */ public Output outputValues() { return outputValues; } - + /** - * The `row_splits` for the returned `RaggedTensor`. + * Gets outputRowSplits. + * The {@code row_splits} for the returned {@code RaggedTensor}. + * @return outputRowSplits. */ public Output outputRowSplits() { return outputRowSplits; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RaggedCross"; - - private Output outputValues; - private Output outputRowSplits; - - private RaggedCross(Operation operation) { - super(operation); - int outputIdx = 0; - outputValues = operation.output(outputIdx++); - outputRowSplits = operation.output(outputIdx++); + + @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 8cfbba1894d..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,109 +19,171 @@ 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; /** - * Gather ragged slices from `params` axis `0` according to `indices`. - *

- * Outputs a `RaggedTensor` output composed from `output_dense_values` and - * `output_nested_splits`, such that: - *

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

where *

    - *
  • - * `params = - * ragged.from_nested_row_splits(params_dense_values, params_nested_splits)` - * provides the values that should be gathered. - *
  • - *
  • - * `indices` ia a dense tensor with dtype `int32` or `int64`, indicating which - * values should be gathered. - *
  • - *
  • - * `output = - * ragged.from_nested_row_splits(output_dense_values, output_nested_splits)` - * is the output tensor. - *
  • + *
  • {@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 - * `tf.ragged.gather` op, which also supports ragged indices.) - * - * - * @param data type for {@code outputNestedSplits()} output - * @param data type for {@code outputDenseValues()} output + *

(Note: This c++ op is used to implement the higher-level python + * {@code tf.ragged.gather} op, which also supports ragged indices.) */ +@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 + */ + public static final String OP_NAME = "RaggedGather"; + + private List> outputNestedSplits; + + private Output outputDenseValues; + + @SuppressWarnings("unchecked") + 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)); + outputIdx += outputNestedSplitsLength; + outputDenseValues = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RaggedGather operation. - * + * * @param scope current scope - * @param paramsNestedSplits The `nested_row_splits` tensors that define the row-partitioning for the - * `params` RaggedTensor input. - * @param paramsDenseValues The `flat_values` for the `params` RaggedTensor. There was a terminology change + * @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 `params` of the values that should be + * @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. `output_nested_splits` will contain - * this number of `row_splits` tensors. This value should equal - * `indices.shape.ndims + params.ragged_rank - 1`. + * @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 */ - @Endpoint(describeByClass = true) - public static RaggedGather create(Scope scope, Iterable> paramsNestedSplits, Operand paramsDenseValues, Operand indices, Long OUTPUTRAGGEDRANK) { - OperationBuilder opBuilder = scope.env().opBuilder("RaggedGather", scope.makeOpName("RaggedGather")); + @Endpoint( + describeByClass = true + ) + public static RaggedGather create(Scope scope, + Iterable> paramsNestedSplits, Operand paramsDenseValues, + Operand indices, Long OUTPUTRAGGEDRANK) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RaggedGather"); opBuilder.addInputList(Operands.asOutputs(paramsNestedSplits)); opBuilder.addInput(paramsDenseValues.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("OUTPUT_RAGGED_RANK", OUTPUTRAGGEDRANK); - return new RaggedGather(opBuilder.build()); + return new RaggedGather<>(opBuilder.build()); } - + /** - * The `nested_row_splits` tensors that define the row-partitioning for the + * Gets outputNestedSplits. + * The {@code nested_row_splits} tensors that define the row-partitioning for the * returned RaggedTensor. + * @return outputNestedSplits. */ public List> outputNestedSplits() { return outputNestedSplits; } - + /** - * The `flat_values` for the returned RaggedTensor. + * Gets outputDenseValues. + * The {@code flat_values} for the returned RaggedTensor. + * @return outputDenseValues. */ public Output outputDenseValues() { return outputDenseValues; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RaggedGather"; - - private List> outputNestedSplits; - private Output outputDenseValues; - - @SuppressWarnings("unchecked") - private RaggedGather(Operation operation) { - super(operation); - int outputIdx = 0; - int outputNestedSplitsLength = operation.outputListLength("output_nested_splits"); - outputNestedSplits = Arrays.asList((Output[])operation.outputList(outputIdx, outputNestedSplitsLength)); - outputIdx += outputNestedSplitsLength; - outputDenseValues = operation.output(outputIdx++); + + @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 67df6a76a63..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,100 +17,162 @@ 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; /** - * Returns a `RaggedTensor` containing the specified sequences of numbers. - *

- * - * Returns a `RaggedTensor` `result` composed from `rt_dense_values` and - * `rt_nested_splits`, such that - * `result[i] = range(starts[i], limits[i], deltas[i])`. - *

{@code
+ * 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)
- * 
- * }
- * The input tensors `starts`, `limits`, and `deltas` may be scalars or vectors. + * <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 data type for {@code rtNestedSplits()} output - * @param data type for {@code rtDenseValues()} 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 + */ + public static final String OP_NAME = "RaggedRange"; + + private Output rtNestedSplits; + + private Output rtDenseValues; + + public RaggedRange(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + rtNestedSplits = operation.output(outputIdx++); + rtDenseValues = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RaggedRange operation. - * + * * @param scope current scope * @param starts The starts of each range. * @param limits The limits of each range. * @param deltas The deltas of each range. - * @param Tsplits + * @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 */ - @Endpoint(describeByClass = true) - public static RaggedRange create(Scope scope, Operand starts, Operand limits, Operand deltas, Class Tsplits) { - OperationBuilder opBuilder = scope.env().opBuilder("RaggedRange", scope.makeOpName("RaggedRange")); + @Endpoint( + describeByClass = true + ) + public static RaggedRange create(Scope scope, + Operand starts, Operand limits, Operand deltas, Class Tsplits) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RaggedRange"); opBuilder.addInput(starts.asOutput()); opBuilder.addInput(limits.asOutput()); opBuilder.addInput(deltas.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tsplits", Operands.toDataType(Tsplits)); - return new RaggedRange(opBuilder.build()); + return new RaggedRange<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new RaggedRange operation using default output types. - * + * Factory method to create a class wrapping a new RaggedRange operation, with the default output types. + * * @param scope current scope * @param starts The starts of each range. * @param limits The limits of each range. * @param deltas The deltas of each range. - * @return a new instance of RaggedRange + * @param data type for {@code RaggedRange} output and operands + * @return a new instance of RaggedRange, with default output types */ - @Endpoint(describeByClass = true) - public static RaggedRange create(Scope scope, Operand starts, Operand limits, Operand deltas) { + @Endpoint( + describeByClass = true + ) + public static RaggedRange create(Scope scope, Operand starts, + Operand limits, Operand deltas) { return create(scope, starts, limits, deltas, TInt64.class); } - + /** - * The `row_splits` for the returned `RaggedTensor`. + * Gets rtNestedSplits. + * The {@code row_splits} for the returned {@code RaggedTensor}. + * @return rtNestedSplits. */ public Output rtNestedSplits() { return rtNestedSplits; } - + /** - * The `flat_values` for the returned `RaggedTensor`. + * Gets rtDenseValues. + * The {@code flat_values} for the returned {@code RaggedTensor}. + * @return rtDenseValues. */ public Output rtDenseValues() { return rtDenseValues; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RaggedRange"; - - private Output rtNestedSplits; - private Output rtDenseValues; - - private RaggedRange(Operation operation) { - super(operation); - int outputIdx = 0; - rtNestedSplits = operation.output(outputIdx++); - rtDenseValues = operation.output(outputIdx++); + + @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 f58a5ca64f3..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,110 +19,168 @@ 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; /** - * Decodes a `variant` Tensor into a `RaggedTensor`. - *

- * Decodes the given `variant` Tensor and returns a `RaggedTensor`. The input - * could be a scalar, meaning it encodes a single `RaggedTensor` with ragged_rank - * `output_ragged_rank`. It could also have an arbitrary rank, in which case each - * element is decoded into a `RaggedTensor` with ragged_rank `input_ragged_rank` + * 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 - * `RaggedTensor` with ragged_rank `output_ragged_rank`. Each `variant` element in - * the input Tensor is decoded by retrieving from the element a 1-D `variant` - * Tensor with `input_ragged_rank + 1` Tensors, corresponding to the splits and - * values of the decoded `RaggedTensor`. If `input_ragged_rank` is -1, then it is - * inferred as `output_ragged_rank` - `rank(encoded_ragged)`. See - * `RaggedTensorToVariant` for the corresponding encoding logic. - * - * - * @param data type for {@code outputNestedSplits()} output - * @param data type for {@code outputDenseValues()} output + * {@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. */ -public final class RaggedTensorFromVariant extends RawOp { - +@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 + */ + public static final String OP_NAME = "RaggedTensorFromVariant"; + + private List> outputNestedSplits; + + private Output outputDenseValues; + + @SuppressWarnings("unchecked") + 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)); + outputIdx += outputNestedSplitsLength; + outputDenseValues = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RaggedTensorFromVariant operation. - * + * * @param scope current scope - * @param encodedRagged A `variant` Tensor containing encoded `RaggedTensor`s. - * @param inputRaggedRank The ragged rank of each encoded `RaggedTensor` component in the input. If set to - * -1, this is inferred as `output_ragged_rank` - `rank(encoded_ragged)` - * @param outputRaggedRank The expected ragged rank of the output `RaggedTensor`. The following must hold: - * `output_ragged_rank = rank(encoded_ragged) + input_ragged_rank`. - * @param Tvalues - * @param Tsplits + * @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 */ - @Endpoint(describeByClass = true) - public static RaggedTensorFromVariant create(Scope scope, Operand encodedRagged, Long inputRaggedRank, Long outputRaggedRank, Class Tvalues, Class Tsplits) { - OperationBuilder opBuilder = scope.env().opBuilder("RaggedTensorFromVariant", scope.makeOpName("RaggedTensorFromVariant")); + @Endpoint( + describeByClass = true + ) + public static RaggedTensorFromVariant create( + Scope scope, Operand encodedRagged, Long inputRaggedRank, + Long outputRaggedRank, Class Tvalues, Class Tsplits) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RaggedTensorFromVariant"); opBuilder.addInput(encodedRagged.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("input_ragged_rank", inputRaggedRank); opBuilder.setAttr("output_ragged_rank", outputRaggedRank); opBuilder.setAttr("Tvalues", Operands.toDataType(Tvalues)); opBuilder.setAttr("Tsplits", Operands.toDataType(Tsplits)); - return new RaggedTensorFromVariant(opBuilder.build()); + return new RaggedTensorFromVariant<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new RaggedTensorFromVariant operation using default output types. - * + * Factory method to create a class wrapping a new RaggedTensorFromVariant operation, with the default output types. + * * @param scope current scope - * @param encodedRagged A `variant` Tensor containing encoded `RaggedTensor`s. - * @param inputRaggedRank The ragged rank of each encoded `RaggedTensor` component in the input. If set to - * -1, this is inferred as `output_ragged_rank` - `rank(encoded_ragged)` - * @param outputRaggedRank The expected ragged rank of the output `RaggedTensor`. The following must hold: - * `output_ragged_rank = rank(encoded_ragged) + input_ragged_rank`. - * @param Tvalues - * @return a new instance of RaggedTensorFromVariant + * @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 */ - @Endpoint(describeByClass = true) - public static RaggedTensorFromVariant create(Scope scope, Operand encodedRagged, Long inputRaggedRank, Long outputRaggedRank, Class Tvalues) { + @Endpoint( + describeByClass = true + ) + public static RaggedTensorFromVariant create(Scope scope, + Operand encodedRagged, Long inputRaggedRank, Long outputRaggedRank, + Class Tvalues) { return create(scope, encodedRagged, inputRaggedRank, outputRaggedRank, Tvalues, TInt64.class); } - + /** + * Gets outputNestedSplits. * A list of one or more Tensors representing the splits of the output - * `RaggedTensor`. + * {@code RaggedTensor}. + * @return outputNestedSplits. */ - public List> outputNestedSplits() { + public List> outputNestedSplits() { return outputNestedSplits; } - + /** - * A Tensor representing the values of the output `RaggedTensor`. + * Gets outputDenseValues. + * A Tensor representing the values of the output {@code RaggedTensor}. + * @return outputDenseValues. */ - public Output outputDenseValues() { + public Output outputDenseValues() { return outputDenseValues; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RaggedTensorFromVariant"; - - private List> outputNestedSplits; - private Output outputDenseValues; - - @SuppressWarnings("unchecked") - private RaggedTensorFromVariant(Operation operation) { - super(operation); - int outputIdx = 0; - int outputNestedSplitsLength = operation.outputListLength("output_nested_splits"); - outputNestedSplits = Arrays.asList((Output[])operation.outputList(outputIdx, outputNestedSplitsLength)); - outputIdx += outputNestedSplitsLength; - outputDenseValues = operation.output(outputIdx++); + + @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 a67a72e1687..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,80 +17,138 @@ 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; /** - * Converts a `RaggedTensor` into a `SparseTensor` with the same values. - *

+ * 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 data type for {@code sparseValues()} output + * dense_shape=sparse_dense_shape) */ +@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 + */ + public static final String OP_NAME = "RaggedTensorToSparse"; + + private Output sparseIndices; + + private Output sparseValues; + + private Output sparseDenseShape; + + public RaggedTensorToSparse(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + sparseIndices = operation.output(outputIdx++); + sparseValues = operation.output(outputIdx++); + sparseDenseShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RaggedTensorToSparse operation. - * + * * @param scope current scope - * @param rtNestedSplits The `row_splits` for the `RaggedTensor`. - * @param rtDenseValues The `flat_values` for the `RaggedTensor`. + * @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 */ - @Endpoint(describeByClass = true) - public static RaggedTensorToSparse create(Scope scope, Iterable> rtNestedSplits, Operand rtDenseValues) { - OperationBuilder opBuilder = scope.env().opBuilder("RaggedTensorToSparse", scope.makeOpName("RaggedTensorToSparse")); + @Endpoint( + describeByClass = true + ) + public static RaggedTensorToSparse create(Scope scope, + Iterable> rtNestedSplits, Operand rtDenseValues) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RaggedTensorToSparse"); opBuilder.addInputList(Operands.asOutputs(rtNestedSplits)); opBuilder.addInput(rtDenseValues.asOutput()); - opBuilder = scope.apply(opBuilder); - return new RaggedTensorToSparse(opBuilder.build()); + return new RaggedTensorToSparse<>(opBuilder.build()); } - + /** - * The indices for the `SparseTensor`. + * Gets sparseIndices. + * The indices for the {@code SparseTensor}. + * @return sparseIndices. */ public Output sparseIndices() { return sparseIndices; } - + /** - * The values of the `SparseTensor`. + * Gets sparseValues. + * The values of the {@code SparseTensor}. + * @return sparseValues. */ public Output sparseValues() { return sparseValues; } - + /** - * `sparse_dense_shape` is a tight bounding box of the input `RaggedTensor`. + * Gets sparseDenseShape. + * {@code sparse_dense_shape} is a tight bounding box of the input {@code RaggedTensor}. + * @return sparseDenseShape. */ public Output sparseDenseShape() { return sparseDenseShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RaggedTensorToSparse"; - - private Output sparseIndices; - private Output sparseValues; - private Output sparseDenseShape; - - private RaggedTensorToSparse(Operation operation) { - super(operation); - int outputIdx = 0; - sparseIndices = operation.output(outputIdx++); - sparseValues = operation.output(outputIdx++); - sparseDenseShape = operation.output(outputIdx++); + + @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 5fdddc476b7..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,130 +17,219 @@ 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; /** * Create a dense tensor from a ragged tensor, possibly altering its shape. - *

- * The `ragged_to_dense` op creates a dense tensor from a list of row partition + * 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 + *

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

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 data type for {@code result()} output + *
  • "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".
  • + *
*/ +@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 + */ + public static final String OP_NAME = "RaggedTensorToTensor"; + + private Output result; + + public RaggedTensorToTensor(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + result = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RaggedTensorToTensor operation. - * + * * @param scope current scope - * @param shape The desired shape of the the output tensor. If left unspecified (empty), + * @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 + *

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

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

- * natural shape: [4, 5, 6] + *

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 + * @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. + *
  • "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 */ - @Endpoint(describeByClass = true) - public static RaggedTensorToTensor create(Scope scope, Operand shape, Operand values, Operand defaultValue, Iterable> rowPartitionTensors, List rowPartitionTypes) { - OperationBuilder opBuilder = scope.env().opBuilder("RaggedTensorToTensor", scope.makeOpName("RaggedTensorToTensor")); + @Endpoint( + describeByClass = true + ) + public static RaggedTensorToTensor create(Scope scope, + Operand shape, Operand values, Operand defaultValue, + Iterable> rowPartitionTensors, List rowPartitionTypes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RaggedTensorToTensor"); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(values.asOutput()); opBuilder.addInput(defaultValue.asOutput()); opBuilder.addInputList(Operands.asOutputs(rowPartitionTensors)); - opBuilder = scope.apply(opBuilder); String[] rowPartitionTypesArray = new String[rowPartitionTypes.size()]; - for (int i = 0; i < rowPartitionTypesArray.length; ++i) { + for (int i = 0 ; i < rowPartitionTypesArray.length ; i++) { rowPartitionTypesArray[i] = rowPartitionTypes.get(i); } opBuilder.setAttr("row_partition_types", rowPartitionTypesArray); - return new RaggedTensorToTensor(opBuilder.build()); + return new RaggedTensorToTensor<>(opBuilder.build()); } - + /** + * Gets result. * The resulting dense tensor. + * @return result. */ public Output result() { return result; } - + @Override public Output asOutput() { return result; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RaggedTensorToTensor"; - - private Output result; - - private RaggedTensorToTensor(Operation operation) { - super(operation); - int outputIdx = 0; - result = operation.output(outputIdx++); + + @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 fa4799f3513..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,77 +17,137 @@ 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; /** - * Encodes a `RaggedTensor` into a `variant` Tensor. - *

- * - * Encodes the given `RaggedTensor` and returns a `variant` Tensor. If - * `batched_input` is True, then input `RaggedTensor` is unbatched along the - * zero-th dimension, each component `RaggedTensor` is encoded into a scalar - * `variant` Tensor, and these are stacked to return a 1-D `variant` Tensor. - * If `batched_input` is False, then the input `RaggedTensor` is encoded as is and - * a scalar `variant` Tensor is returned. A `RaggedTensor` is encoded by first - * creating a 1-D `variant` Tensor with `ragged_rank + 1` elements, containing the - * splits and values Tensors of the `RaggedTensor`. Then the 1-D `variant` Tensor - * is wrapped in a scalar `variant` Tensor. See `RaggedTensorFromVariant` for the + * 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. - * */ +@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 + */ + public static final String OP_NAME = "RaggedTensorToVariant"; + + private Output encodedRagged; + + @SuppressWarnings("unchecked") + public RaggedTensorToVariant(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + encodedRagged = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RaggedTensorToVariant operation. - * + * * @param scope current scope * @param rtNestedSplits A list of one or more Tensors representing the splits of the input - * `RaggedTensor`. - * @param rtDenseValues A Tensor representing the values of the input `RaggedTensor`. - * @param batchedInput A `bool` denoting whether the input is a batched `RaggedTensor`. + * {@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 */ - @Endpoint(describeByClass = true) - public static RaggedTensorToVariant create(Scope scope, Iterable> rtNestedSplits, Operand rtDenseValues, Boolean batchedInput) { - OperationBuilder opBuilder = scope.env().opBuilder("RaggedTensorToVariant", scope.makeOpName("RaggedTensorToVariant")); + @Endpoint( + describeByClass = true + ) + public static RaggedTensorToVariant create(Scope scope, + Iterable> rtNestedSplits, Operand rtDenseValues, + Boolean batchedInput) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RaggedTensorToVariant"); opBuilder.addInputList(Operands.asOutputs(rtNestedSplits)); opBuilder.addInput(rtDenseValues.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("batched_input", batchedInput); return new RaggedTensorToVariant(opBuilder.build()); } - + /** - * A `variant` Tensor that containing encoded `RaggedTensor`. + * Gets encodedRagged. + * A {@code variant} Tensor that containing encoded {@code RaggedTensor}. + * @return encodedRagged. */ - public Output encodedRagged() { + public Output encodedRagged() { return encodedRagged; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) encodedRagged; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RaggedTensorToVariant"; - - private Output encodedRagged; - - private RaggedTensorToVariant(Operation operation) { - super(operation); - int outputIdx = 0; - encodedRagged = operation.output(outputIdx++); + + @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 b753910f048..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,73 +17,131 @@ 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; /** - * Helper used to compute the gradient for `RaggedTensorToVariant`. - *

+ * 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 data type for {@code denseValuesGrad()} 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 + */ + public static final String OP_NAME = "RaggedTensorToVariantGradient"; + + private Output denseValuesGrad; + + public RaggedTensorToVariantGradient(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + denseValuesGrad = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RaggedTensorToVariantGradient operation. - * + * * @param scope current scope - * @param encodedRaggedGrad A `variant` Tensor containing encoded `RaggedTensor` gradients. + * @param 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 + * @param Tvalues The value of the Tvalues attribute + * @param data type for {@code RaggedTensorToVariantGradient} output and operands * @return a new instance of RaggedTensorToVariantGradient */ - @Endpoint(describeByClass = true) - public static RaggedTensorToVariantGradient create(Scope scope, Operand encodedRaggedGrad, Operand rowSplits, Operand denseValuesShape, Class Tvalues) { - OperationBuilder opBuilder = scope.env().opBuilder("RaggedTensorToVariantGradient", scope.makeOpName("RaggedTensorToVariantGradient")); + @Endpoint( + describeByClass = true + ) + public static RaggedTensorToVariantGradient create(Scope scope, + Operand encodedRaggedGrad, Operand rowSplits, + Operand denseValuesShape, Class Tvalues) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RaggedTensorToVariantGradient"); opBuilder.addInput(encodedRaggedGrad.asOutput()); opBuilder.addInput(rowSplits.asOutput()); opBuilder.addInput(denseValuesShape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tvalues", Operands.toDataType(Tvalues)); - return new RaggedTensorToVariantGradient(opBuilder.build()); + return new RaggedTensorToVariantGradient<>(opBuilder.build()); } - + /** + * Gets denseValuesGrad. * Gradient for the dense_values of the RaggedTensorToVariant op. + * @return denseValuesGrad. */ public Output denseValuesGrad() { return denseValuesGrad; } - + @Override public Output asOutput() { return denseValuesGrad; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RaggedTensorToVariantGradient"; - - private Output denseValuesGrad; - - private RaggedTensorToVariantGradient(Operation operation) { - super(operation); - int outputIdx = 0; - denseValuesGrad = operation.output(outputIdx++); + + @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 5ceef808b8d..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,66 +17,62 @@ 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 + *

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. */ -@Operator(group = "random") +@OpMetadata( + opType = AllCandidateSampler.OP_NAME, + inputsClass = AllCandidateSampler.Inputs.class +) +@Operator( + group = "random" +) public final class AllCandidateSampler extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.random.AllCandidateSampler} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 An second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "AllCandidateSampler"; + + private Output sampledCandidates; + + private Output trueExpectedCount; + + private Output sampledExpectedCount; + + public AllCandidateSampler(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 AllCandidateSampler 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. @@ -85,14 +81,16 @@ private Options() { * @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 options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of AllCandidateSampler */ - @Endpoint(describeByClass = true) - public static AllCandidateSampler create(Scope scope, Operand trueClasses, Long numTrue, Long numSampled, Boolean unique, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("AllCandidateSampler", scope.makeOpName("AllCandidateSampler")); + @Endpoint( + describeByClass = true + ) + public static AllCandidateSampler create(Scope scope, Operand trueClasses, Long numTrue, + Long numSampled, Boolean unique, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AllCandidateSampler"); opBuilder.addInput(trueClasses.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_true", numTrue); opBuilder.setAttr("num_sampled", numSampled); opBuilder.setAttr("unique", unique); @@ -108,62 +106,146 @@ public static AllCandidateSampler create(Scope scope, Operand trueClasse } return new AllCandidateSampler(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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AllCandidateSampler"; - - private Output sampledCandidates; - private Output trueExpectedCount; - private Output sampledExpectedCount; - - private AllCandidateSampler(Operation operation) { - super(operation); - int outputIdx = 0; - sampledCandidates = operation.output(outputIdx++); - trueExpectedCount = operation.output(outputIdx++); - sampledExpectedCount = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.AllCandidateSampler} + */ + 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 = 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 3409545d91e..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,59 +17,106 @@ 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 + */ + public static final String OP_NAME = "AnonymousRandomSeedGenerator"; + + private Output handle; + + private Output deleter; + + @SuppressWarnings("unchecked") + public AnonymousRandomSeedGenerator(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 AnonymousRandomSeedGenerator operation. - * + * * @param scope current scope - * @param seed - * @param seed2 + * @param seed The seed value + * @param seed2 The seed2 value * @return a new instance of AnonymousRandomSeedGenerator */ - @Endpoint(describeByClass = true) - public static AnonymousRandomSeedGenerator create(Scope scope, Operand seed, Operand seed2) { - OperationBuilder opBuilder = scope.env().opBuilder("AnonymousRandomSeedGenerator", scope.makeOpName("AnonymousRandomSeedGenerator")); + @Endpoint( + describeByClass = true + ) + public static AnonymousRandomSeedGenerator create(Scope scope, Operand seed, + Operand seed2) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AnonymousRandomSeedGenerator"); opBuilder.addInput(seed.asOutput()); opBuilder.addInput(seed2.asOutput()); - opBuilder = scope.apply(opBuilder); return new AnonymousRandomSeedGenerator(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + /** + * Gets deleter. + * + * @return deleter. */ - public Output deleter() { + public Output deleter() { return deleter; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AnonymousRandomSeedGenerator"; - - private Output handle; - private Output deleter; - - private AnonymousRandomSeedGenerator(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - deleter = operation.output(outputIdx++); + + @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 56c49e0d2ef..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,62 +17,115 @@ 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; /** + * 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 + */ + public static final String OP_NAME = "AnonymousSeedGenerator"; + + private Output handle; + + private Output deleter; + + @SuppressWarnings("unchecked") + public AnonymousSeedGenerator(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 AnonymousSeedGenerator operation. - * + * * @param scope current scope - * @param seed - * @param seed2 - * @param reshuffle + * @param seed The seed value + * @param seed2 The seed2 value + * @param reshuffle The reshuffle value * @return a new instance of AnonymousSeedGenerator */ - @Endpoint(describeByClass = true) - public static AnonymousSeedGenerator create(Scope scope, Operand seed, Operand seed2, Operand reshuffle) { - OperationBuilder opBuilder = scope.env().opBuilder("AnonymousSeedGenerator", scope.makeOpName("AnonymousSeedGenerator")); + @Endpoint( + describeByClass = true + ) + public static AnonymousSeedGenerator create(Scope scope, Operand seed, + Operand seed2, Operand reshuffle) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AnonymousSeedGenerator"); opBuilder.addInput(seed.asOutput()); opBuilder.addInput(seed2.asOutput()); opBuilder.addInput(reshuffle.asOutput()); - opBuilder = scope.apply(opBuilder); return new AnonymousSeedGenerator(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + /** + * Gets deleter. + * + * @return deleter. */ - public Output deleter() { + public Output deleter() { return deleter; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AnonymousSeedGenerator"; - - private Output handle; - private Output deleter; - - private AnonymousSeedGenerator(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - deleter = operation.output(outputIdx++); + + @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 3dcd1320b52..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,39 +17,78 @@ 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"; + + 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 - * @param deleter + * @param handle The handle value + * @param deleter The deleter value * @return a new instance of DeleteRandomSeedGenerator */ - @Endpoint(describeByClass = true) - public static DeleteRandomSeedGenerator create(Scope scope, Operand handle, Operand deleter) { - OperationBuilder opBuilder = scope.env().opBuilder("DeleteRandomSeedGenerator", scope.makeOpName("DeleteRandomSeedGenerator")); + @Endpoint( + describeByClass = true + ) + public static DeleteRandomSeedGenerator create(Scope scope, Operand handle, + Operand deleter) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DeleteRandomSeedGenerator"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(deleter.asOutput()); - opBuilder = scope.apply(opBuilder); return new DeleteRandomSeedGenerator(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DeleteRandomSeedGenerator"; - - private DeleteRandomSeedGenerator(Operation operation) { - super(operation); + + @OpInputsMetadata( + outputsClass = DeleteRandomSeedGenerator.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 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 7bf6ecac561..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,39 +17,78 @@ 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"; + + 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 - * @param deleter + * @param handle The handle value + * @param deleter The deleter value * @return a new instance of DeleteSeedGenerator */ - @Endpoint(describeByClass = true) - public static DeleteSeedGenerator create(Scope scope, Operand handle, Operand deleter) { - OperationBuilder opBuilder = scope.env().opBuilder("DeleteSeedGenerator", scope.makeOpName("DeleteSeedGenerator")); + @Endpoint( + describeByClass = true + ) + public static DeleteSeedGenerator create(Scope scope, Operand handle, + Operand deleter) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DeleteSeedGenerator"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(deleter.asOutput()); - opBuilder = scope.apply(opBuilder); return new DeleteSeedGenerator(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DeleteSeedGenerator"; - - private DeleteSeedGenerator(Operation operation) { - super(operation); + + @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 new file mode 100644 index 00000000000..a73f248e303 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/DummySeedGenerator.java @@ -0,0 +1,98 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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 + */ + public static final String OP_NAME = "DummySeedGenerator"; + + private Output handle; + + @SuppressWarnings("unchecked") + public DummySeedGenerator(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new DummySeedGenerator operation. + * + * @param scope current scope + * @return a new instance of DummySeedGenerator + */ + @Endpoint( + describeByClass = true + ) + public static DummySeedGenerator create(Scope scope) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DummySeedGenerator"); + return new DummySeedGenerator(opBuilder.build()); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + 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 4beb87660ef..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,66 +17,62 @@ 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 log-uniform 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 + *

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. */ -@Operator(group = "random") +@OpMetadata( + opType = LogUniformCandidateSampler.OP_NAME, + inputsClass = LogUniformCandidateSampler.Inputs.class +) +@Operator( + group = "random" +) public final class LogUniformCandidateSampler extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.random.LogUniformCandidateSampler} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 An second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "LogUniformCandidateSampler"; + + private Output sampledCandidates; + + private Output trueExpectedCount; + + private Output sampledExpectedCount; + + public LogUniformCandidateSampler(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 LogUniformCandidateSampler 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. @@ -86,14 +82,16 @@ private Options() { * 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 attributes values + * @param options carries optional attribute values * @return a new instance of LogUniformCandidateSampler */ - @Endpoint(describeByClass = true) - public static LogUniformCandidateSampler create(Scope scope, Operand trueClasses, Long numTrue, Long numSampled, Boolean unique, Long rangeMax, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("LogUniformCandidateSampler", scope.makeOpName("LogUniformCandidateSampler")); + @Endpoint( + describeByClass = true + ) + public static LogUniformCandidateSampler create(Scope scope, Operand trueClasses, + Long numTrue, Long numSampled, Boolean unique, Long rangeMax, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LogUniformCandidateSampler"); opBuilder.addInput(trueClasses.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_true", numTrue); opBuilder.setAttr("num_sampled", numSampled); opBuilder.setAttr("unique", unique); @@ -110,62 +108,152 @@ public static LogUniformCandidateSampler create(Scope scope, Operand tru } return new LogUniformCandidateSampler(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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LogUniformCandidateSampler"; - - private Output sampledCandidates; - private Output trueExpectedCount; - private Output sampledExpectedCount; - - private LogUniformCandidateSampler(Operation operation) { - super(operation); - int outputIdx = 0; - sampledCandidates = operation.output(outputIdx++); - trueExpectedCount = operation.output(outputIdx++); - sampledExpectedCount = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.LogUniformCandidateSampler} + */ + 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 = 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 2122358b803..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,73 +17,70 @@ 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 */ -@Operator(group = "random") +@OpMetadata( + opType = Multinomial.OP_NAME, + inputsClass = Multinomial.Inputs.class +) +@Operator( + group = "random" +) public final class Multinomial extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.random.Multinomial} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param seed 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 Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 A second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "Multinomial"; + + private Output output; + + public Multinomial(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Multinomial operation. - * + * * @param scope current scope - * @param logits 2-D Tensor with shape `[batch_size, num_classes]`. Each slice `[i, :]` + * @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 - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static Multinomial create(Scope scope, Operand logits, Operand numSamples, Class outputDtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Multinomial", scope.makeOpName("Multinomial")); + @Endpoint( + describeByClass = true + ) + public static Multinomial create(Scope scope, + Operand logits, Operand numSamples, Class outputDtype, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Multinomial"); opBuilder.addInput(logits.asOutput()); opBuilder.addInput(numSamples.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_dtype", Operands.toDataType(outputDtype)); if (options != null) { for (Options opts : options) { @@ -95,60 +92,143 @@ public static Multinomial create(Scope scope, Operand(opBuilder.build()); + return new Multinomial<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Multinomial operation using default output types. - * + * Factory method to create a class wrapping a new Multinomial operation, with the default output types. + * * @param scope current scope - * @param logits 2-D Tensor with shape `[batch_size, num_classes]`. Each slice `[i, :]` + * @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 options carries optional attributes values - * @return a new instance of Multinomial + * @param options carries optional attribute values + * @return a new instance of Multinomial, with default output types */ - @Endpoint(describeByClass = true) - public static Multinomial create(Scope scope, Operand logits, Operand numSamples, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Multinomial create(Scope scope, Operand logits, + Operand numSamples, Options... options) { return create(scope, logits, numSamples, TInt64.class, options); } - + /** + * Sets the seed option. + * * @param seed 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. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** - * 2-D Tensor with shape `[batch_size, num_samples]`. Each slice `[i, :]` - * contains the drawn class labels with range `[0, num_classes)`. + * Gets output. + * 2-D Tensor with shape {@code [batch_size, num_samples]}. Each slice {@code [i, :]} + * contains the drawn class labels with range {@code [0, num_classes)}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Multinomial"; - - private Output output; - - private Multinomial(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.Multinomial} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed 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. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = 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 ea189d9d7aa..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,76 +17,122 @@ 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 + */ + public static final String OP_NAME = "NonDeterministicInts"; + + private Output output; + + public NonDeterministicInts(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NonDeterministicInts operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static NonDeterministicInts create(Scope scope, Operand shape, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("NonDeterministicInts", scope.makeOpName("NonDeterministicInts")); + @Endpoint( + describeByClass = true + ) + public static NonDeterministicInts create(Scope scope, + Operand shape, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "NonDeterministicInts"); opBuilder.addInput(shape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new NonDeterministicInts(opBuilder.build()); + return new NonDeterministicInts<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new NonDeterministicInts operation using default output types. - * + * Factory method to create a class wrapping a new NonDeterministicInts operation, with the default output types. + * * @param scope current scope * @param shape The shape of the output tensor. - * @return a new instance of NonDeterministicInts + * @return a new instance of NonDeterministicInts, with default output types */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static NonDeterministicInts create(Scope scope, Operand shape) { return create(scope, shape, TInt64.class); } - + /** + * Gets output. * Non-deterministic integer values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NonDeterministicInts"; - - private Output output; - - private NonDeterministicInts(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 1daadb4a445..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,60 +17,51 @@ 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 */ -@Operator(group = "random") +@OpMetadata( + opType = ParameterizedTruncatedNormal.OP_NAME, + inputsClass = ParameterizedTruncatedNormal.Inputs.class +) +@Operator( + group = "random" +) public final class ParameterizedTruncatedNormal extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.random.ParameterizedTruncatedNormal} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 A second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "ParameterizedTruncatedNormal"; + + private Output output; + + public ParameterizedTruncatedNormal(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ParameterizedTruncatedNormal operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. Batches are indexed by the 0th dimension. * @param means The mean parameter of each batch. @@ -78,18 +69,22 @@ private Options() { * @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 options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ParameterizedTruncatedNormal} output and operands * @return a new instance of ParameterizedTruncatedNormal */ - @Endpoint(describeByClass = true) - public static ParameterizedTruncatedNormal create(Scope scope, Operand shape, Operand means, Operand stdevs, Operand minvals, Operand maxvals, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ParameterizedTruncatedNormal", scope.makeOpName("ParameterizedTruncatedNormal")); + @Endpoint( + describeByClass = true + ) + public static ParameterizedTruncatedNormal create(Scope scope, + Operand shape, Operand means, Operand stdevs, Operand minvals, + Operand maxvals, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ParameterizedTruncatedNormal"); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(means.asOutput()); opBuilder.addInput(stdevs.asOutput()); opBuilder.addInput(minvals.asOutput()); opBuilder.addInput(maxvals.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.seed != null) { @@ -100,46 +95,146 @@ public static ParameterizedTruncatedNormal create(Scope s } } } - return new ParameterizedTruncatedNormal(opBuilder.build()); + return new ParameterizedTruncatedNormal<>(opBuilder.build()); } - + /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number + * Sets the seed option. + * + * @param seed 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. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** + * Gets output. * A matrix of shape num_batches x samples_per_batch, filled with random * truncated normal values using the parameters for each row. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ParameterizedTruncatedNormal"; - - private Output output; - - private ParameterizedTruncatedNormal(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.ParameterizedTruncatedNormal} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed 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. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = 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 7457dd6b1c8..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,75 +17,69 @@ 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 the Gamma distribution(s) described by alpha. - *

* 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 */ -@Operator(group = "random") +@OpMetadata( + opType = RandomGamma.OP_NAME, + inputsClass = RandomGamma.Inputs.class +) +@Operator( + group = "random" +) public final class RandomGamma extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.random.RandomGamma} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 A second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "RandomGamma"; + + private Output output; + + public RandomGamma(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RandomGamma operation. - * + * * @param scope current scope * @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 + * @param alpha A tensor in which each scalar is a "shape" parameter describing the * associated gamma distribution. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code RandomGamma} output and operands * @return a new instance of RandomGamma */ - @Endpoint(describeByClass = true) - public static RandomGamma create(Scope scope, Operand shape, Operand alpha, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RandomGamma", scope.makeOpName("RandomGamma")); + @Endpoint( + describeByClass = true + ) + public static RandomGamma create(Scope scope, + Operand shape, Operand alpha, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RandomGamma"); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(alpha.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.seed != null) { @@ -96,47 +90,130 @@ public static RandomGamma create(Scope scope, Operand(opBuilder.build()); + return new RandomGamma<>(opBuilder.build()); } - + /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number + * Sets the seed option. + * + * @param seed 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. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** - * A tensor with shape `shape + shape(alpha)`. Each slice - * `[:, ..., :, i0, i1, ...iN]` contains the samples drawn for - * `alpha[i0, i1, ...iN]`. The dtype of the output matches the dtype of alpha. + * Gets output. + * A tensor with shape {@code shape + shape(alpha)}. Each slice + * {@code [:, ..., :, i0, i1, ...iN]} contains the samples drawn for + * {@code alpha[i0, i1, ...iN]}. The dtype of the output matches the dtype of alpha. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RandomGamma"; - - private Output output; - - private RandomGamma(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.RandomGamma} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed 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. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = 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 35f9c06d172..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,59 +17,105 @@ 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. `alpha`. - * - * @param data type for {@code output()} output + * Computes the derivative of a Gamma random sample w.r.t. {@code alpha}. */ +@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 + */ + public static final String OP_NAME = "RandomGammaGrad"; + + private Output output; + + public RandomGammaGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RandomGammaGrad operation. - * + * * @param scope current scope - * @param alpha - * @param sample + * @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 */ - @Endpoint(describeByClass = true) - public static RandomGammaGrad create(Scope scope, Operand alpha, Operand sample) { - OperationBuilder opBuilder = scope.env().opBuilder("RandomGammaGrad", scope.makeOpName("RandomGammaGrad")); + @Endpoint( + describeByClass = true + ) + public static RandomGammaGrad create(Scope scope, Operand alpha, + Operand sample) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RandomGammaGrad"); opBuilder.addInput(alpha.asOutput()); opBuilder.addInput(sample.asOutput()); - opBuilder = scope.apply(opBuilder); - return new RandomGammaGrad(opBuilder.build()); + return new RandomGammaGrad<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RandomGammaGrad"; - - private Output output; - - private RandomGammaGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 6d9632c1b73..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,84 +17,78 @@ 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; /** * Outputs random values from the Poisson distribution(s) described by rate. - *

- * This op uses two algorithms, depending on rate. If rate >= 10, then + * This op uses two algorithms, depending on rate. If rate >= 10, then * the algorithm by Hormann is used to acquire samples via * transformation-rejection. * See http://www.sciencedirect.com/science/article/pii/0167668793909974. - *

- * Otherwise, Knuth's algorithm is used to acquire samples via multiplying uniform + *

Otherwise, Knuth's algorithm is used to acquire samples via multiplying uniform * 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 */ -@Operator(group = "random") +@OpMetadata( + opType = RandomPoisson.OP_NAME, + inputsClass = RandomPoisson.Inputs.class +) +@Operator( + group = "random" +) public final class RandomPoisson extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.random.RandomPoisson} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 A second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "RandomPoissonV2"; + + private Output output; + + public RandomPoisson(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new RandomPoisson operation. - * + * Factory method to create a class wrapping a new RandomPoissonV2 operation. + * * @param scope current scope * @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 + * @param rate A tensor in which each scalar is a "rate" parameter describing the * associated poisson distribution. - * @param dtype - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static RandomPoisson create(Scope scope, Operand shape, Operand rate, Class dtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RandomPoissonV2", scope.makeOpName("RandomPoisson")); + @Endpoint( + describeByClass = true + ) + public static RandomPoisson create(Scope scope, + Operand shape, Operand rate, Class dtype, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RandomPoisson"); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(rate.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); if (options != null) { for (Options opts : options) { @@ -106,63 +100,155 @@ public static RandomPoisson create(Scope scope, Operand(opBuilder.build()); + return new RandomPoisson<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new RandomPoisson operation using default output types. - * + * Factory method to create a class wrapping a new RandomPoissonV2 operation, with the default output types. + * * @param scope current scope * @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 + * @param rate A tensor in which each scalar is a "rate" parameter describing the * associated poisson distribution. - * @param options carries optional attributes values - * @return a new instance of RandomPoisson + * @param options carries optional attribute values + * @return a new instance of RandomPoisson, with default output types */ - @Endpoint(describeByClass = true) - public static RandomPoisson create(Scope scope, Operand shape, Operand rate, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RandomPoisson create(Scope scope, Operand shape, + Operand rate, Options... options) { return create(scope, shape, rate, TInt64.class, options); } - + /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number + * Sets the seed option. + * + * @param seed 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. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** - * A tensor with shape `shape + shape(rate)`. Each slice - * `[:, ..., :, i0, i1, ...iN]` contains the samples drawn for - * `rate[i0, i1, ...iN]`. + * Gets output. + * A tensor with shape {@code shape + shape(rate)}. Each slice + * {@code [:, ..., :, i0, i1, ...iN]} contains the samples drawn for + * {@code rate[i0, i1, ...iN]}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RandomPoissonV2"; - - private Output output; - - private RandomPoisson(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.RandomPoisson} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed 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. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = 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 3ef940e631d..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,77 +17,70 @@ 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; /** * Randomly shuffles a tensor along its first dimension. - *

- * The tensor is shuffled along dimension 0, such that each `value[j]` is mapped - * to one and only one `output[i]`. For example, a mapping that might occur for a - * 3x2 tensor is: - *

{@code
+ * 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],
+ *  [3, 4],  ==>   [1, 2],
  *  [5, 6]]        [3, 4]]
- * }
- * - * - * @param data type for {@code output()} output + *
*/ -@Operator(group = "random") +@OpMetadata( + opType = RandomShuffle.OP_NAME, + inputsClass = RandomShuffle.Inputs.class +) +@Operator( + group = "random" +) public final class RandomShuffle extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.random.RandomShuffle} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 A second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "RandomShuffle"; + + private Output output; + + public RandomShuffle(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RandomShuffle operation. - * + * * @param scope current scope * @param value The tensor to be shuffled. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code RandomShuffle} output and operands * @return a new instance of RandomShuffle */ - @Endpoint(describeByClass = true) - public static RandomShuffle create(Scope scope, Operand value, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RandomShuffle", scope.makeOpName("RandomShuffle")); + @Endpoint( + describeByClass = true + ) + public static RandomShuffle create(Scope scope, Operand value, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RandomShuffle"); opBuilder.addInput(value.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.seed != null) { @@ -98,46 +91,115 @@ public static RandomShuffle create(Scope scope, Operand } } } - return new RandomShuffle(opBuilder.build()); + return new RandomShuffle<>(opBuilder.build()); } - + /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number + * Sets the seed option. + * + * @param seed 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. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** - * A tensor of same shape and type as `value`, shuffled along its first + * 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RandomShuffle"; - - private Output output; - - private RandomShuffle(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.RandomShuffle} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed 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. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = 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 5590f39e462..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,71 +17,65 @@ 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 */ -@Operator(group = "random") +@OpMetadata( + opType = RandomStandardNormal.OP_NAME, + inputsClass = RandomStandardNormal.Inputs.class +) +@Operator( + group = "random" +) public final class RandomStandardNormal extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.random.RandomStandardNormal} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 A second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "RandomStandardNormal"; + + private Output output; + + public RandomStandardNormal(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RandomStandardNormal operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param dtype The type of the output. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code RandomStandardNormal} output and operands * @return a new instance of RandomStandardNormal */ - @Endpoint(describeByClass = true) - public static RandomStandardNormal create(Scope scope, Operand shape, Class dtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RandomStandardNormal", scope.makeOpName("RandomStandardNormal")); + @Endpoint( + describeByClass = true + ) + public static RandomStandardNormal create(Scope scope, + Operand shape, Class dtype, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RandomStandardNormal"); opBuilder.addInput(shape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); if (options != null) { for (Options opts : options) { @@ -93,45 +87,120 @@ public static RandomStandardNormal create(Scope scope, Op } } } - return new RandomStandardNormal(opBuilder.build()); + return new RandomStandardNormal<>(opBuilder.build()); } - + /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number + * Sets the seed option. + * + * @param seed 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. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** + * Gets output. * A tensor of the specified shape filled with random normal values. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RandomStandardNormal"; - - private Output output; - - private RandomStandardNormal(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.RandomStandardNormal} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed 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. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = 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 ee3d57fe528..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,72 +17,66 @@ 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 `[0, 1)`. The + * 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 */ -@Operator(group = "random") +@OpMetadata( + opType = RandomUniform.OP_NAME, + inputsClass = RandomUniform.Inputs.class +) +@Operator( + group = "random" +) public final class RandomUniform extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.random.RandomUniform} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 A second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "RandomUniform"; + + private Output output; + + public RandomUniform(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RandomUniform operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param dtype The type of the output. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code RandomUniform} output and operands * @return a new instance of RandomUniform */ - @Endpoint(describeByClass = true) - public static RandomUniform create(Scope scope, Operand shape, Class dtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RandomUniform", scope.makeOpName("RandomUniform")); + @Endpoint( + describeByClass = true + ) + public static RandomUniform create(Scope scope, + Operand shape, Class dtype, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RandomUniform"); opBuilder.addInput(shape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); if (options != null) { for (Options opts : options) { @@ -94,45 +88,120 @@ public static RandomUniform create(Scope scope, Operand(opBuilder.build()); + return new RandomUniform<>(opBuilder.build()); } - + /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number + * Sets the seed option. + * + * @param seed 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. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** + * Gets output. * A tensor of the specified shape filled with uniform random values. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RandomUniform"; - - private Output output; - - private RandomUniform(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.RandomUniform} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed 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. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = 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 fa63412d74a..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,79 +17,72 @@ 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 integers from a uniform distribution. - *

- * The generated values are uniform integers in the range `[minval, maxval)`. - * The lower bound `minval` is included in the range, while the upper bound - * `maxval` is excluded. - *

- * The random integers are slightly biased unless `maxval - minval` is an exact - * power of two. The bias is small for values of `maxval - minval` significantly - * smaller than the range of the output (either `2^32` or `2^64`). - * - * @param data type for {@code output()} output + * 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}). */ -@Operator(group = "random") +@OpMetadata( + opType = RandomUniformInt.OP_NAME, + inputsClass = RandomUniformInt.Inputs.class +) +@Operator( + group = "random" +) public final class RandomUniformInt extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.random.RandomUniformInt} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 A second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "RandomUniformInt"; + + private Output output; + + public RandomUniformInt(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RandomUniformInt operation. - * + * * @param scope current scope * @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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code RandomUniformInt} output and operands * @return a new instance of RandomUniformInt */ - @Endpoint(describeByClass = true) - public static RandomUniformInt create(Scope scope, Operand shape, Operand minval, Operand maxval, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RandomUniformInt", scope.makeOpName("RandomUniformInt")); + @Endpoint( + describeByClass = true + ) + public static RandomUniformInt create(Scope scope, + Operand shape, Operand minval, Operand maxval, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RandomUniformInt"); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(minval.asOutput()); opBuilder.addInput(maxval.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.seed != null) { @@ -100,45 +93,132 @@ public static RandomUniformInt create(Scope scope, Operan } } } - return new RandomUniformInt(opBuilder.build()); + return new RandomUniformInt<>(opBuilder.build()); } - + /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number + * Sets the seed option. + * + * @param seed 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. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** + * Gets output. * A tensor of the specified shape filled with uniform random integers. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RandomUniformInt"; - - private Output output; - - private RandomUniformInt(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.RandomUniformInt} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed 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. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = 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 e7319f4b593..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,100 +17,58 @@ 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. */ -@Operator(group = "random") +@OpMetadata( + opType = RecordInput.OP_NAME, + inputsClass = RecordInput.Inputs.class +) +@Operator( + group = "random" +) public final class RecordInput extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.random.RecordInput} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param fileRandomSeed Random seeds used to produce randomized records. - */ - public Options fileRandomSeed(Long fileRandomSeed) { - this.fileRandomSeed = fileRandomSeed; - return this; - } - - /** - * @param fileShuffleShiftRatio Shifts the list of files after the list is randomly - * shuffled. - */ - public Options fileShuffleShiftRatio(Float fileShuffleShiftRatio) { - this.fileShuffleShiftRatio = fileShuffleShiftRatio; - return this; - } - - /** - * @param fileBufferSize The randomization shuffling buffer. - */ - public Options fileBufferSize(Long fileBufferSize) { - this.fileBufferSize = fileBufferSize; - return this; - } - - /** - * @param fileParallelism How many sstables are opened and concurrently iterated over. - */ - public Options fileParallelism(Long fileParallelism) { - this.fileParallelism = fileParallelism; - return this; - } - - /** - * @param batchSize The batch size. - */ - public Options batchSize(Long batchSize) { - this.batchSize = batchSize; - return this; - } - - /** - * @param compressionType The type of compression for the file. Currently ZLIB and - * GZIP are supported. Defaults to none. - */ - public Options compressionType(String compressionType) { - this.compressionType = compressionType; - return this; - } - - private Long fileRandomSeed; - private Float fileShuffleShiftRatio; - private Long fileBufferSize; - private Long fileParallelism; - private Long batchSize; - private String compressionType; - - private Options() { - } + public static final String OP_NAME = "RecordInput"; + + private Output records; + + public RecordInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + records = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RecordInput operation. - * + * * @param scope current scope * @param filePattern Glob pattern for the data files. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of RecordInput */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static RecordInput create(Scope scope, String filePattern, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RecordInput", scope.makeOpName("RecordInput")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RecordInput"); opBuilder.setAttr("file_pattern", filePattern); if (options != null) { for (Options opts : options) { @@ -136,71 +94,222 @@ public static RecordInput create(Scope scope, String filePattern, Options... opt } return new RecordInput(opBuilder.build()); } - + /** + * Sets the fileRandomSeed option. + * * @param fileRandomSeed Random seeds used to produce randomized records. + * @return this Options instance. */ public static Options fileRandomSeed(Long fileRandomSeed) { return new Options().fileRandomSeed(fileRandomSeed); } - + /** + * Sets the fileShuffleShiftRatio option. + * * @param fileShuffleShiftRatio Shifts the list of files after the list is randomly * shuffled. + * @return this Options instance. */ public static Options fileShuffleShiftRatio(Float fileShuffleShiftRatio) { return new Options().fileShuffleShiftRatio(fileShuffleShiftRatio); } - + /** + * Sets the fileBufferSize option. + * * @param fileBufferSize The randomization shuffling buffer. + * @return this Options instance. */ public static Options fileBufferSize(Long fileBufferSize) { return new Options().fileBufferSize(fileBufferSize); } - + /** + * Sets the fileParallelism option. + * * @param fileParallelism How many sstables are opened and concurrently iterated over. + * @return this Options instance. */ public static Options fileParallelism(Long fileParallelism) { return new Options().fileParallelism(fileParallelism); } - + /** + * Sets the batchSize option. + * * @param batchSize The batch size. + * @return this Options instance. */ public static Options batchSize(Long batchSize) { return new Options().batchSize(batchSize); } - + /** + * Sets the compressionType option. + * * @param compressionType The type of compression for the file. Currently ZLIB and * GZIP are supported. Defaults to none. + * @return this Options instance. */ public static Options compressionType(String compressionType) { return new Options().compressionType(compressionType); } - + /** + * Gets records. * A tensor of shape [batch_size]. + * @return records. */ public Output records() { return records; } - + @Override public Output asOutput() { return records; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RecordInput"; - - private Output records; - - private RecordInput(Operation operation) { - super(operation); - int outputIdx = 0; - records = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.RecordInput} + */ + public static class Options { + private Long fileRandomSeed; + + private Float fileShuffleShiftRatio; + + private Long fileBufferSize; + + private Long fileParallelism; + + private Long batchSize; + + private String compressionType; + + private Options() { + } + + /** + * Sets the fileRandomSeed option. + * + * @param fileRandomSeed Random seeds used to produce randomized records. + * @return this Options instance. + */ + public Options fileRandomSeed(Long fileRandomSeed) { + this.fileRandomSeed = fileRandomSeed; + return this; + } + + /** + * Sets the fileShuffleShiftRatio option. + * + * @param fileShuffleShiftRatio Shifts the list of files after the list is randomly + * shuffled. + * @return this Options instance. + */ + public Options fileShuffleShiftRatio(Float fileShuffleShiftRatio) { + this.fileShuffleShiftRatio = fileShuffleShiftRatio; + return this; + } + + /** + * Sets the fileBufferSize option. + * + * @param fileBufferSize The randomization shuffling buffer. + * @return this Options instance. + */ + public Options fileBufferSize(Long fileBufferSize) { + this.fileBufferSize = fileBufferSize; + return this; + } + + /** + * Sets the fileParallelism option. + * + * @param fileParallelism How many sstables are opened and concurrently iterated over. + * @return this Options instance. + */ + public Options fileParallelism(Long fileParallelism) { + this.fileParallelism = fileParallelism; + return this; + } + + /** + * Sets the batchSize option. + * + * @param batchSize The batch size. + * @return this Options instance. + */ + public Options batchSize(Long batchSize) { + this.batchSize = batchSize; + return this; + } + + /** + * Sets the compressionType option. + * + * @param compressionType The type of compression for the file. Currently ZLIB and + * GZIP are supported. Defaults to none. + * @return this Options instance. + */ + public Options compressionType(String compressionType) { + this.compressionType = 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 b75a3836503..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,66 +17,112 @@ 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; /** * Advance the counter of a counter-based RNG. - *

* The state of the RNG after - * `rng_read_and_skip(n)` will be the same as that after `uniform([n])` + * {@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 + */ + public static final String OP_NAME = "RngReadAndSkip"; + + private Output value; + + public RngReadAndSkip(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + value = operation.output(outputIdx++); + } + /** * 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 */ - @Endpoint(describeByClass = true) - public static RngReadAndSkip create(Scope scope, Operand resource, Operand alg, Operand delta) { - OperationBuilder opBuilder = scope.env().opBuilder("RngReadAndSkip", scope.makeOpName("RngReadAndSkip")); + @Endpoint( + describeByClass = true + ) + public static RngReadAndSkip create(Scope scope, Operand resource, + Operand alg, Operand delta) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RngReadAndSkip"); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(alg.asOutput()); opBuilder.addInput(delta.asOutput()); - opBuilder = scope.apply(opBuilder); return new RngReadAndSkip(opBuilder.build()); } - + /** + * Gets value. * The old value of the resource variable, before incrementing. Since state size is algorithm-dependent, this output will be right-padded with zeros to reach shape int64[3] (the current maximal state size among algorithms). + * @return value. */ public Output value() { return value; } - + @Override public Output asOutput() { return value; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RngReadAndSkip"; - - private Output value; - - private RngReadAndSkip(Operation operation) { - super(operation); - int outputIdx = 0; - value = operation.output(outputIdx++); + + @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 72238907917..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,48 +17,91 @@ 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; /** * Advance the counter of a counter-based RNG. - *

* The state of the RNG after - * `rng_skip(n)` will be the same as that after `stateful_uniform([n])` + * {@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. */ +@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"; + + public RngSkip(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new RngSkip operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static RngSkip create(Scope scope, Operand resource, Operand algorithm, Operand delta) { - OperationBuilder opBuilder = scope.env().opBuilder("RngSkip", scope.makeOpName("RngSkip")); + @Endpoint( + describeByClass = true + ) + public static RngSkip create(Scope scope, Operand resource, + Operand algorithm, Operand delta) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RngSkip"); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(algorithm.asOutput()); opBuilder.addInput(delta.asOutput()); - opBuilder = scope.apply(opBuilder); return new RngSkip(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RngSkip"; - - private RngSkip(Operation operation) { - super(operation); + + @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 f0ca988f977..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,84 +17,169 @@ 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; /** - * @param data type for {@code output()} output + * The StatefulRandomBinomial operation */ -@Operator(group = "random") +@OpMetadata( + opType = StatefulRandomBinomial.OP_NAME, + inputsClass = StatefulRandomBinomial.Inputs.class +) +@Operator( + group = "random" +) public final class StatefulRandomBinomial extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatefulRandomBinomial"; + + private Output output; + + public StatefulRandomBinomial(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatefulRandomBinomial operation. - * + * * @param scope current scope - * @param resource - * @param algorithm - * @param shape - * @param counts - * @param probs - * @param dtype + * @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 */ - @Endpoint(describeByClass = true) - public static StatefulRandomBinomial create(Scope scope, Operand resource, Operand algorithm, Operand shape, Operand counts, Operand probs, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("StatefulRandomBinomial", scope.makeOpName("StatefulRandomBinomial")); + @Endpoint( + describeByClass = true + ) + public static StatefulRandomBinomial create(Scope scope, + Operand resource, Operand algorithm, + Operand shape, Operand counts, Operand probs, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatefulRandomBinomial"); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(algorithm.asOutput()); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(counts.asOutput()); opBuilder.addInput(probs.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatefulRandomBinomial(opBuilder.build()); + return new StatefulRandomBinomial<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatefulRandomBinomial operation using default output types. - * + * Factory method to create a class wrapping a new StatefulRandomBinomial operation, with the default output types. + * * @param scope current scope - * @param resource - * @param algorithm - * @param shape - * @param counts - * @param probs - * @return a new instance of StatefulRandomBinomial + * @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 */ - @Endpoint(describeByClass = true) - public static StatefulRandomBinomial create(Scope scope, Operand resource, Operand algorithm, Operand shape, Operand counts, Operand probs) { + @Endpoint( + describeByClass = true + ) + public static StatefulRandomBinomial create(Scope scope, + Operand resource, Operand algorithm, + Operand shape, Operand counts, Operand probs) { return create(scope, resource, algorithm, shape, counts, probs, TInt64.class); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatefulRandomBinomial"; - - private Output output; - - private StatefulRandomBinomial(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 f2bac599e30..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,84 +17,144 @@ 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; /** * 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 */ -@Operator(group = "random") +@OpMetadata( + opType = StatefulStandardNormal.OP_NAME, + inputsClass = StatefulStandardNormal.Inputs.class +) +@Operator( + group = "random" +) public final class StatefulStandardNormal extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new StatefulStandardNormal operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatefulStandardNormalV2"; + + private Output output; + + public StatefulStandardNormal(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new StatefulStandardNormalV2 operation. + * * @param scope current scope * @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 StatefulStandardNormalV2} output and operands * @return a new instance of StatefulStandardNormal */ - @Endpoint(describeByClass = true) - public static StatefulStandardNormal create(Scope scope, Operand resource, Operand algorithm, Operand shape, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("StatefulStandardNormalV2", scope.makeOpName("StatefulStandardNormal")); + @Endpoint( + describeByClass = true + ) + public static StatefulStandardNormal create(Scope scope, + Operand resource, Operand algorithm, Operand shape, + Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatefulStandardNormal"); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(algorithm.asOutput()); opBuilder.addInput(shape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatefulStandardNormal(opBuilder.build()); + return new StatefulStandardNormal<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatefulStandardNormal operation using default output types. - * + * Factory method to create a class wrapping a new StatefulStandardNormalV2 operation, with the default output types. + * * @param scope current scope * @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 StatefulStandardNormal + * @return a new instance of StatefulStandardNormal, with default output types */ - @Endpoint(describeByClass = true) - public static StatefulStandardNormal create(Scope scope, Operand resource, Operand algorithm, Operand shape) { + @Endpoint( + describeByClass = true + ) + public static StatefulStandardNormal create(Scope scope, + Operand resource, Operand algorithm, + Operand shape) { return create(scope, resource, algorithm, shape, TFloat32.class); } - + /** + * Gets output. * A tensor of the specified shape filled with random normal values. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatefulStandardNormalV2"; - - private Output output; - - private StatefulStandardNormal(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 8674dbfd845..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,85 +17,146 @@ 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; /** * 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 */ +@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 + */ + public static final String OP_NAME = "StatefulTruncatedNormal"; + + private Output output; + + public StatefulTruncatedNormal(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatefulTruncatedNormal operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static StatefulTruncatedNormal create(Scope scope, Operand resource, Operand algorithm, Operand shape, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("StatefulTruncatedNormal", scope.makeOpName("StatefulTruncatedNormal")); + @Endpoint( + describeByClass = true + ) + public static StatefulTruncatedNormal create(Scope scope, + Operand resource, Operand algorithm, Operand shape, + Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatefulTruncatedNormal"); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(algorithm.asOutput()); opBuilder.addInput(shape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatefulTruncatedNormal(opBuilder.build()); + return new StatefulTruncatedNormal<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatefulTruncatedNormal operation using default output types. - * + * Factory method to create a class wrapping a new StatefulTruncatedNormal operation, with the default output types. + * * @param scope current scope * @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 + * @return a new instance of StatefulTruncatedNormal, with default output types */ - @Endpoint(describeByClass = true) - public static StatefulTruncatedNormal create(Scope scope, Operand resource, Operand algorithm, Operand shape) { + @Endpoint( + describeByClass = true + ) + public static StatefulTruncatedNormal create(Scope scope, + Operand resource, Operand algorithm, + Operand shape) { return create(scope, resource, algorithm, shape, TFloat32.class); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatefulTruncatedNormal"; - - private Output output; - - private StatefulTruncatedNormal(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 b7e5f2b461d..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,84 +17,144 @@ 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; /** * Outputs random values from a uniform distribution. - *

- * The generated values follow a uniform distribution in the range `[0, 1)`. The + * 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 + */ + public static final String OP_NAME = "StatefulUniform"; + + private Output output; + + public StatefulUniform(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatefulUniform operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static StatefulUniform create(Scope scope, Operand resource, Operand algorithm, Operand shape, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("StatefulUniform", scope.makeOpName("StatefulUniform")); + @Endpoint( + describeByClass = true + ) + public static StatefulUniform create(Scope scope, + Operand resource, Operand algorithm, Operand shape, + Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatefulUniform"); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(algorithm.asOutput()); opBuilder.addInput(shape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatefulUniform(opBuilder.build()); + return new StatefulUniform<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatefulUniform operation using default output types. - * + * Factory method to create a class wrapping a new StatefulUniform operation, with the default output types. + * * @param scope current scope * @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 + * @return a new instance of StatefulUniform, with default output types */ - @Endpoint(describeByClass = true) - public static StatefulUniform create(Scope scope, Operand resource, Operand algorithm, Operand shape) { + @Endpoint( + describeByClass = true + ) + public static StatefulUniform create(Scope scope, Operand resource, + Operand algorithm, Operand shape) { return create(scope, resource, algorithm, shape, TFloat32.class); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatefulUniform"; - - private Output output; - - private StatefulUniform(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 00cd668c7e5..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,68 +17,125 @@ 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 `dtype`. - * - * @param data type for {@code output()} output + * The generated values are uniform integers covering the whole range of {@code dtype}. */ +@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 + */ + public static final String OP_NAME = "StatefulUniformFullInt"; + + private Output output; + + public StatefulUniformFullInt(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatefulUniformFullInt operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static StatefulUniformFullInt create(Scope scope, Operand resource, Operand algorithm, Operand shape, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("StatefulUniformFullInt", scope.makeOpName("StatefulUniformFullInt")); + @Endpoint( + describeByClass = true + ) + public static StatefulUniformFullInt create(Scope scope, + Operand resource, Operand algorithm, Operand shape, + Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatefulUniformFullInt"); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(algorithm.asOutput()); opBuilder.addInput(shape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatefulUniformFullInt(opBuilder.build()); + return new StatefulUniformFullInt<>(opBuilder.build()); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatefulUniformFullInt"; - - private Output output; - - private StatefulUniformFullInt(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 880b414d875..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,75 +17,143 @@ 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; /** * Outputs random integers from a uniform distribution. - *

- * The generated values are uniform integers in the range `[minval, maxval)`. - * The lower bound `minval` is included in the range, while the upper bound - * `maxval` is excluded. - *

- * The random integers are slightly biased unless `maxval - minval` is an exact - * power of two. The bias is small for values of `maxval - minval` significantly - * smaller than the range of the output (either `2^32` or `2^64`). - * - * @param data type for {@code output()} output + * 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}). */ +@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 + */ + public static final String OP_NAME = "StatefulUniformInt"; + + private Output output; + + public StatefulUniformInt(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatefulUniformInt operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static StatefulUniformInt create(Scope scope, Operand resource, Operand algorithm, Operand shape, Operand minval, Operand maxval) { - OperationBuilder opBuilder = scope.env().opBuilder("StatefulUniformInt", scope.makeOpName("StatefulUniformInt")); + @Endpoint( + describeByClass = true + ) + public static StatefulUniformInt create(Scope scope, + Operand resource, Operand algorithm, Operand shape, + Operand minval, Operand maxval) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatefulUniformInt"); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(algorithm.asOutput()); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(minval.asOutput()); opBuilder.addInput(maxval.asOutput()); - opBuilder = scope.apply(opBuilder); - return new StatefulUniformInt(opBuilder.build()); + return new StatefulUniformInt<>(opBuilder.build()); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatefulUniformInt"; - - private Output output; - - private StatefulUniformInt(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 aa8a31e7f38..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,85 +17,152 @@ 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 */ -@Operator(group = "random") +@OpMetadata( + opType = StatelessMultinomial.OP_NAME, + inputsClass = StatelessMultinomial.Inputs.class +) +@Operator( + group = "random" +) public final class StatelessMultinomial extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessMultinomial"; + + private Output output; + + public StatelessMultinomial(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessMultinomial operation. - * + * * @param scope current scope - * @param logits 2-D Tensor with shape `[batch_size, num_classes]`. Each slice `[i, :]` + * @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 + * @param outputDtype The value of the outputDtype attribute + * @param data type for {@code StatelessMultinomial} output and operands * @return a new instance of StatelessMultinomial */ - @Endpoint(describeByClass = true) - public static StatelessMultinomial create(Scope scope, Operand logits, Operand numSamples, Operand seed, Class outputDtype) { - OperationBuilder opBuilder = scope.env().opBuilder("StatelessMultinomial", scope.makeOpName("StatelessMultinomial")); + @Endpoint( + describeByClass = true + ) + public static StatelessMultinomial create(Scope scope, + Operand logits, Operand numSamples, + Operand seed, Class outputDtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessMultinomial"); opBuilder.addInput(logits.asOutput()); opBuilder.addInput(numSamples.asOutput()); opBuilder.addInput(seed.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_dtype", Operands.toDataType(outputDtype)); - return new StatelessMultinomial(opBuilder.build()); + return new StatelessMultinomial<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatelessMultinomial operation using default output types. - * + * Factory method to create a class wrapping a new StatelessMultinomial operation, with the default output types. + * * @param scope current scope - * @param logits 2-D Tensor with shape `[batch_size, num_classes]`. Each slice `[i, :]` + * @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]). - * @return a new instance of StatelessMultinomial + * @return a new instance of StatelessMultinomial, with default output types */ - @Endpoint(describeByClass = true) - public static StatelessMultinomial create(Scope scope, Operand logits, Operand numSamples, Operand seed) { + @Endpoint( + describeByClass = true + ) + public static StatelessMultinomial create(Scope scope, Operand logits, + Operand numSamples, Operand seed) { return create(scope, logits, numSamples, seed, TInt64.class); } - + /** - * 2-D Tensor with shape `[batch_size, num_samples]`. Each slice `[i, :]` - * contains the drawn class labels with range `[0, num_classes)`. + * Gets output. + * 2-D Tensor with shape {@code [batch_size, num_samples]}. Each slice {@code [i, :]} + * contains the drawn class labels with range {@code [0, num_classes)}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessMultinomial"; - - private Output output; - - private StatelessMultinomial(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 8c740f16994..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,24 +17,49 @@ 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; /** - * @param data type for {@code output()} output + * The StatelessParameterizedTruncatedNormal operation */ +@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 + */ + public static final String OP_NAME = "StatelessParameterizedTruncatedNormal"; + + private Output output; + + public StatelessParameterizedTruncatedNormal(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessParameterizedTruncatedNormal operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). @@ -43,42 +68,102 @@ public final class StatelessParameterizedTruncatedNormal exte * @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 */ - @Endpoint(describeByClass = true) - public static StatelessParameterizedTruncatedNormal create(Scope scope, Operand shape, Operand seed, Operand means, Operand stddevs, Operand minvals, Operand maxvals) { - OperationBuilder opBuilder = scope.env().opBuilder("StatelessParameterizedTruncatedNormal", scope.makeOpName("StatelessParameterizedTruncatedNormal")); + @Endpoint( + describeByClass = true + ) + public static StatelessParameterizedTruncatedNormal create(Scope scope, + Operand shape, Operand seed, Operand means, + Operand stddevs, Operand minvals, Operand maxvals) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessParameterizedTruncatedNormal"); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(seed.asOutput()); opBuilder.addInput(means.asOutput()); opBuilder.addInput(stddevs.asOutput()); opBuilder.addInput(minvals.asOutput()); opBuilder.addInput(maxvals.asOutput()); - opBuilder = scope.apply(opBuilder); - return new StatelessParameterizedTruncatedNormal(opBuilder.build()); + return new StatelessParameterizedTruncatedNormal<>(opBuilder.build()); } - + /** + * Gets output. * The outputs are truncated normal samples and are a deterministic function of - * `shape`, `seed`, `minvals`, `maxvals`, `means` and `stddevs`. + * {@code shape}, {@code seed}, {@code minvals}, {@code maxvals}, {@code means} and {@code stddevs}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessParameterizedTruncatedNormal"; - - private Output output; - - private StatelessParameterizedTruncatedNormal(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 0b1e081e551..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,91 +17,173 @@ 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; /** * Outputs deterministic pseudorandom random numbers from a binomial distribution. - *

* Outputs random values from a binomial distribution. - *

- * The outputs are a deterministic function of `shape`, `seed`, `counts`, and `probs`. - * - * @param data type for {@code output()} output + *

The outputs are a deterministic function of {@code shape}, {@code seed}, {@code counts}, and {@code probs}. */ +@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 + */ + public static final String OP_NAME = "StatelessRandomBinomial"; + + private Output output; + + public StatelessRandomBinomial(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessRandomBinomial operation. - * + * * @param scope current scope * @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 `probs`, - * and broadcastable with the rightmost dimensions of `shape`. + * @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 `counts` and broadcastable with the rightmost dimensions of `shape`. + * 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 */ - @Endpoint(describeByClass = true) - public static StatelessRandomBinomial create(Scope scope, Operand shape, Operand seed, Operand counts, Operand probs, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomBinomial", scope.makeOpName("StatelessRandomBinomial")); + @Endpoint( + describeByClass = true + ) + public static StatelessRandomBinomial create( + Scope scope, Operand shape, Operand seed, + Operand counts, Operand probs, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessRandomBinomial"); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(seed.asOutput()); opBuilder.addInput(counts.asOutput()); opBuilder.addInput(probs.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatelessRandomBinomial(opBuilder.build()); + return new StatelessRandomBinomial<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatelessRandomBinomial operation using default output types. - * + * Factory method to create a class wrapping a new StatelessRandomBinomial operation, with the default output types. + * * @param scope current scope * @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 `probs`, - * and broadcastable with the rightmost dimensions of `shape`. + * @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 `counts` and broadcastable with the rightmost dimensions of `shape`. - * @return a new instance of StatelessRandomBinomial + * 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 */ - @Endpoint(describeByClass = true) - public static StatelessRandomBinomial create(Scope scope, Operand shape, Operand seed, Operand counts, Operand probs) { + @Endpoint( + describeByClass = true + ) + public static StatelessRandomBinomial create(Scope scope, + Operand shape, Operand seed, Operand counts, + Operand probs) { return create(scope, shape, seed, counts, probs, TInt64.class); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomBinomial"; - - private Output output; - - private StatelessRandomBinomial(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 3665612e654..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,67 +17,142 @@ 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 `shape`, `seed`, and `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 { /** - * Factory method to create a class wrapping a new StatelessRandomGamma operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessRandomGammaV3"; + + private Output output; + + public StatelessRandomGamma(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * 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 `shape`. + * dimensions of {@code shape}. + * @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) { - OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomGammaV2", scope.makeOpName("StatelessRandomGamma")); + @Endpoint( + describeByClass = true + ) + 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()); - opBuilder = scope.apply(opBuilder); - return new StatelessRandomGamma(opBuilder.build()); + return new StatelessRandomGamma<>(opBuilder.build()); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override - public Output asOutput() { + public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomGammaV2"; - - private Output output; - - private StatelessRandomGamma(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 60e4646b816..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,72 +17,119 @@ 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; /** * 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 + */ + public static final String OP_NAME = "StatelessRandomGetKeyCounterAlg"; + + private Output key; + + private Output counter; + + private Output alg; + + @SuppressWarnings("unchecked") + public StatelessRandomGetKeyCounterAlg(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + key = operation.output(outputIdx++); + counter = operation.output(outputIdx++); + alg = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessRandomGetKeyCounterAlg operation. - * + * * @param scope current scope * @param seed 2 seeds (shape [2]). * @return a new instance of StatelessRandomGetKeyCounterAlg */ - @Endpoint(describeByClass = true) - public static StatelessRandomGetKeyCounterAlg create(Scope scope, Operand seed) { - OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomGetKeyCounterAlg", scope.makeOpName("StatelessRandomGetKeyCounterAlg")); + @Endpoint( + describeByClass = true + ) + public static StatelessRandomGetKeyCounterAlg create(Scope scope, + Operand seed) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessRandomGetKeyCounterAlg"); opBuilder.addInput(seed.asOutput()); - opBuilder = scope.apply(opBuilder); return new StatelessRandomGetKeyCounterAlg(opBuilder.build()); } - + /** + * Gets key. * Key for the counter-based RNG algorithm (shape uint64[1]). + * @return key. */ - public Output 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() { + public Output counter() { return counter; } - + /** + * Gets alg. * The RNG algorithm (shape int32[]). + * @return alg. */ public Output alg() { return alg; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomGetKeyCounterAlg"; - - private Output key; - private Output counter; - private Output alg; - - private StatelessRandomGetKeyCounterAlg(Operation operation) { - super(operation); - int outputIdx = 0; - key = operation.output(outputIdx++); - counter = operation.output(outputIdx++); - alg = operation.output(outputIdx++); + + @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 21587fa0ff0..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,82 +17,139 @@ 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; /** * Outputs deterministic pseudorandom values from a normal distribution. - *

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

- * The outputs are a deterministic function of `shape` and `seed`. - * - * @param data type for {@code output()} output + *

The outputs are a deterministic function of {@code shape} and {@code seed}. */ -@Operator(group = "random") +@OpMetadata( + opType = StatelessRandomNormal.OP_NAME, + inputsClass = StatelessRandomNormal.Inputs.class +) +@Operator( + group = "random" +) public final class StatelessRandomNormal extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessRandomNormal"; + + private Output output; + + public StatelessRandomNormal(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessRandomNormal operation. - * + * * @param scope current scope * @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 StatelessRandomNormal} output and operands * @return a new instance of StatelessRandomNormal */ - @Endpoint(describeByClass = true) - public static StatelessRandomNormal create(Scope scope, Operand shape, Operand seed, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomNormal", scope.makeOpName("StatelessRandomNormal")); + @Endpoint( + describeByClass = true + ) + public static StatelessRandomNormal create(Scope scope, + Operand shape, Operand seed, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessRandomNormal"); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(seed.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatelessRandomNormal(opBuilder.build()); + return new StatelessRandomNormal<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatelessRandomNormal operation using default output types. - * + * Factory method to create a class wrapping a new StatelessRandomNormal operation, with the default output types. + * * @param scope current scope * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). - * @return a new instance of StatelessRandomNormal + * @return a new instance of StatelessRandomNormal, with default output types */ - @Endpoint(describeByClass = true) - public static StatelessRandomNormal create(Scope scope, Operand shape, Operand seed) { + @Endpoint( + describeByClass = true + ) + public static StatelessRandomNormal create(Scope scope, + Operand shape, Operand seed) { return create(scope, shape, seed, TFloat32.class); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomNormal"; - - private Output output; - - private StatelessRandomNormal(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 b8dc52febf2..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,88 +17,155 @@ 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; +import org.tensorflow.types.family.TType; /** * Outputs deterministic pseudorandom values from a normal distribution. - *

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

- * The outputs are a deterministic function of `shape`, `key`, `counter` and `alg`. - * - * @param data type for {@code output()} output + *

The outputs are a deterministic function of {@code shape}, {@code key}, {@code counter} and {@code alg}. */ +@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 + */ + public static final String OP_NAME = "StatelessRandomNormalV2"; + + private Output output; + + public StatelessRandomNormalV2(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessRandomNormalV2 operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param key Key for the counter-based RNG algorithm (shape uint64[1]). * @param counter Initial counter for the counter-based RNG algorithm (shape uint64[2] or uint64[1] depending on the algorithm). If a larger vector is given, only the needed portion on the left (i.e. [:N]) will be used. * @param alg The RNG algorithm (shape int32[]). * @param dtype The type of the output. + * @param data type for {@code StatelessRandomNormalV2} output and operands * @return a new instance of StatelessRandomNormalV2 */ - @Endpoint(describeByClass = true) - public static StatelessRandomNormalV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomNormalV2", scope.makeOpName("StatelessRandomNormalV2")); + @Endpoint( + describeByClass = true + ) + public static StatelessRandomNormalV2 create(Scope scope, + Operand shape, Operand key, + Operand counter, Operand alg, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessRandomNormalV2"); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(key.asOutput()); opBuilder.addInput(counter.asOutput()); opBuilder.addInput(alg.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatelessRandomNormalV2(opBuilder.build()); + return new StatelessRandomNormalV2<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatelessRandomNormalV2 operation using default output types. - * + * Factory method to create a class wrapping a new StatelessRandomNormalV2 operation, with the default output types. + * * @param scope current scope * @param shape The shape of the output tensor. * @param key Key for the counter-based RNG algorithm (shape uint64[1]). * @param counter Initial counter for the counter-based RNG algorithm (shape uint64[2] or uint64[1] depending on the algorithm). If a larger vector is given, only the needed portion on the left (i.e. [:N]) will be used. * @param alg The RNG algorithm (shape int32[]). - * @return a new instance of StatelessRandomNormalV2 + * @return a new instance of StatelessRandomNormalV2, with default output types */ - @Endpoint(describeByClass = true) - public static StatelessRandomNormalV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg) { + @Endpoint( + describeByClass = true + ) + public static StatelessRandomNormalV2 create(Scope scope, + Operand shape, Operand key, + Operand counter, Operand alg) { return create(scope, shape, key, counter, alg, TFloat32.class); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomNormalV2"; - - private Output output; - - private StatelessRandomNormalV2(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 2c0f4b988bc..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,70 +17,139 @@ 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 `shape`, `seed`, and `lam`. - * - * @param data type for {@code output()} output + *

The outputs are a deterministic function of {@code shape}, {@code seed}, and {@code lam}. */ +@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 + */ + public static final String OP_NAME = "StatelessRandomPoisson"; + + private Output output; + + public StatelessRandomPoisson(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessRandomPoisson operation. - * + * * @param scope current scope * @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 `shape`. + * 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 */ - @Endpoint(describeByClass = true) - public static StatelessRandomPoisson create(Scope scope, Operand shape, Operand seed, Operand lam, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomPoisson", scope.makeOpName("StatelessRandomPoisson")); + @Endpoint( + describeByClass = true + ) + public static StatelessRandomPoisson create(Scope scope, + Operand shape, Operand seed, + Operand lam, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessRandomPoisson"); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(seed.asOutput()); opBuilder.addInput(lam.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatelessRandomPoisson(opBuilder.build()); + return new StatelessRandomPoisson<>(opBuilder.build()); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomPoisson"; - - private Output output; - - private StatelessRandomPoisson(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 06a468bb84f..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,83 +17,140 @@ 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; /** * Outputs deterministic pseudorandom random values from a uniform distribution. - *

- * The generated values follow a uniform distribution in the range `[0, 1)`. The + * 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 `shape` and `seed`. - * - * @param data type for {@code output()} output + *

The outputs are a deterministic function of {@code shape} and {@code seed}. */ -@Operator(group = "random") +@OpMetadata( + opType = StatelessRandomUniform.OP_NAME, + inputsClass = StatelessRandomUniform.Inputs.class +) +@Operator( + group = "random" +) public final class StatelessRandomUniform extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessRandomUniform"; + + private Output output; + + public StatelessRandomUniform(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessRandomUniform operation. - * + * * @param scope current scope * @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 StatelessRandomUniform} output and operands * @return a new instance of StatelessRandomUniform */ - @Endpoint(describeByClass = true) - public static StatelessRandomUniform create(Scope scope, Operand shape, Operand seed, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomUniform", scope.makeOpName("StatelessRandomUniform")); + @Endpoint( + describeByClass = true + ) + public static StatelessRandomUniform create(Scope scope, + Operand shape, Operand seed, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessRandomUniform"); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(seed.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatelessRandomUniform(opBuilder.build()); + return new StatelessRandomUniform<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatelessRandomUniform operation using default output types. - * + * Factory method to create a class wrapping a new StatelessRandomUniform operation, with the default output types. + * * @param scope current scope * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). - * @return a new instance of StatelessRandomUniform + * @return a new instance of StatelessRandomUniform, with default output types */ - @Endpoint(describeByClass = true) - public static StatelessRandomUniform create(Scope scope, Operand shape, Operand seed) { + @Endpoint( + describeByClass = true + ) + public static StatelessRandomUniform create(Scope scope, + Operand shape, Operand seed) { return create(scope, shape, seed, TFloat32.class); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomUniform"; - - private Output output; - - private StatelessRandomUniform(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 87c2d18b556..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,67 +17,122 @@ 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 `dtype`. - *

- * The outputs are a deterministic function of `shape` and `seed`. - * - * @param data type for {@code output()} output + * 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}. */ +@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 + */ + public static final String OP_NAME = "StatelessRandomUniformFullInt"; + + private Output output; + + public StatelessRandomUniformFullInt(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessRandomUniformFullInt operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static StatelessRandomUniformFullInt create(Scope scope, Operand shape, Operand seed, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomUniformFullInt", scope.makeOpName("StatelessRandomUniformFullInt")); + @Endpoint( + describeByClass = true + ) + public static StatelessRandomUniformFullInt create(Scope scope, + Operand shape, Operand seed, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessRandomUniformFullInt"); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(seed.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatelessRandomUniformFullInt(opBuilder.build()); + return new StatelessRandomUniformFullInt<>(opBuilder.build()); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomUniformFullInt"; - - private Output output; - - private StatelessRandomUniformFullInt(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 8e9e2d572e2..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,72 +17,135 @@ 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; /** * Outputs deterministic pseudorandom random integers from a uniform distribution. - *

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

- * The outputs are a deterministic function of `shape`, `key`, `counter` and `alg`. - * - * @param data type for {@code output()} output + * 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}. */ +@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 + */ + public static final String OP_NAME = "StatelessRandomUniformFullIntV2"; + + private Output output; + + public StatelessRandomUniformFullIntV2(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessRandomUniformFullIntV2 operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param key Key for the counter-based RNG algorithm (shape uint64[1]). * @param counter Initial counter for the counter-based RNG algorithm (shape uint64[2] or uint64[1] depending on the algorithm). If a larger vector is given, only the needed portion on the left (i.e. [:N]) will be used. * @param alg The RNG algorithm (shape int32[]). * @param dtype The type of the output. + * @param data type for {@code StatelessRandomUniformFullIntV2} output and operands * @return a new instance of StatelessRandomUniformFullIntV2 */ - @Endpoint(describeByClass = true) - public static StatelessRandomUniformFullIntV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomUniformFullIntV2", scope.makeOpName("StatelessRandomUniformFullIntV2")); + @Endpoint( + describeByClass = true + ) + public static StatelessRandomUniformFullIntV2 create(Scope scope, + Operand shape, Operand key, + Operand counter, Operand alg, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessRandomUniformFullIntV2"); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(key.asOutput()); opBuilder.addInput(counter.asOutput()); opBuilder.addInput(alg.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatelessRandomUniformFullIntV2(opBuilder.build()); + return new StatelessRandomUniformFullIntV2<>(opBuilder.build()); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomUniformFullIntV2"; - - private Output output; - - private StatelessRandomUniformFullIntV2(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 37b882c8c39..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,68 +17,136 @@ 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 `[minval, maxval)`. - *

- * The outputs are a deterministic function of `shape`, `seed`, `minval`, and `maxval`. - * - * @param data type for {@code output()} output + * 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}. */ +@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 + */ + public static final String OP_NAME = "StatelessRandomUniformInt"; + + private Output output; + + public StatelessRandomUniformInt(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessRandomUniformInt operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static StatelessRandomUniformInt create(Scope scope, Operand shape, Operand seed, Operand minval, Operand maxval) { - OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomUniformInt", scope.makeOpName("StatelessRandomUniformInt")); + @Endpoint( + describeByClass = true + ) + public static StatelessRandomUniformInt create(Scope scope, + Operand shape, Operand seed, Operand minval, + Operand maxval) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessRandomUniformInt"); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(seed.asOutput()); opBuilder.addInput(minval.asOutput()); opBuilder.addInput(maxval.asOutput()); - opBuilder = scope.apply(opBuilder); - return new StatelessRandomUniformInt(opBuilder.build()); + return new StatelessRandomUniformInt<>(opBuilder.build()); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomUniformInt"; - - private Output output; - - private StatelessRandomUniformInt(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 885c6440764..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,31 +17,53 @@ 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 integers from a uniform distribution. - *

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

- * The outputs are a deterministic function of `shape`, `key`, `counter`, `alg`, `minval` and `maxval`. - * - * @param data type for {@code output()} output + * 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}. */ +@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 + */ + public static final String OP_NAME = "StatelessRandomUniformIntV2"; + + private Output output; + + public StatelessRandomUniformIntV2(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessRandomUniformIntV2 operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param key Key for the counter-based RNG algorithm (shape uint64[1]). @@ -49,41 +71,94 @@ public final class StatelessRandomUniformIntV2 extends RawOp * @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 */ - @Endpoint(describeByClass = true) - public static StatelessRandomUniformIntV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg, Operand minval, Operand maxval) { - OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomUniformIntV2", scope.makeOpName("StatelessRandomUniformIntV2")); + @Endpoint( + describeByClass = true + ) + public static StatelessRandomUniformIntV2 create(Scope scope, + Operand shape, Operand key, + Operand counter, Operand alg, Operand minval, Operand maxval) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessRandomUniformIntV2"); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(key.asOutput()); opBuilder.addInput(counter.asOutput()); opBuilder.addInput(alg.asOutput()); opBuilder.addInput(minval.asOutput()); opBuilder.addInput(maxval.asOutput()); - opBuilder = scope.apply(opBuilder); - return new StatelessRandomUniformIntV2(opBuilder.build()); + return new StatelessRandomUniformIntV2<>(opBuilder.build()); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomUniformIntV2"; - - private Output output; - - private StatelessRandomUniformIntV2(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 0fa51757aef..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,89 +17,156 @@ 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; +import org.tensorflow.types.family.TType; /** * Outputs deterministic pseudorandom random values from a uniform distribution. - *

- * The generated values follow a uniform distribution in the range `[0, 1)`. The + * 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 `shape`, `key`, `counter` and `alg`. - * - * @param data type for {@code output()} output + *

The outputs are a deterministic function of {@code shape}, {@code key}, {@code counter} and {@code alg}. */ +@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 + */ + public static final String OP_NAME = "StatelessRandomUniformV2"; + + private Output output; + + public StatelessRandomUniformV2(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessRandomUniformV2 operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param key Key for the counter-based RNG algorithm (shape uint64[1]). * @param counter Initial counter for the counter-based RNG algorithm (shape uint64[2] or uint64[1] depending on the algorithm). If a larger vector is given, only the needed portion on the left (i.e. [:N]) will be used. * @param alg The RNG algorithm (shape int32[]). * @param dtype The type of the output. + * @param data type for {@code StatelessRandomUniformV2} output and operands * @return a new instance of StatelessRandomUniformV2 */ - @Endpoint(describeByClass = true) - public static StatelessRandomUniformV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomUniformV2", scope.makeOpName("StatelessRandomUniformV2")); + @Endpoint( + describeByClass = true + ) + public static StatelessRandomUniformV2 create(Scope scope, + Operand shape, Operand key, + Operand counter, Operand alg, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessRandomUniformV2"); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(key.asOutput()); opBuilder.addInput(counter.asOutput()); opBuilder.addInput(alg.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatelessRandomUniformV2(opBuilder.build()); + return new StatelessRandomUniformV2<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatelessRandomUniformV2 operation using default output types. - * + * Factory method to create a class wrapping a new StatelessRandomUniformV2 operation, with the default output types. + * * @param scope current scope * @param shape The shape of the output tensor. * @param key Key for the counter-based RNG algorithm (shape uint64[1]). * @param counter Initial counter for the counter-based RNG algorithm (shape uint64[2] or uint64[1] depending on the algorithm). If a larger vector is given, only the needed portion on the left (i.e. [:N]) will be used. * @param alg The RNG algorithm (shape int32[]). - * @return a new instance of StatelessRandomUniformV2 + * @return a new instance of StatelessRandomUniformV2, with default output types */ - @Endpoint(describeByClass = true) - public static StatelessRandomUniformV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg) { + @Endpoint( + describeByClass = true + ) + public static StatelessRandomUniformV2 create(Scope scope, + Operand shape, Operand key, + Operand counter, Operand alg) { return create(scope, shape, key, counter, alg, TFloat32.class); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomUniformV2"; - - private Output output; - - private StatelessRandomUniformV2(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 6550b77b3a9..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,84 +17,141 @@ 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; /** * Outputs deterministic pseudorandom values from a truncated normal distribution. - *

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

- * The outputs are a deterministic function of `shape` and `seed`. - * - * @param data type for {@code output()} output + *

The outputs are a deterministic function of {@code shape} and {@code seed}. */ -@Operator(group = "random") +@OpMetadata( + opType = StatelessTruncatedNormal.OP_NAME, + inputsClass = StatelessTruncatedNormal.Inputs.class +) +@Operator( + group = "random" +) public final class StatelessTruncatedNormal extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessTruncatedNormal"; + + private Output output; + + public StatelessTruncatedNormal(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessTruncatedNormal operation. - * + * * @param scope current scope * @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 StatelessTruncatedNormal} output and operands * @return a new instance of StatelessTruncatedNormal */ - @Endpoint(describeByClass = true) - public static StatelessTruncatedNormal create(Scope scope, Operand shape, Operand seed, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("StatelessTruncatedNormal", scope.makeOpName("StatelessTruncatedNormal")); + @Endpoint( + describeByClass = true + ) + public static StatelessTruncatedNormal create(Scope scope, + Operand shape, Operand seed, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessTruncatedNormal"); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(seed.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatelessTruncatedNormal(opBuilder.build()); + return new StatelessTruncatedNormal<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatelessTruncatedNormal operation using default output types. - * + * Factory method to create a class wrapping a new StatelessTruncatedNormal operation, with the default output types. + * * @param scope current scope * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). - * @return a new instance of StatelessTruncatedNormal + * @return a new instance of StatelessTruncatedNormal, with default output types */ - @Endpoint(describeByClass = true) - public static StatelessTruncatedNormal create(Scope scope, Operand shape, Operand seed) { + @Endpoint( + describeByClass = true + ) + public static StatelessTruncatedNormal create(Scope scope, + Operand shape, Operand seed) { return create(scope, shape, seed, TFloat32.class); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessTruncatedNormal"; - - private Output output; - - private StatelessTruncatedNormal(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 02146b32b27..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,90 +17,157 @@ 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; +import org.tensorflow.types.family.TType; /** * Outputs deterministic pseudorandom values from a truncated normal distribution. - *

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

- * The outputs are a deterministic function of `shape`, `key`, `counter` and `alg`. - * - * @param data type for {@code output()} output + *

The outputs are a deterministic function of {@code shape}, {@code key}, {@code counter} and {@code alg}. */ +@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 + */ + public static final String OP_NAME = "StatelessTruncatedNormalV2"; + + private Output output; + + public StatelessTruncatedNormalV2(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessTruncatedNormalV2 operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param key Key for the counter-based RNG algorithm (shape uint64[1]). * @param counter Initial counter for the counter-based RNG algorithm (shape uint64[2] or uint64[1] depending on the algorithm). If a larger vector is given, only the needed portion on the left (i.e. [:N]) will be used. * @param alg The RNG algorithm (shape int32[]). * @param dtype The type of the output. + * @param data type for {@code StatelessTruncatedNormalV2} output and operands * @return a new instance of StatelessTruncatedNormalV2 */ - @Endpoint(describeByClass = true) - public static StatelessTruncatedNormalV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("StatelessTruncatedNormalV2", scope.makeOpName("StatelessTruncatedNormalV2")); + @Endpoint( + describeByClass = true + ) + public static StatelessTruncatedNormalV2 create(Scope scope, + Operand shape, Operand key, + Operand counter, Operand alg, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessTruncatedNormalV2"); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(key.asOutput()); opBuilder.addInput(counter.asOutput()); opBuilder.addInput(alg.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatelessTruncatedNormalV2(opBuilder.build()); + return new StatelessTruncatedNormalV2<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatelessTruncatedNormalV2 operation using default output types. - * + * Factory method to create a class wrapping a new StatelessTruncatedNormalV2 operation, with the default output types. + * * @param scope current scope * @param shape The shape of the output tensor. * @param key Key for the counter-based RNG algorithm (shape uint64[1]). * @param counter Initial counter for the counter-based RNG algorithm (shape uint64[2] or uint64[1] depending on the algorithm). If a larger vector is given, only the needed portion on the left (i.e. [:N]) will be used. * @param alg The RNG algorithm (shape int32[]). - * @return a new instance of StatelessTruncatedNormalV2 + * @return a new instance of StatelessTruncatedNormalV2, with default output types */ - @Endpoint(describeByClass = true) - public static StatelessTruncatedNormalV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg) { + @Endpoint( + describeByClass = true + ) + public static StatelessTruncatedNormalV2 create(Scope scope, + Operand shape, Operand key, + Operand counter, Operand alg) { return create(scope, shape, key, counter, alg, TFloat32.class); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessTruncatedNormalV2"; - - private Output output; - - private StatelessTruncatedNormalV2(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 aa2be6ce8ea..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,73 +17,67 @@ 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 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 */ -@Operator(group = "random") +@OpMetadata( + opType = TruncatedNormal.OP_NAME, + inputsClass = TruncatedNormal.Inputs.class +) +@Operator( + group = "random" +) public final class TruncatedNormal extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.random.TruncatedNormal} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 A second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "TruncatedNormal"; + + private Output output; + + public TruncatedNormal(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new TruncatedNormal operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param dtype The type of the output. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code TruncatedNormal} output and operands * @return a new instance of TruncatedNormal */ - @Endpoint(describeByClass = true) - public static TruncatedNormal create(Scope scope, Operand shape, Class dtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("TruncatedNormal", scope.makeOpName("TruncatedNormal")); + @Endpoint( + describeByClass = true + ) + public static TruncatedNormal create(Scope scope, + Operand shape, Class dtype, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TruncatedNormal"); opBuilder.addInput(shape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); if (options != null) { for (Options opts : options) { @@ -95,46 +89,121 @@ public static TruncatedNormal create(Scope scope, Operand } } } - return new TruncatedNormal(opBuilder.build()); + return new TruncatedNormal<>(opBuilder.build()); } - + /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number + * Sets the seed option. + * + * @param seed 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. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** + * Gets output. * A tensor of the specified shape filled with random truncated normal * values. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TruncatedNormal"; - - private Output output; - - private TruncatedNormal(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.TruncatedNormal} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed 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. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = 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 8a5a7ce3c21..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,66 +17,62 @@ 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 uniform 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 + *

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. */ -@Operator(group = "random") +@OpMetadata( + opType = UniformCandidateSampler.OP_NAME, + inputsClass = UniformCandidateSampler.Inputs.class +) +@Operator( + group = "random" +) public final class UniformCandidateSampler extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.random.UniformCandidateSampler} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 An second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "UniformCandidateSampler"; + + private Output sampledCandidates; + + private Output trueExpectedCount; + + private Output sampledExpectedCount; + + public UniformCandidateSampler(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 UniformCandidateSampler 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. @@ -86,14 +82,16 @@ private Options() { * 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 attributes values + * @param options carries optional attribute values * @return a new instance of UniformCandidateSampler */ - @Endpoint(describeByClass = true) - public static UniformCandidateSampler create(Scope scope, Operand trueClasses, Long numTrue, Long numSampled, Boolean unique, Long rangeMax, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("UniformCandidateSampler", scope.makeOpName("UniformCandidateSampler")); + @Endpoint( + describeByClass = true + ) + public static UniformCandidateSampler create(Scope scope, Operand trueClasses, + Long numTrue, Long numSampled, Boolean unique, Long rangeMax, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UniformCandidateSampler"); opBuilder.addInput(trueClasses.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_true", numTrue); opBuilder.setAttr("num_sampled", numSampled); opBuilder.setAttr("unique", unique); @@ -110,62 +108,152 @@ public static UniformCandidateSampler create(Scope scope, Operand trueCl } return new UniformCandidateSampler(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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UniformCandidateSampler"; - - private Output sampledCandidates; - private Output trueExpectedCount; - private Output sampledExpectedCount; - - private UniformCandidateSampler(Operation operation) { - super(operation); - int outputIdx = 0; - sampledCandidates = operation.output(outputIdx++); - trueExpectedCount = operation.output(outputIdx++); - sampledExpectedCount = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.UniformCandidateSampler} + */ + 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 = 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/DummySeedGenerator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/experimental/DummySeedGenerator.java deleted file mode 100644 index 8c60fc6350f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/experimental/DummySeedGenerator.java +++ /dev/null @@ -1,69 +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.random.experimental; - -import 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; - -/** - */ -public final class DummySeedGenerator extends RawOp implements Operand { - - /** - * Factory method to create a class wrapping a new DummySeedGenerator operation. - * - * @param scope current scope - * @return a new instance of DummySeedGenerator - */ - @Endpoint(describeByClass = true) - public static DummySeedGenerator create(Scope scope) { - OperationBuilder opBuilder = scope.env().opBuilder("DummySeedGenerator", scope.makeOpName("DummySeedGenerator")); - opBuilder = scope.apply(opBuilder); - return new DummySeedGenerator(opBuilder.build()); - } - - /** - */ - public Output handle() { - return handle; - } - - @Override - @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DummySeedGenerator"; - - private Output handle; - - private DummySeedGenerator(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/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/signal/BatchFft.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft.java index fcc3eaa813b..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,56 +17,90 @@ 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 */ -@Operator(group = "signal") +@OpMetadata( + opType = BatchFft.OP_NAME, + inputsClass = BatchFft.Inputs.class +) +@Operator( + group = "signal" +) public final class BatchFft extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new BatchFft operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchFFT"; + + private Output output; + + @SuppressWarnings("unchecked") + public BatchFft(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new BatchFFT operation. + * * @param scope current scope - * @param input + * @param input The input value * @return a new instance of BatchFft */ - @Endpoint(describeByClass = true) - public static BatchFft create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchFFT", scope.makeOpName("BatchFft")); + @Endpoint( + describeByClass = true + ) + public static BatchFft create(Scope scope, Operand input) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchFft"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); return new BatchFft(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchFFT"; - - private Output output; - - private BatchFft(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 13fc0ba9d42..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,56 +17,90 @@ 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 */ -@Operator(group = "signal") +@OpMetadata( + opType = BatchFft2d.OP_NAME, + inputsClass = BatchFft2d.Inputs.class +) +@Operator( + group = "signal" +) public final class BatchFft2d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new BatchFft2d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchFFT2D"; + + private Output output; + + @SuppressWarnings("unchecked") + public BatchFft2d(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new BatchFFT2D operation. + * * @param scope current scope - * @param input + * @param input The input value * @return a new instance of BatchFft2d */ - @Endpoint(describeByClass = true) - public static BatchFft2d create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchFFT2D", scope.makeOpName("BatchFft2d")); + @Endpoint( + describeByClass = true + ) + public static BatchFft2d create(Scope scope, Operand input) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchFft2d"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); return new BatchFft2d(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchFFT2D"; - - private Output output; - - private BatchFft2d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 9f28e6634f0..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,56 +17,90 @@ 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 */ -@Operator(group = "signal") +@OpMetadata( + opType = BatchFft3d.OP_NAME, + inputsClass = BatchFft3d.Inputs.class +) +@Operator( + group = "signal" +) public final class BatchFft3d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new BatchFft3d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchFFT3D"; + + private Output output; + + @SuppressWarnings("unchecked") + public BatchFft3d(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new BatchFFT3D operation. + * * @param scope current scope - * @param input + * @param input The input value * @return a new instance of BatchFft3d */ - @Endpoint(describeByClass = true) - public static BatchFft3d create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchFFT3D", scope.makeOpName("BatchFft3d")); + @Endpoint( + describeByClass = true + ) + public static BatchFft3d create(Scope scope, Operand input) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchFft3d"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); return new BatchFft3d(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchFFT3D"; - - private Output output; - - private BatchFft3d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 282eec13ac1..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,56 +17,90 @@ 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 */ -@Operator(group = "signal") +@OpMetadata( + opType = BatchIfft.OP_NAME, + inputsClass = BatchIfft.Inputs.class +) +@Operator( + group = "signal" +) public final class BatchIfft extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new BatchIfft operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchIFFT"; + + private Output output; + + @SuppressWarnings("unchecked") + public BatchIfft(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new BatchIFFT operation. + * * @param scope current scope - * @param input + * @param input The input value * @return a new instance of BatchIfft */ - @Endpoint(describeByClass = true) - public static BatchIfft create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchIFFT", scope.makeOpName("BatchIfft")); + @Endpoint( + describeByClass = true + ) + public static BatchIfft create(Scope scope, Operand input) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchIfft"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); return new BatchIfft(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchIFFT"; - - private Output output; - - private BatchIfft(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 318102e94ac..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,56 +17,90 @@ 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 */ -@Operator(group = "signal") +@OpMetadata( + opType = BatchIfft2d.OP_NAME, + inputsClass = BatchIfft2d.Inputs.class +) +@Operator( + group = "signal" +) public final class BatchIfft2d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new BatchIfft2d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchIFFT2D"; + + private Output output; + + @SuppressWarnings("unchecked") + public BatchIfft2d(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new BatchIFFT2D operation. + * * @param scope current scope - * @param input + * @param input The input value * @return a new instance of BatchIfft2d */ - @Endpoint(describeByClass = true) - public static BatchIfft2d create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchIFFT2D", scope.makeOpName("BatchIfft2d")); + @Endpoint( + describeByClass = true + ) + public static BatchIfft2d create(Scope scope, Operand input) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchIfft2d"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); return new BatchIfft2d(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchIFFT2D"; - - private Output output; - - private BatchIfft2d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 f50257f0129..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,56 +17,90 @@ 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 */ -@Operator(group = "signal") +@OpMetadata( + opType = BatchIfft3d.OP_NAME, + inputsClass = BatchIfft3d.Inputs.class +) +@Operator( + group = "signal" +) public final class BatchIfft3d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new BatchIfft3d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchIFFT3D"; + + private Output output; + + @SuppressWarnings("unchecked") + public BatchIfft3d(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new BatchIFFT3D operation. + * * @param scope current scope - * @param input + * @param input The input value * @return a new instance of BatchIfft3d */ - @Endpoint(describeByClass = true) - public static BatchIfft3d create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchIFFT3D", scope.makeOpName("BatchIfft3d")); + @Endpoint( + describeByClass = true + ) + public static BatchIfft3d create(Scope scope, Operand input) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchIfft3d"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); return new BatchIfft3d(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchIFFT3D"; - - private Output output; - - private BatchIfft3d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 7e64778dd99..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,67 +17,102 @@ 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 `input`. - * - * @param data type for {@code output()} output + * dimension of {@code input}. */ -@Operator(group = "signal") +@OpMetadata( + opType = Fft.OP_NAME, + inputsClass = Fft.Inputs.class +) +@Operator( + group = "signal" +) public final class Fft extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Fft operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FFT"; + + private Output output; + + public Fft(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new FFT operation. + * * @param scope current scope * @param input A complex tensor. + * @param data type for {@code FFT} output and operands * @return a new instance of Fft */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Fft create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("FFT", scope.makeOpName("Fft")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Fft"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Fft(opBuilder.build()); + return new Fft<>(opBuilder.build()); } - + /** - * A complex tensor of the same shape as `input`. The inner-most - * dimension of `input` is replaced with its 1D Fourier transform. - *

- * @compatibility(numpy) + * Gets output. + * A complex tensor of the same shape as {@code input}. The inner-most + * dimension of {@code input} is replaced with its 1D Fourier transform. + *

{@literal @}compatibility(numpy)
* Equivalent to np.fft.fft - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FFT"; - - private Output output; - - private Fft(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 d8c1d3332b9..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,67 +17,102 @@ 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 `input`. - * - * @param data type for {@code output()} output + * 2 dimensions of {@code input}. */ -@Operator(group = "signal") +@OpMetadata( + opType = Fft2d.OP_NAME, + inputsClass = Fft2d.Inputs.class +) +@Operator( + group = "signal" +) public final class Fft2d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Fft2d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FFT2D"; + + private Output output; + + public Fft2d(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new FFT2D operation. + * * @param scope current scope * @param input A complex tensor. + * @param data type for {@code FFT2D} output and operands * @return a new instance of Fft2d */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Fft2d create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("FFT2D", scope.makeOpName("Fft2d")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Fft2d"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Fft2d(opBuilder.build()); + return new Fft2d<>(opBuilder.build()); } - + /** - * A complex tensor of the same shape as `input`. The inner-most 2 - * dimensions of `input` are replaced with their 2D Fourier transform. - *

- * @compatibility(numpy) + * Gets output. + * A complex tensor of the same shape as {@code input}. The inner-most 2 + * dimensions of {@code input} are replaced with their 2D Fourier transform. + *

{@literal @}compatibility(numpy)
* Equivalent to np.fft.fft2 - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FFT2D"; - - private Output output; - - private Fft2d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 167e6e6dd23..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,67 +17,102 @@ 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 `input`. - * - * @param data type for {@code output()} output + * dimensions of {@code input}. */ -@Operator(group = "signal") +@OpMetadata( + opType = Fft3d.OP_NAME, + inputsClass = Fft3d.Inputs.class +) +@Operator( + group = "signal" +) public final class Fft3d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Fft3d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FFT3D"; + + private Output output; + + public Fft3d(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new FFT3D operation. + * * @param scope current scope * @param input A complex tensor. + * @param data type for {@code FFT3D} output and operands * @return a new instance of Fft3d */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Fft3d create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("FFT3D", scope.makeOpName("Fft3d")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Fft3d"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Fft3d(opBuilder.build()); + return new Fft3d<>(opBuilder.build()); } - + /** - * A complex tensor of the same shape as `input`. The inner-most 3 - * dimensions of `input` are replaced with their 3D Fourier transform. - *

- * @compatibility(numpy) + * Gets output. + * A complex tensor of the same shape as {@code input}. The inner-most 3 + * dimensions of {@code input} are replaced with their 3D Fourier transform. + *

{@literal @}compatibility(numpy)
* Equivalent to np.fft.fftn with 3 dimensions. - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FFT3D"; - - private Output output; - - private Fft3d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 21b794f0731..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,67 +17,102 @@ 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 `input`. - * - * @param data type for {@code output()} output + * inner-most dimension of {@code input}. */ -@Operator(group = "signal") +@OpMetadata( + opType = Ifft.OP_NAME, + inputsClass = Ifft.Inputs.class +) +@Operator( + group = "signal" +) public final class Ifft extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Ifft operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IFFT"; + + private Output output; + + public Ifft(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new IFFT operation. + * * @param scope current scope * @param input A complex tensor. + * @param data type for {@code IFFT} output and operands * @return a new instance of Ifft */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Ifft create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("IFFT", scope.makeOpName("Ifft")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Ifft"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Ifft(opBuilder.build()); + return new Ifft<>(opBuilder.build()); } - + /** - * A complex tensor of the same shape as `input`. The inner-most - * dimension of `input` is replaced with its inverse 1D Fourier transform. - *

- * @compatibility(numpy) + * Gets output. + * A complex tensor of the same shape as {@code input}. The inner-most + * dimension of {@code input} is replaced with its inverse 1D Fourier transform. + *

{@literal @}compatibility(numpy)
* Equivalent to np.fft.ifft - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IFFT"; - - private Output output; - - private Ifft(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 4a5a3063d9d..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,67 +17,102 @@ 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 `input`. - * - * @param data type for {@code output()} output + * inner-most 2 dimensions of {@code input}. */ -@Operator(group = "signal") +@OpMetadata( + opType = Ifft2d.OP_NAME, + inputsClass = Ifft2d.Inputs.class +) +@Operator( + group = "signal" +) public final class Ifft2d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Ifft2d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IFFT2D"; + + private Output output; + + public Ifft2d(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new IFFT2D operation. + * * @param scope current scope * @param input A complex tensor. + * @param data type for {@code IFFT2D} output and operands * @return a new instance of Ifft2d */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Ifft2d create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("IFFT2D", scope.makeOpName("Ifft2d")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Ifft2d"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Ifft2d(opBuilder.build()); + return new Ifft2d<>(opBuilder.build()); } - + /** - * A complex tensor of the same shape as `input`. The inner-most 2 - * dimensions of `input` are replaced with their inverse 2D Fourier transform. - *

- * @compatibility(numpy) + * Gets output. + * A complex tensor of the same shape as {@code input}. The inner-most 2 + * dimensions of {@code input} are replaced with their inverse 2D Fourier transform. + *

{@literal @}compatibility(numpy)
* Equivalent to np.fft.ifft2 - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IFFT2D"; - - private Output output; - - private Ifft2d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 24995f28a16..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,67 +17,102 @@ 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 `input`. - * - * @param data type for {@code output()} output + * inner-most 3 dimensions of {@code input}. */ -@Operator(group = "signal") +@OpMetadata( + opType = Ifft3d.OP_NAME, + inputsClass = Ifft3d.Inputs.class +) +@Operator( + group = "signal" +) public final class Ifft3d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Ifft3d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IFFT3D"; + + private Output output; + + public Ifft3d(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new IFFT3D operation. + * * @param scope current scope * @param input A complex tensor. + * @param data type for {@code IFFT3D} output and operands * @return a new instance of Ifft3d */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Ifft3d create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("IFFT3D", scope.makeOpName("Ifft3d")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Ifft3d"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Ifft3d(opBuilder.build()); + return new Ifft3d<>(opBuilder.build()); } - + /** - * A complex tensor of the same shape as `input`. The inner-most 3 - * dimensions of `input` are replaced with their inverse 3D Fourier transform. - *

- * @compatibility(numpy) + * Gets output. + * A complex tensor of the same shape as {@code input}. The inner-most 3 + * dimensions of {@code input} are replaced with their inverse 3D Fourier transform. + *

{@literal @}compatibility(numpy)
* Equivalent to np.fft.ifftn with 3 dimensions. - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IFFT3D"; - - private Output output; - - private Ifft3d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 f823a9be60c..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; @@ -33,84 +39,127 @@ /** * Inverse real-valued fast Fourier transform. - *

* Computes the inverse 1-dimensional discrete Fourier transform of a real-valued - * signal over the inner-most dimension of `input`. - *

- * The inner-most dimension of `input` is assumed to be the result of `RFFT`: the - * `fft_length / 2 + 1` unique components of the DFT of a real-valued signal. If - * `fft_length` is not provided, it is computed from the size of the inner-most - * dimension of `input` (`fft_length = 2 * (inner - 1)`). If the FFT length used to - * compute `input` is odd, it should be provided since it cannot be inferred + * signal over the inner-most dimension of {@code input}. + *

The inner-most dimension of {@code input} is assumed to be the result of {@code RFFT}: the + * {@code fft_length / 2 + 1} unique components of the DFT of a real-valued signal. If + * {@code fft_length} is not provided, it is computed from the size of the inner-most + * dimension of {@code input} ({@code fft_length = 2 * (inner - 1)}). If the FFT length used to + * compute {@code input} is odd, it should be provided since it cannot be inferred * properly. - *

- * Along the axis `signal.Irfft` is computed on, if `fft_length / 2 + 1` is smaller - * than the corresponding dimension of `input`, the dimension is cropped. If it is + *

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 */ -@Operator(group = "signal") +@OpMetadata( + opType = Irfft.OP_NAME, + inputsClass = Irfft.Inputs.class +) +@Operator( + group = "signal" +) public final class Irfft extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Irfft operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IRFFT"; + + private Output output; + + public Irfft(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new IRFFT operation. + * * @param scope current scope * @param input A complex tensor. * @param fftLength An int32 tensor of shape [1]. The FFT length. - * @param Treal + * @param Treal The value of the Treal attribute + * @param data type for {@code IRFFT} output and operands * @return a new instance of Irfft */ - @Endpoint(describeByClass = true) - public static Irfft create(Scope scope, Operand input, Operand fftLength, Class Treal) { - OperationBuilder opBuilder = scope.env().opBuilder("IRFFT", scope.makeOpName("Irfft")); + @Endpoint( + describeByClass = true + ) + public static Irfft create(Scope scope, Operand input, + Operand fftLength, Class Treal) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Irfft"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(fftLength.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Treal", Operands.toDataType(Treal)); - return new Irfft(opBuilder.build()); + return new Irfft<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Irfft operation using default output types. - * + * Factory method to create a class wrapping a new IRFFT operation, with the default output types. + * * @param scope current scope * @param input A complex tensor. * @param fftLength An int32 tensor of shape [1]. The FFT length. - * @return a new instance of Irfft + * @return a new instance of Irfft, with default output types */ - @Endpoint(describeByClass = true) - public static Irfft create(Scope scope, Operand input, Operand fftLength) { + @Endpoint( + describeByClass = true + ) + public static Irfft create(Scope scope, Operand input, + Operand fftLength) { return create(scope, input, fftLength, TFloat32.class); } - + /** - * A float32 tensor of the same rank as `input`. The inner-most - * dimension of `input` is replaced with the `fft_length` samples of its inverse - * 1D Fourier transform. - *

- * @compatibility(numpy) + * Gets output. + * A float32 tensor of the same rank as {@code input}. The inner-most + * dimension of {@code input} is replaced with the {@code fft_length} samples of its inverse + * 1D Fourier transform. + *

{@literal @}compatibility(numpy)
* Equivalent to np.fft.irfft - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IRFFT"; - - private Output output; - - private Irfft(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 709297f6afe..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; @@ -33,85 +39,128 @@ /** * Inverse 2D real-valued fast Fourier transform. - *

* Computes the inverse 2-dimensional discrete Fourier transform of a real-valued - * signal over the inner-most 2 dimensions of `input`. - *

- * The inner-most 2 dimensions of `input` are assumed to be the result of `RFFT2D`: - * The inner-most dimension contains the `fft_length / 2 + 1` unique components of - * the DFT of a real-valued signal. If `fft_length` is not provided, it is computed - * from the size of the inner-most 2 dimensions of `input`. If the FFT length used - * to compute `input` is odd, it should be provided since it cannot be inferred + * signal over the inner-most 2 dimensions of {@code input}. + *

The inner-most 2 dimensions of {@code input} are assumed to be the result of {@code RFFT2D}: + * The inner-most dimension contains the {@code fft_length / 2 + 1} unique components of + * the DFT of a real-valued signal. If {@code fft_length} is not provided, it is computed + * from the size of the inner-most 2 dimensions of {@code input}. If the FFT length used + * to compute {@code input} is odd, it should be provided since it cannot be inferred * properly. - *

- * Along each axis `signal.Irfft2d` is computed on, if `fft_length` (or - * `fft_length / 2 + 1` for the inner-most dimension) is smaller than the - * corresponding dimension of `input`, the dimension is cropped. If it is larger, + *

Along each axis {@code signal.Irfft2d} is computed on, if {@code fft_length} (or + * {@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 */ -@Operator(group = "signal") +@OpMetadata( + opType = Irfft2d.OP_NAME, + inputsClass = Irfft2d.Inputs.class +) +@Operator( + group = "signal" +) public final class Irfft2d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Irfft2d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IRFFT2D"; + + private Output output; + + public Irfft2d(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new IRFFT2D 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 + * @param Treal The value of the Treal attribute + * @param data type for {@code IRFFT2D} output and operands * @return a new instance of Irfft2d */ - @Endpoint(describeByClass = true) - public static Irfft2d create(Scope scope, Operand input, Operand fftLength, Class Treal) { - OperationBuilder opBuilder = scope.env().opBuilder("IRFFT2D", scope.makeOpName("Irfft2d")); + @Endpoint( + describeByClass = true + ) + public static Irfft2d create(Scope scope, Operand input, + Operand fftLength, Class Treal) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Irfft2d"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(fftLength.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Treal", Operands.toDataType(Treal)); - return new Irfft2d(opBuilder.build()); + return new Irfft2d<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Irfft2d operation using default output types. - * + * Factory method to create a class wrapping a new IRFFT2D operation, with the default output types. + * * @param scope current scope * @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 + * @return a new instance of Irfft2d, with default output types */ - @Endpoint(describeByClass = true) - public static Irfft2d create(Scope scope, Operand input, Operand fftLength) { + @Endpoint( + describeByClass = true + ) + public static Irfft2d create(Scope scope, Operand input, + Operand fftLength) { return create(scope, input, fftLength, TFloat32.class); } - + /** - * A float32 tensor of the same rank as `input`. The inner-most 2 - * dimensions of `input` are replaced with the `fft_length` samples of their - * inverse 2D Fourier transform. - *

- * @compatibility(numpy) + * Gets output. + * A float32 tensor of the same rank as {@code input}. The inner-most 2 + * dimensions of {@code input} are replaced with the {@code fft_length} samples of their + * inverse 2D Fourier transform. + *

{@literal @}compatibility(numpy)
* Equivalent to np.fft.irfft2 - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IRFFT2D"; - - private Output output; - - private Irfft2d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 c30315d1e7b..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; @@ -33,85 +39,128 @@ /** * Inverse 3D real-valued fast Fourier transform. - *

* Computes the inverse 3-dimensional discrete Fourier transform of a real-valued - * signal over the inner-most 3 dimensions of `input`. - *

- * The inner-most 3 dimensions of `input` are assumed to be the result of `RFFT3D`: - * The inner-most dimension contains the `fft_length / 2 + 1` unique components of - * the DFT of a real-valued signal. If `fft_length` is not provided, it is computed - * from the size of the inner-most 3 dimensions of `input`. If the FFT length used - * to compute `input` is odd, it should be provided since it cannot be inferred + * signal over the inner-most 3 dimensions of {@code input}. + *

The inner-most 3 dimensions of {@code input} are assumed to be the result of {@code RFFT3D}: + * The inner-most dimension contains the {@code fft_length / 2 + 1} unique components of + * the DFT of a real-valued signal. If {@code fft_length} is not provided, it is computed + * from the size of the inner-most 3 dimensions of {@code input}. If the FFT length used + * to compute {@code input} is odd, it should be provided since it cannot be inferred * properly. - *

- * Along each axis `signal.Irfft3d` is computed on, if `fft_length` (or - * `fft_length / 2 + 1` for the inner-most dimension) is smaller than the - * corresponding dimension of `input`, the dimension is cropped. If it is larger, + *

Along each axis {@code signal.Irfft3d} is computed on, if {@code fft_length} (or + * {@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 */ -@Operator(group = "signal") +@OpMetadata( + opType = Irfft3d.OP_NAME, + inputsClass = Irfft3d.Inputs.class +) +@Operator( + group = "signal" +) public final class Irfft3d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Irfft3d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IRFFT3D"; + + private Output output; + + public Irfft3d(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new IRFFT3D 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 + * @param Treal The value of the Treal attribute + * @param data type for {@code IRFFT3D} output and operands * @return a new instance of Irfft3d */ - @Endpoint(describeByClass = true) - public static Irfft3d create(Scope scope, Operand input, Operand fftLength, Class Treal) { - OperationBuilder opBuilder = scope.env().opBuilder("IRFFT3D", scope.makeOpName("Irfft3d")); + @Endpoint( + describeByClass = true + ) + public static Irfft3d create(Scope scope, Operand input, + Operand fftLength, Class Treal) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Irfft3d"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(fftLength.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Treal", Operands.toDataType(Treal)); - return new Irfft3d(opBuilder.build()); + return new Irfft3d<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Irfft3d operation using default output types. - * + * Factory method to create a class wrapping a new IRFFT3D operation, with the default output types. + * * @param scope current scope * @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 + * @return a new instance of Irfft3d, with default output types */ - @Endpoint(describeByClass = true) - public static Irfft3d create(Scope scope, Operand input, Operand fftLength) { + @Endpoint( + describeByClass = true + ) + public static Irfft3d create(Scope scope, Operand input, + Operand fftLength) { return create(scope, input, fftLength, TFloat32.class); } - + /** - * A float32 tensor of the same rank as `input`. The inner-most 3 - * dimensions of `input` are replaced with the `fft_length` samples of their - * inverse 3D real Fourier transform. - *

- * @compatibility(numpy) + * Gets output. + * A float32 tensor of the same rank as {@code input}. The inner-most 3 + * dimensions of {@code input} are replaced with the {@code fft_length} samples of their + * inverse 3D real Fourier transform. + *

{@literal @}compatibility(numpy)
* Equivalent to np.irfftn with 3 dimensions. - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IRFFT3D"; - - private Output output; - - private Irfft3d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 5ca4fe1c4d5..7aeb9f690dc 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,83 +17,131 @@ 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; /** * Real-valued fast Fourier transform. - *

* Computes the 1-dimensional discrete Fourier transform of a real-valued signal - * over the inner-most dimension of `input`. - *

- * Since the DFT of a real signal is Hermitian-symmetric, `signal.Rfft` only returns the - * `fft_length / 2 + 1` unique components of the FFT: the zero-frequency term, - * followed by the `fft_length / 2` positive-frequency terms. - *

- * Along the axis `signal.Rfft` is computed on, if `fft_length` is smaller than the - * corresponding dimension of `input`, the dimension is cropped. If it is larger, + * over the inner-most dimension of {@code input}. + *

Since the DFT of a real signal is Hermitian-symmetric, {@code signal.Rfft} only returns the + * {@code fft_length / 2 + 1} unique components of the FFT: the zero-frequency term, + * followed by the {@code fft_length / 2} positive-frequency terms. + *

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 */ -@Operator(group = "signal") +@OpMetadata( + opType = Rfft.OP_NAME, + inputsClass = Rfft.Inputs.class +) +@Operator( + group = "signal" +) public final class Rfft extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Rfft operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RFFT"; + + private Output output; + + public Rfft(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new RFFT operation. + * * @param scope current scope - * @param input A float32 tensor. + * @param input A float32 or float64 tensor. * @param fftLength An int32 tensor of shape [1]. The FFT length. - * @param Tcomplex + * @param Tcomplex Should be {@code tf.complex64} when the type of {@code input} is {@code float32}. + * Should be {@code tf.complex128} when the type of {@code input} is {@code float64}. + * @param data type for {@code RFFT} output and operands * @return a new instance of Rfft */ - @Endpoint(describeByClass = true) - public static Rfft create(Scope scope, Operand input, Operand fftLength, Class Tcomplex) { - OperationBuilder opBuilder = scope.env().opBuilder("RFFT", scope.makeOpName("Rfft")); + @Endpoint( + describeByClass = true + ) + public static Rfft create(Scope scope, Operand input, + Operand fftLength, Class Tcomplex) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Rfft"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(fftLength.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tcomplex", Operands.toDataType(Tcomplex)); - return new Rfft(opBuilder.build()); + return new Rfft<>(opBuilder.build()); } - + /** - * A complex64 tensor of the same rank as `input`. The inner-most - * dimension of `input` is replaced with the `fft_length / 2 + 1` unique - * frequency components of its 1D Fourier transform. - *

- * @compatibility(numpy) + * Gets output. + * A complex64 tensor of the same rank as {@code input}. The inner-most + * dimension of {@code input} is replaced with the {@code fft_length / 2 + 1} unique + * frequency components of its 1D Fourier transform. + *

{@literal @}compatibility(numpy)
* Equivalent to np.fft.rfft - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RFFT"; - - private Output output; - - private Rfft(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @OpInputsMetadata( + outputsClass = Rfft.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A float32 or float64 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; + + /** + * Should be {@code tf.complex64} when the type of {@code input} is {@code float32}. + * Should be {@code tf.complex128} when the type of {@code input} is {@code float64}. + */ + 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 483d26a898f..d440d3b706c 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,85 +17,133 @@ 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; /** * 2D real-valued fast Fourier transform. - *

* Computes the 2-dimensional discrete Fourier transform of a real-valued signal - * over the inner-most 2 dimensions of `input`. - *

- * Since the DFT of a real signal is Hermitian-symmetric, `signal.Rfft2d` only returns the - * `fft_length / 2 + 1` unique components of the FFT for the inner-most dimension - * of `output`: the zero-frequency term, followed by the `fft_length / 2` + * over the inner-most 2 dimensions of {@code input}. + *

Since the DFT of a real signal is Hermitian-symmetric, {@code signal.Rfft2d} only returns the + * {@code fft_length / 2 + 1} unique components of the FFT for the inner-most dimension + * of {@code output}: the zero-frequency term, followed by the {@code fft_length / 2} * positive-frequency terms. - *

- * Along each axis `signal.Rfft2d` is computed on, if `fft_length` is smaller than the - * corresponding dimension of `input`, the dimension is cropped. If it is larger, + *

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 */ -@Operator(group = "signal") +@OpMetadata( + opType = Rfft2d.OP_NAME, + inputsClass = Rfft2d.Inputs.class +) +@Operator( + group = "signal" +) public final class Rfft2d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Rfft2d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RFFT2D"; + + private Output output; + + public Rfft2d(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new RFFT2D operation. + * * @param scope current scope - * @param input A float32 tensor. + * @param input A float32 or float64 tensor. * @param fftLength An int32 tensor of shape [2]. The FFT length for each dimension. - * @param Tcomplex + * @param Tcomplex Should be {@code tf.complex64} when the type of {@code input} is {@code float32}. + * Should be {@code tf.complex128} when the type of {@code input} is {@code float64}. + * @param data type for {@code RFFT2D} output and operands * @return a new instance of Rfft2d */ - @Endpoint(describeByClass = true) - public static Rfft2d create(Scope scope, Operand input, Operand fftLength, Class Tcomplex) { - OperationBuilder opBuilder = scope.env().opBuilder("RFFT2D", scope.makeOpName("Rfft2d")); + @Endpoint( + describeByClass = true + ) + public static Rfft2d create(Scope scope, Operand input, + Operand fftLength, Class Tcomplex) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Rfft2d"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(fftLength.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tcomplex", Operands.toDataType(Tcomplex)); - return new Rfft2d(opBuilder.build()); + return new Rfft2d<>(opBuilder.build()); } - + /** - * A complex64 tensor of the same rank as `input`. The inner-most 2 - * dimensions of `input` are replaced with their 2D Fourier transform. The - * inner-most dimension contains `fft_length / 2 + 1` unique frequency - * components. - *

- * @compatibility(numpy) + * Gets output. + * A complex64 tensor of the same rank as {@code input}. The inner-most 2 + * dimensions of {@code input} are replaced with their 2D Fourier transform. The + * inner-most dimension contains {@code fft_length / 2 + 1} unique frequency + * components. + *

{@literal @}compatibility(numpy)
* Equivalent to np.fft.rfft2 - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RFFT2D"; - - private Output output; - - private Rfft2d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @OpInputsMetadata( + outputsClass = Rfft2d.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A float32 or float64 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; + + /** + * Should be {@code tf.complex64} when the type of {@code input} is {@code float32}. + * Should be {@code tf.complex128} when the type of {@code input} is {@code float64}. + */ + 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 cf64fceea54..92b44cfd563 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,85 +17,133 @@ 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; /** * 3D real-valued fast Fourier transform. - *

* Computes the 3-dimensional discrete Fourier transform of a real-valued signal - * over the inner-most 3 dimensions of `input`. - *

- * Since the DFT of a real signal is Hermitian-symmetric, `signal.Rfft3d` only returns the - * `fft_length / 2 + 1` unique components of the FFT for the inner-most dimension - * of `output`: the zero-frequency term, followed by the `fft_length / 2` + * over the inner-most 3 dimensions of {@code input}. + *

Since the DFT of a real signal is Hermitian-symmetric, {@code signal.Rfft3d} only returns the + * {@code fft_length / 2 + 1} unique components of the FFT for the inner-most dimension + * of {@code output}: the zero-frequency term, followed by the {@code fft_length / 2} * positive-frequency terms. - *

- * Along each axis `signal.Rfft3d` is computed on, if `fft_length` is smaller than the - * corresponding dimension of `input`, the dimension is cropped. If it is larger, + *

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 */ -@Operator(group = "signal") +@OpMetadata( + opType = Rfft3d.OP_NAME, + inputsClass = Rfft3d.Inputs.class +) +@Operator( + group = "signal" +) public final class Rfft3d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Rfft3d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RFFT3D"; + + private Output output; + + public Rfft3d(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new RFFT3D operation. + * * @param scope current scope - * @param input A float32 tensor. + * @param input A float32 or float64 tensor. * @param fftLength An int32 tensor of shape [3]. The FFT length for each dimension. - * @param Tcomplex + * @param Tcomplex Should be {@code tf.complex64} when the type of {@code input} is {@code float32}. + * Should be {@code tf.complex128} when the type of {@code input} is {@code float64}. + * @param data type for {@code RFFT3D} output and operands * @return a new instance of Rfft3d */ - @Endpoint(describeByClass = true) - public static Rfft3d create(Scope scope, Operand input, Operand fftLength, Class Tcomplex) { - OperationBuilder opBuilder = scope.env().opBuilder("RFFT3D", scope.makeOpName("Rfft3d")); + @Endpoint( + describeByClass = true + ) + public static Rfft3d create(Scope scope, Operand input, + Operand fftLength, Class Tcomplex) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Rfft3d"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(fftLength.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tcomplex", Operands.toDataType(Tcomplex)); - return new Rfft3d(opBuilder.build()); + return new Rfft3d<>(opBuilder.build()); } - + /** - * A complex64 tensor of the same rank as `input`. The inner-most 3 - * dimensions of `input` are replaced with the their 3D Fourier transform. The - * inner-most dimension contains `fft_length / 2 + 1` unique frequency - * components. - *

- * @compatibility(numpy) + * Gets output. + * A complex64 tensor of the same rank as {@code input}. The inner-most 3 + * dimensions of {@code input} are replaced with the their 3D Fourier transform. The + * inner-most dimension contains {@code fft_length / 2 + 1} unique frequency + * components. + *

{@literal @}compatibility(numpy)
* Equivalent to np.fft.rfftn with 3 dimensions. - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RFFT3D"; - - private Output output; - - private Rfft3d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @OpInputsMetadata( + outputsClass = Rfft3d.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A float32 or float64 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; + + /** + * Should be {@code tf.complex64} when the type of {@code input} is {@code float32}. + * Should be {@code tf.complex128} when the type of {@code input} is {@code float64}. + */ + 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..72183e79a42 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/RfftNd.java @@ -0,0 +1,155 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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 float32 or float64 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 Should be {@code tf.complex64} when the type of {@code input} is {@code float32}. + * Should be {@code tf.complex128} when the type of {@code input} is {@code float64}. + * @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 float32 or float64 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; + + /** + * Should be {@code tf.complex64} when the type of {@code input} is {@code float32}. + * Should be {@code tf.complex128} when the type of {@code input} is {@code float64}. + */ + 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 b1c834f44f1..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,93 +17,86 @@ 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; /** - * Add an `N`-minibatch `SparseTensor` to a `SparseTensorsMap`, return `N` handles. - *

- * A `SparseTensor` of rank `R` is represented by three tensors: `sparse_indices`, - * `sparse_values`, and `sparse_shape`, where - *

{@code
- * sparse_indices.shape[1] == sparse_shape.shape[0] == R}
- * An `N`-minibatch of `SparseTensor` objects is represented as a `SparseTensor` - * having a first `sparse_indices` column taking values between `[0, N)`, where - * the minibatch size `N == sparse_shape[0]`. - *

- * The input `SparseTensor` must have rank `R` greater than 1, and the first - * dimension is treated as the minibatch dimension. Elements of the `SparseTensor` + * Add an {@code N}-minibatch {@code SparseTensor} to a {@code SparseTensorsMap}, return {@code N} handles. + * A {@code SparseTensor} of rank {@code R} is represented by three tensors: {@code sparse_indices}, + * {@code sparse_values}, and {@code sparse_shape}, where + *

{@code sparse_indices.shape[1] == sparse_shape.shape[0] == R} + *

An {@code N}-minibatch of {@code SparseTensor} objects is represented as a {@code SparseTensor} + * having a first {@code sparse_indices} column taking values between {@code [0, N)}, where + * the minibatch size {@code N == sparse_shape[0]}. + *

The input {@code SparseTensor} must have rank {@code R} greater than 1, and the first + * dimension is treated as the minibatch dimension. Elements of the {@code SparseTensor} * must be sorted in increasing order of this first dimension. The stored - * `SparseTensor` objects pointed to by each row of the output `sparse_handles` - * will have rank `R-1`. - *

- * The `SparseTensor` values can then be read out as part of a minibatch by passing - * the given keys as vector elements to `TakeManySparseFromTensorsMap`. To ensure - * the correct `SparseTensorsMap` is accessed, ensure that the same - * `container` and `shared_name` are passed to that Op. If no `shared_name` - * is provided here, instead use the name of the Operation created by calling - * `sparse.AddManySparseToTensorsMap` as the `shared_name` passed to - * `TakeManySparseFromTensorsMap`. Ensure the Operations are colocated. + * {@code SparseTensor} objects pointed to by each row of the output {@code sparse_handles} + * will have rank {@code R-1}. + *

The {@code SparseTensor} values can then be read out as part of a minibatch by passing + * the given keys as vector elements to {@code TakeManySparseFromTensorsMap}. To ensure + * the correct {@code SparseTensorsMap} is accessed, ensure that the same + * {@code container} and {@code shared_name} are passed to that Op. If no {@code shared_name} + * is provided here, instead use the name of the Operation created by calling + * {@code sparse.AddManySparseToTensorsMap} as the {@code shared_name} passed to + * {@code TakeManySparseFromTensorsMap}. Ensure the Operations are colocated. */ -@Operator(group = "sparse") +@OpMetadata( + opType = AddManySparseToTensorsMap.OP_NAME, + inputsClass = AddManySparseToTensorsMap.Inputs.class +) +@Operator( + group = "sparse" +) public final class AddManySparseToTensorsMap extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.AddManySparseToTensorsMap} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container The container name for the `SparseTensorsMap` created by this op. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName The shared name for the `SparseTensorsMap` created by this op. - * If blank, the new Operation's unique name is used. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "AddManySparseToTensorsMap"; + + private Output sparseHandles; + + public AddManySparseToTensorsMap(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + sparseHandles = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new AddManySparseToTensorsMap operation. - * + * * @param scope current scope - * @param sparseIndices 2-D. The `indices` of the minibatch `SparseTensor`. - * `sparse_indices[:, 0]` must be ordered values in `[0, N)`. - * @param sparseValues 1-D. The `values` of the minibatch `SparseTensor`. - * @param sparseShape 1-D. The `shape` of the minibatch `SparseTensor`. - * The minibatch size `N == sparse_shape[0]`. - * @param options carries optional attributes values + * @param sparseIndices 2-D. The {@code indices} of the minibatch {@code SparseTensor}. + * {@code sparse_indices[:, 0]} must be ordered values in {@code [0, N)}. + * @param sparseValues 1-D. The {@code values} of the minibatch {@code SparseTensor}. + * @param sparseShape 1-D. The {@code shape} of the minibatch {@code SparseTensor}. + * The minibatch size {@code N == sparse_shape[0]}. + * @param options carries optional attribute values * @return a new instance of AddManySparseToTensorsMap */ - @Endpoint(describeByClass = true) - public static AddManySparseToTensorsMap create(Scope scope, Operand sparseIndices, Operand sparseValues, Operand sparseShape, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("AddManySparseToTensorsMap", scope.makeOpName("AddManySparseToTensorsMap")); + @Endpoint( + describeByClass = true + ) + public static AddManySparseToTensorsMap create(Scope scope, Operand sparseIndices, + Operand sparseValues, Operand sparseShape, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AddManySparseToTensorsMap"); opBuilder.addInput(sparseIndices.asOutput()); opBuilder.addInput(sparseValues.asOutput()); opBuilder.addInput(sparseShape.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.container != null) { @@ -116,43 +109,124 @@ public static AddManySparseToTensorsMap create(Scope scope, Operand spar } return new AddManySparseToTensorsMap(opBuilder.build()); } - + /** - * @param container The container name for the `SparseTensorsMap` created by this op. + * Sets the container option. + * + * @param container The container name for the {@code SparseTensorsMap} created by this op. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName The shared name for the `SparseTensorsMap` created by this op. + * Sets the sharedName option. + * + * @param sharedName The shared name for the {@code SparseTensorsMap} created by this op. * If blank, the new Operation's unique name is used. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * 1-D. The handles of the `SparseTensor` now stored in the - * `SparseTensorsMap`. Shape: `[N]`. + * Gets sparseHandles. + * 1-D. The handles of the {@code SparseTensor} now stored in the + * {@code SparseTensorsMap}. Shape: {@code [N]}. + * @return sparseHandles. */ public Output sparseHandles() { return sparseHandles; } - + @Override public Output asOutput() { return sparseHandles; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AddManySparseToTensorsMap"; - - private Output sparseHandles; - - private AddManySparseToTensorsMap(Operation operation) { - super(operation); - int outputIdx = 0; - sparseHandles = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.AddManySparseToTensorsMap} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container The container name for the {@code SparseTensorsMap} created by this op. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName The shared name for the {@code SparseTensorsMap} created by this op. + * If blank, the new Operation's unique name is used. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = 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 c8313d66e85..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,84 +17,78 @@ 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; /** - * Add a `SparseTensor` to a `SparseTensorsMap` return its handle. - *

- * A `SparseTensor` is represented by three tensors: `sparse_indices`, - * `sparse_values`, and `sparse_shape`. - *

- * This operator takes the given `SparseTensor` and adds it to a container - * object (a `SparseTensorsMap`). A unique key within this container is generated - * in the form of an `int64`, and this is the value that is returned. - *

- * The `SparseTensor` can then be read out as part of a minibatch by passing - * the key as a vector element to `TakeManySparseFromTensorsMap`. To ensure - * the correct `SparseTensorsMap` is accessed, ensure that the same - * `container` and `shared_name` are passed to that Op. If no `shared_name` - * is provided here, instead use the name of the Operation created by calling - * `sparse.AddSparseToTensorsMap` as the `shared_name` passed to - * `TakeManySparseFromTensorsMap`. Ensure the Operations are colocated. + * Add a {@code SparseTensor} to a {@code SparseTensorsMap} return its handle. + * A {@code SparseTensor} is represented by three tensors: {@code sparse_indices}, + * {@code sparse_values}, and {@code sparse_shape}. + *

This operator takes the given {@code SparseTensor} and adds it to a container + * object (a {@code SparseTensorsMap}). A unique key within this container is generated + * in the form of an {@code int64}, and this is the value that is returned. + *

The {@code SparseTensor} can then be read out as part of a minibatch by passing + * the key as a vector element to {@code TakeManySparseFromTensorsMap}. To ensure + * the correct {@code SparseTensorsMap} is accessed, ensure that the same + * {@code container} and {@code shared_name} are passed to that Op. If no {@code shared_name} + * is provided here, instead use the name of the Operation created by calling + * {@code sparse.AddSparseToTensorsMap} as the {@code shared_name} passed to + * {@code TakeManySparseFromTensorsMap}. Ensure the Operations are colocated. */ -@Operator(group = "sparse") +@OpMetadata( + opType = AddSparseToTensorsMap.OP_NAME, + inputsClass = AddSparseToTensorsMap.Inputs.class +) +@Operator( + group = "sparse" +) public final class AddSparseToTensorsMap extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.AddSparseToTensorsMap} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container The container name for the `SparseTensorsMap` created by this op. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName The shared name for the `SparseTensorsMap` created by this op. - * If blank, the new Operation's unique name is used. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "AddSparseToTensorsMap"; + + private Output sparseHandle; + + public AddSparseToTensorsMap(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + sparseHandle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new AddSparseToTensorsMap operation. - * + * * @param scope current scope - * @param sparseIndices 2-D. The `indices` of the `SparseTensor`. - * @param sparseValues 1-D. The `values` of the `SparseTensor`. - * @param sparseShape 1-D. The `shape` of the `SparseTensor`. - * @param options carries optional attributes values + * @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}. + * @param options carries optional attribute values * @return a new instance of AddSparseToTensorsMap */ - @Endpoint(describeByClass = true) - public static AddSparseToTensorsMap create(Scope scope, Operand sparseIndices, Operand sparseValues, Operand sparseShape, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("AddSparseToTensorsMap", scope.makeOpName("AddSparseToTensorsMap")); + @Endpoint( + describeByClass = true + ) + public static AddSparseToTensorsMap create(Scope scope, Operand sparseIndices, + Operand sparseValues, Operand sparseShape, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AddSparseToTensorsMap"); opBuilder.addInput(sparseIndices.asOutput()); opBuilder.addInput(sparseValues.asOutput()); opBuilder.addInput(sparseShape.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.container != null) { @@ -107,43 +101,122 @@ public static AddSparseToTensorsMap create(Scope scope, Operand sparseIn } return new AddSparseToTensorsMap(opBuilder.build()); } - + /** - * @param container The container name for the `SparseTensorsMap` created by this op. + * Sets the container option. + * + * @param container The container name for the {@code SparseTensorsMap} created by this op. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName The shared name for the `SparseTensorsMap` created by this op. + * Sets the sharedName option. + * + * @param sharedName The shared name for the {@code SparseTensorsMap} created by this op. * If blank, the new Operation's unique name is used. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * 0-D. The handle of the `SparseTensor` now stored in the - * `SparseTensorsMap`. + * Gets sparseHandle. + * 0-D. The handle of the {@code SparseTensor} now stored in the + * {@code SparseTensorsMap}. + * @return sparseHandle. */ public Output sparseHandle() { return sparseHandle; } - + @Override public Output asOutput() { return sparseHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AddSparseToTensorsMap"; - - private Output sparseHandle; - - private AddSparseToTensorsMap(Operation operation) { - super(operation); - int outputIdx = 0; - sparseHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.AddSparseToTensorsMap} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container The container name for the {@code SparseTensorsMap} created by this op. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName The shared name for the {@code SparseTensorsMap} created by this op. + * If blank, the new Operation's unique name is used. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = 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 fa956a4032f..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,71 +17,75 @@ 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 outputValues()} output + * Counts the number of times each value occurs in the input. */ +@OpMetadata( + opType = DenseCountSparseOutput.OP_NAME, + inputsClass = DenseCountSparseOutput.Inputs.class +) +@Operator( + group = "sparse" +) public final class DenseCountSparseOutput extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.DenseCountSparseOutput} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param minlength Minimum value to count. Can be set to -1 for no minimum. - */ - public Options minlength(Long minlength) { - this.minlength = minlength; - return this; - } - - /** - * @param maxlength Maximum value to count. Can be set to -1 for no maximum. - */ - public Options maxlength(Long maxlength) { - this.maxlength = maxlength; - return this; - } - - private Long minlength; - private Long maxlength; - - private Options() { - } + public static final String OP_NAME = "DenseCountSparseOutput"; + + private Output outputIndices; + + private Output outputValues; + + private Output outputDenseShape; + + public DenseCountSparseOutput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + outputDenseShape = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DenseCountSparseOutput operation. - * + * * @param scope current scope * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code DenseCountSparseOutput} output and operands * @return a new instance of DenseCountSparseOutput */ - @Endpoint(describeByClass = true) - public static DenseCountSparseOutput create(Scope scope, Operand values, Operand weights, Boolean binaryOutput, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DenseCountSparseOutput", scope.makeOpName("DenseCountSparseOutput")); + @Endpoint( + describeByClass = true + ) + public static DenseCountSparseOutput create(Scope scope, + Operand values, Operand weights, Boolean binaryOutput, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DenseCountSparseOutput"); opBuilder.addInput(values.asOutput()); opBuilder.addInput(weights.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("binary_output", binaryOutput); if (options != null) { for (Options opts : options) { @@ -93,56 +97,140 @@ public static DenseCountSparseOutput create(Scope scope, } } } - return new DenseCountSparseOutput(opBuilder.build()); + return new DenseCountSparseOutput<>(opBuilder.build()); } - + /** + * Sets the minlength option. + * * @param minlength Minimum value to count. Can be set to -1 for no minimum. + * @return this Options instance. */ public static Options minlength(Long minlength) { return new Options().minlength(minlength); } - + /** + * Sets the maxlength option. + * * @param maxlength Maximum value to count. Can be set to -1 for no maximum. + * @return this Options instance. */ public static Options maxlength(Long maxlength) { return new Options().maxlength(maxlength); } - + /** + * Gets outputIndices. * Indices tensor for the resulting sparse tensor object. + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** + * Gets outputValues. * Values tensor for the resulting sparse tensor object. + * @return outputValues. */ public Output outputValues() { return outputValues; } - + /** + * Gets outputDenseShape. * Shape tensor for the resulting sparse tensor object. + * @return outputDenseShape. */ public Output outputDenseShape() { return outputDenseShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DenseCountSparseOutput"; - - private Output outputIndices; - private Output outputValues; - private Output outputDenseShape; - - private DenseCountSparseOutput(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - outputDenseShape = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.DenseCountSparseOutput} + */ + public static class Options { + private Long minlength; + + private Long maxlength; + + private Options() { + } + + /** + * Sets the minlength option. + * + * @param minlength Minimum value to count. Can be set to -1 for no minimum. + * @return this Options instance. + */ + public Options minlength(Long minlength) { + this.minlength = minlength; + return this; + } + + /** + * Sets the maxlength option. + * + * @param maxlength Maximum value to count. Can be set to -1 for no maximum. + * @return this Options instance. + */ + public Options maxlength(Long maxlength) { + this.maxlength = 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 bb71fd48284..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,70 +17,80 @@ 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; /** - * Applies set operation along last dimension of 2 `Tensor` inputs. - *

- * See SetOperationOp::SetOperationFromContext for values of `set_operation`. - *

- * Output `result` is a `SparseTensor` represented by `result_indices`, - * `result_values`, and `result_shape`. For `set1` and `set2` ranked `n`, this - * has rank `n` and the same 1st `n-1` dimensions as `set1` and `set2`. The `nth` - * dimension contains the result of `set_operation` applied to the corresponding - * `[0...n-1]` dimension of `set`. - * - * @param data type for {@code resultValues()} output + * Applies set operation along last dimension of 2 {@code Tensor} inputs. + * See SetOperationOp::SetOperationFromContext for values of {@code set_operation}. + *

Output {@code result} is a {@code SparseTensor} represented by {@code result_indices}, + * {@code result_values}, and {@code result_shape}. For {@code set1} and {@code set2} ranked {@code n}, this + * 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}. */ -@Operator(group = "sparse") +@OpMetadata( + opType = DenseToDenseSetOperation.OP_NAME, + inputsClass = DenseToDenseSetOperation.Inputs.class +) +@Operator( + group = "sparse" +) public final class DenseToDenseSetOperation extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.DenseToDenseSetOperation} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param validateIndices - */ - public Options validateIndices(Boolean validateIndices) { - this.validateIndices = validateIndices; - return this; - } - - private Boolean validateIndices; - - private Options() { - } + public static final String OP_NAME = "DenseToDenseSetOperation"; + + private Output resultIndices; + + private Output resultValues; + + private Output resultShape; + + public DenseToDenseSetOperation(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + resultIndices = operation.output(outputIdx++); + resultValues = operation.output(outputIdx++); + resultShape = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DenseToDenseSetOperation operation. - * + * * @param scope current scope - * @param set1 `Tensor` with rank `n`. 1st `n-1` dimensions must be the same as `set2`. - * Dimension `n` contains values in a set, duplicates are allowed but ignored. - * @param set2 `Tensor` with rank `n`. 1st `n-1` dimensions must be the same as `set1`. - * Dimension `n` contains values in a set, duplicates are allowed but ignored. - * @param setOperation - * @param options carries optional attributes values + * @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 attribute + * @param options carries optional attribute values + * @param data type for {@code DenseToDenseSetOperation} output and operands * @return a new instance of DenseToDenseSetOperation */ - @Endpoint(describeByClass = true) - public static DenseToDenseSetOperation create(Scope scope, Operand set1, Operand set2, String setOperation, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DenseToDenseSetOperation", scope.makeOpName("DenseToDenseSetOperation")); + @Endpoint( + describeByClass = true + ) + public static DenseToDenseSetOperation create(Scope scope, Operand set1, + Operand set2, String setOperation, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DenseToDenseSetOperation"); opBuilder.addInput(set1.asOutput()); opBuilder.addInput(set2.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("set_operation", setOperation); if (options != null) { for (Options opts : options) { @@ -89,51 +99,108 @@ public static DenseToDenseSetOperation create(Scope scope, } } } - return new DenseToDenseSetOperation(opBuilder.build()); + return new DenseToDenseSetOperation<>(opBuilder.build()); } - + /** - * @param validateIndices + * Sets the validateIndices option. + * + * @param validateIndices the validateIndices option + * @return this Options instance. */ public static Options validateIndices(Boolean validateIndices) { return new Options().validateIndices(validateIndices); } - + /** - * 2D indices of a `SparseTensor`. + * Gets resultIndices. + * 2D indices of a {@code SparseTensor}. + * @return resultIndices. */ public Output resultIndices() { return resultIndices; } - + /** - * 1D values of a `SparseTensor`. + * Gets resultValues. + * 1D values of a {@code SparseTensor}. + * @return resultValues. */ public Output resultValues() { return resultValues; } - + /** - * 1D `Tensor` shape of a `SparseTensor`. `result_shape[0...n-1]` is - * the same as the 1st `n-1` dimensions of `set1` and `set2`, `result_shape[n]` - * is the max result set size across all `0...n-1` dimensions. + * Gets resultShape. + * 1D {@code Tensor} shape of a {@code SparseTensor}. {@code result_shape[0...n-1]} is + * the same as the 1st {@code n-1} dimensions of {@code set1} and {@code set2}, {@code result_shape[n]} + * is the max result set size across all {@code 0...n-1} dimensions. + * @return resultShape. */ public Output resultShape() { return resultShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DenseToDenseSetOperation"; - - private Output resultIndices; - private Output resultValues; - private Output resultShape; - - private DenseToDenseSetOperation(Operation operation) { - super(operation); - int outputIdx = 0; - resultIndices = operation.output(outputIdx++); - resultValues = operation.output(outputIdx++); - resultShape = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.DenseToDenseSetOperation} + */ + public static class Options { + private Boolean validateIndices; + + private Options() { + } + + /** + * Sets the validateIndices option. + * + * @param validateIndices the validateIndices option + * @return this Options instance. + */ + public Options validateIndices(Boolean validateIndices) { + this.validateIndices = 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 82da6d7902e..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,85 +17,94 @@ 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; /** - * Applies set operation along last dimension of `Tensor` and `SparseTensor`. - *

- * See SetOperationOp::SetOperationFromContext for values of `set_operation`. - *

- * Input `set2` is a `SparseTensor` represented by `set2_indices`, `set2_values`, - * and `set2_shape`. For `set2` ranked `n`, 1st `n-1` dimensions must be the same - * as `set1`. Dimension `n` contains values in a set, duplicates are allowed but + * Applies set operation along last dimension of {@code Tensor} and {@code SparseTensor}. + * See SetOperationOp::SetOperationFromContext for values of {@code set_operation}. + *

Input {@code set2} is a {@code SparseTensor} represented by {@code set2_indices}, {@code set2_values}, + * and {@code set2_shape}. For {@code set2} ranked {@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. - *

- * If `validate_indices` is `True`, this op validates the order and range of `set2` + *

If {@code validate_indices} is {@code True}, this op validates the order and range of {@code set2} * indices. - *

- * Output `result` is a `SparseTensor` represented by `result_indices`, - * `result_values`, and `result_shape`. For `set1` and `set2` ranked `n`, this - * has rank `n` and the same 1st `n-1` dimensions as `set1` and `set2`. The `nth` - * dimension contains the result of `set_operation` applied to the corresponding - * `[0...n-1]` dimension of `set`. - * - * @param data type for {@code resultValues()} output + *

Output {@code result} is a {@code SparseTensor} represented by {@code result_indices}, + * {@code result_values}, and {@code result_shape}. For {@code set1} and {@code set2} ranked {@code n}, this + * 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}. */ -@Operator(group = "sparse") +@OpMetadata( + opType = DenseToSparseSetOperation.OP_NAME, + inputsClass = DenseToSparseSetOperation.Inputs.class +) +@Operator( + group = "sparse" +) public final class DenseToSparseSetOperation extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.DenseToSparseSetOperation} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param validateIndices - */ - public Options validateIndices(Boolean validateIndices) { - this.validateIndices = validateIndices; - return this; - } - - private Boolean validateIndices; - - private Options() { - } + public static final String OP_NAME = "DenseToSparseSetOperation"; + + private Output resultIndices; + + private Output resultValues; + + private Output resultShape; + + public DenseToSparseSetOperation(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + resultIndices = operation.output(outputIdx++); + resultValues = operation.output(outputIdx++); + resultShape = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DenseToSparseSetOperation operation. - * + * * @param scope current scope - * @param set1 `Tensor` with rank `n`. 1st `n-1` dimensions must be the same as `set2`. - * Dimension `n` contains values in a set, duplicates are allowed but ignored. - * @param set2Indices 2D `Tensor`, indices of a `SparseTensor`. Must be in row-major + * @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 * order. - * @param set2Values 1D `Tensor`, values of a `SparseTensor`. Must be in row-major + * @param set2Values 1D {@code Tensor}, values of a {@code SparseTensor}. Must be in row-major * order. - * @param set2Shape 1D `Tensor`, shape of a `SparseTensor`. `set2_shape[0...n-1]` must - * be the same as the 1st `n-1` dimensions of `set1`, `result_shape[n]` is the - * max set size across `n-1` dimensions. - * @param setOperation - * @param options carries optional attributes values + * @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 attribute + * @param options carries optional attribute values + * @param data type for {@code DenseToSparseSetOperation} output and operands * @return a new instance of DenseToSparseSetOperation */ - @Endpoint(describeByClass = true) - public static DenseToSparseSetOperation create(Scope scope, Operand set1, Operand set2Indices, Operand set2Values, Operand set2Shape, String setOperation, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("DenseToSparseSetOperation", scope.makeOpName("DenseToSparseSetOperation")); + @Endpoint( + describeByClass = true + ) + public static DenseToSparseSetOperation create(Scope scope, Operand set1, + Operand set2Indices, Operand set2Values, Operand set2Shape, + String setOperation, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DenseToSparseSetOperation"); opBuilder.addInput(set1.asOutput()); opBuilder.addInput(set2Indices.asOutput()); opBuilder.addInput(set2Values.asOutput()); opBuilder.addInput(set2Shape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("set_operation", setOperation); if (options != null) { for (Options opts : options) { @@ -104,51 +113,123 @@ public static DenseToSparseSetOperation create(Scope scope, } } } - return new DenseToSparseSetOperation(opBuilder.build()); + return new DenseToSparseSetOperation<>(opBuilder.build()); } - + /** - * @param validateIndices + * Sets the validateIndices option. + * + * @param validateIndices the validateIndices option + * @return this Options instance. */ public static Options validateIndices(Boolean validateIndices) { return new Options().validateIndices(validateIndices); } - + /** - * 2D indices of a `SparseTensor`. + * Gets resultIndices. + * 2D indices of a {@code SparseTensor}. + * @return resultIndices. */ public Output resultIndices() { return resultIndices; } - + /** - * 1D values of a `SparseTensor`. + * Gets resultValues. + * 1D values of a {@code SparseTensor}. + * @return resultValues. */ public Output resultValues() { return resultValues; } - + /** - * 1D `Tensor` shape of a `SparseTensor`. `result_shape[0...n-1]` is - * the same as the 1st `n-1` dimensions of `set1` and `set2`, `result_shape[n]` - * is the max result set size across all `0...n-1` dimensions. + * Gets resultShape. + * 1D {@code Tensor} shape of a {@code SparseTensor}. {@code result_shape[0...n-1]} is + * the same as the 1st {@code n-1} dimensions of {@code set1} and {@code set2}, {@code result_shape[n]} + * is the max result set size across all {@code 0...n-1} dimensions. + * @return resultShape. */ public Output resultShape() { return resultShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DenseToSparseSetOperation"; - - private Output resultIndices; - private Output resultValues; - private Output resultShape; - - private DenseToSparseSetOperation(Operation operation) { - super(operation); - int outputIdx = 0; - resultIndices = operation.output(outputIdx++); - resultValues = operation.output(outputIdx++); - resultShape = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.DenseToSparseSetOperation} + */ + public static class Options { + private Boolean validateIndices; + + private Options() { + } + + /** + * Sets the validateIndices option. + * + * @param validateIndices the validateIndices option + * @return this Options instance. + */ + public Options validateIndices(Boolean validateIndices) { + this.validateIndices = 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 82afc01ea47..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,116 +17,167 @@ 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; /** - * Deserialize `SparseTensor` objects. - *

- * The input `serialized_sparse` must have the shape `[?, ?, ..., ?, 3]` where - * the last dimension stores serialized `SparseTensor` objects and the other N - * dimensions (N >= 0) correspond to a batch. The ranks of the original - * `SparseTensor` objects must all match. When the final `SparseTensor` is - * created, its rank is the rank of the incoming `SparseTensor` objects plus N; + * Deserialize {@code SparseTensor} objects. + * The input {@code serialized_sparse} must have the shape {@code [?, ?, ..., ?, 3]} where + * the last dimension stores serialized {@code SparseTensor} objects and the other N + * dimensions (N >= 0) correspond to a batch. The ranks of the original + * {@code SparseTensor} objects must all match. When the final {@code SparseTensor} is + * created, its rank is the rank of the incoming {@code SparseTensor} objects plus N; * the sparse tensors have been concatenated along new dimensions, one for each * batch. - *

- * The output `SparseTensor` object's shape values for the original dimensions - * are the max across the input `SparseTensor` objects' shape values for the + *

The output {@code SparseTensor} object's shape values for the original dimensions + * are the max across the input {@code SparseTensor} objects' shape values for the * corresponding dimensions. The new dimensions match the size of the batch. - *

- * The input `SparseTensor` objects' indices are assumed ordered in + *

The input {@code SparseTensor} objects' indices are assumed ordered in * standard lexicographic order. If this is not the case, after this - * step run `SparseReorder` to restore index ordering. - *

- * For example, if the serialized input is a `[2 x 3]` matrix representing two - * original `SparseTensor` objects: - *

- * index = [ 0] - * [10] - * [20] - * values = [1, 2, 3] - * shape = [50] - *

- * and - *

- * index = [ 2] - * [10] - * values = [4, 5] - * shape = [30] - *

- * then the final deserialized `SparseTensor` will be: - *

- * index = [0 0] - * [0 10] - * [0 20] - * [1 2] - * [1 10] - * values = [1, 2, 3, 4, 5] - * shape = [2 50] - * - * @param data type for {@code sparseValues()} output + * step run {@code SparseReorder} to restore index ordering. + *

For example, if the serialized input is a {@code [2 x 3]} matrix representing two + * original {@code SparseTensor} objects: + *

+ * index = [ 0]
+ *         [10]
+ *         [20]
+ * values = [1, 2, 3]
+ * shape = [50]
+ * 
+ *

and + *

+ * index = [ 2]
+ *         [10]
+ * values = [4, 5]
+ * shape = [30]
+ * 
+ *

then the final deserialized {@code SparseTensor} will be: + *

+ * index = [0  0]
+ *         [0 10]
+ *         [0 20]
+ *         [1  2]
+ *         [1 10]
+ * values = [1, 2, 3, 4, 5]
+ * shape = [2 50]
+ * 
*/ -@Operator(group = "sparse") +@OpMetadata( + opType = DeserializeSparse.OP_NAME, + inputsClass = DeserializeSparse.Inputs.class +) +@Operator( + group = "sparse" +) public final class DeserializeSparse extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DeserializeSparse"; + + private Output sparseIndices; + + private Output sparseValues; + + private Output sparseShape; + + public DeserializeSparse(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + sparseIndices = operation.output(outputIdx++); + sparseValues = operation.output(outputIdx++); + sparseShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DeserializeSparse operation. - * + * * @param scope current scope - * @param serializedSparse The serialized `SparseTensor` objects. The last dimension + * @param serializedSparse The serialized {@code SparseTensor} objects. The last dimension * must have 3 columns. - * @param dtype The `dtype` of the serialized `SparseTensor` objects. + * @param dtype The {@code dtype} of the serialized {@code SparseTensor} objects. + * @param data type for {@code DeserializeSparse} output and operands * @return a new instance of DeserializeSparse */ - @Endpoint(describeByClass = true) - public static DeserializeSparse create(Scope scope, Operand serializedSparse, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("DeserializeSparse", scope.makeOpName("DeserializeSparse")); + @Endpoint( + describeByClass = true + ) + public static DeserializeSparse create(Scope scope, + Operand serializedSparse, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DeserializeSparse"); opBuilder.addInput(serializedSparse.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new DeserializeSparse(opBuilder.build()); + return new DeserializeSparse<>(opBuilder.build()); } - + /** + * Gets sparseIndices. + * + * @return sparseIndices. */ public Output sparseIndices() { return sparseIndices; } - + /** + * Gets sparseValues. + * + * @return sparseValues. */ public Output sparseValues() { return sparseValues; } - + /** + * Gets sparseShape. + * + * @return sparseShape. */ public Output sparseShape() { return sparseShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DeserializeSparse"; - - private Output sparseIndices; - private Output sparseValues; - private Output sparseShape; - - private DeserializeSparse(Operation operation) { - super(operation); - int outputIdx = 0; - sparseIndices = operation.output(outputIdx++); - sparseValues = operation.output(outputIdx++); - sparseShape = operation.output(outputIdx++); + + @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 94e912c38f8..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,29 +17,48 @@ 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; /** * Applies a sparse gradient to a given accumulator. - *

* Does not add if local_step is smaller than the accumulator's * global_step. */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseAccumulatorApplyGradient.OP_NAME, + inputsClass = SparseAccumulatorApplyGradient.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseAccumulatorApplyGradient extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseAccumulatorApplyGradient"; + + public SparseAccumulatorApplyGradient(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new SparseAccumulatorApplyGradient operation. - * + * * @param scope current scope * @param handle The handle to a accumulator. * @param localStep The local_step value at which the sparse gradient was computed. @@ -53,23 +72,77 @@ public final class SparseAccumulatorApplyGradient extends RawOp { * case the input is ignored during validation. * @return a new instance of SparseAccumulatorApplyGradient */ - @Endpoint(describeByClass = true) - public static SparseAccumulatorApplyGradient create(Scope scope, Operand handle, Operand localStep, Operand gradientIndices, Operand gradientValues, Operand gradientShape, Boolean hasKnownShape) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseAccumulatorApplyGradient", scope.makeOpName("SparseAccumulatorApplyGradient")); + @Endpoint( + describeByClass = true + ) + public static SparseAccumulatorApplyGradient create(Scope scope, Operand handle, + Operand localStep, Operand gradientIndices, + Operand gradientValues, Operand gradientShape, + Boolean hasKnownShape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseAccumulatorApplyGradient"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(localStep.asOutput()); opBuilder.addInput(gradientIndices.asOutput()); opBuilder.addInput(gradientValues.asOutput()); opBuilder.addInput(gradientShape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("has_known_shape", hasKnownShape); return new SparseAccumulatorApplyGradient(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseAccumulatorApplyGradient"; - - private SparseAccumulatorApplyGradient(Operation operation) { - super(operation); + + @OpInputsMetadata( + outputsClass = SparseAccumulatorApplyGradient.class + ) + public static class Inputs extends RawOpInputs { + /** + * 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 f7250020c10..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; @@ -33,72 +39,116 @@ /** * Extracts the average sparse gradient in a SparseConditionalAccumulator. - *

* The op will 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 will return its * 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 */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseAccumulatorTakeGradient.OP_NAME, + inputsClass = SparseAccumulatorTakeGradient.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseAccumulatorTakeGradient extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseAccumulatorTakeGradient"; + + private Output indices; + + private Output values; + + private Output shape; + + public SparseAccumulatorTakeGradient(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + indices = operation.output(outputIdx++); + values = operation.output(outputIdx++); + shape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseAccumulatorTakeGradient operation. - * + * * @param scope current scope * @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 * of the accumulator. + * @param data type for {@code SparseAccumulatorTakeGradient} output and operands * @return a new instance of SparseAccumulatorTakeGradient */ - @Endpoint(describeByClass = true) - public static SparseAccumulatorTakeGradient create(Scope scope, Operand handle, Operand numRequired, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseAccumulatorTakeGradient", scope.makeOpName("SparseAccumulatorTakeGradient")); + @Endpoint( + describeByClass = true + ) + public static SparseAccumulatorTakeGradient create(Scope scope, + Operand handle, Operand numRequired, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseAccumulatorTakeGradient"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(numRequired.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new SparseAccumulatorTakeGradient(opBuilder.build()); + return new SparseAccumulatorTakeGradient<>(opBuilder.build()); } - + /** + * Gets indices. * Indices of the average of the accumulated sparse gradients. + * @return indices. */ public Output indices() { return indices; } - + /** + * Gets values. * Values of the average of the accumulated sparse gradients. + * @return values. */ public Output values() { return values; } - + /** + * Gets shape. * Shape of the average of the accumulated sparse gradients. + * @return shape. */ public Output shape() { return shape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseAccumulatorTakeGradient"; - - private Output indices; - private Output values; - private Output shape; - - private SparseAccumulatorTakeGradient(Operation operation) { - super(operation); - int outputIdx = 0; - indices = operation.output(outputIdx++); - values = operation.output(outputIdx++); - shape = operation.output(outputIdx++); + + @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 7ced04729a4..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,57 +17,87 @@ 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; /** - * Adds two `SparseTensor` objects to produce another `SparseTensor`. - *

- * The input `SparseTensor` objects' indices are assumed ordered in standard + * Adds two {@code SparseTensor} objects to produce another {@code SparseTensor}. + * The input {@code SparseTensor} objects' indices are assumed ordered in standard * lexicographic order. If this is not the case, before this step run - * `SparseReorder` to restore index ordering. - *

- * By default, if two values sum to zero at some index, the output `SparseTensor` + * {@code SparseReorder} to restore index ordering. + *

By default, if two values sum to zero at some index, the output {@code SparseTensor} * would still include that particular location in its index, storing a zero in the - * corresponding value slot. To override this, callers can specify `thresh`, - * indicating that if the sum has a magnitude strictly smaller than `thresh`, its + * corresponding value slot. To override this, callers can specify {@code thresh}, + * indicating that if the sum has a magnitude strictly smaller than {@code thresh}, its * corresponding value and index would then not be included. In particular, - * `thresh == 0` (default) means everything is kept and actual thresholding happens + * {@code thresh == 0} (default) means everything is kept and actual thresholding happens * only for a positive value. - *

- * In the following shapes, `nnz` is the count after taking `thresh` into account. - * - * @param data type for {@code sumValues()} output + *

In the following shapes, {@code nnz} is the count after taking {@code thresh} into account. */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseAdd.OP_NAME, + inputsClass = SparseAdd.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseAdd extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseAdd"; + + private Output sumIndices; + + private Output sumValues; + + private Output sumShape; + + public SparseAdd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + sumIndices = operation.output(outputIdx++); + sumValues = operation.output(outputIdx++); + sumShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseAdd operation. - * + * * @param scope current scope - * @param aIndices 2-D. The `indices` of the first `SparseTensor`, size `[nnz, ndims]` Matrix. - * @param aValues 1-D. The `values` of the first `SparseTensor`, size `[nnz]` Vector. - * @param aShape 1-D. The `shape` of the first `SparseTensor`, size `[ndims]` Vector. - * @param bIndices 2-D. The `indices` of the second `SparseTensor`, size `[nnz, ndims]` Matrix. - * @param bValues 1-D. The `values` of the second `SparseTensor`, size `[nnz]` Vector. - * @param bShape 1-D. The `shape` of the second `SparseTensor`, size `[ndims]` Vector. + * @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. + * @param bIndices 2-D. The {@code indices} of the second {@code SparseTensor}, size {@code [nnz, ndims]} Matrix. + * @param bValues 1-D. The {@code values} of the second {@code SparseTensor}, size {@code [nnz]} Vector. + * @param bShape 1-D. The {@code shape} of the second {@code SparseTensor}, size {@code [ndims]} Vector. * @param thresh 0-D. The magnitude threshold that determines if an output value/index * pair takes space. + * @param data type for {@code SparseAdd} output and operands * @return a new instance of SparseAdd */ - @Endpoint(describeByClass = true) - public static SparseAdd create(Scope scope, Operand aIndices, Operand aValues, Operand aShape, Operand bIndices, Operand bValues, Operand bShape, Operand thresh) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseAdd", scope.makeOpName("SparseAdd")); + @Endpoint( + describeByClass = true + ) + public static SparseAdd create(Scope scope, Operand aIndices, + Operand aValues, Operand aShape, Operand bIndices, Operand bValues, + Operand bShape, Operand thresh) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseAdd"); opBuilder.addInput(aIndices.asOutput()); opBuilder.addInput(aValues.asOutput()); opBuilder.addInput(aShape.asOutput()); @@ -75,40 +105,98 @@ public static SparseAdd create(Scope scope, Operand opBuilder.addInput(bValues.asOutput()); opBuilder.addInput(bShape.asOutput()); opBuilder.addInput(thresh.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SparseAdd(opBuilder.build()); + return new SparseAdd<>(opBuilder.build()); } - + /** + * Gets sumIndices. + * + * @return sumIndices. */ public Output sumIndices() { return sumIndices; } - + /** + * Gets sumValues. + * + * @return sumValues. */ public Output sumValues() { return sumValues; } - + /** + * Gets sumShape. + * + * @return sumShape. */ public Output sumShape() { return sumShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseAdd"; - - private Output sumIndices; - private Output sumValues; - private Output sumShape; - - private SparseAdd(Operation operation) { - super(operation); - int outputIdx = 0; - sumIndices = operation.output(outputIdx++); - sumValues = operation.output(outputIdx++); - sumShape = operation.output(outputIdx++); + + @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 19c9594386c..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,79 +17,139 @@ 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; /** * The gradient operator for the SparseAdd op. - *

* The SparseAdd op calculates A + B, where A, B, and the sum are all represented - * as `SparseTensor` objects. This op takes in the upstream gradient w.r.t. + * 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 aValGrad()} output */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseAddGrad.OP_NAME, + inputsClass = SparseAddGrad.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseAddGrad extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseAddGrad"; + + private Output aValGrad; + + private Output bValGrad; + + public SparseAddGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + aValGrad = operation.output(outputIdx++); + bValGrad = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseAddGrad operation. - * + * * @param scope current scope - * @param backpropValGrad 1-D with shape `[nnz(sum)]`. The gradient with respect to + * @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 `indices` of the `SparseTensor` A, size `[nnz(A), ndims]`. - * @param bIndices 2-D. The `indices` of the `SparseTensor` B, size `[nnz(B), ndims]`. - * @param sumIndices 2-D. The `indices` of the sum `SparseTensor`, size - * `[nnz(sum), ndims]`. + * @param aIndices 2-D. The {@code indices} of the {@code SparseTensor} A, size {@code [nnz(A), ndims]}. + * @param bIndices 2-D. The {@code indices} of the {@code SparseTensor} B, size {@code [nnz(B), ndims]}. + * @param sumIndices 2-D. The {@code indices} of the sum {@code SparseTensor}, size + * {@code [nnz(sum), ndims]}. + * @param data type for {@code SparseAddGrad} output and operands * @return a new instance of SparseAddGrad */ - @Endpoint(describeByClass = true) - public static SparseAddGrad create(Scope scope, Operand backpropValGrad, Operand aIndices, Operand bIndices, Operand sumIndices) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseAddGrad", scope.makeOpName("SparseAddGrad")); + @Endpoint( + describeByClass = true + ) + public static SparseAddGrad create(Scope scope, Operand backpropValGrad, + Operand aIndices, Operand bIndices, Operand sumIndices) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseAddGrad"); opBuilder.addInput(backpropValGrad.asOutput()); opBuilder.addInput(aIndices.asOutput()); opBuilder.addInput(bIndices.asOutput()); opBuilder.addInput(sumIndices.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SparseAddGrad(opBuilder.build()); + return new SparseAddGrad<>(opBuilder.build()); } - + /** - * 1-D with shape `[nnz(A)]`. The gradient with respect to the + * Gets aValGrad. + * 1-D with shape {@code [nnz(A)]}. The gradient with respect to the * non-empty values of A. + * @return aValGrad. */ public Output aValGrad() { return aValGrad; } - + /** - * 1-D with shape `[nnz(B)]`. The gradient with respect to the + * Gets bValGrad. + * 1-D with shape {@code [nnz(B)]}. The gradient with respect to the * non-empty values of B. + * @return bValGrad. */ public Output bValGrad() { return bValGrad; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseAddGrad"; - - private Output aValGrad; - private Output bValGrad; - - private SparseAddGrad(Operation operation) { - super(operation); - int outputIdx = 0; - aValGrad = operation.output(outputIdx++); - bValGrad = operation.output(outputIdx++); + + @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 bea0d8b3c71..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,75 +17,81 @@ 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; /** * Counts the number of occurrences of each value in an integer array. - *

- * Outputs a vector with length `size` and the same dtype as `weights`. If - * `weights` are empty, then index `i` stores the number of times the value `i` is - * counted in `arr`. If `weights` are non-empty, then index `i` stores the sum of - * the value in `weights` at each index where the corresponding value in `arr` is - * `i`. - *

- * Values in `arr` outside of the range [0, size) are ignored. - * - * @param data type for {@code output()} output + * Outputs a vector with length {@code size} and the same dtype as {@code weights}. If + * {@code weights} are empty, then index {@code i} stores the number of times the value {@code i} is + * counted in {@code arr}. If {@code weights} are non-empty, then index {@code i} stores the sum of + * 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. */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseBincount.OP_NAME, + inputsClass = SparseBincount.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseBincount extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.SparseBincount} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param binaryOutput bool; Whether the kernel should count the appearance or number of occurrences. - */ - public Options binaryOutput(Boolean binaryOutput) { - this.binaryOutput = binaryOutput; - return this; - } - - private Boolean binaryOutput; - - private Options() { - } + public static final String OP_NAME = "SparseBincount"; + + private Output output; + + public SparseBincount(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseBincount operation. - * + * * @param scope current scope - * @param indices 2D int64 `Tensor`. - * @param values 1D int `Tensor`. - * @param denseShape 1D int64 `Tensor`. - * @param size non-negative int scalar `Tensor`. - * @param weights is an int32, int64, float32, or float64 `Tensor` with the same - * shape as `input`, or a length-0 `Tensor`, in which case it acts as all weights + * @param indices 2D int64 {@code Tensor}. + * @param values 1D int {@code Tensor}. + * @param denseShape 1D int64 {@code Tensor}. + * @param sizeOutput non-negative int scalar {@code Tensor}. + * @param weights 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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseBincount} output and operands + * @param data type for {@code SparseBincount} output and operands * @return a new instance of SparseBincount */ - @Endpoint(describeByClass = true) - public static SparseBincount create(Scope scope, Operand indices, Operand values, Operand denseShape, Operand size, Operand weights, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseBincount", scope.makeOpName("SparseBincount")); + @Endpoint( + describeByClass = true + ) + public static SparseBincount create(Scope scope, + Operand indices, Operand values, Operand denseShape, Operand sizeOutput, + Operand weights, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseBincount"); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(values.asOutput()); opBuilder.addInput(denseShape.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder.addInput(weights.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.binaryOutput != null) { @@ -93,37 +99,112 @@ public static SparseBincount create(Sc } } } - return new SparseBincount(opBuilder.build()); + return new SparseBincount<>(opBuilder.build()); } - + /** + * Sets the binaryOutput option. + * * @param binaryOutput bool; Whether the kernel should count the appearance or number of occurrences. + * @return this Options instance. */ public static Options binaryOutput(Boolean binaryOutput) { return new Options().binaryOutput(binaryOutput); } - + /** - * 1D `Tensor` with length equal to `size` or 2D `Tensor` with [batch_size, `size`]. + * Gets output. + * 1D {@code Tensor} with length equal to {@code size} or 2D {@code Tensor} with [batch_size, {@code size}]. * The counts or summed weights for each value in the range [0, size). + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseBincount"; - - private Output output; - - private SparseBincount(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseBincount} + */ + public static class Options { + private Boolean binaryOutput; + + private Options() { + } + + /** + * Sets the binaryOutput option. + * + * @param binaryOutput bool; Whether the kernel should count the appearance or number of occurrences. + * @return this Options instance. + */ + public Options binaryOutput(Boolean binaryOutput) { + this.binaryOutput = 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 0b3ac3389e5..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,123 +17,188 @@ 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; /** - * Concatenates a list of `SparseTensor` along the specified dimension. - *

+ * Concatenates a list of {@code SparseTensor} along the specified dimension. * Concatenation is with respect to the dense versions of these sparse tensors. - * It is assumed that each input is a `SparseTensor` whose elements are ordered + * It is assumed that each input is a {@code SparseTensor} whose elements are ordered * along increasing dimension number. - *

- * All inputs' shapes must match, except for the concat dimension. The - * `indices`, `values`, and `shapes` lists must have the same length. - *

- * The output shape is identical to the inputs', except along the concat + *

All inputs' shapes must match, except for the concat dimension. The + * {@code indices}, {@code values}, and {@code shapes} lists must have the same length. + *

The output shape is identical to the inputs', except along the concat * dimension, where it is the sum of the inputs' sizes along that dimension. - *

- * The output elements will be resorted to preserve the sort order along + *

The output elements will be resorted to preserve the sort order along * increasing dimension number. - *

- * This op runs in `O(M log M)` time, where `M` is the total number of non-empty + *

This op runs in {@code O(M log M)} time, where {@code M} is the total number of non-empty * values across all inputs. This is due to the need for an internal sort in * order to concatenate efficiently across an arbitrary dimension. - *

- * For example, if `concat_dim = 1` and the inputs are - *

- * sp_inputs[0]: shape = [2, 3] - * [0, 2]: "a" - * [1, 0]: "b" - * [1, 1]: "c" - *

- * sp_inputs[1]: shape = [2, 4] - * [0, 1]: "d" - * [0, 2]: "e" - *

- * then the output will be - *

- * shape = [2, 7] - * [0, 2]: "a" - * [0, 4]: "d" - * [0, 5]: "e" - * [1, 0]: "b" - * [1, 1]: "c" - *

- * Graphically this is equivalent to doing - *

- * [ a] concat [ d e ] = [ a d e ] - * [b c ] [ ] [b c ] - * - * @param data type for {@code outputValues()} output + *

For example, if {@code concat_dim = 1} and the inputs are + *

+ * sp_inputs[0]: shape = [2, 3]
+ * [0, 2]: "a"
+ * [1, 0]: "b"
+ * [1, 1]: "c"
+ *
+ * sp_inputs[1]: shape = [2, 4]
+ * [0, 1]: "d"
+ * [0, 2]: "e"
+ * 
+ *

then the output will be + *

+ * shape = [2, 7]
+ * [0, 2]: "a"
+ * [0, 4]: "d"
+ * [0, 5]: "e"
+ * [1, 0]: "b"
+ * [1, 1]: "c"
+ * 
+ *

Graphically this is equivalent to doing + *

+ * [    a] concat [  d e  ] = [    a   d e  ]
+ * [b c  ]        [       ]   [b c          ]
+ * 
*/ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseConcat.OP_NAME, + inputsClass = SparseConcat.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseConcat extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseConcat"; + + private Output outputIndices; + + private Output outputValues; + + private Output outputShape; + + public SparseConcat(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + outputShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseConcat operation. - * + * * @param scope current scope - * @param indices 2-D. Indices of each input `SparseTensor`. - * @param values 1-D. Non-empty values of each `SparseTensor`. - * @param shapes 1-D. Shapes of each `SparseTensor`. + * @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}. * @param concatDim Dimension to concatenate along. Must be in range [-rank, rank), - * where rank is the number of dimensions in each input `SparseTensor`. + * where rank is the number of dimensions in each input {@code SparseTensor}. + * @param data type for {@code SparseConcat} output and operands * @return a new instance of SparseConcat */ - @Endpoint(describeByClass = true) - public static SparseConcat create(Scope scope, Iterable> indices, Iterable> values, Iterable> shapes, Long concatDim) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseConcat", scope.makeOpName("SparseConcat")); + @Endpoint( + describeByClass = true + ) + public static SparseConcat create(Scope scope, + Iterable> indices, Iterable> values, + Iterable> shapes, Long concatDim) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseConcat"); opBuilder.addInputList(Operands.asOutputs(indices)); opBuilder.addInputList(Operands.asOutputs(values)); opBuilder.addInputList(Operands.asOutputs(shapes)); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("concat_dim", concatDim); - return new SparseConcat(opBuilder.build()); + return new SparseConcat<>(opBuilder.build()); } - + /** - * 2-D. Indices of the concatenated `SparseTensor`. + * Gets outputIndices. + * 2-D. Indices of the concatenated {@code SparseTensor}. + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** - * 1-D. Non-empty values of the concatenated `SparseTensor`. + * Gets outputValues. + * 1-D. Non-empty values of the concatenated {@code SparseTensor}. + * @return outputValues. */ public Output outputValues() { return outputValues; } - + /** - * 1-D. Shape of the concatenated `SparseTensor`. + * Gets outputShape. + * 1-D. Shape of the concatenated {@code SparseTensor}. + * @return outputShape. */ public Output outputShape() { return outputShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseConcat"; - - private Output outputIndices; - private Output outputValues; - private Output outputShape; - - private SparseConcat(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - outputShape = operation.output(outputIdx++); + + @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 e012cb631c8..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,15 +26,18 @@ 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 conditional accumulator for aggregating sparse gradients. - *

* The accumulator accepts gradients marked with local_step greater or * equal to the most recent global_step known to the accumulator. The * average can be extracted from the accumulator, provided sufficient @@ -40,61 +45,43 @@ * resets the aggregate to 0, and increments the global_step recorded by * the accumulator. */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseConditionalAccumulator.OP_NAME, + inputsClass = SparseConditionalAccumulator.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseConditionalAccumulator extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.SparseConditionalAccumulator} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this accumulator is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this accumulator will be shared under the given name - * across multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param reductionType - */ - public Options reductionType(String reductionType) { - this.reductionType = reductionType; - return this; - } - - private String container; - private String sharedName; - private String reductionType; - - private Options() { - } + public static final String OP_NAME = "SparseConditionalAccumulator"; + + private Output handle; + + public SparseConditionalAccumulator(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseConditionalAccumulator operation. - * + * * @param scope current scope * @param dtype The type of the value being accumulated. * @param shape The shape of the values. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseConditionalAccumulator} output and operands * @return a new instance of SparseConditionalAccumulator */ - @Endpoint(describeByClass = true) - public static SparseConditionalAccumulator create(Scope scope, Class dtype, Shape shape, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseConditionalAccumulator", scope.makeOpName("SparseConditionalAccumulator")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static SparseConditionalAccumulator create(Scope scope, Class dtype, + Shape shape, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseConditionalAccumulator"); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); opBuilder.setAttr("shape", shape); if (options != null) { @@ -112,50 +99,141 @@ public static SparseConditionalAccumulator create(Scope scope, } return new SparseConditionalAccumulator(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this accumulator is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this accumulator will be shared under the given name * across multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * @param reductionType + * Sets the reductionType option. + * + * @param reductionType the reductionType option + * @return this Options instance. */ public static Options reductionType(String reductionType) { return new Options().reductionType(reductionType); } - + /** + * Gets handle. * The handle to the accumulator. + * @return handle. */ public Output handle() { return handle; } - + @Override public Output asOutput() { return handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseConditionalAccumulator"; - - private Output handle; - - private SparseConditionalAccumulator(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseConditionalAccumulator} + */ + public static class Options { + private String container; + + private String sharedName; + + private String reductionType; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this accumulator is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this accumulator will be shared under the given name + * across multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the reductionType option. + * + * @param reductionType the reductionType option + * @return this Options instance. + */ + public Options reductionType(String reductionType) { + this.reductionType = 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 3133f02292a..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,57 +17,57 @@ 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 outputValues()} output + * Counts the number of times each value occurs in the input. */ +@OpMetadata( + opType = SparseCountSparseOutput.OP_NAME, + inputsClass = SparseCountSparseOutput.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseCountSparseOutput extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.SparseCountSparseOutput} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param minlength Minimum value to count. Can be set to -1 for no minimum. - */ - public Options minlength(Long minlength) { - this.minlength = minlength; - return this; - } - - /** - * @param maxlength Maximum value to count. Can be set to -1 for no maximum. - */ - public Options maxlength(Long maxlength) { - this.maxlength = maxlength; - return this; - } - - private Long minlength; - private Long maxlength; - - private Options() { - } + public static final String OP_NAME = "SparseCountSparseOutput"; + + private Output outputIndices; + + private Output outputValues; + + private Output outputDenseShape; + + public SparseCountSparseOutput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + outputDenseShape = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseCountSparseOutput operation. - * + * * @param scope current scope * @param indices Tensor containing the indices of the sparse tensor to count. * @param values Tensor containing values of the sparse tensor to count. @@ -75,17 +75,21 @@ private Options() { * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseCountSparseOutput} output and operands * @return a new instance of SparseCountSparseOutput */ - @Endpoint(describeByClass = true) - public static SparseCountSparseOutput create(Scope scope, Operand indices, Operand values, Operand denseShape, Operand weights, Boolean binaryOutput, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseCountSparseOutput", scope.makeOpName("SparseCountSparseOutput")); + @Endpoint( + describeByClass = true + ) + public static SparseCountSparseOutput create(Scope scope, + Operand indices, Operand values, Operand denseShape, + Operand weights, Boolean binaryOutput, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseCountSparseOutput"); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(values.asOutput()); opBuilder.addInput(denseShape.asOutput()); opBuilder.addInput(weights.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("binary_output", binaryOutput); if (options != null) { for (Options opts : options) { @@ -97,56 +101,152 @@ public static SparseCountSparseOutput create(Scope scope, } } } - return new SparseCountSparseOutput(opBuilder.build()); + return new SparseCountSparseOutput<>(opBuilder.build()); } - + /** + * Sets the minlength option. + * * @param minlength Minimum value to count. Can be set to -1 for no minimum. + * @return this Options instance. */ public static Options minlength(Long minlength) { return new Options().minlength(minlength); } - + /** + * Sets the maxlength option. + * * @param maxlength Maximum value to count. Can be set to -1 for no maximum. + * @return this Options instance. */ public static Options maxlength(Long maxlength) { return new Options().maxlength(maxlength); } - + /** + * Gets outputIndices. * Indices tensor for the resulting sparse tensor object. + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** + * Gets outputValues. * Values tensor for the resulting sparse tensor object. + * @return outputValues. */ public Output outputValues() { return outputValues; } - + /** + * Gets outputDenseShape. * Shape tensor for the resulting sparse tensor object. + * @return outputDenseShape. */ public Output outputDenseShape() { return outputDenseShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseCountSparseOutput"; - - private Output outputIndices; - private Output outputValues; - private Output outputDenseShape; - - private SparseCountSparseOutput(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - outputDenseShape = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseCountSparseOutput} + */ + public static class Options { + private Long minlength; + + private Long maxlength; + + private Options() { + } + + /** + * Sets the minlength option. + * + * @param minlength Minimum value to count. Can be set to -1 for no minimum. + * @return this Options instance. + */ + public Options minlength(Long minlength) { + this.minlength = minlength; + return this; + } + + /** + * Sets the maxlength option. + * + * @param maxlength Maximum value to count. Can be set to -1 for no maximum. + * @return this Options instance. + */ + public Options maxlength(Long maxlength) { + this.maxlength = 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 93b76d3e56f..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,118 +17,201 @@ 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; /** * Generates sparse cross from a list of sparse and dense tensors. - *

- * The op takes two lists, one of 2D `SparseTensor` and one of 2D `Tensor`, each - * representing features of one feature column. It outputs a 2D `SparseTensor` with + * The op takes two lists, one of 2D {@code SparseTensor} and one of 2D {@code Tensor}, each + * representing features of one feature column. It outputs a 2D {@code SparseTensor} with * the batchwise crosses of these features. - *

- * For example, if the inputs are - *

- * inputs[0]: SparseTensor with shape = [2, 2] - * [0, 0]: "a" - * [1, 0]: "b" - * [1, 1]: "c" - *

- * inputs[1]: SparseTensor with shape = [2, 1] - * [0, 0]: "d" - * [1, 0]: "e" - *

- * inputs[2]: Tensor [["f"], ["g"]] - *

- * then the output will be - *

- * shape = [2, 2] - * [0, 0]: "a_X_d_X_f" - * [1, 0]: "b_X_e_X_g" - * [1, 1]: "c_X_e_X_g" - *

- * if hashed_output=true then the output will be - *

- * shape = [2, 2] - * [0, 0]: FingerprintCat64( - * Fingerprint64("f"), FingerprintCat64( - * Fingerprint64("d"), Fingerprint64("a"))) - * [1, 0]: FingerprintCat64( - * Fingerprint64("g"), FingerprintCat64( - * Fingerprint64("e"), Fingerprint64("b"))) - * [1, 1]: FingerprintCat64( - * Fingerprint64("g"), FingerprintCat64( - * Fingerprint64("e"), Fingerprint64("c"))) + *

For example, if the inputs are + *

+ * inputs[0]: SparseTensor with shape = [2, 2]
+ * [0, 0]: "a"
+ * [1, 0]: "b"
+ * [1, 1]: "c"
+ *
+ * inputs[1]: SparseTensor with shape = [2, 1]
+ * [0, 0]: "d"
+ * [1, 0]: "e"
+ *
+ * inputs[2]: Tensor [["f"], ["g"]]
+ * 
+ *

then the output will be + *

+ * shape = [2, 2]
+ * [0, 0]: "a_X_d_X_f"
+ * [1, 0]: "b_X_e_X_g"
+ * [1, 1]: "c_X_e_X_g"
+ * 
+ *

if hashed_output=true then the output will be + *

+ * shape = [2, 2]
+ * [0, 0]: FingerprintCat64(
+ *             Fingerprint64("f"), FingerprintCat64(
+ *                 Fingerprint64("d"), Fingerprint64("a")))
+ * [1, 0]: FingerprintCat64(
+ *             Fingerprint64("g"), FingerprintCat64(
+ *                 Fingerprint64("e"), Fingerprint64("b")))
+ * [1, 1]: FingerprintCat64(
+ *             Fingerprint64("g"), FingerprintCat64(
+ *                 Fingerprint64("e"), Fingerprint64("c")))
+ * 
*/ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseCross.OP_NAME, + inputsClass = SparseCross.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseCross extends RawOp { - /** - * Factory method to create a class wrapping a new SparseCross operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseCrossV2"; + + private Output outputIndices; + + private Output outputValues; + + private Output outputShape; + + public SparseCross(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + outputShape = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new SparseCrossV2 operation. + * * @param scope current scope - * @param indices 2-D. Indices of each input `SparseTensor`. - * @param values 1-D. values of each `SparseTensor`. - * @param shapes 1-D. Shapes of each `SparseTensor`. - * @param denseInputs 2-D. Columns represented by dense `Tensor`. + * @param indices 2-D. Indices of each input {@code SparseTensor}. + * @param values 1-D. values of each {@code SparseTensor}. + * @param shapes 1-D. Shapes of each {@code SparseTensor}. + * @param denseInputs 2-D. Columns represented by dense {@code Tensor}. * @param sep string used when joining a list of string inputs, can be used as separator later. * @return a new instance of SparseCross */ - @Endpoint(describeByClass = true) - public static SparseCross create(Scope scope, Iterable> indices, Iterable> values, Iterable> shapes, Iterable> denseInputs, Operand sep) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseCrossV2", scope.makeOpName("SparseCross")); + @Endpoint( + describeByClass = true + ) + public static SparseCross create(Scope scope, Iterable> indices, + Iterable> values, Iterable> shapes, + Iterable> denseInputs, Operand sep) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseCross"); opBuilder.addInputList(Operands.asOutputs(indices)); opBuilder.addInputList(Operands.asOutputs(values)); opBuilder.addInputList(Operands.asOutputs(shapes)); opBuilder.addInputList(Operands.asOutputs(denseInputs)); opBuilder.addInput(sep.asOutput()); - opBuilder = scope.apply(opBuilder); return new SparseCross(opBuilder.build()); } - + /** - * 2-D. Indices of the concatenated `SparseTensor`. + * Gets outputIndices. + * 2-D. Indices of the concatenated {@code SparseTensor}. + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** + * Gets outputValues. * 1-D. Non-empty values of the concatenated or hashed - * `SparseTensor`. + * {@code SparseTensor}. + * @return outputValues. */ public Output outputValues() { return outputValues; } - + /** - * 1-D. Shape of the concatenated `SparseTensor`. + * Gets outputShape. + * 1-D. Shape of the concatenated {@code SparseTensor}. + * @return outputShape. */ public Output outputShape() { return outputShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseCrossV2"; - - private Output outputIndices; - private Output outputValues; - private Output outputShape; - - private SparseCross(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - outputShape = operation.output(outputIdx++); + + @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 c3a3b987da7..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,78 +17,112 @@ 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; /** * Generates sparse cross from a list of sparse and dense tensors. - *

- * The op takes two lists, one of 2D `SparseTensor` and one of 2D `Tensor`, each - * representing features of one feature column. It outputs a 2D `SparseTensor` with + * The op takes two lists, one of 2D {@code SparseTensor} and one of 2D {@code Tensor}, each + * representing features of one feature column. It outputs a 2D {@code SparseTensor} with * the batchwise crosses of these features. - *

- * For example, if the inputs are - *

- * inputs[0]: SparseTensor with shape = [2, 2] - * [0, 0]: "a" - * [1, 0]: "b" - * [1, 1]: "c" - *

- * inputs[1]: SparseTensor with shape = [2, 1] - * [0, 0]: "d" - * [1, 0]: "e" - *

- * inputs[2]: Tensor [["f"], ["g"]] - *

- * then the output will be - *

- * shape = [2, 2] - * [0, 0]: "a_X_d_X_f" - * [1, 0]: "b_X_e_X_g" - * [1, 1]: "c_X_e_X_g" - *

- * if hashed_output=true then the output will be - *

- * shape = [2, 2] - * [0, 0]: FingerprintCat64( - * Fingerprint64("f"), FingerprintCat64( - * Fingerprint64("d"), Fingerprint64("a"))) - * [1, 0]: FingerprintCat64( - * Fingerprint64("g"), FingerprintCat64( - * Fingerprint64("e"), Fingerprint64("b"))) - * [1, 1]: FingerprintCat64( - * Fingerprint64("g"), FingerprintCat64( - * Fingerprint64("e"), Fingerprint64("c"))) + *

For example, if the inputs are + *

+ * inputs[0]: SparseTensor with shape = [2, 2]
+ * [0, 0]: "a"
+ * [1, 0]: "b"
+ * [1, 1]: "c"
+ *
+ * inputs[1]: SparseTensor with shape = [2, 1]
+ * [0, 0]: "d"
+ * [1, 0]: "e"
+ *
+ * inputs[2]: Tensor [["f"], ["g"]]
+ * 
+ *

then the output will be + *

+ * shape = [2, 2]
+ * [0, 0]: "a_X_d_X_f"
+ * [1, 0]: "b_X_e_X_g"
+ * [1, 1]: "c_X_e_X_g"
+ * 
+ *

if hashed_output=true then the output will be + *

+ * shape = [2, 2]
+ * [0, 0]: FingerprintCat64(
+ *             Fingerprint64("f"), FingerprintCat64(
+ *                 Fingerprint64("d"), Fingerprint64("a")))
+ * [1, 0]: FingerprintCat64(
+ *             Fingerprint64("g"), FingerprintCat64(
+ *                 Fingerprint64("e"), Fingerprint64("b")))
+ * [1, 1]: FingerprintCat64(
+ *             Fingerprint64("g"), FingerprintCat64(
+ *                 Fingerprint64("e"), Fingerprint64("c")))
+ * 
*/ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseCrossHashed.OP_NAME, + inputsClass = SparseCrossHashed.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseCrossHashed extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseCrossHashed"; + + private Output outputIndices; + + private Output outputValues; + + private Output outputShape; + + public SparseCrossHashed(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + outputShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseCrossHashed operation. - * + * * @param scope current scope - * @param indices 2-D. Indices of each input `SparseTensor`. - * @param values 1-D. values of each `SparseTensor`. - * @param shapes 1-D. Shapes of each `SparseTensor`. - * @param denseInputs 2-D. Columns represented by dense `Tensor`. + * @param indices 2-D. Indices of each input {@code SparseTensor}. + * @param values 1-D. values of each {@code SparseTensor}. + * @param shapes 1-D. Shapes of each {@code SparseTensor}. + * @param denseInputs 2-D. Columns represented by dense {@code Tensor}. * @param numBuckets It is used if hashed_output is true. - * output = hashed_value%num_buckets if num_buckets > 0 else hashed_value. + * output = hashed_value%num_buckets if num_buckets > 0 else hashed_value. * @param strongHash boolean, if true, siphash with salt will be used instead of farmhash. * @param salt Specify the salt that will be used by the siphash function. * @return a new instance of SparseCrossHashed */ - @Endpoint(describeByClass = true) - public static SparseCrossHashed create(Scope scope, Iterable> indices, Iterable> values, Iterable> shapes, Iterable> denseInputs, Operand numBuckets, Operand strongHash, Operand salt) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseCrossHashed", scope.makeOpName("SparseCrossHashed")); + @Endpoint( + describeByClass = true + ) + public static SparseCrossHashed create(Scope scope, Iterable> indices, + Iterable> values, Iterable> shapes, + Iterable> denseInputs, Operand numBuckets, Operand strongHash, + Operand salt) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseCrossHashed"); opBuilder.addInputList(Operands.asOutputs(indices)); opBuilder.addInputList(Operands.asOutputs(values)); opBuilder.addInputList(Operands.asOutputs(shapes)); @@ -96,44 +130,107 @@ public static SparseCrossHashed create(Scope scope, Iterable> in opBuilder.addInput(numBuckets.asOutput()); opBuilder.addInput(strongHash.asOutput()); opBuilder.addInput(salt.asOutput()); - opBuilder = scope.apply(opBuilder); return new SparseCrossHashed(opBuilder.build()); } - + /** - * 2-D. Indices of the concatenated `SparseTensor`. + * Gets outputIndices. + * 2-D. Indices of the concatenated {@code SparseTensor}. + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** + * Gets outputValues. * 1-D. Non-empty values of the concatenated or hashed - * `SparseTensor`. + * {@code SparseTensor}. + * @return outputValues. */ public Output outputValues() { return outputValues; } - + /** - * 1-D. Shape of the concatenated `SparseTensor`. + * Gets outputShape. + * 1-D. Shape of the concatenated {@code SparseTensor}. + * @return outputShape. */ public Output outputShape() { return outputShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseCrossHashed"; - - private Output outputIndices; - private Output outputValues; - private Output outputShape; - - private SparseCrossHashed(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - outputShape = operation.output(outputIdx++); + + @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 600c582c56d..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,76 +17,131 @@ 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; /** * Adds up a SparseTensor and a dense Tensor, using these special rules: - *

* (1) Broadcasts the dense side to have the same shape as the sparse side, if - * eligible; + * eligible; * (2) Then, only the dense values pointed to by the indices of the SparseTensor - * participate in the cwise addition. - *

- * By these rules, the result is a logical SparseTensor with exactly the same + * participate in the cwise addition. + *

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 */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseDenseCwiseAdd.OP_NAME, + inputsClass = SparseDenseCwiseAdd.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseDenseCwiseAdd extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseDenseCwiseAdd"; + + private Output output; + + public SparseDenseCwiseAdd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseDenseCwiseAdd operation. - * + * * @param scope current scope - * @param spIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @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. `N` non-empty values corresponding to `sp_indices`. + * @param spValues 1-D. {@code N} non-empty values corresponding to {@code sp_indices}. * @param spShape 1-D. Shape of the input SparseTensor. - * @param dense `R`-D. The dense Tensor operand. + * @param dense {@code R}-D. The dense Tensor operand. + * @param data type for {@code SparseDenseCwiseAdd} output and operands * @return a new instance of SparseDenseCwiseAdd */ - @Endpoint(describeByClass = true) - public static SparseDenseCwiseAdd create(Scope scope, Operand spIndices, Operand spValues, Operand spShape, Operand dense) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseDenseCwiseAdd", scope.makeOpName("SparseDenseCwiseAdd")); + @Endpoint( + describeByClass = true + ) + public static SparseDenseCwiseAdd create(Scope scope, + Operand spIndices, Operand spValues, Operand spShape, Operand dense) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseDenseCwiseAdd"); opBuilder.addInput(spIndices.asOutput()); opBuilder.addInput(spValues.asOutput()); opBuilder.addInput(spShape.asOutput()); opBuilder.addInput(dense.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SparseDenseCwiseAdd(opBuilder.build()); + return new SparseDenseCwiseAdd<>(opBuilder.build()); } - + /** - * 1-D. The `N` values that are operated on. + * Gets output. + * 1-D. The {@code N} values that are operated on. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseDenseCwiseAdd"; - - private Output output; - - private SparseDenseCwiseAdd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 900f8ef6b64..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,70 +17,126 @@ 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; /** * Component-wise divides a SparseTensor by a dense Tensor. - *

- * Limitation: this Op only broadcasts the dense side to the sparse side, but not + * Limitation: this Op only broadcasts the dense side to the sparse side, but not * the other direction. - * - * @param data type for {@code output()} output */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseDenseCwiseDiv.OP_NAME, + inputsClass = SparseDenseCwiseDiv.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseDenseCwiseDiv extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseDenseCwiseDiv"; + + private Output output; + + public SparseDenseCwiseDiv(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseDenseCwiseDiv operation. - * + * * @param scope current scope - * @param spIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @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. `N` non-empty values corresponding to `sp_indices`. + * @param spValues 1-D. {@code N} non-empty values corresponding to {@code sp_indices}. * @param spShape 1-D. Shape of the input SparseTensor. - * @param dense `R`-D. The dense Tensor operand. + * @param dense {@code R}-D. The dense Tensor operand. + * @param data type for {@code SparseDenseCwiseDiv} output and operands * @return a new instance of SparseDenseCwiseDiv */ - @Endpoint(describeByClass = true) - public static SparseDenseCwiseDiv create(Scope scope, Operand spIndices, Operand spValues, Operand spShape, Operand dense) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseDenseCwiseDiv", scope.makeOpName("SparseDenseCwiseDiv")); + @Endpoint( + describeByClass = true + ) + public static SparseDenseCwiseDiv create(Scope scope, + Operand spIndices, Operand spValues, Operand spShape, Operand dense) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseDenseCwiseDiv"); opBuilder.addInput(spIndices.asOutput()); opBuilder.addInput(spValues.asOutput()); opBuilder.addInput(spShape.asOutput()); opBuilder.addInput(dense.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SparseDenseCwiseDiv(opBuilder.build()); + return new SparseDenseCwiseDiv<>(opBuilder.build()); } - + /** - * 1-D. The `N` values that are operated on. + * Gets output. + * 1-D. The {@code N} values that are operated on. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseDenseCwiseDiv"; - - private Output output; - - private SparseDenseCwiseDiv(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 85e13890111..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,74 +17,129 @@ 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; /** * Component-wise multiplies a SparseTensor by a dense Tensor. - *

* The output locations corresponding to the implicitly zero elements in the sparse * tensor will be zero (i.e., will not take up storage space), regardless of the - * contents of the dense tensor (even if it's +/-INF and that INF0 == NaN). - *

- * Limitation*: this Op only broadcasts the dense side to the sparse side, but not + * 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 */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseDenseCwiseMul.OP_NAME, + inputsClass = SparseDenseCwiseMul.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseDenseCwiseMul extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseDenseCwiseMul"; + + private Output output; + + public SparseDenseCwiseMul(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseDenseCwiseMul operation. - * + * * @param scope current scope - * @param spIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @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. `N` non-empty values corresponding to `sp_indices`. + * @param spValues 1-D. {@code N} non-empty values corresponding to {@code sp_indices}. * @param spShape 1-D. Shape of the input SparseTensor. - * @param dense `R`-D. The dense Tensor operand. + * @param dense {@code R}-D. The dense Tensor operand. + * @param data type for {@code SparseDenseCwiseMul} output and operands * @return a new instance of SparseDenseCwiseMul */ - @Endpoint(describeByClass = true) - public static SparseDenseCwiseMul create(Scope scope, Operand spIndices, Operand spValues, Operand spShape, Operand dense) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseDenseCwiseMul", scope.makeOpName("SparseDenseCwiseMul")); + @Endpoint( + describeByClass = true + ) + public static SparseDenseCwiseMul create(Scope scope, + Operand spIndices, Operand spValues, Operand spShape, Operand dense) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseDenseCwiseMul"); opBuilder.addInput(spIndices.asOutput()); opBuilder.addInput(spValues.asOutput()); opBuilder.addInput(spShape.asOutput()); opBuilder.addInput(dense.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SparseDenseCwiseMul(opBuilder.build()); + return new SparseDenseCwiseMul<>(opBuilder.build()); } - + /** - * 1-D. The `N` values that are operated on. + * Gets output. + * 1-D. The {@code N} values that are operated on. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseDenseCwiseMul"; - - private Output output; - - private SparseDenseCwiseMul(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 47a7d90793e..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,128 +17,194 @@ 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; /** - * Fills empty rows in the input 2-D `SparseTensor` with a default value. - *

- * The input `SparseTensor` is represented via the tuple of inputs - * (`indices`, `values`, `dense_shape`). The output `SparseTensor` has the - * same `dense_shape` but with indices `output_indices` and values - * `output_values`. - *

- * This op inserts a single entry for every row that doesn't have any values. - * The index is created as `[row, 0, ..., 0]` and the inserted value - * is `default_value`. - *

- * For example, suppose `sp_input` has shape `[5, 6]` and non-empty values: - *

- * [0, 1]: a - * [0, 3]: b - * [2, 0]: c - * [3, 1]: d - *

- * Rows 1 and 4 are empty, so the output will be of shape `[5, 6]` with values: - *

- * [0, 1]: a - * [0, 3]: b - * [1, 0]: default_value - * [2, 0]: c - * [3, 1]: d - * [4, 0]: default_value - *

- * The output `SparseTensor` will be in row-major order and will have the + * Fills empty rows in the input 2-D {@code SparseTensor} with a default value. + * The input {@code SparseTensor} is represented via the tuple of inputs + * ({@code indices}, {@code values}, {@code dense_shape}). The output {@code SparseTensor} has the + * same {@code dense_shape} but with indices {@code output_indices} and values + * {@code output_values}. + *

This op inserts a single entry for every row that doesn't have any values. + * The index is created as {@code [row, 0, ..., 0]} and the inserted value + * is {@code default_value}. + *

For example, suppose {@code sp_input} has shape {@code [5, 6]} and non-empty values: + *

+ * [0, 1]: a
+ * [0, 3]: b
+ * [2, 0]: c
+ * [3, 1]: d
+ * 
+ *

Rows 1 and 4 are empty, so the output will be of shape {@code [5, 6]} with values: + *

+ * [0, 1]: a
+ * [0, 3]: b
+ * [1, 0]: default_value
+ * [2, 0]: c
+ * [3, 1]: d
+ * [4, 0]: default_value
+ * 
+ *

The output {@code SparseTensor} will be in row-major order and will have the * same shape as the input. - *

- * This op also returns an indicator vector shaped `[dense_shape[0]]` such that - *

- * empty_row_indicator[i] = True iff row i was an empty row. - *

- * And a reverse index map vector shaped `[indices.shape[0]]` that is used during + *

This op also returns an indicator vector shaped {@code [dense_shape[0]]} such that + *

+ * empty_row_indicator[i] = True iff row i was an empty row.
+ * 
+ *

And a reverse index map vector shaped {@code [indices.shape[0]]} that is used during * backpropagation, - *

- * reverse_index_map[j] = out_j s.t. indices[j, :] == output_indices[out_j, :] - * - * @param data type for {@code outputValues()} output + *

+ * reverse_index_map[j] = out_j s.t. indices[j, :] == output_indices[out_j, :]
+ * 
*/ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseFillEmptyRows.OP_NAME, + inputsClass = SparseFillEmptyRows.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseFillEmptyRows extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseFillEmptyRows"; + + private Output outputIndices; + + private Output outputValues; + + private Output emptyRowIndicator; + + private Output reverseIndexMap; + + public SparseFillEmptyRows(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + emptyRowIndicator = operation.output(outputIdx++); + reverseIndexMap = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseFillEmptyRows operation. - * + * * @param scope current scope * @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. - * @param defaultValue 0-D. default value to insert into location `[row, 0, ..., 0]` - * for rows missing from the input sparse tensor. + * @param defaultValue 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. + * @param data type for {@code SparseFillEmptyRows} output and operands * @return a new instance of SparseFillEmptyRows */ - @Endpoint(describeByClass = true) - public static SparseFillEmptyRows create(Scope scope, Operand indices, Operand values, Operand denseShape, Operand defaultValue) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseFillEmptyRows", scope.makeOpName("SparseFillEmptyRows")); + @Endpoint( + describeByClass = true + ) + public static SparseFillEmptyRows create(Scope scope, + Operand indices, Operand values, Operand denseShape, + Operand defaultValue) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseFillEmptyRows"); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(values.asOutput()); opBuilder.addInput(denseShape.asOutput()); opBuilder.addInput(defaultValue.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SparseFillEmptyRows(opBuilder.build()); + return new SparseFillEmptyRows<>(opBuilder.build()); } - + /** + * Gets outputIndices. + * + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** + * Gets outputValues. * 1-D. the values of the filled sparse tensor. + * @return outputValues. */ public Output outputValues() { return outputValues; } - + /** + * Gets emptyRowIndicator. * 1-D. whether the dense row was missing in the * input sparse tensor. + * @return emptyRowIndicator. */ public Output emptyRowIndicator() { return emptyRowIndicator; } - + /** + * Gets reverseIndexMap. * 1-D. a map from the input indices to the output indices. + * @return reverseIndexMap. */ public Output reverseIndexMap() { return reverseIndexMap; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseFillEmptyRows"; - - private Output outputIndices; - private Output outputValues; - private Output emptyRowIndicator; - private Output reverseIndexMap; - - private SparseFillEmptyRows(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - emptyRowIndicator = operation.output(outputIdx++); - reverseIndexMap = operation.output(outputIdx++); + + @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 e776ff51246..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,75 +17,120 @@ 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; /** * The gradient of SparseFillEmptyRows. - *

- * Takes vectors reverse_index_map, shaped `[N]`, and grad_values, - * shaped `[N_full]`, where `N_full >= N` and copies data into either - * `d_values` or `d_default_value`. Here `d_values` is shaped `[N]` and - * `d_default_value` is a scalar. - *

- * 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 dValues()} output + * Takes vectors reverse_index_map, shaped {@code [N]}, and grad_values, + * shaped {@code [N_full]}, where {@code N_full >= N} and copies data into either + * {@code d_values} or {@code d_default_value}. Here {@code d_values} is shaped {@code [N]} and + * {@code d_default_value} is a scalar. + *

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}) */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseFillEmptyRowsGrad.OP_NAME, + inputsClass = SparseFillEmptyRowsGrad.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseFillEmptyRowsGrad extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseFillEmptyRowsGrad"; + + private Output dValues; + + private Output dDefaultValue; + + public SparseFillEmptyRowsGrad(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 SparseFillEmptyRowsGrad operation. - * + * * @param scope current scope * @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 * @return a new instance of SparseFillEmptyRowsGrad */ - @Endpoint(describeByClass = true) - public static SparseFillEmptyRowsGrad create(Scope scope, Operand reverseIndexMap, Operand gradValues) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseFillEmptyRowsGrad", scope.makeOpName("SparseFillEmptyRowsGrad")); + @Endpoint( + describeByClass = true + ) + public static SparseFillEmptyRowsGrad create(Scope scope, + Operand reverseIndexMap, Operand gradValues) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseFillEmptyRowsGrad"); opBuilder.addInput(reverseIndexMap.asOutput()); opBuilder.addInput(gradValues.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SparseFillEmptyRowsGrad(opBuilder.build()); + return new SparseFillEmptyRowsGrad<>(opBuilder.build()); } - + /** + * Gets dValues. * 1-D. The backprop into values. + * @return dValues. */ public Output dValues() { return dValues; } - + /** + * Gets dDefaultValue. * 0-D. The backprop into default_value. + * @return dDefaultValue. */ public Output dDefaultValue() { return dDefaultValue; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseFillEmptyRowsGrad"; - - private Output dValues; - private Output dDefaultValue; - - private SparseFillEmptyRowsGrad(Operation operation) { - super(operation); - int outputIdx = 0; - dValues = operation.output(outputIdx++); - dDefaultValue = operation.output(outputIdx++); + + @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 ce1216ea5e1..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,94 +17,72 @@ 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; /** - * Multiply matrix "a" by matrix "b". - *

- * The inputs must be two-dimensional matrices and the inner dimension of "a" must - * match the outer dimension of "b". Both "a" and "b" must be `Tensor`s not - * `SparseTensor`s. This op is optimized for the case where at least one of "a" or - * "b" is sparse, in the sense that they have a large proportion of zero values. + * Multiply matrix "a" by matrix "b". + * The inputs must be two-dimensional matrices and the inner dimension of "a" must + * match the outer dimension of "b". Both "a" and "b" must be {@code Tensor}s not + * {@code SparseTensor}s. This op is optimized for the case where at least one of "a" or + * "b" is sparse, in the sense that they have a large proportion of zero values. * The breakeven for using this versus a dense matrix multiply on one platform was * 30% zero values in the sparse matrix. - *

- * The gradient computation of this operation will only take advantage of sparsity + *

The gradient computation of this operation will only take advantage of sparsity * in the input gradient when that gradient comes from a Relu. */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseMatMul.OP_NAME, + inputsClass = SparseMatMul.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseMatMul extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.SparseMatMul} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param transposeA - */ - public Options transposeA(Boolean transposeA) { - this.transposeA = transposeA; - return this; - } - - /** - * @param transposeB - */ - public Options transposeB(Boolean transposeB) { - this.transposeB = transposeB; - return this; - } - - /** - * @param aIsSparse - */ - public Options aIsSparse(Boolean aIsSparse) { - this.aIsSparse = aIsSparse; - return this; - } - - /** - * @param bIsSparse - */ - public Options bIsSparse(Boolean bIsSparse) { - this.bIsSparse = bIsSparse; - return this; - } - - private Boolean transposeA; - private Boolean transposeB; - private Boolean aIsSparse; - private Boolean bIsSparse; - - private Options() { - } + public static final String OP_NAME = "SparseMatMul"; + + private Output product; + + public SparseMatMul(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + product = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseMatMul operation. - * + * * @param scope current scope - * @param a - * @param b - * @param options carries optional attributes values + * @param a The a value + * @param b The b value + * @param options carries optional attribute values * @return a new instance of SparseMatMul */ - @Endpoint(describeByClass = true) - public static SparseMatMul create(Scope scope, Operand a, Operand b, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseMatMul", scope.makeOpName("SparseMatMul")); + @Endpoint( + describeByClass = true + ) + public static SparseMatMul create(Scope scope, Operand a, + Operand b, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseMatMul"); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.transposeA != null) { @@ -123,54 +101,176 @@ public static SparseMatMul create(Scope scope, Operand a, Ope } return new SparseMatMul(opBuilder.build()); } - + /** - * @param transposeA + * Sets the transposeA option. + * + * @param transposeA the transposeA option + * @return this Options instance. */ public static Options transposeA(Boolean transposeA) { return new Options().transposeA(transposeA); } - + /** - * @param transposeB + * Sets the transposeB option. + * + * @param transposeB the transposeB option + * @return this Options instance. */ public static Options transposeB(Boolean transposeB) { return new Options().transposeB(transposeB); } - + /** - * @param aIsSparse + * Sets the aIsSparse option. + * + * @param aIsSparse the aIsSparse option + * @return this Options instance. */ public static Options aIsSparse(Boolean aIsSparse) { return new Options().aIsSparse(aIsSparse); } - + /** - * @param bIsSparse + * Sets the bIsSparse option. + * + * @param bIsSparse the bIsSparse option + * @return this Options instance. */ public static Options bIsSparse(Boolean bIsSparse) { return new Options().bIsSparse(bIsSparse); } - + /** + * Gets product. + * + * @return product. */ public Output product() { return product; } - + @Override public Output asOutput() { return product; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatMul"; - - private Output product; - - private SparseMatMul(Operation operation) { - super(operation); - int outputIdx = 0; - product = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseMatMul} + */ + public static class Options { + private Boolean transposeA; + + private Boolean transposeB; + + private Boolean aIsSparse; + + private Boolean bIsSparse; + + 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; + } + + /** + * Sets the aIsSparse option. + * + * @param aIsSparse the aIsSparse option + * @return this Options instance. + */ + public Options aIsSparse(Boolean aIsSparse) { + this.aIsSparse = aIsSparse; + return this; + } + + /** + * Sets the bIsSparse option. + * + * @param bIsSparse the bIsSparse option + * @return this Options instance. + */ + public Options bIsSparse(Boolean bIsSparse) { + this.bIsSparse = 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 190f06c2dbf..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,78 +17,82 @@ 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; /** * Computes the max of elements across dimensions of a SparseTensor. - *

* This Op takes a SparseTensor and is the sparse counterpart to - * `tf.reduce_max()`. In particular, this Op also returns a dense `Tensor` + * {@code tf.reduce_max()}. In particular, this Op also returns a dense {@code Tensor} * instead of a sparse one. - *

- * Reduces `sp_input` along the dimensions given in `reduction_axes`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `reduction_axes`. If `keep_dims` is true, the reduced dimensions are retained + *

Reduces {@code sp_input} along the dimensions given in {@code reduction_axes}. Unless + * {@code keep_dims} is true, the rank of the tensor is reduced by 1 for each entry in + * {@code reduction_axes}. If {@code keep_dims} is true, the reduced dimensions are retained * with length 1. - *

- * If `reduction_axes` has no entries, all dimensions are reduced, and a tensor + *

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 */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseReduceMax.OP_NAME, + inputsClass = SparseReduceMax.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseReduceMax extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.SparseReduceMax} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "SparseReduceMax"; + + private Output output; + + public SparseReduceMax(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseReduceMax operation. - * + * * @param scope current scope - * @param inputIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @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. `N` non-empty values corresponding to `input_indices`. + * @param inputValues 1-D. {@code N} non-empty values corresponding to {@code input_indices}. * @param inputShape 1-D. Shape of the input SparseTensor. - * @param reductionAxes 1-D. Length-`K` vector containing the reduction axes. - * @param options carries optional attributes values + * @param reductionAxes 1-D. Length-{@code K} vector containing the reduction axes. + * @param options carries optional attribute values + * @param data type for {@code SparseReduceMax} output and operands * @return a new instance of SparseReduceMax */ - @Endpoint(describeByClass = true) - public static SparseReduceMax create(Scope scope, Operand inputIndices, Operand inputValues, Operand inputShape, Operand reductionAxes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseReduceMax", scope.makeOpName("SparseReduceMax")); + @Endpoint( + describeByClass = true + ) + public static SparseReduceMax create(Scope scope, + Operand inputIndices, Operand inputValues, Operand inputShape, + Operand reductionAxes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseReduceMax"); opBuilder.addInput(inputIndices.asOutput()); opBuilder.addInput(inputValues.asOutput()); opBuilder.addInput(inputShape.asOutput()); opBuilder.addInput(reductionAxes.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.keepDims != null) { @@ -96,36 +100,98 @@ public static SparseReduceMax create(Scope scope, Operand } } } - return new SparseReduceMax(opBuilder.build()); + return new SparseReduceMax<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** - * `R-K`-D. The reduced Tensor. + * Gets output. + * {@code R-K}-D. The reduced Tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseReduceMax"; - - private Output output; - - private SparseReduceMax(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseReduceMax} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = 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 ae36fcb07e3..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,78 +17,88 @@ 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; /** * Computes the max of elements across dimensions of a SparseTensor. - *

* This Op takes a SparseTensor and is the sparse counterpart to - * `tf.reduce_max()`. In contrast to SparseReduceMax, this Op returns a + * {@code tf.reduce_max()}. In contrast to SparseReduceMax, this Op returns a * SparseTensor. - *

- * Reduces `sp_input` along the dimensions given in `reduction_axes`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `reduction_axes`. If `keep_dims` is true, the reduced dimensions are retained + *

Reduces {@code sp_input} along the dimensions given in {@code reduction_axes}. Unless + * {@code keep_dims} is true, the rank of the tensor is reduced by 1 for each entry in + * {@code reduction_axes}. If {@code keep_dims} is true, the reduced dimensions are retained * with length 1. - *

- * If `reduction_axes` has no entries, all dimensions are reduced, and a tensor + *

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 outputValues()} output */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseReduceMaxSparse.OP_NAME, + inputsClass = SparseReduceMaxSparse.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseReduceMaxSparse extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.SparseReduceMaxSparse} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "SparseReduceMaxSparse"; + + private Output outputIndices; + + private Output outputValues; + + private Output outputShape; + + public SparseReduceMaxSparse(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + outputShape = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseReduceMaxSparse operation. - * + * * @param scope current scope - * @param inputIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @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. `N` non-empty values corresponding to `input_indices`. + * @param inputValues 1-D. {@code N} non-empty values corresponding to {@code input_indices}. * @param inputShape 1-D. Shape of the input SparseTensor. - * @param reductionAxes 1-D. Length-`K` vector containing the reduction axes. - * @param options carries optional attributes values + * @param reductionAxes 1-D. Length-{@code K} vector containing the reduction axes. + * @param options carries optional attribute values + * @param data type for {@code SparseReduceMaxSparse} output and operands * @return a new instance of SparseReduceMaxSparse */ - @Endpoint(describeByClass = true) - public static SparseReduceMaxSparse create(Scope scope, Operand inputIndices, Operand inputValues, Operand inputShape, Operand reductionAxes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseReduceMaxSparse", scope.makeOpName("SparseReduceMaxSparse")); + @Endpoint( + describeByClass = true + ) + public static SparseReduceMaxSparse create(Scope scope, + Operand inputIndices, Operand inputValues, Operand inputShape, + Operand reductionAxes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseReduceMaxSparse"); opBuilder.addInput(inputIndices.asOutput()); opBuilder.addInput(inputValues.asOutput()); opBuilder.addInput(inputShape.asOutput()); opBuilder.addInput(reductionAxes.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.keepDims != null) { @@ -96,46 +106,111 @@ public static SparseReduceMaxSparse create(Scope scope, O } } } - return new SparseReduceMaxSparse(opBuilder.build()); + return new SparseReduceMaxSparse<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets outputIndices. + * + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** + * Gets outputValues. + * + * @return outputValues. */ public Output outputValues() { return outputValues; } - + /** + * Gets outputShape. + * + * @return outputShape. */ public Output outputShape() { return outputShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseReduceMaxSparse"; - - private Output outputIndices; - private Output outputValues; - private Output outputShape; - - private SparseReduceMaxSparse(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - outputShape = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseReduceMaxSparse} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = 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 03243c81939..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,78 +17,82 @@ 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; /** * Computes the sum of elements across dimensions of a SparseTensor. - *

* This Op takes a SparseTensor and is the sparse counterpart to - * `tf.reduce_sum()`. In particular, this Op also returns a dense `Tensor` + * {@code tf.reduce_sum()}. In particular, this Op also returns a dense {@code Tensor} * instead of a sparse one. - *

- * Reduces `sp_input` along the dimensions given in `reduction_axes`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `reduction_axes`. If `keep_dims` is true, the reduced dimensions are retained + *

Reduces {@code sp_input} along the dimensions given in {@code reduction_axes}. Unless + * {@code keep_dims} is true, the rank of the tensor is reduced by 1 for each entry in + * {@code reduction_axes}. If {@code keep_dims} is true, the reduced dimensions are retained * with length 1. - *

- * If `reduction_axes` has no entries, all dimensions are reduced, and a tensor + *

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 */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseReduceSum.OP_NAME, + inputsClass = SparseReduceSum.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseReduceSum extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.SparseReduceSum} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "SparseReduceSum"; + + private Output output; + + public SparseReduceSum(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseReduceSum operation. - * + * * @param scope current scope - * @param inputIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @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. `N` non-empty values corresponding to `input_indices`. + * @param inputValues 1-D. {@code N} non-empty values corresponding to {@code input_indices}. * @param inputShape 1-D. Shape of the input SparseTensor. - * @param reductionAxes 1-D. Length-`K` vector containing the reduction axes. - * @param options carries optional attributes values + * @param reductionAxes 1-D. Length-{@code K} vector containing the reduction axes. + * @param options carries optional attribute values + * @param data type for {@code SparseReduceSum} output and operands * @return a new instance of SparseReduceSum */ - @Endpoint(describeByClass = true) - public static SparseReduceSum create(Scope scope, Operand inputIndices, Operand inputValues, Operand inputShape, Operand reductionAxes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseReduceSum", scope.makeOpName("SparseReduceSum")); + @Endpoint( + describeByClass = true + ) + public static SparseReduceSum create(Scope scope, + Operand inputIndices, Operand inputValues, Operand inputShape, + Operand reductionAxes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseReduceSum"); opBuilder.addInput(inputIndices.asOutput()); opBuilder.addInput(inputValues.asOutput()); opBuilder.addInput(inputShape.asOutput()); opBuilder.addInput(reductionAxes.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.keepDims != null) { @@ -96,36 +100,98 @@ public static SparseReduceSum create(Scope scope, Operand(opBuilder.build()); + return new SparseReduceSum<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** - * `R-K`-D. The reduced Tensor. + * Gets output. + * {@code R-K}-D. The reduced Tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseReduceSum"; - - private Output output; - - private SparseReduceSum(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseReduceSum} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = 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 d328616e8d1..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,78 +17,88 @@ 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; /** * Computes the sum of elements across dimensions of a SparseTensor. - *

* This Op takes a SparseTensor and is the sparse counterpart to - * `tf.reduce_sum()`. In contrast to SparseReduceSum, this Op returns a + * {@code tf.reduce_sum()}. In contrast to SparseReduceSum, this Op returns a * SparseTensor. - *

- * Reduces `sp_input` along the dimensions given in `reduction_axes`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `reduction_axes`. If `keep_dims` is true, the reduced dimensions are retained + *

Reduces {@code sp_input} along the dimensions given in {@code reduction_axes}. Unless + * {@code keep_dims} is true, the rank of the tensor is reduced by 1 for each entry in + * {@code reduction_axes}. If {@code keep_dims} is true, the reduced dimensions are retained * with length 1. - *

- * If `reduction_axes` has no entries, all dimensions are reduced, and a tensor + *

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 outputValues()} output */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseReduceSumSparse.OP_NAME, + inputsClass = SparseReduceSumSparse.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseReduceSumSparse extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.SparseReduceSumSparse} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "SparseReduceSumSparse"; + + private Output outputIndices; + + private Output outputValues; + + private Output outputShape; + + public SparseReduceSumSparse(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + outputShape = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseReduceSumSparse operation. - * + * * @param scope current scope - * @param inputIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @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. `N` non-empty values corresponding to `input_indices`. + * @param inputValues 1-D. {@code N} non-empty values corresponding to {@code input_indices}. * @param inputShape 1-D. Shape of the input SparseTensor. - * @param reductionAxes 1-D. Length-`K` vector containing the reduction axes. - * @param options carries optional attributes values + * @param reductionAxes 1-D. Length-{@code K} vector containing the reduction axes. + * @param options carries optional attribute values + * @param data type for {@code SparseReduceSumSparse} output and operands * @return a new instance of SparseReduceSumSparse */ - @Endpoint(describeByClass = true) - public static SparseReduceSumSparse create(Scope scope, Operand inputIndices, Operand inputValues, Operand inputShape, Operand reductionAxes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseReduceSumSparse", scope.makeOpName("SparseReduceSumSparse")); + @Endpoint( + describeByClass = true + ) + public static SparseReduceSumSparse create(Scope scope, + Operand inputIndices, Operand inputValues, Operand inputShape, + Operand reductionAxes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseReduceSumSparse"); opBuilder.addInput(inputIndices.asOutput()); opBuilder.addInput(inputValues.asOutput()); opBuilder.addInput(inputShape.asOutput()); opBuilder.addInput(reductionAxes.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.keepDims != null) { @@ -96,46 +106,111 @@ public static SparseReduceSumSparse create(Scope scope, Ope } } } - return new SparseReduceSumSparse(opBuilder.build()); + return new SparseReduceSumSparse<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets outputIndices. + * + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** + * Gets outputValues. + * + * @return outputValues. */ public Output outputValues() { return outputValues; } - + /** + * Gets outputShape. + * + * @return outputShape. */ public Output outputShape() { return outputShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseReduceSumSparse"; - - private Output outputIndices; - private Output outputValues; - private Output outputShape; - - private SparseReduceSumSparse(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - outputShape = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseReduceSumSparse} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = 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 66de5ab2f40..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,79 +17,130 @@ 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; /** * Reorders a SparseTensor into the canonical, row-major ordering. - *

* Note that by convention, all sparse ops preserve the canonical ordering along * increasing dimension number. The only time ordering can be violated is during * manual manipulation of the indices and values vectors to add entries. - *

- * Reordering does not affect the shape of the SparseTensor. - *

- * If the tensor has rank `R` and `N` non-empty values, `input_indices` has - * shape `[N, R]`, input_values has length `N`, and input_shape has length `R`. - * - * @param data type for {@code outputValues()} output + *

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}. */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseReorder.OP_NAME, + inputsClass = SparseReorder.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseReorder extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseReorder"; + + private Output outputIndices; + + private Output outputValues; + + public SparseReorder(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseReorder operation. - * + * * @param scope current scope - * @param inputIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @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. `N` non-empty values corresponding to `input_indices`. + * @param inputValues 1-D. {@code N} non-empty values corresponding to {@code input_indices}. * @param inputShape 1-D. Shape of the input SparseTensor. + * @param data type for {@code SparseReorder} output and operands * @return a new instance of SparseReorder */ - @Endpoint(describeByClass = true) - public static SparseReorder create(Scope scope, Operand inputIndices, Operand inputValues, Operand inputShape) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseReorder", scope.makeOpName("SparseReorder")); + @Endpoint( + describeByClass = true + ) + public static SparseReorder create(Scope scope, Operand inputIndices, + Operand inputValues, Operand inputShape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseReorder"); opBuilder.addInput(inputIndices.asOutput()); opBuilder.addInput(inputValues.asOutput()); opBuilder.addInput(inputShape.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SparseReorder(opBuilder.build()); + return new SparseReorder<>(opBuilder.build()); } - + /** - * 2-D. `N x R` matrix with the same indices as input_indices, but + * Gets outputIndices. + * 2-D. {@code N x R} matrix with the same indices as input_indices, but * in canonical row-major ordering. + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** - * 1-D. `N` non-empty values corresponding to `output_indices`. + * Gets outputValues. + * 1-D. {@code N} non-empty values corresponding to {@code output_indices}. + * @return outputValues. */ public Output outputValues() { return outputValues; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseReorder"; - - private Output outputIndices; - private Output outputValues; - - private SparseReorder(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); + + @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 9c79e07f447..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,85 +17,129 @@ 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; /** * Reshapes a SparseTensor to represent values in a new dense shape. - *

* This operation has the same semantics as reshape on the represented dense - * tensor. The `input_indices` are recomputed based on the requested `new_shape`. - *

- * If one component of `new_shape` is the special value -1, the size of that + * tensor. The {@code input_indices} are recomputed based on the requested {@code new_shape}. + *

If one component of {@code new_shape} is the special value -1, the size of that * dimension is computed so that the total dense size remains constant. At - * most one component of `new_shape` can be -1. The number of dense elements - * implied by `new_shape` must be the same as the number of dense elements - * originally implied by `input_shape`. - *

- * Reshaping does not affect the order of values in the SparseTensor. - *

- * If the input tensor has rank `R_in` and `N` non-empty values, and `new_shape` - * has length `R_out`, then `input_indices` has shape `[N, R_in]`, - * `input_shape` has length `R_in`, `output_indices` has shape `[N, R_out]`, and - * `output_shape` has length `R_out`. + * most one component of {@code new_shape} can be -1. The number of dense elements + * implied by {@code new_shape} must be the same as the number of dense elements + * originally implied by {@code input_shape}. + *

Reshaping does not affect the order of values in the SparseTensor. + *

If the input tensor has rank {@code R_in} and {@code N} non-empty values, and {@code new_shape} + * has length {@code R_out}, then {@code input_indices} has shape {@code [N, R_in]}, + * {@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}. */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseReshape.OP_NAME, + inputsClass = SparseReshape.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseReshape extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseReshape"; + + private Output outputIndices; + + private Output outputShape; + + public SparseReshape(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseReshape operation. - * + * * @param scope current scope - * @param inputIndices 2-D. `N x R_in` matrix with the indices of non-empty values in a + * @param inputIndices 2-D. {@code N x R_in} matrix with the indices of non-empty values in a * SparseTensor. - * @param inputShape 1-D. `R_in` vector with the input SparseTensor's dense shape. - * @param newShape 1-D. `R_out` vector with the requested new dense shape. + * @param inputShape 1-D. {@code R_in} vector with the input SparseTensor's dense shape. + * @param newShape 1-D. {@code R_out} vector with the requested new dense shape. * @return a new instance of SparseReshape */ - @Endpoint(describeByClass = true) - public static SparseReshape create(Scope scope, Operand inputIndices, Operand inputShape, Operand newShape) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseReshape", scope.makeOpName("SparseReshape")); + @Endpoint( + describeByClass = true + ) + public static SparseReshape create(Scope scope, Operand inputIndices, + Operand inputShape, Operand newShape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseReshape"); opBuilder.addInput(inputIndices.asOutput()); opBuilder.addInput(inputShape.asOutput()); opBuilder.addInput(newShape.asOutput()); - opBuilder = scope.apply(opBuilder); return new SparseReshape(opBuilder.build()); } - + /** - * 2-D. `N x R_out` matrix with the updated indices of non-empty + * Gets outputIndices. + * 2-D. {@code N x R_out} matrix with the updated indices of non-empty * values in the output SparseTensor. + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** - * 1-D. `R_out` vector with the full dense shape of the output - * SparseTensor. This is the same as `new_shape` but with any -1 dimensions + * Gets outputShape. + * 1-D. {@code R_out} vector with the full dense shape of the output + * SparseTensor. This is the same as {@code new_shape} but with any -1 dimensions * filled in. + * @return outputShape. */ public Output outputShape() { return outputShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseReshape"; - - private Output outputIndices; - private Output outputShape; - - private SparseReshape(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputShape = operation.output(outputIdx++); + + @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 496dfc994de..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,69 +17,175 @@ 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 mean along sparse segments of a tensor. - *

- * See `tf.sparse.segment_sum` for usage examples. - *

- * Like `SegmentMean`, but `segment_ids` can have rank less than `data`'s first - * dimension, selecting a subset of dimension 0, specified by `indices`. - * - * @param data type for {@code output()} output + * 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}. */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseSegmentMean.OP_NAME, + inputsClass = SparseSegmentMean.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseSegmentMean extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSegmentMean"; + + private Output output; + + public SparseSegmentMean(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSegmentMean operation. - * + * * @param scope current scope - * @param data - * @param indices A 1-D tensor. Has same rank as `segment_ids`. + * @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 */ - @Endpoint(describeByClass = true) - public static SparseSegmentMean create(Scope scope, Operand data, Operand indices, Operand segmentIds) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseSegmentMean", scope.makeOpName("SparseSegmentMean")); + @Endpoint( + describeByClass = true + ) + public static SparseSegmentMean create(Scope scope, Operand data, + 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()); - opBuilder = scope.apply(opBuilder); - return new SparseSegmentMean(opBuilder.build()); + 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 - * has size `k`, the number of segments. + * has size {@code k}, the number of segments. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSegmentMean"; - - private Output output; - - private SparseSegmentMean(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * 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 2b9aa410096..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,68 +17,146 @@ 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 + * Returns tensor "output" with same shape as grad, except for dimension 0 whose + * value is the number of unique indexes in "indices". Also returns vector + * "sorted_unique_indices" containing the corresponding indexes from "indices". */ -@Operator(group = "sparse") -public final class SparseSegmentMeanGrad extends RawOp implements Operand { - +@OpMetadata( + opType = SparseSegmentMeanGrad.OP_NAME, + inputsClass = SparseSegmentMeanGrad.Inputs.class +) +@Operator( + group = "sparse" +) +public final class SparseSegmentMeanGrad extends RawOp { /** - * Factory method to create a class wrapping a new SparseSegmentMeanGrad operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSegmentMeanGradV2"; + + private Output output; + + 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 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 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) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseSegmentMeanGrad", scope.makeOpName("SparseSegmentMeanGrad")); + @Endpoint( + describeByClass = true + ) + 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 = scope.apply(opBuilder); - return new SparseSegmentMeanGrad(opBuilder.build()); + opBuilder.addInput(denseOutputDim0.asOutput()); + return new SparseSegmentMeanGrad<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - - @Override - public Output asOutput() { - return output; + + /** + * Gets sortedUniqueIndices. + * + * @return sortedUniqueIndices. + */ + public Output sortedUniqueIndices() { + return sortedUniqueIndices; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSegmentMeanGrad"; - - private Output output; - - private SparseSegmentMeanGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 e2d79025981..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,73 +17,191 @@ 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 mean along sparse segments of a tensor. - *

- * Like `SparseSegmentMean`, but allows missing ids in `segment_ids`. If an id is - * missing, the `output` tensor at that position will be zeroed. - *

- * Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * Like {@code SparseSegmentMean}, but allows missing ids in {@code segment_ids}. If an id is + * missing, the {@code output} tensor at that position will be zeroed. + *

Read + * the section on segmentation * for an explanation of segments. - * - * @param data type for {@code output()} output */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseSegmentMeanWithNumSegments.OP_NAME, + inputsClass = SparseSegmentMeanWithNumSegments.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseSegmentMeanWithNumSegments extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSegmentMeanWithNumSegments"; + + private Output output; + + public SparseSegmentMeanWithNumSegments(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSegmentMeanWithNumSegments operation. - * + * * @param scope current scope - * @param data - * @param indices A 1-D tensor. Has same rank as `segment_ids`. + * @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 */ - @Endpoint(describeByClass = true) - public static SparseSegmentMeanWithNumSegments create(Scope scope, Operand data, Operand indices, Operand segmentIds, Operand numSegments) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseSegmentMeanWithNumSegments", scope.makeOpName("SparseSegmentMeanWithNumSegments")); + @Endpoint( + describeByClass = true + ) + public static SparseSegmentMeanWithNumSegments create(Scope scope, + Operand data, Operand indices, Operand segmentIds, + 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()); - opBuilder = scope.apply(opBuilder); - return new SparseSegmentMeanWithNumSegments(opBuilder.build()); + 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 - * `num_segments`. + * {@code num_segments}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSegmentMeanWithNumSegments"; - - private Output output; - - private SparseSegmentMeanWithNumSegments(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * 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 f9768aa67bd..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,69 +17,174 @@ 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 `tf.sparse.segment_sum` for usage examples. - * - * - * @param data type for {@code output()} output + *

See {@code tf.sparse.segment_sum} for usage examples. */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseSegmentSqrtN.OP_NAME, + inputsClass = SparseSegmentSqrtN.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseSegmentSqrtN extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSegmentSqrtN"; + + private Output output; + + public SparseSegmentSqrtN(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSegmentSqrtN operation. - * + * * @param scope current scope - * @param data - * @param indices A 1-D tensor. Has same rank as `segment_ids`. + * @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 */ - @Endpoint(describeByClass = true) - public static SparseSegmentSqrtN create(Scope scope, Operand data, Operand indices, Operand segmentIds) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseSegmentSqrtN", scope.makeOpName("SparseSegmentSqrtN")); + @Endpoint( + describeByClass = true + ) + public static SparseSegmentSqrtN create(Scope scope, Operand data, + 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()); - opBuilder = scope.apply(opBuilder); - return new SparseSegmentSqrtN(opBuilder.build()); + 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 - * has size `k`, the number of segments. + * has size {@code k}, the number of segments. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSegmentSqrtN"; - - private Output output; - - private SparseSegmentSqrtN(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * 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 8d43bc92976..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,68 +17,146 @@ 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 + * Returns tensor "output" with same shape as grad, except for dimension 0 whose + * value is the number of unique indexes in "indices". Also returns vector + * "sorted_unique_indices" containing the corresponding indexes from "indices". */ -@Operator(group = "sparse") -public final class SparseSegmentSqrtNGrad extends RawOp implements Operand { - +@OpMetadata( + opType = SparseSegmentSqrtNGrad.OP_NAME, + inputsClass = SparseSegmentSqrtNGrad.Inputs.class +) +@Operator( + group = "sparse" +) +public final class SparseSegmentSqrtNGrad extends RawOp { /** - * Factory method to create a class wrapping a new SparseSegmentSqrtNGrad operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSegmentSqrtNGradV2"; + + private Output output; + + 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 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 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) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseSegmentSqrtNGrad", scope.makeOpName("SparseSegmentSqrtNGrad")); + @Endpoint( + describeByClass = true + ) + 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 = scope.apply(opBuilder); - return new SparseSegmentSqrtNGrad(opBuilder.build()); + opBuilder.addInput(denseOutputDim0.asOutput()); + return new SparseSegmentSqrtNGrad<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - - @Override - public Output asOutput() { - return output; + + /** + * Gets sortedUniqueIndices. + * + * @return sortedUniqueIndices. + */ + public Output sortedUniqueIndices() { + return sortedUniqueIndices; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSegmentSqrtNGrad"; - - private Output output; - - private SparseSegmentSqrtNGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 569c2d40534..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,75 +17,192 @@ 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. - *

- * Like `SparseSegmentSqrtN`, but allows missing ids in `segment_ids`. If an id is - * missing, the `output` tensor at that position will be zeroed. - *

- * Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + *

Like {@code SparseSegmentSqrtN}, but allows missing ids in {@code segment_ids}. If an id is + * missing, the {@code output} tensor at that position will be zeroed. + *

Read + * the section on segmentation * for an explanation of segments. - * - * @param data type for {@code output()} output */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseSegmentSqrtNWithNumSegments.OP_NAME, + inputsClass = SparseSegmentSqrtNWithNumSegments.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseSegmentSqrtNWithNumSegments extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSegmentSqrtNWithNumSegments"; + + private Output output; + + public SparseSegmentSqrtNWithNumSegments(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSegmentSqrtNWithNumSegments operation. - * + * * @param scope current scope - * @param data - * @param indices A 1-D tensor. Has same rank as `segment_ids`. + * @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 */ - @Endpoint(describeByClass = true) - public static SparseSegmentSqrtNWithNumSegments create(Scope scope, Operand data, Operand indices, Operand segmentIds, Operand numSegments) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseSegmentSqrtNWithNumSegments", scope.makeOpName("SparseSegmentSqrtNWithNumSegments")); + @Endpoint( + describeByClass = true + ) + public static SparseSegmentSqrtNWithNumSegments create(Scope scope, + Operand data, Operand indices, Operand segmentIds, + 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()); - opBuilder = scope.apply(opBuilder); - return new SparseSegmentSqrtNWithNumSegments(opBuilder.build()); + 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 - * has size `k`, the number of segments. + * has size {@code k}, the number of segments. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSegmentSqrtNWithNumSegments"; - - private Output output; - - private SparseSegmentSqrtNWithNumSegments(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * 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 04e00d71648..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,94 +17,198 @@ 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. - *

* Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * the section on segmentation * for an explanation of segments. - *

- * Like `SegmentSum`, but `segment_ids` can have rank less than `data`'s first - * dimension, selecting a subset of dimension 0, specified by `indices`. - *

- * For example: - *

{@code
+ * 

Like {@code SegmentSum}, but {@code segment_ids} can have rank less than {@code data}'s first + * dimension, selecting a subset of dimension 0, specified by {@code indices}. + *

For example: + *

  * c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])
- * 
+ *
  * # Select two rows, one segment.
  * tf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 0]))
- * # => [[0 0 0 0]]
- * 
+ * # => [[0 0 0 0]]
+ *
  * # Select two rows, two segment.
  * tf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 1]))
- * # => [[ 1  2  3  4]
+ * # => [[ 1  2  3  4]
  * #     [-1 -2 -3 -4]]
- * 
+ *
  * # Select all rows, two segments.
  * tf.sparse_segment_sum(c, tf.constant([0, 1, 2]), tf.constant([0, 0, 1]))
- * # => [[0 0 0 0]
+ * # => [[0 0 0 0]
  * #     [5 6 7 8]]
- * 
+ *
  * # Which is equivalent to:
  * tf.segment_sum(c, tf.constant([0, 0, 1]))
- * }
- * - * - * @param data type for {@code output()} output + *
*/ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseSegmentSum.OP_NAME, + inputsClass = SparseSegmentSum.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseSegmentSum extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSegmentSum"; + + private Output output; + + public SparseSegmentSum(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSegmentSum operation. - * + * * @param scope current scope - * @param data - * @param indices A 1-D tensor. Has same rank as `segment_ids`. + * @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 */ - @Endpoint(describeByClass = true) - public static SparseSegmentSum create(Scope scope, Operand data, Operand indices, Operand segmentIds) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseSegmentSum", scope.makeOpName("SparseSegmentSum")); + @Endpoint( + describeByClass = true + ) + public static SparseSegmentSum create(Scope scope, Operand data, + 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()); - opBuilder = scope.apply(opBuilder); - return new SparseSegmentSum(opBuilder.build()); + 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 - * has size `k`, the number of segments. + * has size {@code k}, the number of segments. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSegmentSum"; - - private Output output; - - private SparseSegmentSum(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * 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 new file mode 100644 index 00000000000..1372d6f7089 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSumGrad.java @@ -0,0 +1,162 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.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 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 { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSegmentSumGradV2"; + + private Output output; + + 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 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 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 denseOutputDim0) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseSegmentSumGrad"); + opBuilder.addInput(grad.asOutput()); + opBuilder.addInput(indices.asOutput()); + opBuilder.addInput(segmentIds.asOutput()); + opBuilder.addInput(denseOutputDim0.asOutput()); + return new SparseSegmentSumGrad<>(opBuilder.build()); + } + + /** + * Gets output. + * + * @return output. + */ + public Output output() { + 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 0dca626c528..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,94 +17,210 @@ 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. - *

- * Like `SparseSegmentSum`, but allows missing ids in `segment_ids`. If an id is - * missing, the `output` tensor at that position will be zeroed. - *

- * Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/sparse#Segmentation) + * Like {@code SparseSegmentSum}, but allows missing ids in {@code segment_ids}. If an id is + * missing, the {@code output} tensor at that position will be zeroed. + *

Read + * the section on segmentation * for an explanation of segments. - *

- * For example: - *

{@code
+ * 

For example: + *

  * c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])
- * 
+ *
  * tf.sparse_segment_sum_with_num_segments(
  *     c, tf.constant([0, 1]), tf.constant([0, 0]), num_segments=3)
- * # => [[0 0 0 0]
+ * # => [[0 0 0 0]
  * #     [0 0 0 0]
  * #     [0 0 0 0]]
- * 
+ *
  * tf.sparse_segment_sum_with_num_segments(c,
  *                                         tf.constant([0, 1]),
  *                                         tf.constant([0, 2],
  *                                         num_segments=4))
- * # => [[ 1  2  3  4]
+ * # => [[ 1  2  3  4]
  * #     [ 0  0  0  0]
  * #     [-1 -2 -3 -4]
  * #     [ 0  0  0  0]]
- * }
- * - * - * @param data type for {@code output()} output + *
*/ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseSegmentSumWithNumSegments.OP_NAME, + inputsClass = SparseSegmentSumWithNumSegments.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseSegmentSumWithNumSegments extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSegmentSumWithNumSegments"; + + private Output output; + + public SparseSegmentSumWithNumSegments(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSegmentSumWithNumSegments operation. - * + * * @param scope current scope - * @param data - * @param indices A 1-D tensor. Has same rank as `segment_ids`. + * @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 */ - @Endpoint(describeByClass = true) - public static SparseSegmentSumWithNumSegments create(Scope scope, Operand data, Operand indices, Operand segmentIds, Operand numSegments) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseSegmentSumWithNumSegments", scope.makeOpName("SparseSegmentSumWithNumSegments")); + @Endpoint( + describeByClass = true + ) + public static SparseSegmentSumWithNumSegments create(Scope scope, + Operand data, Operand indices, Operand segmentIds, + 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()); - opBuilder = scope.apply(opBuilder); - return new SparseSegmentSumWithNumSegments(opBuilder.build()); + 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 - * has size `num_segments`. + * has size {@code num_segments}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSegmentSumWithNumSegments"; - - private Output output; - - private SparseSegmentSumWithNumSegments(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * 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 cca3f77b72e..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,100 +17,171 @@ 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; /** - * Slice a `SparseTensor` based on the `start` and `size`. - *

+ * Slice a {@code SparseTensor} based on the {@code start} and {@code size}. * For example, if the input is - *

- * input_tensor = shape = [2, 7] - * [ a d e ] - * [b c ] - *

- * Graphically the output tensors are: - *

- * sparse_slice([0, 0], [2, 4]) = shape = [2, 4] - * [ a ] - * [b c ] - *

- * sparse_slice([0, 4], [2, 3]) = shape = [2, 3] - * [ d e ] - * [ ] - * - * @param data type for {@code outputValues()} output + *

+ * input_tensor = shape = [2, 7]
+ * [    a   d e  ]
+ * [b c          ]
+ * 
+ *

Graphically the output tensors are: + *

+ * sparse_slice([0, 0], [2, 4]) = shape = [2, 4]
+ * [    a  ]
+ * [b c    ]
+ *
+ * sparse_slice([0, 4], [2, 3]) = shape = [2, 3]
+ * [ d e  ]
+ * [      ]
+ * 
*/ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseSlice.OP_NAME, + inputsClass = SparseSlice.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseSlice extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSlice"; + + private Output outputIndices; + + private Output outputValues; + + private Output outputShape; + + public SparseSlice(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + outputShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSlice operation. - * + * * @param scope current scope * @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. * @param start 1-D. tensor represents the start of the slice. - * @param size 1-D. tensor represents the size of the slice. + * @param sizeOutput 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. + * @param data type for {@code SparseSlice} output and operands * @return a new instance of SparseSlice */ - @Endpoint(describeByClass = true) - public static SparseSlice create(Scope scope, Operand indices, Operand values, Operand shape, Operand start, Operand size) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseSlice", scope.makeOpName("SparseSlice")); + @Endpoint( + describeByClass = true + ) + public static SparseSlice create(Scope scope, Operand indices, + Operand values, Operand shape, Operand start, Operand sizeOutput) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseSlice"); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(values.asOutput()); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(start.asOutput()); - opBuilder.addInput(size.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SparseSlice(opBuilder.build()); + opBuilder.addInput(sizeOutput.asOutput()); + return new SparseSlice<>(opBuilder.build()); } - + /** + * Gets outputIndices. + * + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** + * Gets outputValues. * A list of 1-D tensors represents the values of the output sparse * tensors. + * @return outputValues. */ public Output outputValues() { return outputValues; } - + /** + * Gets outputShape. * A list of 1-D tensors represents the shape of the output sparse * tensors. + * @return outputShape. */ public Output outputShape() { return outputShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSlice"; - - private Output outputIndices; - private Output outputValues; - private Output outputShape; - - private SparseSlice(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - outputShape = operation.output(outputIdx++); + + @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 be3ffd7b15c..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,71 +17,127 @@ 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; /** * The gradient operator for the SparseSlice op. - *

* This op takes in the upstream gradient w.r.t. non-empty values of - * the sliced `SparseTensor`, and outputs the gradients w.r.t. - * the non-empty values of input `SparseTensor`. - * - * @param data type for {@code valGrad()} output + * the sliced {@code SparseTensor}, and outputs the gradients w.r.t. + * the non-empty values of input {@code SparseTensor}. */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseSliceGrad.OP_NAME, + inputsClass = SparseSliceGrad.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseSliceGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSliceGrad"; + + private Output valGrad; + + public SparseSliceGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + valGrad = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSliceGrad operation. - * + * * @param scope current scope * @param backpropValGrad 1-D. The gradient with respect to - * the non-empty values of the sliced `SparseTensor`. - * @param inputIndices 2-D. The `indices` of the input `SparseTensor`. + * the non-empty values of the sliced {@code SparseTensor}. + * @param inputIndices 2-D. The {@code indices} of the input {@code SparseTensor}. * @param inputStart 1-D. tensor represents the start of the slice. - * @param outputIndices 2-D. The `indices` of the sliced `SparseTensor`. + * @param outputIndices 2-D. The {@code indices} of the sliced {@code SparseTensor}. + * @param data type for {@code SparseSliceGrad} output and operands * @return a new instance of SparseSliceGrad */ - @Endpoint(describeByClass = true) - public static SparseSliceGrad create(Scope scope, Operand backpropValGrad, Operand inputIndices, Operand inputStart, Operand outputIndices) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseSliceGrad", scope.makeOpName("SparseSliceGrad")); + @Endpoint( + describeByClass = true + ) + public static SparseSliceGrad create(Scope scope, Operand backpropValGrad, + Operand inputIndices, Operand inputStart, Operand outputIndices) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseSliceGrad"); opBuilder.addInput(backpropValGrad.asOutput()); opBuilder.addInput(inputIndices.asOutput()); opBuilder.addInput(inputStart.asOutput()); opBuilder.addInput(outputIndices.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SparseSliceGrad(opBuilder.build()); + return new SparseSliceGrad<>(opBuilder.build()); } - + /** - * 1-D. The gradient with respect to the non-empty values of input `SparseTensor`. + * Gets valGrad. + * 1-D. The gradient with respect to the non-empty values of input {@code SparseTensor}. + * @return valGrad. */ public Output valGrad() { return valGrad; } - + @Override public Output asOutput() { return valGrad; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSliceGrad"; - - private Output valGrad; - - private SparseSliceGrad(Operation operation) { - super(operation); - int outputIdx = 0; - valGrad = operation.output(outputIdx++); + + @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 252a00e838b..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,81 +17,128 @@ 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; /** - * Applies softmax to a batched N-D `SparseTensor`. - *

- * The inputs represent an N-D SparseTensor with logical shape `[..., B, C]` - * (where `N >= 2`), and with indices sorted in the canonical lexicographic order. - *

- * This op is equivalent to applying the normal `tf.nn.softmax()` to each innermost - * logical submatrix with shape `[B, C]`, but with the catch that the implicitly - * zero elements do not participate. Specifically, the algorithm is equivalent + * Applies softmax to a batched N-D {@code SparseTensor}. + * The inputs represent an N-D SparseTensor with logical shape {@code [..., B, C]} + * (where {@code N >= 2}), and with indices sorted in the canonical lexicographic order. + *

This op is equivalent to applying the normal {@code tf.nn.softmax()} to each innermost + * logical submatrix with shape {@code [B, C]}, but with the catch that the implicitly + * zero elements do not participate. Specifically, the algorithm is equivalent * to the following: - *

- * (1) Applies `tf.nn.softmax()` to a densified view of each innermost submatrix - * with shape `[B, C]`, along the size-C dimension; - * (2) Masks out the original implicitly-zero locations; - * (3) Renormalizes the remaining elements. - *

- * Hence, the `SparseTensor` result has exactly the same non-zero indices and + *

(1) Applies {@code tf.nn.softmax()} to a densified view of each innermost submatrix + * with shape {@code [B, C]}, along the size-C dimension; + * (2) Masks out the original implicitly-zero locations; + * (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 */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseSoftmax.OP_NAME, + inputsClass = SparseSoftmax.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseSoftmax extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSoftmax"; + + private Output output; + + public SparseSoftmax(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSoftmax operation. - * + * * @param scope current scope - * @param spIndices 2-D. `NNZ x R` matrix with the indices of non-empty values in a + * @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. `NNZ` non-empty values corresponding to `sp_indices`. + * @param spValues 1-D. {@code NNZ} non-empty values corresponding to {@code sp_indices}. * @param spShape 1-D. Shape of the input SparseTensor. + * @param data type for {@code SparseSoftmax} output and operands * @return a new instance of SparseSoftmax */ - @Endpoint(describeByClass = true) - public static SparseSoftmax create(Scope scope, Operand spIndices, Operand spValues, Operand spShape) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseSoftmax", scope.makeOpName("SparseSoftmax")); + @Endpoint( + describeByClass = true + ) + public static SparseSoftmax create(Scope scope, Operand spIndices, + Operand spValues, Operand spShape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseSoftmax"); opBuilder.addInput(spIndices.asOutput()); opBuilder.addInput(spValues.asOutput()); opBuilder.addInput(spShape.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SparseSoftmax(opBuilder.build()); + return new SparseSoftmax<>(opBuilder.build()); } - + /** - * 1-D. The `NNZ` values for the result `SparseTensor`. + * Gets output. + * 1-D. The {@code NNZ} values for the result {@code SparseTensor}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSoftmax"; - - private Output output; - - private SparseSoftmax(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 8886a6fda12..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,77 +17,149 @@ 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 outputValues()} output */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseSparseMaximum.OP_NAME, + inputsClass = SparseSparseMaximum.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseSparseMaximum extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSparseMaximum"; + + private Output outputIndices; + + private Output outputValues; + + public SparseSparseMaximum(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSparseMaximum operation. - * + * * @param scope current scope - * @param aIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @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. `N` non-empty values corresponding to `a_indices`. + * @param aValues 1-D. {@code N} non-empty values corresponding to {@code a_indices}. * @param aShape 1-D. Shape of the input SparseTensor. - * @param bIndices counterpart to `a_indices` for the other operand. - * @param bValues counterpart to `a_values` for the other operand; must be of the same dtype. - * @param bShape counterpart to `a_shape` for the other operand; the two shapes must be equal. + * @param bIndices counterpart to {@code a_indices} for the other operand. + * @param bValues counterpart to {@code a_values} for the other operand; must be of the same dtype. + * @param bShape counterpart to {@code a_shape} for the other operand; the two shapes must be equal. + * @param data type for {@code SparseSparseMaximum} output and operands * @return a new instance of SparseSparseMaximum */ - @Endpoint(describeByClass = true) - public static SparseSparseMaximum create(Scope scope, Operand aIndices, Operand aValues, Operand aShape, Operand bIndices, Operand bValues, Operand bShape) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseSparseMaximum", scope.makeOpName("SparseSparseMaximum")); + @Endpoint( + describeByClass = true + ) + public static SparseSparseMaximum create(Scope scope, + Operand aIndices, Operand aValues, Operand aShape, + Operand bIndices, Operand bValues, Operand bShape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseSparseMaximum"); opBuilder.addInput(aIndices.asOutput()); opBuilder.addInput(aValues.asOutput()); opBuilder.addInput(aShape.asOutput()); opBuilder.addInput(bIndices.asOutput()); opBuilder.addInput(bValues.asOutput()); opBuilder.addInput(bShape.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SparseSparseMaximum(opBuilder.build()); + return new SparseSparseMaximum<>(opBuilder.build()); } - + /** + * Gets outputIndices. * 2-D. The indices of the output SparseTensor. + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** + * Gets outputValues. * 1-D. The values of the output SparseTensor. + * @return outputValues. */ public Output outputValues() { return outputValues; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSparseMaximum"; - - private Output outputIndices; - private Output outputValues; - - private SparseSparseMaximum(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); + + @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 4ac7a7b9dbc..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,77 +17,149 @@ 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 outputValues()} output */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseSparseMinimum.OP_NAME, + inputsClass = SparseSparseMinimum.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseSparseMinimum extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSparseMinimum"; + + private Output outputIndices; + + private Output outputValues; + + public SparseSparseMinimum(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSparseMinimum operation. - * + * * @param scope current scope - * @param aIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @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. `N` non-empty values corresponding to `a_indices`. + * @param aValues 1-D. {@code N} non-empty values corresponding to {@code a_indices}. * @param aShape 1-D. Shape of the input SparseTensor. - * @param bIndices counterpart to `a_indices` for the other operand. - * @param bValues counterpart to `a_values` for the other operand; must be of the same dtype. - * @param bShape counterpart to `a_shape` for the other operand; the two shapes must be equal. + * @param bIndices counterpart to {@code a_indices} for the other operand. + * @param bValues counterpart to {@code a_values} for the other operand; must be of the same dtype. + * @param bShape counterpart to {@code a_shape} for the other operand; the two shapes must be equal. + * @param data type for {@code SparseSparseMinimum} output and operands * @return a new instance of SparseSparseMinimum */ - @Endpoint(describeByClass = true) - public static SparseSparseMinimum create(Scope scope, Operand aIndices, Operand aValues, Operand aShape, Operand bIndices, Operand bValues, Operand bShape) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseSparseMinimum", scope.makeOpName("SparseSparseMinimum")); + @Endpoint( + describeByClass = true + ) + public static SparseSparseMinimum create(Scope scope, + Operand aIndices, Operand aValues, Operand aShape, + Operand bIndices, Operand bValues, Operand bShape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseSparseMinimum"); opBuilder.addInput(aIndices.asOutput()); opBuilder.addInput(aValues.asOutput()); opBuilder.addInput(aShape.asOutput()); opBuilder.addInput(bIndices.asOutput()); opBuilder.addInput(bValues.asOutput()); opBuilder.addInput(bShape.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SparseSparseMinimum(opBuilder.build()); + return new SparseSparseMinimum<>(opBuilder.build()); } - + /** + * Gets outputIndices. * 2-D. The indices of the output SparseTensor. + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** + * Gets outputValues. * 1-D. The values of the output SparseTensor. + * @return outputValues. */ public Output outputValues() { return outputValues; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSparseMinimum"; - - private Output outputIndices; - private Output outputValues; - - private SparseSparseMinimum(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); + + @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 3ca435ff577..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,110 +19,175 @@ 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; /** - * Split a `SparseTensor` into `num_split` tensors along one dimension. - *

- * If the `shape[split_dim]` is not an integer multiple of `num_split`. Slices - * `[0 : shape[split_dim] % num_split]` gets one extra dimension. - * For example, if `split_dim = 1` and `num_split = 2` and the input is - *

- * input_tensor = shape = [2, 7] - * [ a d e ] - * [b c ] - *

- * Graphically the output tensors are: - *

- * output_tensor[0] = shape = [2, 4] - * [ a ] - * [b c ] - *

- * output_tensor[1] = shape = [2, 3] - * [ d e ] - * [ ] - * - * @param data type for {@code outputValues()} output + * Split a {@code SparseTensor} into {@code num_split} tensors along one dimension. + * If the {@code shape[split_dim]} is not an integer multiple of {@code num_split}. Slices + * {@code [0 : shape[split_dim] % num_split]} gets one extra dimension. + * For example, if {@code split_dim = 1} and {@code num_split = 2} and the input is + *

+ * input_tensor = shape = [2, 7]
+ * [    a   d e  ]
+ * [b c          ]
+ * 
+ *

Graphically the output tensors are: + *

+ * output_tensor[0] = shape = [2, 4]
+ * [    a  ]
+ * [b c    ]
+ *
+ * output_tensor[1] = shape = [2, 3]
+ * [ d e  ]
+ * [      ]
+ * 
*/ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseSplit.OP_NAME, + inputsClass = SparseSplit.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseSplit extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSplit"; + + private List> outputIndices; + + private List> outputValues; + + private List> outputShape; + + @SuppressWarnings("unchecked") + 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)); + outputIdx += outputIndicesLength; + int outputValuesLength = operation.outputListLength("output_values"); + outputValues = Arrays.asList((Output[]) operation.outputList(outputIdx, outputValuesLength)); + outputIdx += outputValuesLength; + int outputShapeLength = operation.outputListLength("output_shape"); + outputShape = Arrays.asList((Output[]) operation.outputList(outputIdx, outputShapeLength)); + outputIdx += outputShapeLength; + } + /** * Factory method to create a class wrapping a new SparseSplit operation. - * + * * @param scope current scope * @param splitDim 0-D. The dimension along which to split. Must be in the range - * `[0, rank(shape))`. + * {@code [0, rank(shape))}. * @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. * output indices: A list of 1-D tensors represents the indices of the output * sparse tensors. * @param numSplit The number of ways to split. + * @param data type for {@code SparseSplit} output and operands * @return a new instance of SparseSplit */ - @Endpoint(describeByClass = true) - public static SparseSplit create(Scope scope, Operand splitDim, Operand indices, Operand values, Operand shape, Long numSplit) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseSplit", scope.makeOpName("SparseSplit")); + @Endpoint( + describeByClass = true + ) + public static SparseSplit create(Scope scope, Operand splitDim, + Operand indices, Operand values, Operand shape, Long numSplit) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseSplit"); opBuilder.addInput(splitDim.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(values.asOutput()); opBuilder.addInput(shape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_split", numSplit); - return new SparseSplit(opBuilder.build()); + return new SparseSplit<>(opBuilder.build()); } - + /** + * Gets outputIndices. + * + * @return outputIndices. */ public List> outputIndices() { return outputIndices; } - + /** + * Gets outputValues. * A list of 1-D tensors represents the values of the output sparse * tensors. + * @return outputValues. */ public List> outputValues() { return outputValues; } - + /** + * Gets outputShape. * A list of 1-D tensors represents the shape of the output sparse * tensors. + * @return outputShape. */ public List> outputShape() { return outputShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSplit"; - - private List> outputIndices; - private List> outputValues; - private List> outputShape; - - @SuppressWarnings("unchecked") - private SparseSplit(Operation operation) { - super(operation); - int outputIdx = 0; - int outputIndicesLength = operation.outputListLength("output_indices"); - outputIndices = Arrays.asList((Output[])operation.outputList(outputIdx, outputIndicesLength)); - outputIdx += outputIndicesLength; - int outputValuesLength = operation.outputListLength("output_values"); - outputValues = Arrays.asList((Output[])operation.outputList(outputIdx, outputValuesLength)); - outputIdx += outputValuesLength; - int outputShapeLength = operation.outputListLength("output_shape"); - outputShape = Arrays.asList((Output[])operation.outputList(outputIdx, outputShapeLength)); - outputIdx += outputShapeLength; + + @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 f104606ea34..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,67 +17,130 @@ 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 `SparseTensor` and a dense `Tensor`, producing a dense `Tensor`. - *

- * This Op does not require `a_indices` be sorted in standard lexicographic order. - * - * @param data type for {@code output()} output + * 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. */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseTensorDenseAdd.OP_NAME, + inputsClass = SparseTensorDenseAdd.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseTensorDenseAdd extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseTensorDenseAdd"; + + private Output output; + + public SparseTensorDenseAdd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseTensorDenseAdd operation. - * + * * @param scope current scope - * @param aIndices 2-D. The `indices` of the `SparseTensor`, with shape `[nnz, ndims]`. - * @param aValues 1-D. The `values` of the `SparseTensor`, with shape `[nnz]`. - * @param aShape 1-D. The `shape` of the `SparseTensor`, with shape `[ndims]`. - * @param b `ndims`-D Tensor. With shape `a_shape`. + * @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]}. + * @param b {@code ndims}-D Tensor. With shape {@code a_shape}. + * @param data type for {@code SparseTensorDenseAdd} output and operands + * @param data type for {@code SparseTensorDenseAdd} output and operands * @return a new instance of SparseTensorDenseAdd */ - @Endpoint(describeByClass = true) - public static SparseTensorDenseAdd create(Scope scope, Operand aIndices, Operand aValues, Operand aShape, Operand b) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseTensorDenseAdd", scope.makeOpName("SparseTensorDenseAdd")); + @Endpoint( + describeByClass = true + ) + public static SparseTensorDenseAdd create(Scope scope, + Operand aIndices, Operand aValues, Operand aShape, Operand b) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseTensorDenseAdd"); opBuilder.addInput(aIndices.asOutput()); opBuilder.addInput(aValues.asOutput()); opBuilder.addInput(aShape.asOutput()); opBuilder.addInput(b.asOutput()); - opBuilder = scope.apply(opBuilder); - return new SparseTensorDenseAdd(opBuilder.build()); + return new SparseTensorDenseAdd<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseTensorDenseAdd"; - - private Output output; - - private SparseTensorDenseAdd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 076dd63a78d..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,85 +17,79 @@ 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; /** - * Multiply SparseTensor (of rank 2) "A" by dense matrix "B". - *

+ * Multiply SparseTensor (of rank 2) "A" by dense matrix "B". * No validity checking is performed on the indices of A. However, the following * input format is recommended for optimal behavior: - *

- * if adjoint_a == false: - * A should be sorted in lexicographically increasing order. Use SparseReorder - * if you're not sure. + *

if adjoint_a == false: + * A should be sorted in lexicographically increasing order. Use SparseReorder + * if you're not sure. * 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 + * A should be sorted in order of increasing dimension 1 (i.e., "column major" + * order instead of "row major" order). */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseTensorDenseMatMul.OP_NAME, + inputsClass = SparseTensorDenseMatMul.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseTensorDenseMatMul extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.SparseTensorDenseMatMul} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param adjointA Use the adjoint of A in the matrix multiply. If A is complex, this - * is transpose(conj(A)). Otherwise it's transpose(A). - */ - public Options adjointA(Boolean adjointA) { - this.adjointA = adjointA; - return this; - } - - /** - * @param adjointB Use the adjoint of B in the matrix multiply. If B is complex, this - * is transpose(conj(B)). Otherwise it's transpose(B). - */ - public Options adjointB(Boolean adjointB) { - this.adjointB = adjointB; - return this; - } - - private Boolean adjointA; - private Boolean adjointB; - - private Options() { - } + public static final String OP_NAME = "SparseTensorDenseMatMul"; + + private Output product; + + public SparseTensorDenseMatMul(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + product = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseTensorDenseMatMul operation. - * + * * @param scope current scope - * @param aIndices 2-D. The `indices` of the `SparseTensor`, size `[nnz, 2]` Matrix. - * @param aValues 1-D. The `values` of the `SparseTensor`, size `[nnz]` Vector. - * @param aShape 1-D. The `shape` of the `SparseTensor`, size `[2]` Vector. + * @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. * @param b 2-D. A dense Matrix. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseTensorDenseMatMul} output and operands * @return a new instance of SparseTensorDenseMatMul */ - @Endpoint(describeByClass = true) - public static SparseTensorDenseMatMul create(Scope scope, Operand aIndices, Operand aValues, Operand aShape, Operand b, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseTensorDenseMatMul", scope.makeOpName("SparseTensorDenseMatMul")); + @Endpoint( + describeByClass = true + ) + public static SparseTensorDenseMatMul create(Scope scope, + Operand aIndices, Operand aValues, Operand aShape, Operand b, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseTensorDenseMatMul"); opBuilder.addInput(aIndices.asOutput()); opBuilder.addInput(aValues.asOutput()); opBuilder.addInput(aShape.asOutput()); opBuilder.addInput(b.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.adjointA != null) { @@ -106,44 +100,138 @@ public static SparseTensorDenseMatMul create(Scope scope, O } } } - return new SparseTensorDenseMatMul(opBuilder.build()); + return new SparseTensorDenseMatMul<>(opBuilder.build()); } - + /** + * Sets the adjointA option. + * * @param adjointA Use the adjoint of A in the matrix multiply. If A is complex, this * is transpose(conj(A)). Otherwise it's transpose(A). + * @return this Options instance. */ public static Options adjointA(Boolean adjointA) { return new Options().adjointA(adjointA); } - + /** + * Sets the adjointB option. + * * @param adjointB Use the adjoint of B in the matrix multiply. If B is complex, this * is transpose(conj(B)). Otherwise it's transpose(B). + * @return this Options instance. */ public static Options adjointB(Boolean adjointB) { return new Options().adjointB(adjointB); } - + /** + * Gets product. + * + * @return product. */ public Output product() { return product; } - + @Override public Output asOutput() { return product; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseTensorDenseMatMul"; - - private Output product; - - private SparseTensorDenseMatMul(Operation operation) { - super(operation); - int outputIdx = 0; - product = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseTensorDenseMatMul} + */ + public static class Options { + private Boolean adjointA; + + private Boolean adjointB; + + private Options() { + } + + /** + * Sets the adjointA option. + * + * @param adjointA Use the adjoint of A in the matrix multiply. If A is complex, this + * is transpose(conj(A)). Otherwise it's transpose(A). + * @return this Options instance. + */ + public Options adjointA(Boolean adjointA) { + this.adjointA = adjointA; + return this; + } + + /** + * Sets the adjointB option. + * + * @param adjointB Use the adjoint of B in the matrix multiply. If B is complex, this + * is transpose(conj(B)). Otherwise it's transpose(B). + * @return this Options instance. + */ + public Options adjointB(Boolean adjointB) { + this.adjointB = 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 11dccb5873a..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,85 +17,90 @@ 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; /** * Converts a sparse representation into a dense tensor. - *

- * Builds an array `dense` with shape `output_shape` such that - *

{@code
+ * Builds an array {@code dense} with shape {@code output_shape} such that
+ * 
  * # If sparse_indices is scalar
  * dense[i] = (i == sparse_indices ? sparse_values : default_value)
- * 
+ *
  * # If sparse_indices is a vector, then for each i
  * dense[sparse_indices[i]] = sparse_values[i]
- * 
+ *
  * # If sparse_indices is an n by d matrix, then for each i in [0, n)
  * dense[sparse_indices[i][0], ..., sparse_indices[i][d-1]] = sparse_values[i]
- * }
- * All other values in `dense` are set to `default_value`. If `sparse_values` is a + *
+ *

All other values in {@code dense} are set to {@code default_value}. If {@code sparse_values} is a * scalar, all sparse indices are set to this single value. - *

- * Indices should be sorted in lexicographic order, and indices must not - * contain any repeats. If `validate_indices` is true, these properties + *

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 */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseToDense.OP_NAME, + inputsClass = SparseToDense.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseToDense extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.SparseToDense} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param validateIndices If true, indices are checked to make sure they are sorted in - * lexicographic order and that there are no repeats. - */ - public Options validateIndices(Boolean validateIndices) { - this.validateIndices = validateIndices; - return this; - } - - private Boolean validateIndices; - - private Options() { - } + public static final String OP_NAME = "SparseToDense"; + + private Output dense; + + public SparseToDense(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + dense = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseToDense operation. - * + * * @param scope current scope - * @param sparseIndices 0-D, 1-D, or 2-D. `sparse_indices[i]` contains the complete - * index where `sparse_values[i]` will be placed. + * @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. - * @param sparseValues 1-D. Values corresponding to each row of `sparse_indices`, + * @param sparseValues 1-D. Values corresponding to each row of {@code sparse_indices}, * or a scalar value to be used for all sparse indices. * @param defaultValue Scalar value to set for indices not specified in - * `sparse_indices`. - * @param options carries optional attributes values + * {@code sparse_indices}. + * @param options carries optional attribute values + * @param data type for {@code SparseToDense} output and operands + * @param data type for {@code SparseToDense} output and operands * @return a new instance of SparseToDense */ - @Endpoint(describeByClass = true) - public static SparseToDense create(Scope scope, Operand sparseIndices, Operand outputShape, Operand sparseValues, Operand defaultValue, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseToDense", scope.makeOpName("SparseToDense")); + @Endpoint( + describeByClass = true + ) + public static SparseToDense create(Scope scope, + Operand sparseIndices, Operand outputShape, Operand sparseValues, + Operand defaultValue, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseToDense"); opBuilder.addInput(sparseIndices.asOutput()); opBuilder.addInput(outputShape.asOutput()); opBuilder.addInput(sparseValues.asOutput()); opBuilder.addInput(defaultValue.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.validateIndices != null) { @@ -103,37 +108,109 @@ public static SparseToDense create(Scope } } } - return new SparseToDense(opBuilder.build()); + return new SparseToDense<>(opBuilder.build()); } - + /** + * Sets the validateIndices option. + * * @param validateIndices If true, indices are checked to make sure they are sorted in * lexicographic order and that there are no repeats. + * @return this Options instance. */ public static Options validateIndices(Boolean validateIndices) { return new Options().validateIndices(validateIndices); } - + /** - * Dense output tensor of shape `output_shape`. + * Gets dense. + * Dense output tensor of shape {@code output_shape}. + * @return dense. */ public Output dense() { return dense; } - + @Override public Output asOutput() { return dense; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseToDense"; - - private Output dense; - - private SparseToDense(Operation operation) { - super(operation); - int outputIdx = 0; - dense = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseToDense} + */ + public static class Options { + private Boolean validateIndices; + + private Options() { + } + + /** + * Sets the validateIndices option. + * + * @param validateIndices If true, indices are checked to make sure they are sorted in + * lexicographic order and that there are no repeats. + * @return this Options instance. + */ + public Options validateIndices(Boolean validateIndices) { + this.validateIndices = 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 68d17c8eeca..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,100 +17,108 @@ 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; /** - * Applies set operation along last dimension of 2 `SparseTensor` inputs. - *

- * See SetOperationOp::SetOperationFromContext for values of `set_operation`. - *

- * If `validate_indices` is `True`, `sparse.SparseToSparseSetOperation` validates the - * order and range of `set1` and `set2` indices. - *

- * Input `set1` is a `SparseTensor` represented by `set1_indices`, `set1_values`, - * and `set1_shape`. For `set1` ranked `n`, 1st `n-1` dimensions must be the same - * as `set2`. Dimension `n` contains values in a set, duplicates are allowed but + * Applies set operation along last dimension of 2 {@code SparseTensor} inputs. + * See SetOperationOp::SetOperationFromContext for values of {@code set_operation}. + *

If {@code validate_indices} is {@code True}, {@code sparse.SparseToSparseSetOperation} validates the + * order and range of {@code set1} and {@code set2} indices. + *

Input {@code set1} is a {@code SparseTensor} represented by {@code set1_indices}, {@code set1_values}, + * and {@code set1_shape}. For {@code set1} ranked {@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. - *

- * Input `set2` is a `SparseTensor` represented by `set2_indices`, `set2_values`, - * and `set2_shape`. For `set2` ranked `n`, 1st `n-1` dimensions must be the same - * as `set1`. Dimension `n` contains values in a set, duplicates are allowed but + *

Input {@code set2} is a {@code SparseTensor} represented by {@code set2_indices}, {@code set2_values}, + * and {@code set2_shape}. For {@code set2} ranked {@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. - *

- * If `validate_indices` is `True`, this op validates the order and range of `set1` - * and `set2` indices. - *

- * Output `result` is a `SparseTensor` represented by `result_indices`, - * `result_values`, and `result_shape`. For `set1` and `set2` ranked `n`, this - * has rank `n` and the same 1st `n-1` dimensions as `set1` and `set2`. The `nth` - * dimension contains the result of `set_operation` applied to the corresponding - * `[0...n-1]` dimension of `set`. - * - * @param data type for {@code resultValues()} output + *

If {@code validate_indices} is {@code True}, this op validates the order and range of {@code set1} + * and {@code set2} indices. + *

Output {@code result} is a {@code SparseTensor} represented by {@code result_indices}, + * {@code result_values}, and {@code result_shape}. For {@code set1} and {@code set2} ranked {@code n}, this + * 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}. */ -@Operator(group = "sparse") +@OpMetadata( + opType = SparseToSparseSetOperation.OP_NAME, + inputsClass = SparseToSparseSetOperation.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseToSparseSetOperation extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.SparseToSparseSetOperation} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param validateIndices - */ - public Options validateIndices(Boolean validateIndices) { - this.validateIndices = validateIndices; - return this; - } - - private Boolean validateIndices; - - private Options() { - } + public static final String OP_NAME = "SparseToSparseSetOperation"; + + private Output resultIndices; + + private Output resultValues; + + private Output resultShape; + + public SparseToSparseSetOperation(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + resultIndices = operation.output(outputIdx++); + resultValues = operation.output(outputIdx++); + resultShape = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseToSparseSetOperation operation. - * + * * @param scope current scope - * @param set1Indices 2D `Tensor`, indices of a `SparseTensor`. Must be in row-major + * @param set1Indices 2D {@code Tensor}, indices of a {@code SparseTensor}. Must be in row-major * order. - * @param set1Values 1D `Tensor`, values of a `SparseTensor`. Must be in row-major + * @param set1Values 1D {@code Tensor}, values of a {@code SparseTensor}. Must be in row-major * order. - * @param set1Shape 1D `Tensor`, shape of a `SparseTensor`. `set1_shape[0...n-1]` must - * be the same as `set2_shape[0...n-1]`, `set1_shape[n]` is the - * max set size across `0...n-1` dimensions. - * @param set2Indices 2D `Tensor`, indices of a `SparseTensor`. Must be in row-major + * @param set1Shape 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. + * @param set2Indices 2D {@code Tensor}, indices of a {@code SparseTensor}. Must be in row-major * order. - * @param set2Values 1D `Tensor`, values of a `SparseTensor`. Must be in row-major + * @param set2Values 1D {@code Tensor}, values of a {@code SparseTensor}. Must be in row-major * order. - * @param set2Shape 1D `Tensor`, shape of a `SparseTensor`. `set2_shape[0...n-1]` must - * be the same as `set1_shape[0...n-1]`, `set2_shape[n]` is the - * max set size across `0...n-1` dimensions. - * @param setOperation - * @param options carries optional attributes values + * @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 attribute + * @param options carries optional attribute values + * @param data type for {@code SparseToSparseSetOperation} output and operands * @return a new instance of SparseToSparseSetOperation */ - @Endpoint(describeByClass = true) - public static SparseToSparseSetOperation create(Scope scope, Operand set1Indices, Operand set1Values, Operand set1Shape, Operand set2Indices, Operand set2Values, Operand set2Shape, String setOperation, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseToSparseSetOperation", scope.makeOpName("SparseToSparseSetOperation")); + @Endpoint( + describeByClass = true + ) + public static SparseToSparseSetOperation create(Scope scope, + Operand set1Indices, Operand set1Values, Operand set1Shape, + Operand set2Indices, Operand set2Values, Operand set2Shape, + String setOperation, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseToSparseSetOperation"); opBuilder.addInput(set1Indices.asOutput()); opBuilder.addInput(set1Values.asOutput()); opBuilder.addInput(set1Shape.asOutput()); opBuilder.addInput(set2Indices.asOutput()); opBuilder.addInput(set2Values.asOutput()); opBuilder.addInput(set2Shape.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("set_operation", setOperation); if (options != null) { for (Options opts : options) { @@ -119,51 +127,138 @@ public static SparseToSparseSetOperation create(Scope scope } } } - return new SparseToSparseSetOperation(opBuilder.build()); + return new SparseToSparseSetOperation<>(opBuilder.build()); } - + /** - * @param validateIndices + * Sets the validateIndices option. + * + * @param validateIndices the validateIndices option + * @return this Options instance. */ public static Options validateIndices(Boolean validateIndices) { return new Options().validateIndices(validateIndices); } - + /** - * 2D indices of a `SparseTensor`. + * Gets resultIndices. + * 2D indices of a {@code SparseTensor}. + * @return resultIndices. */ public Output resultIndices() { return resultIndices; } - + /** - * 1D values of a `SparseTensor`. + * Gets resultValues. + * 1D values of a {@code SparseTensor}. + * @return resultValues. */ public Output resultValues() { return resultValues; } - + /** - * 1D `Tensor` shape of a `SparseTensor`. `result_shape[0...n-1]` is - * the same as the 1st `n-1` dimensions of `set1` and `set2`, `result_shape[n]` - * is the max result set size across all `0...n-1` dimensions. + * Gets resultShape. + * 1D {@code Tensor} shape of a {@code SparseTensor}. {@code result_shape[0...n-1]} is + * the same as the 1st {@code n-1} dimensions of {@code set1} and {@code set2}, {@code result_shape[n]} + * is the max result set size across all {@code 0...n-1} dimensions. + * @return resultShape. */ public Output resultShape() { return resultShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseToSparseSetOperation"; - - private Output resultIndices; - private Output resultValues; - private Output resultShape; - - private SparseToSparseSetOperation(Operation operation) { - super(operation); - int outputIdx = 0; - resultIndices = operation.output(outputIdx++); - resultValues = operation.output(outputIdx++); - resultShape = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseToSparseSetOperation} + */ + public static class Options { + private Boolean validateIndices; + + private Options() { + } + + /** + * Sets the validateIndices option. + * + * @param validateIndices the validateIndices option + * @return this Options instance. + */ + public Options validateIndices(Boolean validateIndices) { + this.validateIndices = 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 a18674e8c4c..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,56 +17,58 @@ 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; /** - * Read `SparseTensors` from a `SparseTensorsMap` and concatenate them. - *

- * The input `sparse_handles` must be an `int64` matrix of shape `[N, 1]` where - * `N` is the minibatch size and the rows correspond to the output handles of - * `AddSparseToTensorsMap` or `AddManySparseToTensorsMap`. The ranks of the - * original `SparseTensor` objects that went into the given input ops must all - * match. When the final `SparseTensor` is created, it has rank one - * higher than the ranks of the incoming `SparseTensor` objects + * Read {@code SparseTensors} from a {@code SparseTensorsMap} and concatenate them. + * The input {@code sparse_handles} must be an {@code int64} matrix of shape {@code [N, 1]} where + * {@code N} is the minibatch size and the rows correspond to the output handles of + * {@code AddSparseToTensorsMap} or {@code AddManySparseToTensorsMap}. The ranks of the + * original {@code SparseTensor} objects that went into the given input ops must all + * match. When the final {@code SparseTensor} is created, it has rank one + * higher than the ranks of the incoming {@code SparseTensor} objects * (they have been concatenated along a new row dimension on the left). - *

- * The output `SparseTensor` object's shape values for all dimensions but the - * first are the max across the input `SparseTensor` objects' shape values - * for the corresponding dimensions. Its first shape value is `N`, the minibatch + *

The output {@code SparseTensor} object's shape values for all dimensions but the + * first are the max across the input {@code SparseTensor} objects' shape values + * for the corresponding dimensions. Its first shape value is {@code N}, the minibatch * size. - *

- * The input `SparseTensor` objects' indices are assumed ordered in + *

The input {@code SparseTensor} objects' indices are assumed ordered in * standard lexicographic order. If this is not the case, after this - * step run `SparseReorder` to restore index ordering. - *

- * For example, if the handles represent an input, which is a `[2, 3]` matrix - * representing two original `SparseTensor` objects: - *

{@code
+ * step run {@code SparseReorder} to restore index ordering.
+ * 

For example, if the handles represent an input, which is a {@code [2, 3]} matrix + * representing two original {@code SparseTensor} objects: + *

  *     index = [ 0]
  *             [10]
  *             [20]
  *     values = [1, 2, 3]
  *     shape = [50]
- * }
- * and - *
{@code
+ * 
+ *

and + *

  *     index = [ 2]
  *             [10]
  *     values = [4, 5]
  *     shape = [30]
- * }
- * then the final `SparseTensor` will be: - *
{@code
+ * 
+ *

then the final {@code SparseTensor} will be: + *

  *     index = [0  0]
  *             [0 10]
  *             [0 20]
@@ -74,60 +76,54 @@
  *             [1 10]
  *     values = [1, 2, 3, 4, 5]
  *     shape = [2 50]
- * }
- * - * - * @param data type for {@code sparseValues()} output + *
*/ -@Operator(group = "sparse") +@OpMetadata( + opType = TakeManySparseFromTensorsMap.OP_NAME, + inputsClass = TakeManySparseFromTensorsMap.Inputs.class +) +@Operator( + group = "sparse" +) public final class TakeManySparseFromTensorsMap extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.TakeManySparseFromTensorsMap} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container The container name for the `SparseTensorsMap` read by this op. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName The shared name for the `SparseTensorsMap` read by this op. - * It should not be blank; rather the `shared_name` or unique Operation name - * of the Op that created the original `SparseTensorsMap` should be used. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "TakeManySparseFromTensorsMap"; + + private Output sparseIndices; + + private Output sparseValues; + + private Output sparseShape; + + public TakeManySparseFromTensorsMap(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + sparseIndices = operation.output(outputIdx++); + sparseValues = operation.output(outputIdx++); + sparseShape = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new TakeManySparseFromTensorsMap operation. - * + * * @param scope current scope - * @param sparseHandles 1-D, The `N` serialized `SparseTensor` objects. - * Shape: `[N]`. - * @param dtype The `dtype` of the `SparseTensor` objects stored in the - * `SparseTensorsMap`. - * @param options carries optional attributes values + * @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 + * {@code SparseTensorsMap}. + * @param options carries optional attribute values + * @param data type for {@code TakeManySparseFromTensorsMap} output and operands * @return a new instance of TakeManySparseFromTensorsMap */ - @Endpoint(describeByClass = true) - public static TakeManySparseFromTensorsMap create(Scope scope, Operand sparseHandles, Class dtype, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("TakeManySparseFromTensorsMap", scope.makeOpName("TakeManySparseFromTensorsMap")); + @Endpoint( + describeByClass = true + ) + public static TakeManySparseFromTensorsMap create(Scope scope, + Operand sparseHandles, Class dtype, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TakeManySparseFromTensorsMap"); opBuilder.addInput(sparseHandles.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); if (options != null) { for (Options opts : options) { @@ -139,58 +135,129 @@ public static TakeManySparseFromTensorsMap create(Scope sco } } } - return new TakeManySparseFromTensorsMap(opBuilder.build()); + return new TakeManySparseFromTensorsMap<>(opBuilder.build()); } - + /** - * @param container The container name for the `SparseTensorsMap` read by this op. + * Sets the container option. + * + * @param container The container name for the {@code SparseTensorsMap} read by this op. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName The shared name for the `SparseTensorsMap` read by this op. - * It should not be blank; rather the `shared_name` or unique Operation name - * of the Op that created the original `SparseTensorsMap` should be used. + * Sets the sharedName option. + * + * @param sharedName 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. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * 2-D. The `indices` of the minibatch `SparseTensor`. + * Gets sparseIndices. + * 2-D. The {@code indices} of the minibatch {@code SparseTensor}. + * @return sparseIndices. */ public Output sparseIndices() { return sparseIndices; } - + /** - * 1-D. The `values` of the minibatch `SparseTensor`. + * Gets sparseValues. + * 1-D. The {@code values} of the minibatch {@code SparseTensor}. + * @return sparseValues. */ public Output sparseValues() { return sparseValues; } - + /** - * 1-D. The `shape` of the minibatch `SparseTensor`. + * Gets sparseShape. + * 1-D. The {@code shape} of the minibatch {@code SparseTensor}. + * @return sparseShape. */ public Output sparseShape() { return sparseShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TakeManySparseFromTensorsMap"; - - private Output sparseIndices; - private Output sparseValues; - private Output sparseShape; - - private TakeManySparseFromTensorsMap(Operation operation) { - super(operation); - int outputIdx = 0; - sparseIndices = operation.output(outputIdx++); - sparseValues = operation.output(outputIdx++); - sparseShape = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.TakeManySparseFromTensorsMap} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container The container name for the {@code SparseTensorsMap} read by this op. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName 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. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = 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 9d2247185e7..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,65 +17,73 @@ 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; /** * Joins the strings in the given list of string tensors into one tensor; - *

* with the given separator (default is an empty separator). - *

- * Examples: - *

- * >>> s = ["hello", "world", "tensorflow"] - * >>> tf.strings.join(s, " ") - * + *

Examples: + *

+ *
+ *
+ *

s = ["hello", "world", "tensorflow"] + * tf.strings.join(s, " ") + * <tf.Tensor: shape=(), dtype=string, numpy=b'hello world tensorflow'> + *

+ *
+ *
*/ -@Operator(group = "strings") +@OpMetadata( + opType = Join.OP_NAME, + inputsClass = Join.Inputs.class +) +@Operator( + group = "strings" +) public final class Join extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.Join} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param separator string, an optional join separator. - */ - public Options separator(String separator) { - this.separator = separator; - return this; - } - - private String separator; - - private Options() { - } + public static final String OP_NAME = "StringJoin"; + + private Output output; + + public Join(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Join operation. - * + * Factory method to create a class wrapping a new StringJoin operation. + * * @param scope current scope * @param inputs 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. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Join */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Join create(Scope scope, Iterable> inputs, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("StringJoin", scope.makeOpName("Join")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Join"); opBuilder.addInputList(Operands.asOutputs(inputs)); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.separator != null) { @@ -85,33 +93,75 @@ public static Join create(Scope scope, Iterable> inputs, Option } return new Join(opBuilder.build()); } - + /** + * Sets the separator option. + * * @param separator string, an optional join separator. + * @return this Options instance. */ public static Options separator(String separator) { return new Options().separator(separator); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringJoin"; - - private Output output; - - private Join(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.Join} + */ + public static class Options { + private String separator; + + private Options() { + } + + /** + * Sets the separator option. + * + * @param separator string, an optional join separator. + * @return this Options instance. + */ + public Options separator(String separator) { + this.separator = 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 2d3e8393e40..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,60 +17,68 @@ 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; /** * Converts all uppercase characters into their respective lowercase replacements. - *

* Example: - *

- * >>> tf.strings.lower("CamelCase string and ALL CAPS") - * - * + *

+ *
+ *
+ *

tf.strings.lower("CamelCase string and ALL CAPS") + * <tf.Tensor: shape=(), dtype=string, numpy=b'camelcase string and all caps'> + *

+ *
+ *
*/ -@Operator(group = "strings") +@OpMetadata( + opType = Lower.OP_NAME, + inputsClass = Lower.Inputs.class +) +@Operator( + group = "strings" +) public final class Lower extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.Lower} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param encoding - */ - public Options encoding(String encoding) { - this.encoding = encoding; - return this; - } - - private String encoding; - - private Options() { - } + public static final String OP_NAME = "StringLower"; + + private Output output; + + public Lower(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Lower operation. - * + * Factory method to create a class wrapping a new StringLower operation. + * * @param scope current scope - * @param input - * @param options carries optional attributes values + * @param input The input to be lower-cased. + * @param options carries optional attribute values * @return a new instance of Lower */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Lower create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("StringLower", scope.makeOpName("Lower")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Lower"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.encoding != null) { @@ -80,33 +88,74 @@ public static Lower create(Scope scope, Operand input, Options... optio } return new Lower(opBuilder.build()); } - + /** - * @param encoding + * Sets the encoding option. + * + * @param encoding Character encoding of {@code input}. Allowed values are '' and 'utf-8'. + * Value '' is interpreted as ASCII. + * @return this Options instance. */ public static Options encoding(String encoding) { return new Options().encoding(encoding); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringLower"; - - private Output output; - - private Lower(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.Lower} + */ + public static class Options { + private String encoding; + + private Options() { + } + + /** + * Sets the encoding option. + * + * @param encoding Character encoding of {@code input}. Allowed values are '' and 'utf-8'. + * Value '' is interpreted as ASCII. + * @return this Options instance. + */ + public Options encoding(String encoding) { + this.encoding = 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 6ea85330626..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,92 +17,86 @@ 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; /** * Joins a string Tensor across the given dimensions. - *

* Computes the string join across dimensions in the given string Tensor of shape - * `[\\(d_0, d_1, ..., d_{n-1}\\)]`. Returns a new Tensor created by joining the input + * {@code [\\(d_0, d_1, ..., d_{n-1}\\)]}. Returns a new Tensor created by joining the input * strings with the given separator (default: empty string). Negative indices are - * counted backwards from the end, with `-1` being equivalent to `n - 1`. If - * indices are not specified, joins across all dimensions beginning from `n - 1` - * through `0`. - *

- * For example: - *

{@code
- * # tensor `a` is [["a", "b"], ["c", "d"]]
- * tf.reduce_join(a, 0) ==> ["ac", "bd"]
- * tf.reduce_join(a, 1) ==> ["ab", "cd"]
- * tf.reduce_join(a, -2) = tf.reduce_join(a, 0) ==> ["ac", "bd"]
- * tf.reduce_join(a, -1) = tf.reduce_join(a, 1) ==> ["ab", "cd"]
- * tf.reduce_join(a, 0, keep_dims=True) ==> [["ac", "bd"]]
- * tf.reduce_join(a, 1, keep_dims=True) ==> [["ab"], ["cd"]]
- * tf.reduce_join(a, 0, separator=".") ==> ["a.c", "b.d"]
- * tf.reduce_join(a, [0, 1]) ==> "acbd"
- * tf.reduce_join(a, [1, 0]) ==> "abcd"
- * tf.reduce_join(a, []) ==> [["a", "b"], ["c", "d"]]
- * tf.reduce_join(a) = tf.reduce_join(a, [1, 0]) ==> "abcd"
- * }
- * + * counted backwards from the end, with {@code -1} being equivalent to {@code n - 1}. If + * indices are not specified, joins across all dimensions beginning from {@code n - 1} + * through {@code 0}. + *

For example: + *

+ * # tensor `a` is [["a", "b"], ["c", "d"]]
+ * tf.reduce_join(a, 0) ==> ["ac", "bd"]
+ * tf.reduce_join(a, 1) ==> ["ab", "cd"]
+ * tf.reduce_join(a, -2) = tf.reduce_join(a, 0) ==> ["ac", "bd"]
+ * tf.reduce_join(a, -1) = tf.reduce_join(a, 1) ==> ["ab", "cd"]
+ * tf.reduce_join(a, 0, keep_dims=True) ==> [["ac", "bd"]]
+ * tf.reduce_join(a, 1, keep_dims=True) ==> [["ab"], ["cd"]]
+ * tf.reduce_join(a, 0, separator=".") ==> ["a.c", "b.d"]
+ * tf.reduce_join(a, [0, 1]) ==> "acbd"
+ * tf.reduce_join(a, [1, 0]) ==> "abcd"
+ * tf.reduce_join(a, []) ==> [["a", "b"], ["c", "d"]]
+ * tf.reduce_join(a) = tf.reduce_join(a, [1, 0]) ==> "abcd"
+ * 
*/ -@Operator(group = "strings") +@OpMetadata( + opType = ReduceJoin.OP_NAME, + inputsClass = ReduceJoin.Inputs.class +) +@Operator( + group = "strings" +) public final class ReduceJoin extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.ReduceJoin} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If `True`, retain reduced dimensions with length `1`. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - /** - * @param separator The separator to use when joining. - */ - public Options separator(String separator) { - this.separator = separator; - return this; - } - - private Boolean keepDims; - private String separator; - - private Options() { - } + public static final String OP_NAME = "ReduceJoin"; + + private Output output; + + public ReduceJoin(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ReduceJoin operation. - * + * * @param scope current scope * @param inputs The input to be joined. All reduced indices must have non-zero size. * @param reductionIndices The dimensions to reduce over. Dimensions are reduced in the - * order specified. Omitting `reduction_indices` is equivalent to passing - * `[n-1, n-2, ..., 0]`. Negative indices from `-n` to `-1` are supported. - * @param options carries optional attributes values + * 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. + * @param options carries optional attribute values * @return a new instance of ReduceJoin */ - @Endpoint(describeByClass = true) - public static ReduceJoin create(Scope scope, Operand inputs, Operand reductionIndices, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ReduceJoin", scope.makeOpName("ReduceJoin")); + @Endpoint( + describeByClass = true + ) + public static ReduceJoin create(Scope scope, Operand inputs, + Operand reductionIndices, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReduceJoin"); opBuilder.addInput(inputs.asOutput()); opBuilder.addInput(reductionIndices.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.keepDims != null) { @@ -115,42 +109,109 @@ public static ReduceJoin create(Scope scope, Operand inputs, Operand output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReduceJoin"; - - private Output output; - - private ReduceJoin(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.ReduceJoin} + */ + public static class Options { + private Boolean keepDims; + + private String separator; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If {@code True}, retain reduced dimensions with length {@code 1}. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = keepDims; + return this; + } + + /** + * Sets the separator option. + * + * @param separator The separator to use when joining. + * @return this Options instance. + */ + public Options separator(String separator) { + this.separator = 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 04d507f29fc..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,74 +17,114 @@ 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; /** * Check if the input matches the regex pattern. - *

* The input is a string tensor of any shape. The pattern is a scalar * string tensor which is applied to 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) - *

- * Examples: - *

- * >>> tf.strings.regex_full_match(["TF lib", "lib TF"], ".*lib$") - * - * >>> tf.strings.regex_full_match(["TF lib", "lib TF"], ".*TF$") - * + *

The pattern follows the re2 syntax (https://github.com/google/re2/wiki/Syntax) + *

Examples: + *

+ *
+ *
+ *

tf.strings.regex_full_match(["TF lib", "lib TF"], ".*lib$") + * <tf.Tensor: shape=(2,), dtype=bool, numpy=array([ True, False])> + * tf.strings.regex_full_match(["TF lib", "lib TF"], ".*TF$") + * <tf.Tensor: shape=(2,), dtype=bool, numpy=array([False, True])> + *

+ *
+ *
*/ -@Operator(group = "strings") +@OpMetadata( + opType = RegexFullMatch.OP_NAME, + inputsClass = RegexFullMatch.Inputs.class +) +@Operator( + group = "strings" +) public final class RegexFullMatch extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RegexFullMatch"; + + private Output output; + + public RegexFullMatch(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RegexFullMatch operation. - * + * * @param scope current scope * @param input A string tensor of the text to be processed. * @param pattern A scalar string tensor containing the regular expression to match the input. * @return a new instance of RegexFullMatch */ - @Endpoint(describeByClass = true) - public static RegexFullMatch create(Scope scope, Operand input, Operand pattern) { - OperationBuilder opBuilder = scope.env().opBuilder("RegexFullMatch", scope.makeOpName("RegexFullMatch")); + @Endpoint( + describeByClass = true + ) + public static RegexFullMatch create(Scope scope, Operand input, + Operand pattern) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RegexFullMatch"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(pattern.asOutput()); - opBuilder = scope.apply(opBuilder); return new RegexFullMatch(opBuilder.build()); } - + /** - * A bool tensor with the same shape as `input`. + * Gets output. + * A bool tensor with the same shape as {@code input}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RegexFullMatch"; - - private Output output; - - private RegexFullMatch(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 31063d7d2ba..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,64 +17,67 @@ 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 matches of the `pattern` regular expression in `input` with the - * replacement string provided in `rewrite`. - *

+ * Replaces matches of the {@code pattern} regular expression in {@code input} with the + * replacement string provided in {@code rewrite}. * It follows the re2 syntax (https://github.com/google/re2/wiki/Syntax) */ -@Operator(group = "strings") +@OpMetadata( + opType = RegexReplace.OP_NAME, + inputsClass = RegexReplace.Inputs.class +) +@Operator( + group = "strings" +) public final class RegexReplace extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.RegexReplace} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param replaceGlobal If True, the replacement is global (that is, all matches of the `pattern` regular - * expression in each input string are rewritten), otherwise the `rewrite` - * substitution is only made for the first `pattern` match. - */ - public Options replaceGlobal(Boolean replaceGlobal) { - this.replaceGlobal = replaceGlobal; - return this; - } - - private Boolean replaceGlobal; - - private Options() { - } + public static final String OP_NAME = "RegexReplace"; + + private Output output; + + public RegexReplace(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RegexReplace operation. - * + * * @param scope current scope * @param input The text to be processed. - * @param pattern The regular expression to be matched in the `input` strings. - * @param rewrite The rewrite string to be substituted for the `pattern` expression where it is - * matched in the `input` strings. - * @param options carries optional attributes values + * @param pattern The regular expression to be matched in the {@code input} strings. + * @param rewrite The rewrite string to be substituted for the {@code pattern} expression where it is + * matched in the {@code input} strings. + * @param options carries optional attribute values * @return a new instance of RegexReplace */ - @Endpoint(describeByClass = true) - public static RegexReplace create(Scope scope, Operand input, Operand pattern, Operand rewrite, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RegexReplace", scope.makeOpName("RegexReplace")); + @Endpoint( + describeByClass = true + ) + public static RegexReplace create(Scope scope, Operand input, Operand pattern, + Operand rewrite, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RegexReplace"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(pattern.asOutput()); opBuilder.addInput(rewrite.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.replaceGlobal != null) { @@ -84,36 +87,90 @@ public static RegexReplace create(Scope scope, Operand input, Operand output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RegexReplace"; - - private Output output; - - private RegexReplace(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.RegexReplace} + */ + public static class Options { + private Boolean replaceGlobal; + + private Options() { + } + + /** + * Sets the replaceGlobal option. + * + * @param replaceGlobal 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. + * @return this Options instance. + */ + public Options replaceGlobal(Boolean replaceGlobal) { + this.replaceGlobal = 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 e3b7425e268..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,66 +17,102 @@ 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; /** * 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) + *

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 + */ + public static final String OP_NAME = "StaticRegexFullMatch"; + + private Output output; + + public StaticRegexFullMatch(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StaticRegexFullMatch operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static StaticRegexFullMatch create(Scope scope, Operand input, String pattern) { - OperationBuilder opBuilder = scope.env().opBuilder("StaticRegexFullMatch", scope.makeOpName("StaticRegexFullMatch")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StaticRegexFullMatch"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("pattern", pattern); return new StaticRegexFullMatch(opBuilder.build()); } - + /** - * A bool tensor with the same shape as `input`. + * Gets output. + * A bool tensor with the same shape as {@code input}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StaticRegexFullMatch"; - - private Output output; - - private StaticRegexFullMatch(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 b6a4a47f641..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,58 +17,63 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.strings.StaticRegexReplace} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param replaceGlobal If True, the replacement is global, otherwise the replacement - * is done only on the first match. - */ - public Options replaceGlobal(Boolean replaceGlobal) { - this.replaceGlobal = replaceGlobal; - return this; - } - - private Boolean replaceGlobal; - - private Options() { - } + public static final String OP_NAME = "StaticRegexReplace"; + + private Output output; + + public StaticRegexReplace(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new StaticRegexReplace operation. - * + * * @param scope current scope * @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 attributes values + * @param options carries optional attribute values * @return a new instance of StaticRegexReplace */ - @Endpoint(describeByClass = true) - public static StaticRegexReplace create(Scope scope, Operand input, String pattern, String rewrite, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("StaticRegexReplace", scope.makeOpName("StaticRegexReplace")); + @Endpoint( + describeByClass = true + ) + public static StaticRegexReplace create(Scope scope, Operand input, String pattern, + String rewrite, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StaticRegexReplace"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("pattern", pattern); opBuilder.setAttr("rewrite", rewrite); if (options != null) { @@ -80,35 +85,86 @@ public static StaticRegexReplace create(Scope scope, Operand input, Str } return new StaticRegexReplace(opBuilder.build()); } - + /** + * Sets the replaceGlobal option. + * * @param replaceGlobal If True, the replacement is global, otherwise the replacement * is done only on the first match. + * @return this Options instance. */ public static Options replaceGlobal(Boolean replaceGlobal) { return new Options().replaceGlobal(replaceGlobal); } - + /** + * Gets output. * The text after applying pattern and rewrite. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StaticRegexReplace"; - - private Output output; - - private StaticRegexReplace(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.StaticRegexReplace} + */ + public static class Options { + private Boolean replaceGlobal; + + private Options() { + } + + /** + * Sets the replaceGlobal option. + * + * @param replaceGlobal If True, the replacement is global, otherwise the replacement + * is done only on the first match. + * @return this Options instance. + */ + public Options replaceGlobal(Boolean replaceGlobal) { + this.replaceGlobal = 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 de8827e32e5..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,75 +17,62 @@ 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. */ -@Operator(group = "strings") +@OpMetadata( + opType = StringFormat.OP_NAME, + inputsClass = StringFormat.Inputs.class +) +@Operator( + group = "strings" +) public final class StringFormat extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.StringFormat} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param template A string, the template to format tensor summaries into. - */ - public Options template(String template) { - this.template = template; - return this; - } - - /** - * @param placeholder A string, at each placeholder in the template a subsequent tensor summary will be inserted. - */ - public Options placeholder(String placeholder) { - this.placeholder = placeholder; - return this; - } - - /** - * @param summarize When formatting the tensor summaries print the first and last summarize entries of each tensor dimension. - */ - public Options summarize(Long summarize) { - this.summarize = summarize; - return this; - } - - private String template; - private String placeholder; - private Long summarize; - - private Options() { - } + public static final String OP_NAME = "StringFormat"; + + private Output output; + + public StringFormat(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new StringFormat operation. - * + * * @param scope current scope * @param inputs The list of tensors to format into the placeholder string. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of StringFormat */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static StringFormat create(Scope scope, Iterable> inputs, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("StringFormat", scope.makeOpName("StringFormat")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StringFormat"); opBuilder.addInputList(Operands.asOutputs(inputs)); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.template != null) { @@ -101,48 +88,137 @@ public static StringFormat create(Scope scope, Iterable> inputs, Opti } return new StringFormat(opBuilder.build()); } - + /** + * Sets the template option. + * * @param template A string, the template to format tensor summaries into. + * @return this Options instance. */ public static Options template(String template) { return new Options().template(template); } - + /** + * Sets the placeholder option. + * * @param placeholder A string, at each placeholder in the template a subsequent tensor summary will be inserted. + * @return this Options instance. */ public static Options placeholder(String placeholder) { return new Options().placeholder(placeholder); } - + /** + * Sets the summarize option. + * * @param summarize When formatting the tensor summaries print the first and last summarize entries of each tensor dimension. + * @return this Options instance. */ public static Options summarize(Long summarize) { return new Options().summarize(summarize); } - + /** + * Gets output. * = The resulting string scalar. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringFormat"; - - private Output output; - - private StringFormat(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.StringFormat} + */ + public static class Options { + private String template; + + private String placeholder; + + private Long summarize; + + private Options() { + } + + /** + * Sets the template option. + * + * @param template A string, the template to format tensor summaries into. + * @return this Options instance. + */ + public Options template(String template) { + this.template = template; + return this; + } + + /** + * Sets the placeholder option. + * + * @param placeholder A string, at each placeholder in the template a subsequent tensor summary will be inserted. + * @return this Options instance. + */ + public Options placeholder(String placeholder) { + this.placeholder = placeholder; + return this; + } + + /** + * Sets the summarize option. + * + * @param summarize When formatting the tensor summaries print the first and last summarize entries of each tensor dimension. + * @return this Options instance. + */ + public Options summarize(Long summarize) { + this.summarize = 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 d9a76aad6fe..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,68 +17,72 @@ 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; /** - * String lengths of `input`. - *

+ * String lengths of {@code input}. * Computes the length of each string given in the input tensor. - *

- * >>> strings = tf.constant(['Hello','TensorFlow', '\U0001F642']) - * >>> tf.strings.length(strings).numpy() # default counts bytes + *

+ *
+ *
+ *

strings = tf.constant(['Hello','TensorFlow', '\U0001F642']) + * tf.strings.length(strings).numpy() # default counts bytes * array([ 5, 10, 4], dtype=int32) - * >>> tf.strings.length(strings, unit="UTF8_CHAR").numpy() + * tf.strings.length(strings, unit="UTF8_CHAR").numpy() * array([ 5, 10, 1], dtype=int32) - * + *

+ *
+ *
*/ -@Operator(group = "strings") +@OpMetadata( + opType = StringLength.OP_NAME, + inputsClass = StringLength.Inputs.class +) +@Operator( + group = "strings" +) public final class StringLength extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.StringLength} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param unit The unit that is counted to compute string length. One of: `"BYTE"` (for - * the number of bytes in each string) or `"UTF8_CHAR"` (for the number of UTF-8 - * encoded Unicode code points in each string). Results are undefined - * if `unit=UTF8_CHAR` and the `input` strings do not contain structurally - * valid UTF-8. - */ - public Options unit(String unit) { - this.unit = unit; - return this; - } - - private String unit; - - private Options() { - } + public static final String OP_NAME = "StringLength"; + + private Output output; + + public StringLength(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new StringLength operation. - * + * * @param scope current scope * @param input The strings for which to compute the length for each element. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of StringLength */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static StringLength create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("StringLength", scope.makeOpName("StringLength")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StringLength"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.unit != null) { @@ -88,39 +92,84 @@ public static StringLength create(Scope scope, Operand input, Options.. } return new StringLength(opBuilder.build()); } - + /** - * @param unit The unit that is counted to compute string length. One of: `"BYTE"` (for - * the number of bytes in each string) or `"UTF8_CHAR"` (for the number of UTF-8 + * Sets the unit option. + * + * @param unit 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 `unit=UTF8_CHAR` and the `input` strings do not contain structurally + * if {@code unit=UTF8_CHAR} and the {@code input} strings do not contain structurally * valid UTF-8. + * @return this Options instance. */ public static Options unit(String unit) { return new Options().unit(unit); } - + /** - * Integer tensor that has the same shape as `input`. The output contains the - * element-wise string lengths of `input`. + * Gets output. + * Integer tensor that has the same shape as {@code input}. The output contains the + * element-wise string lengths of {@code input}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringLength"; - - private Output output; - - private StringLength(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.StringLength} + */ + public static class Options { + private String unit; + + private Options() { + } + + /** + * Sets the unit option. + * + * @param unit 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. + * @return this Options instance. + */ + public Options unit(String unit) { + this.unit = 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 e504e164c41..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,38 +17,62 @@ 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; /** * Creates ngrams from ragged string data. - *

* 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 ngramsSplits()} output */ -@Operator(group = "strings") +@OpMetadata( + opType = StringNGrams.OP_NAME, + inputsClass = StringNGrams.Inputs.class +) +@Operator( + group = "strings" +) public final class StringNGrams extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StringNGrams"; + + private Output ngrams; + + private Output ngramsSplits; + + public StringNGrams(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + ngrams = operation.output(outputIdx++); + ngramsSplits = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StringNGrams operation. - * + * * @param scope current scope * @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. - * @param separator The string to append between elements of the token. Use "" for no separator. + * @param separator The string to append between elements of the token. Use "" for no separator. * @param ngramWidths The sizes of the ngrams to create. * @param leftPad The string to use to pad the left side of the ngram sequence. Only used if * pad_width != 0. @@ -56,20 +80,24 @@ public final class StringNGrams extends RawOp { * pad_width != 0. * @param padWidth 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 `pad_width=-1`, then add `max(ngram_widths)-1` + * regardless of this value. If {@code pad_width=-1}, then add {@code max(ngram_widths)-1} * elements. - * @param preserveShortSequences + * @param preserveShortSequences The value of the preserveShortSequences attribute + * @param data type for {@code StringNGrams} output and operands * @return a new instance of StringNGrams */ - @Endpoint(describeByClass = true) - public static StringNGrams create(Scope scope, Operand data, Operand dataSplits, String separator, List ngramWidths, String leftPad, String rightPad, Long padWidth, Boolean preserveShortSequences) { - OperationBuilder opBuilder = scope.env().opBuilder("StringNGrams", scope.makeOpName("StringNGrams")); + @Endpoint( + describeByClass = true + ) + public static StringNGrams create(Scope scope, Operand data, + Operand dataSplits, String separator, List ngramWidths, String leftPad, + String rightPad, Long padWidth, Boolean preserveShortSequences) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StringNGrams"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(dataSplits.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("separator", separator); long[] ngramWidthsArray = new long[ngramWidths.size()]; - for (int i = 0; i < ngramWidthsArray.length; ++i) { + for (int i = 0 ; i < ngramWidthsArray.length ; i++) { ngramWidthsArray[i] = ngramWidths.get(i); } opBuilder.setAttr("ngram_widths", ngramWidthsArray); @@ -77,33 +105,94 @@ public static StringNGrams create(Scope scope, Operand(opBuilder.build()); + return new StringNGrams<>(opBuilder.build()); } - + /** + * Gets ngrams. * The values tensor of the output ngrams ragged tensor. + * @return ngrams. */ public Output ngrams() { return ngrams; } - + /** + * Gets ngramsSplits. * The splits tensor of the output ngrams ragged tensor. + * @return ngramsSplits. */ public Output ngramsSplits() { return ngramsSplits; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringNGrams"; - - private Output ngrams; - private Output ngramsSplits; - - private StringNGrams(Operation operation) { - super(operation); - int outputIdx = 0; - ngrams = operation.output(outputIdx++); - ngramsSplits = operation.output(outputIdx++); + + @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 56d773c688e..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,27 +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.types.TInt64; import org.tensorflow.types.TString; /** - * Split elements of `source` based on `sep` into a `SparseTensor`. - *

+ * Split elements of {@code source} based on {@code sep} into a {@code SparseTensor}. * Let N be the size of source (typically N will be the batch size). Split each - * element of `source` based on `sep` and return a `SparseTensor` + * element of {@code source} based on {@code sep} and return a {@code SparseTensor} * containing the split tokens. Empty tokens are ignored. - *

- * For example, N = 2, source[0] is 'hello world' and source[1] is 'a b c', + *

For example, N = 2, source[0] is 'hello world' and source[1] is 'a b c', * then the output will be - *

{@code
+ * 
  * st.indices = [0, 0;
  *               0, 1;
  *               1, 0;
@@ -45,53 +48,59 @@
  *               1, 2]
  * st.shape = [2, 3]
  * st.values = ['hello', 'world', 'a', 'b', 'c']
- * }
- * If `sep` is given, consecutive delimiters are not grouped together and are - * deemed to delimit empty strings. For example, source of `"1<>2<><>3"` and - * sep of `"<>"` returns `["1", "2", "", "3"]`. If `sep` is None or an empty + *
+ *

If {@code sep} is given, consecutive delimiters are not grouped together and are + * deemed to delimit empty strings. For example, source of {@code "1<>2<><>3"} and + * sep of {@code "<>"} returns {@code ["1", "2", "", "3"]}. If {@code sep} is None or an empty * string, consecutive whitespace are regarded as a single separator, and the * result will contain no empty strings at the startor end if the string has * leading or trailing whitespace. - *

- * Note that the above mentioned behavior matches python's str.split. + *

Note that the above mentioned behavior matches python's str.split. */ -@Operator(group = "strings") +@OpMetadata( + opType = StringSplit.OP_NAME, + inputsClass = StringSplit.Inputs.class +) +@Operator( + group = "strings" +) public final class StringSplit extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.strings.StringSplit} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param maxsplit An `int`. If `maxsplit > 0`, limit of the split of the result. - */ - public Options maxsplit(Long maxsplit) { - this.maxsplit = maxsplit; - return this; - } - - private Long maxsplit; - - private Options() { - } + public static final String OP_NAME = "StringSplitV2"; + + private Output indices; + + private Output values; + + private Output shape; + + public StringSplit(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + indices = operation.output(outputIdx++); + values = operation.output(outputIdx++); + shape = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new StringSplit operation. - * + * Factory method to create a class wrapping a new StringSplitV2 operation. + * * @param scope current scope - * @param input `1-D` string `Tensor`, the strings to split. - * @param sep `0-D` string `Tensor`, the delimiter character. - * @param options carries optional attributes values + * @param input {@code 1-D} string {@code Tensor}, the strings to split. + * @param sep {@code 0-D} string {@code Tensor}, the delimiter character. + * @param options carries optional attribute values * @return a new instance of StringSplit */ - @Endpoint(describeByClass = true) - public static StringSplit create(Scope scope, Operand input, Operand sep, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("StringSplitV2", scope.makeOpName("StringSplit")); + @Endpoint( + describeByClass = true + ) + public static StringSplit create(Scope scope, Operand input, Operand sep, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StringSplit"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(sep.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.maxsplit != null) { @@ -101,44 +110,90 @@ public static StringSplit create(Scope scope, Operand input, Operand 0`, limit of the split of the result. + * Sets the maxsplit option. + * + * @param maxsplit An {@code int}. If {@code maxsplit > 0}, limit of the split of the result. + * @return this Options instance. */ public static Options maxsplit(Long maxsplit) { return new Options().maxsplit(maxsplit); } - + /** + * Gets indices. + * + * @return indices. */ public Output indices() { return indices; } - + /** + * Gets values. + * + * @return values. */ public Output values() { return values; } - + /** + * Gets shape. + * + * @return shape. */ public Output shape() { return shape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringSplitV2"; - - private Output indices; - private Output values; - private Output shape; - - private StringSplit(Operation operation) { - super(operation); - int outputIdx = 0; - indices = operation.output(outputIdx++); - values = operation.output(outputIdx++); - shape = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.StringSplit} + */ + public static class Options { + private Long maxsplit; + + private Options() { + } + + /** + * Sets the maxsplit option. + * + * @param maxsplit An {@code int}. If {@code maxsplit > 0}, limit of the split of the result. + * @return this Options instance. + */ + public Options maxsplit(Long maxsplit) { + this.maxsplit = 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 39834ed61db..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,62 +17,97 @@ 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; /** * Strip leading and trailing whitespaces from the Tensor. + * Examples: + *

+ *
+ *
+ *

tf.strings.strip(["\nTensorFlow", " The python library "]).numpy() + * array([b'TensorFlow', b'The python library'], dtype=object) + *

+ *
+ *
*/ -@Operator(group = "strings") +@OpMetadata( + opType = Strip.OP_NAME, + inputsClass = Strip.Inputs.class +) +@Operator( + group = "strings" +) public final class Strip extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Strip operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StringStrip"; + + private Output output; + + public Strip(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new StringStrip operation. + * * @param scope current scope - * @param input A string `Tensor` of any shape. + * @param input A string {@code Tensor} of any shape. * @return a new instance of Strip */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Strip create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("StringStrip", scope.makeOpName("Strip")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Strip"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); return new Strip(opBuilder.build()); } - + /** - * A string `Tensor` of the same shape as the input. - *

- * Examples: - *

- * >>> tf.strings.strip(["\nTensorFlow", " The python library "]).numpy() - * array([b'TensorFlow', b'The python library'], dtype=object) + * Gets output. + * A string {@code Tensor} of the same shape as the input. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringStrip"; - - private Output output; - - private Strip(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 472e30bc98c..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,52 +17,49 @@ 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; /** - * Return substrings from `Tensor` of strings. - *

- * For each string in the input `Tensor`, creates a substring starting at index - * `pos` with a total length of `len`. - *

- * If `len` defines a substring that would extend beyond the length of the input - * string, or if `len` is negative, then as many characters as possible are used. - *

- * A negative `pos` indicates distance within the string backwards from the end. - *

- * If `pos` specifies an index which is out of range for any of the input strings, - * then an `InvalidArgumentError` is thrown. - *

- * `pos` and `len` must have the same shape, otherwise a `ValueError` is thrown on + * Return substrings from {@code Tensor} of strings. + * For each string in the input {@code Tensor}, creates a substring starting at index + * {@code pos} with a total length of {@code len}. + *

If {@code len} defines a substring that would extend beyond the length of the input + * string, or if {@code len} is negative, then as many characters as possible are used. + *

A negative {@code pos} indicates distance within the string backwards from the end. + *

If {@code pos} specifies an index which is out of range for any of the input strings, + * then an {@code InvalidArgumentError} is thrown. + *

{@code pos} and {@code len} must have the same shape, otherwise a {@code ValueError} is thrown on * Op creation. - *

- * NOTE: `strings.Substr` supports broadcasting up to two dimensions. More about + *

NOTE: {@code strings.Substr} supports broadcasting up to two dimensions. More about * broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - *

- * --- - *

- * Examples - *

- * Using scalar `pos` and `len`: - *

{@code
+ *  here 
+ * 
+ *

Examples + *

Using scalar {@code pos} and {@code len}: + *

  * input = [b'Hello', b'World']
  * position = 1
  * length = 3
- * 
+ *
  * output = [b'ell', b'orl']
- * }
- * Using `pos` and `len` with same shape as `input`: - *
{@code
+ * 
+ *

Using {@code pos} and {@code len} with same shape as {@code input}: + *

  * input = [[b'ten', b'eleven', b'twelve'],
  *          [b'thirteen', b'fourteen', b'fifteen'],
  *          [b'sixteen', b'seventeen', b'eighteen']]
@@ -72,84 +69,82 @@
  * length =   [[2, 3, 4],
  *             [4, 3, 2],
  *             [5, 5, 5]]
- * 
+ *
  * output = [[b'en', b'eve', b'lve'],
  *           [b'hirt', b'urt', b'te'],
  *           [b'ixtee', b'vente', b'hteen']]
- * }
- * Broadcasting `pos` and `len` onto `input`: - *
{@code
+ * 
+ *

Broadcasting {@code pos} and {@code len} onto {@code input}: + *

  * input = [[b'ten', b'eleven', b'twelve'],
  *          [b'thirteen', b'fourteen', b'fifteen'],
  *          [b'sixteen', b'seventeen', b'eighteen'],
  *          [b'nineteen', b'twenty', b'twentyone']]
  * position = [1, 2, 3]
  * length =   [1, 2, 3]
- * 
+ *
  * output = [[b'e', b'ev', b'lve'],
  *           [b'h', b'ur', b'tee'],
  *           [b'i', b've', b'hte'],
  *           [b'i', b'en', b'nty']]
- * }
- * Broadcasting `input` onto `pos` and `len`: - *
{@code
+ * 
+ *

Broadcasting {@code input} onto {@code pos} and {@code len}: + *

  * input = b'thirteen'
  * position = [1, 5, 7]
  * length =   [3, 2, 1]
- * 
+ *
  * output = [b'hir', b'ee', b'n']
- * }
- * Raises: - *

- * * `ValueError`: If the first argument cannot be converted to a - * Tensor of `dtype string`. - * * `InvalidArgumentError`: If indices are out of range. - * * `ValueError`: If `pos` and `len` are not the same shape. - * + *

+ *

Raises: + *

    + *
  • {@code ValueError}: If the first argument cannot be converted to a + * Tensor of {@code dtype string}.
  • + *
  • {@code InvalidArgumentError}: If indices are out of range.
  • + *
  • {@code ValueError}: If {@code pos} and {@code len} are not the same shape.
  • + *
*/ -@Operator(group = "strings") +@OpMetadata( + opType = Substr.OP_NAME, + inputsClass = Substr.Inputs.class +) +@Operator( + group = "strings" +) public final class Substr extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.Substr} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param unit The unit that is used to create the substring. One of: `"BYTE"` (for - * defining position and length by bytes) or `"UTF8_CHAR"` (for the UTF-8 - * encoded Unicode code points). The default is `"BYTE"`. Results are undefined if - * `unit=UTF8_CHAR` and the `input` strings do not contain structurally valid - * UTF-8. - */ - public Options unit(String unit) { - this.unit = unit; - return this; - } - - private String unit; - - private Options() { - } + public static final String OP_NAME = "Substr"; + + private Output output; + + public Substr(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Substr operation. - * + * * @param scope current scope * @param input Tensor of strings * @param pos Scalar defining the position of first character in each substring * @param len Scalar defining the number of characters to include in each substring - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Substr} output and operands * @return a new instance of Substr */ - @Endpoint(describeByClass = true) - public static Substr create(Scope scope, Operand input, Operand pos, Operand len, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Substr", scope.makeOpName("Substr")); + @Endpoint( + describeByClass = true + ) + public static Substr create(Scope scope, Operand input, + Operand pos, Operand len, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Substr"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(pos.asOutput()); opBuilder.addInput(len.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.unit != null) { @@ -159,38 +154,101 @@ public static Substr create(Scope scope, Operand in } return new Substr(opBuilder.build()); } - + /** - * @param unit The unit that is used to create the substring. One of: `"BYTE"` (for - * defining position and length by bytes) or `"UTF8_CHAR"` (for the UTF-8 - * encoded Unicode code points). The default is `"BYTE"`. Results are undefined if - * `unit=UTF8_CHAR` and the `input` strings do not contain structurally valid + * Sets the unit option. + * + * @param unit 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. + * @return this Options instance. */ public static Options unit(String unit) { return new Options().unit(unit); } - + /** + * Gets output. * Tensor of substrings + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Substr"; - - private Output output; - - private Substr(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.Substr} + */ + public static class Options { + private String unit; + + private Options() { + } + + /** + * Sets the unit option. + * + * @param unit 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. + * @return this Options instance. + */ + public Options unit(String unit) { + this.unit = 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 51820eae8fd..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,67 +17,102 @@ 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; /** * Converts each string in the input Tensor to its hash mod by a number of buckets. - *

* The hash function is deterministic on the content of the string within the * process. - *

- * Note that the hash function may change from time to time. + *

Note that the hash function may change from time to time. * This functionality will be deprecated and it's recommended to use - * `tf.string_to_hash_bucket_fast()` or `tf.string_to_hash_bucket_strong()`. + * {@code tf.string_to_hash_bucket_fast()} or {@code tf.string_to_hash_bucket_strong()}. */ -@Operator(group = "strings") +@OpMetadata( + opType = ToHashBucket.OP_NAME, + inputsClass = ToHashBucket.Inputs.class +) +@Operator( + group = "strings" +) public final class ToHashBucket extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new ToHashBucket operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StringToHashBucket"; + + private Output output; + + public ToHashBucket(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new StringToHashBucket operation. + * * @param scope current scope - * @param stringTensor + * @param stringTensor The stringTensor value * @param numBuckets The number of buckets. * @return a new instance of ToHashBucket */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ToHashBucket create(Scope scope, Operand stringTensor, Long numBuckets) { - OperationBuilder opBuilder = scope.env().opBuilder("StringToHashBucket", scope.makeOpName("ToHashBucket")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ToHashBucket"); opBuilder.addInput(stringTensor.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_buckets", numBuckets); return new ToHashBucket(opBuilder.build()); } - + /** - * A Tensor of the same shape as the input `string_tensor`. + * Gets output. + * A Tensor of the same shape as the input {@code string_tensor}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringToHashBucket"; - - private Output output; - - private ToHashBucket(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 2b0ed1ba044..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,72 +17,112 @@ 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; /** * Converts each string in the input Tensor to its hash mod by a number of buckets. - *

* The hash function is deterministic on the content of the string within the * process and will never change. However, it is not suitable for cryptography. * This function may be used when CPU time is scarce and inputs are trusted or * unimportant. There is a risk of adversaries constructing inputs that all hash * to the same bucket. To prevent this problem, use a strong hash function with - * `tf.string_to_hash_bucket_strong`. - *

- * Examples: - *

- * >>> tf.strings.to_hash_bucket_fast(["Hello", "TensorFlow", "2.x"], 3).numpy() + * {@code tf.string_to_hash_bucket_strong}. + *

Examples: + *

+ *
+ *
+ *

tf.strings.to_hash_bucket_fast(["Hello", "TensorFlow", "2.x"], 3).numpy() * array([0, 2, 2]) + *

+ *
+ *
*/ -@Operator(group = "strings") +@OpMetadata( + opType = ToHashBucketFast.OP_NAME, + inputsClass = ToHashBucketFast.Inputs.class +) +@Operator( + group = "strings" +) public final class ToHashBucketFast extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new ToHashBucketFast operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StringToHashBucketFast"; + + private Output output; + + public ToHashBucketFast(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new StringToHashBucketFast operation. + * * @param scope current scope * @param input The strings to assign a hash bucket. * @param numBuckets The number of buckets. * @return a new instance of ToHashBucketFast */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ToHashBucketFast create(Scope scope, Operand input, Long numBuckets) { - OperationBuilder opBuilder = scope.env().opBuilder("StringToHashBucketFast", scope.makeOpName("ToHashBucketFast")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ToHashBucketFast"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_buckets", numBuckets); return new ToHashBucketFast(opBuilder.build()); } - + /** - * A Tensor of the same shape as the input `string_tensor`. + * Gets output. + * A Tensor of the same shape as the input {@code string_tensor}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringToHashBucketFast"; - - private Output output; - - private ToHashBucketFast(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 1ef7188b816..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,46 +17,70 @@ 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; /** * Converts each string in the input Tensor to its hash mod by a number of buckets. - *

* The hash function is deterministic on the content of the string within the - * process. The hash function is a keyed hash function, where attribute `key` - * defines the key of the hash function. `key` is an array of 2 elements. - *

- * A strong hash is important when inputs may be malicious, e.g. URLs with + * process. The hash function is a keyed hash function, where attribute {@code key} + * defines the key of the hash function. {@code key} is an array of 2 elements. + *

A strong hash is important when inputs may be malicious, e.g. URLs with * additional components. Adversaries could try to make their inputs hash to the * same bucket for a denial-of-service attack or to skew the results. A strong * hash can be used to make it difficult to find inputs with a skewed hash value * distribution over buckets. This requires that the hash function is - * seeded by a high-entropy (random) "key" unknown to the adversary. - *

- * The additional robustness comes at a cost of roughly 4x higher compute - * time than `tf.string_to_hash_bucket_fast`. - *

- * Examples: - *

- * >>> tf.strings.to_hash_bucket_strong(["Hello", "TF"], 3, [1, 2]).numpy() + * seeded by a high-entropy (random) "key" unknown to the adversary. + *

The additional robustness comes at a cost of roughly 4x higher compute + * time than {@code tf.string_to_hash_bucket_fast}. + *

Examples: + *

+ *
+ *
+ *

tf.strings.to_hash_bucket_strong(["Hello", "TF"], 3, [1, 2]).numpy() * array([2, 0]) + *

+ *
+ *
*/ -@Operator(group = "strings") +@OpMetadata( + opType = ToHashBucketStrong.OP_NAME, + inputsClass = ToHashBucketStrong.Inputs.class +) +@Operator( + group = "strings" +) public final class ToHashBucketStrong extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new ToHashBucketStrong operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StringToHashBucketStrong"; + + private Output output; + + public ToHashBucketStrong(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new StringToHashBucketStrong operation. + * * @param scope current scope * @param input The strings to assign a hash bucket. * @param numBuckets The number of buckets. @@ -64,40 +88,62 @@ public final class ToHashBucketStrong extends RawOp implements Operand { * elements. * @return a new instance of ToHashBucketStrong */ - @Endpoint(describeByClass = true) - public static ToHashBucketStrong create(Scope scope, Operand input, Long numBuckets, List key) { - OperationBuilder opBuilder = scope.env().opBuilder("StringToHashBucketStrong", scope.makeOpName("ToHashBucketStrong")); + @Endpoint( + describeByClass = true + ) + public static ToHashBucketStrong create(Scope scope, Operand input, Long numBuckets, + List key) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ToHashBucketStrong"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_buckets", numBuckets); long[] keyArray = new long[key.size()]; - for (int i = 0; i < keyArray.length; ++i) { + for (int i = 0 ; i < keyArray.length ; i++) { keyArray[i] = key.get(i); } opBuilder.setAttr("key", keyArray); return new ToHashBucketStrong(opBuilder.build()); } - + /** - * A Tensor of the same shape as the input `string_tensor`. + * Gets output. + * A Tensor of the same shape as the input {@code string_tensor}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringToHashBucketStrong"; - - private Output output; - - private ToHashBucketStrong(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 547a4f17b95..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,86 +17,128 @@ 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; /** * Converts each string in the input Tensor to the specified numeric type. - *

* (Note that int32 overflow results in an error while float overflow * results in a rounded value.) - *

- * Example: - *

- * >>> strings = ["5.0", "3.0", "7.0"] - * >>> tf.strings.to_number(strings) - * - * - * - * @param data type for {@code output()} output + *

Example: + *

+ *
+ *
+ *

strings = ["5.0", "3.0", "7.0"] + * tf.strings.to_number(strings) + * <tf.Tensor: shape=(3,), dtype=float32, numpy=array([5., 3., 7.], dtype=float32)> + *

+ *
+ *
*/ -@Operator(group = "strings") +@OpMetadata( + opType = ToNumber.OP_NAME, + inputsClass = ToNumber.Inputs.class +) +@Operator( + group = "strings" +) public final class ToNumber extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new ToNumber operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StringToNumber"; + + private Output output; + + public ToNumber(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new StringToNumber operation. + * * @param scope current scope - * @param stringTensor - * @param outType The numeric type to interpret each string in `string_tensor` as. + * @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 */ - @Endpoint(describeByClass = true) - public static ToNumber create(Scope scope, Operand stringTensor, Class outType) { - OperationBuilder opBuilder = scope.env().opBuilder("StringToNumber", scope.makeOpName("ToNumber")); + @Endpoint( + describeByClass = true + ) + public static ToNumber create(Scope scope, Operand stringTensor, + Class outType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ToNumber"); opBuilder.addInput(stringTensor.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new ToNumber(opBuilder.build()); + return new ToNumber<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new ToNumber operation using default output types. - * + * Factory method to create a class wrapping a new StringToNumber operation, with the default output types. + * * @param scope current scope - * @param stringTensor - * @return a new instance of ToNumber + * @param stringTensor The stringTensor value + * @return a new instance of ToNumber, with default output types */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ToNumber create(Scope scope, Operand stringTensor) { return create(scope, stringTensor, TFloat32.class); } - + /** - * A Tensor of the same shape as the input `string_tensor`. + * Gets output. + * A Tensor of the same shape as the input {@code string_tensor}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringToNumber"; - - private Output output; - - private ToNumber(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 65e5e256780..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,108 +17,86 @@ 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; import org.tensorflow.types.family.TNumber; /** - * Decodes each string in `input` into a sequence of Unicode code points. - *

+ * 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 - * `char_values`, with strings expanded to characters in row-major order. - *

- * The `row_splits` tensor indicates where the codepoints for - * each input string begin and end within the `char_values` tensor. - * In particular, the values for the `i`th + * {@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 - * `[row_splits[i]:row_splits[i+1]]`. Thus: + * {@code [row_splits[i]:row_splits[i+1]]}. Thus: *

    - *
  • - * `char_values[row_splits[i]+j]` is the Unicode codepoint for the `j`th - * character in the `i`th string (in row-major order). - *
  • - *
  • - * `row_splits[i+1] - row_splits[i]` is the number of characters in the `i`th - * string (in row-major order). - * - * @param data type for {@code rowSplits()} output + *
  • {@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).
  • + *
*/ +@OpMetadata( + opType = UnicodeDecode.OP_NAME, + inputsClass = UnicodeDecode.Inputs.class +) +@Operator( + group = "strings" +) public final class UnicodeDecode extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.strings.UnicodeDecode} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param errors 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 - * `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 Options errors(String errors) { - this.errors = errors; - return this; - } - - /** - * @param replacementChar The replacement character codepoint to be used in place of any invalid - * formatting in the input when `errors='replace'`. Any valid unicode codepoint may - * be used. The default value is the default unicode replacement character is - * 0xFFFD or U+65533.) - */ - public Options replacementChar(Long replacementChar) { - this.replacementChar = replacementChar; - return this; - } - - /** - * @param replaceControlCharacters Whether to replace the C0 control characters (00-1F) with the - * `replacement_char`. Default is false. - */ - public Options replaceControlCharacters(Boolean replaceControlCharacters) { - this.replaceControlCharacters = replaceControlCharacters; - return this; - } - - private String errors; - private Long replacementChar; - private Boolean replaceControlCharacters; - - private Options() { - } + public static final String OP_NAME = "UnicodeDecode"; + + private Output rowSplits; + + private Output charValues; + + public UnicodeDecode(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + rowSplits = operation.output(outputIdx++); + charValues = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new UnicodeDecode operation. - * + * * @param scope current scope * @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: `"UTF-16", "US ASCII", "UTF-8"`. - * @param Tsplits - * @param options carries optional attributes values + * 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 */ - @Endpoint(describeByClass = true) - public static UnicodeDecode create(Scope scope, Operand input, String inputEncoding, Class Tsplits, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("UnicodeDecode", scope.makeOpName("UnicodeDecode")); + @Endpoint( + describeByClass = true + ) + public static UnicodeDecode create(Scope scope, Operand input, + String inputEncoding, Class Tsplits, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UnicodeDecode"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("input_encoding", inputEncoding); opBuilder.setAttr("Tsplits", Operands.toDataType(Tsplits)); if (options != null) { @@ -134,80 +112,198 @@ public static UnicodeDecode create(Scope scope, Operand(opBuilder.build()); + return new UnicodeDecode<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new UnicodeDecode operation using default output types. - * + * Factory method to create a class wrapping a new UnicodeDecode operation, with the default output types. + * * @param scope current scope * @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: `"UTF-16", "US ASCII", "UTF-8"`. - * @param options carries optional attributes values - * @return a new instance of UnicodeDecode + * 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 */ - @Endpoint(describeByClass = true) - public static UnicodeDecode create(Scope scope, Operand input, String inputEncoding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static UnicodeDecode create(Scope scope, Operand input, + String inputEncoding, Options... options) { return create(scope, input, inputEncoding, TInt64.class, options); } - + /** + * Sets the errors option. + * * @param errors 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 - * `replacement_char` codepoint. A value of 'ignore' will cause the operation to + * {@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. + * @return this Options instance. */ public static Options errors(String errors) { return new Options().errors(errors); } - + /** + * Sets the replacementChar option. + * * @param replacementChar The replacement character codepoint to be used in place of any invalid - * formatting in the input when `errors='replace'`. Any valid unicode codepoint may + * 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.) + * @return this Options instance. */ public static Options replacementChar(Long replacementChar) { return new Options().replacementChar(replacementChar); } - + /** + * Sets the replaceControlCharacters option. + * * @param replaceControlCharacters Whether to replace the C0 control characters (00-1F) with the - * `replacement_char`. Default is false. + * {@code replacement_char}. Default is false. + * @return this Options instance. */ public static Options replaceControlCharacters(Boolean replaceControlCharacters) { return new Options().replaceControlCharacters(replaceControlCharacters); } - + /** + * Gets rowSplits. * A 1D int32 tensor containing the row splits. + * @return rowSplits. */ public Output rowSplits() { return rowSplits; } - + /** + * Gets charValues. * A 1D int32 Tensor containing the decoded codepoints. + * @return charValues. */ public Output charValues() { return charValues; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnicodeDecode"; - - private Output rowSplits; - private Output charValues; - - private UnicodeDecode(Operation operation) { - super(operation); - int outputIdx = 0; - rowSplits = operation.output(outputIdx++); - charValues = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.UnicodeDecode} + */ + public static class Options { + private String errors; + + private Long replacementChar; + + private Boolean replaceControlCharacters; + + private Options() { + } + + /** + * Sets the errors option. + * + * @param errors 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. + * @return this Options instance. + */ + public Options errors(String errors) { + this.errors = errors; + return this; + } + + /** + * Sets the replacementChar option. + * + * @param replacementChar 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.) + * @return this Options instance. + */ + public Options replacementChar(Long replacementChar) { + this.replacementChar = replacementChar; + return this; + } + + /** + * Sets the replaceControlCharacters option. + * + * @param replaceControlCharacters Whether to replace the C0 control characters (00-1F) with the + * {@code replacement_char}. Default is false. + * @return this Options instance. + */ + public Options replaceControlCharacters(Boolean replaceControlCharacters) { + this.replaceControlCharacters = 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 2b10934b37a..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,114 +17,93 @@ 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; import org.tensorflow.types.family.TNumber; /** - * Decodes each string in `input` into a sequence of Unicode code points. - *

+ * 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 - * `char_values`, with strings expanded to characters in row-major order. + * {@code char_values}, with strings expanded to characters in row-major order. * Similarly, the character start byte offsets are returned using a single vector - * `char_to_byte_starts`, with strings expanded in row-major order. - *

- * The `row_splits` tensor indicates where the codepoints and start offsets for - * each input string begin and end within the `char_values` and - * `char_to_byte_starts` tensors. In particular, the values for the `i`th + * {@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 - * `[row_splits[i]:row_splits[i+1]]`. Thus: + * {@code [row_splits[i]:row_splits[i+1]]}. Thus: *

    - *
  • - * `char_values[row_splits[i]+j]` is the Unicode codepoint for the `j`th - * character in the `i`th string (in row-major order). - *
  • - *
  • - * `char_to_bytes_starts[row_splits[i]+j]` is the start byte offset for the `j`th - * character in the `i`th string (in row-major order). - *
  • - *
  • - * `row_splits[i+1] - row_splits[i]` is the number of characters in the `i`th - * string (in row-major order). - * - * @param data type for {@code rowSplits()} output + *
  • {@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).
  • + *
*/ +@OpMetadata( + opType = UnicodeDecodeWithOffsets.OP_NAME, + inputsClass = UnicodeDecodeWithOffsets.Inputs.class +) +@Operator( + group = "strings" +) public final class UnicodeDecodeWithOffsets extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.strings.UnicodeDecodeWithOffsets} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param errors 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 - * `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 Options errors(String errors) { - this.errors = errors; - return this; - } - - /** - * @param replacementChar The replacement character codepoint to be used in place of any invalid - * formatting in the input when `errors='replace'`. Any valid unicode codepoint may - * be used. The default value is the default unicode replacement character is - * 0xFFFD or U+65533.) - */ - public Options replacementChar(Long replacementChar) { - this.replacementChar = replacementChar; - return this; - } - - /** - * @param replaceControlCharacters Whether to replace the C0 control characters (00-1F) with the - * `replacement_char`. Default is false. - */ - public Options replaceControlCharacters(Boolean replaceControlCharacters) { - this.replaceControlCharacters = replaceControlCharacters; - return this; - } - - private String errors; - private Long replacementChar; - private Boolean replaceControlCharacters; - - private Options() { - } + public static final String OP_NAME = "UnicodeDecodeWithOffsets"; + + private Output rowSplits; + + private Output charValues; + + private Output charToByteStarts; + + public UnicodeDecodeWithOffsets(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + rowSplits = operation.output(outputIdx++); + charValues = operation.output(outputIdx++); + charToByteStarts = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new UnicodeDecodeWithOffsets operation. - * + * * @param scope current scope * @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: `"UTF-16", "US ASCII", "UTF-8"`. - * @param Tsplits - * @param options carries optional attributes values + * 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 */ - @Endpoint(describeByClass = true) - public static UnicodeDecodeWithOffsets create(Scope scope, Operand input, String inputEncoding, Class Tsplits, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("UnicodeDecodeWithOffsets", scope.makeOpName("UnicodeDecodeWithOffsets")); + @Endpoint( + describeByClass = true + ) + public static UnicodeDecodeWithOffsets create(Scope scope, + Operand input, String inputEncoding, Class Tsplits, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UnicodeDecodeWithOffsets"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("input_encoding", inputEncoding); opBuilder.setAttr("Tsplits", Operands.toDataType(Tsplits)); if (options != null) { @@ -140,90 +119,208 @@ public static UnicodeDecodeWithOffsets create(Scope scope } } } - return new UnicodeDecodeWithOffsets(opBuilder.build()); + return new UnicodeDecodeWithOffsets<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new UnicodeDecodeWithOffsets operation using default output types. - * + * Factory method to create a class wrapping a new UnicodeDecodeWithOffsets operation, with the default output types. + * * @param scope current scope * @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: `"UTF-16", "US ASCII", "UTF-8"`. - * @param options carries optional attributes values - * @return a new instance of UnicodeDecodeWithOffsets + * 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 */ - @Endpoint(describeByClass = true) - public static UnicodeDecodeWithOffsets create(Scope scope, Operand input, String inputEncoding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static UnicodeDecodeWithOffsets create(Scope scope, Operand input, + String inputEncoding, Options... options) { return create(scope, input, inputEncoding, TInt64.class, options); } - + /** + * Sets the errors option. + * * @param errors 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 - * `replacement_char` codepoint. A value of 'ignore' will cause the operation to + * {@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. + * @return this Options instance. */ public static Options errors(String errors) { return new Options().errors(errors); } - + /** + * Sets the replacementChar option. + * * @param replacementChar The replacement character codepoint to be used in place of any invalid - * formatting in the input when `errors='replace'`. Any valid unicode codepoint may + * 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.) + * @return this Options instance. */ public static Options replacementChar(Long replacementChar) { return new Options().replacementChar(replacementChar); } - + /** + * Sets the replaceControlCharacters option. + * * @param replaceControlCharacters Whether to replace the C0 control characters (00-1F) with the - * `replacement_char`. Default is false. + * {@code replacement_char}. Default is false. + * @return this Options instance. */ public static Options replaceControlCharacters(Boolean replaceControlCharacters) { return new Options().replaceControlCharacters(replaceControlCharacters); } - + /** + * Gets rowSplits. * A 1D int32 tensor containing the row splits. + * @return rowSplits. */ public Output rowSplits() { return rowSplits; } - + /** + * Gets charValues. * A 1D int32 Tensor containing the decoded codepoints. + * @return charValues. */ public Output charValues() { return charValues; } - + /** + * Gets charToByteStarts. * A 1D int32 Tensor containing the byte index in the input string where each - * character in `char_values` starts. + * character in {@code char_values} starts. + * @return charToByteStarts. */ public Output charToByteStarts() { return charToByteStarts; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnicodeDecodeWithOffsets"; - - private Output rowSplits; - private Output charValues; - private Output charToByteStarts; - - private UnicodeDecodeWithOffsets(Operation operation) { - super(operation); - int outputIdx = 0; - rowSplits = operation.output(outputIdx++); - charValues = operation.output(outputIdx++); - charToByteStarts = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.UnicodeDecodeWithOffsets} + */ + public static class Options { + private String errors; + + private Long replacementChar; + + private Boolean replaceControlCharacters; + + private Options() { + } + + /** + * Sets the errors option. + * + * @param errors 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. + * @return this Options instance. + */ + public Options errors(String errors) { + this.errors = errors; + return this; + } + + /** + * Sets the replacementChar option. + * + * @param replacementChar 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.) + * @return this Options instance. + */ + public Options replacementChar(Long replacementChar) { + this.replacementChar = replacementChar; + return this; + } + + /** + * Sets the replaceControlCharacters option. + * + * @param replaceControlCharacters Whether to replace the C0 control characters (00-1F) with the + * {@code replacement_char}. Default is false. + * @return this Options instance. + */ + public Options replaceControlCharacters(Boolean replaceControlCharacters) { + this.replaceControlCharacters = 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 091d598a2e8..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,95 +17,80 @@ 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; /** * Encode a tensor of ints into unicode strings. - *

- * Returns a vector of strings, where `output[i]` is constructed by encoding the - * Unicode codepoints in `input_values[input_splits[i]:input_splits[i+1]]` - * using `output_encoding`. - *

- * --- - *

- * Example: - *

{@code
+ * 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']
- * }
- * + *
*/ +@OpMetadata( + opType = UnicodeEncode.OP_NAME, + inputsClass = UnicodeEncode.Inputs.class +) +@Operator( + group = "strings" +) public final class UnicodeEncode extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.UnicodeEncode} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param errors 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 - * `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 Options errors(String errors) { - this.errors = errors; - return this; - } - - /** - * @param replacementChar The replacement character codepoint to be used in place of any invalid - * formatting in the input when `errors='replace'`. Any valid unicode codepoint may - * be used. The default value is the default unicode replacement character is - * 0xFFFD (U+65533). - */ - public Options replacementChar(Long replacementChar) { - this.replacementChar = replacementChar; - return this; - } - - private String errors; - private Long replacementChar; - - private Options() { - } + public static final String OP_NAME = "UnicodeEncode"; + + private Output output; + + public UnicodeEncode(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new UnicodeEncode operation. - * + * * @param scope current scope * @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, `output[i]` is constructed by encoding the codepoints in the - * slice `input_values[input_splits[i]:input_splits[i+1]]`. - * @param outputEncoding Unicode encoding of the output strings. Valid encodings are: `"UTF-8", - * "UTF-16-BE", and "UTF-32-BE"`. - * @param options carries optional attributes values + * 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 */ - @Endpoint(describeByClass = true) - public static UnicodeEncode create(Scope scope, Operand inputValues, Operand inputSplits, String outputEncoding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("UnicodeEncode", scope.makeOpName("UnicodeEncode")); + @Endpoint( + describeByClass = true + ) + public static UnicodeEncode create(Scope scope, Operand inputValues, + Operand inputSplits, String outputEncoding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UnicodeEncode"); opBuilder.addInput(inputValues.asOutput()); opBuilder.addInput(inputSplits.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_encoding", outputEncoding); if (options != null) { for (Options opts : options) { @@ -119,50 +104,147 @@ public static UnicodeEncode create(Scope scope, Operand inputValues, Ope } return new UnicodeEncode(opBuilder.build()); } - + /** + * Sets the errors option. + * * @param errors 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 - * `replacement_char` codepoint. A value of 'ignore' will cause the operation to + * {@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. + * @return this Options instance. */ public static Options errors(String errors) { return new Options().errors(errors); } - + /** + * Sets the replacementChar option. + * * @param replacementChar The replacement character codepoint to be used in place of any invalid - * formatting in the input when `errors='replace'`. Any valid unicode codepoint may + * 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). + * @return this Options instance. */ public static Options replacementChar(Long replacementChar) { return new Options().replacementChar(replacementChar); } - + /** + * Gets output. * The 1-D Tensor of strings encoded from the provided unicode codepoints. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnicodeEncode"; - - private Output output; - - private UnicodeEncode(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.UnicodeEncode} + */ + public static class Options { + private String errors; + + private Long replacementChar; + + private Options() { + } + + /** + * Sets the errors option. + * + * @param errors 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. + * @return this Options instance. + */ + public Options errors(String errors) { + this.errors = errors; + return this; + } + + /** + * Sets the replacementChar option. + * + * @param replacementChar 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). + * @return this Options instance. + */ + public Options replacementChar(Long replacementChar) { + this.replacementChar = 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 a3ec471d2b4..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,76 +17,107 @@ 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; /** * Determine the script codes of a given tensor of Unicode integer code points. - *

* This operation converts Unicode code points to script codes corresponding to * each code point. Script codes correspond to International Components for * Unicode (ICU) UScriptCode values. - *

- * See - * [ICU project docs](http://icu-project.org/apiref/icu4c/uscript_8h.html) + *

See + * ICU project docs * for more details on script codes. - *

- * For an example, see the unicode strings guide on [unicode scripts] + *

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

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

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

- * Examples: - *

- * >>> tf.strings.unicode_script([1, 31, 38]) - * + *

Examples: + *

+ *
+ *
+ *

tf.strings.unicode_script([1, 31, 38]) + * <tf.Tensor: shape=(3,), dtype=int32, numpy=array([0, 0, 0], dtype=int32)> + *

+ *
+ *
*/ -@Operator(group = "strings") +@OpMetadata( + opType = UnicodeScript.OP_NAME, + inputsClass = UnicodeScript.Inputs.class +) +@Operator( + group = "strings" +) public final class UnicodeScript extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UnicodeScript"; + + private Output output; + + public UnicodeScript(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new UnicodeScript operation. - * + * * @param scope current scope * @param input A Tensor of int32 Unicode code points. * @return a new instance of UnicodeScript */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static UnicodeScript create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("UnicodeScript", scope.makeOpName("UnicodeScript")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UnicodeScript"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); return new UnicodeScript(opBuilder.build()); } - + /** + * Gets output. * A Tensor of int32 script codes corresponding to each input code point. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnicodeScript"; - - private Output output; - - private UnicodeScript(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 b2f8b87a991..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,126 +17,99 @@ 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; /** * Transcode the input text from a source encoding to a destination encoding. - *

* The input is a string tensor of any shape. The output is a string tensor of * the same shape containing the transcoded strings. Output strings are always * valid unicode. If the input contains invalid encoding positions, the - * `errors` attribute sets the policy for how to deal with them. If the default + * {@code errors} attribute sets the policy for how to deal with them. If the default * error-handling policy is used, invalid formatting will be substituted in the - * output by the `replacement_char`. If the errors policy is to `ignore`, any + * output by the {@code replacement_char}. If the errors policy is to {@code ignore}, any * invalid encoding positions in the input are skipped and not included in the - * output. If it set to `strict` then any invalid formatting will result in an + * output. If it set to {@code strict} then any invalid formatting will result in an * InvalidArgument error. - *

- * This operation can be used with `output_encoding = input_encoding` to enforce + *

This operation can be used with {@code output_encoding = input_encoding} to enforce * correct formatting for inputs even if they are already in the desired encoding. - *

- * If the input is prefixed by a Byte Order Mark needed to determine encoding + *

If the input is prefixed by a Byte Order Mark needed to determine encoding * (e.g. if the encoding is UTF-16 and the BOM indicates big-endian), then that * BOM will be consumed and not emitted into the output. If the input encoding * is marked with an explicit endianness (e.g. UTF-16-BE), then the BOM is * interpreted as a non-breaking-space and is preserved in the output (including * always for UTF-8). - *

- * The end result is that if the input is marked as an explicit endianness the + *

The end result is that if the input is marked as an explicit endianness the * transcoding is faithful to all codepoints in the source. If it is not marked * with an explicit endianness, the BOM is not considered part of the string itself * but as metadata, and so is not preserved in the output. - *

- * Examples: - *

- * >>> tf.strings.unicode_transcode(["Hello", "TensorFlow", "2.x"], "UTF-8", "UTF-16-BE") - * Examples: + *

+ *
+ *
+ *

tf.strings.unicode_transcode(["Hello", "TensorFlow", "2.x"], "UTF-8", "UTF-16-BE") + * <tf.Tensor: shape=(3,), dtype=string, numpy= * array([b'\x00H\x00e\x00l\x00l\x00o', - * b'\x00T\x00e\x00n\x00s\x00o\x00r\x00F\x00l\x00o\x00w', - * b'\x002\x00.\x00x'], dtype=object)> - * >>> tf.strings.unicode_transcode(["A", "B", "C"], "US ASCII", "UTF-8").numpy() + * b'\x00T\x00e\x00n\x00s\x00o\x00r\x00F\x00l\x00o\x00w', + * b'\x002\x00.\x00x'], dtype=object)> + * tf.strings.unicode_transcode(["A", "B", "C"], "US ASCII", "UTF-8").numpy() * array([b'A', b'B', b'C'], dtype=object) + *

+ *
+ *
*/ -@Operator(group = "strings") +@OpMetadata( + opType = UnicodeTranscode.OP_NAME, + inputsClass = UnicodeTranscode.Inputs.class +) +@Operator( + group = "strings" +) public final class UnicodeTranscode extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.UnicodeTranscode} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param errors 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 - * `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 Options errors(String errors) { - this.errors = errors; - return this; - } - - /** - * @param replacementChar The replacement character codepoint to be used in place of any invalid - * formatting in the input when `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 Options replacementChar(Long replacementChar) { - this.replacementChar = replacementChar; - return this; - } - - /** - * @param replaceControlCharacters Whether to replace the C0 control characters (00-1F) with the - * `replacement_char`. Default is false. - */ - public Options replaceControlCharacters(Boolean replaceControlCharacters) { - this.replaceControlCharacters = replaceControlCharacters; - return this; - } - - private String errors; - private Long replacementChar; - private Boolean replaceControlCharacters; - - private Options() { - } + public static final String OP_NAME = "UnicodeTranscode"; + + private Output output; + + public UnicodeTranscode(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new UnicodeTranscode operation. - * + * * @param scope current scope * @param input The text to be processed. Can have any shape. * @param inputEncoding Text encoding of the input strings. This is any of the encodings supported - * by ICU ucnv algorithmic converters. Examples: `"UTF-16", "US ASCII", "UTF-8"`. + * by ICU ucnv algorithmic converters. Examples: {@code "UTF-16", "US ASCII", "UTF-8"}. * @param outputEncoding The unicode encoding to use in the output. Must be one of - * `"UTF-8", "UTF-16-BE", "UTF-32-BE"`. Multi-byte encodings will be big-endian. - * @param options carries optional attributes values + * {@code "UTF-8", "UTF-16-BE", "UTF-32-BE"}. Multi-byte encodings will be big-endian. + * @param options carries optional attribute values * @return a new instance of UnicodeTranscode */ - @Endpoint(describeByClass = true) - public static UnicodeTranscode create(Scope scope, Operand input, String inputEncoding, String outputEncoding, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("UnicodeTranscode", scope.makeOpName("UnicodeTranscode")); + @Endpoint( + describeByClass = true + ) + public static UnicodeTranscode create(Scope scope, Operand input, String inputEncoding, + String outputEncoding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UnicodeTranscode"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("input_encoding", inputEncoding); opBuilder.setAttr("output_encoding", outputEncoding); if (options != null) { @@ -154,63 +127,185 @@ public static UnicodeTranscode create(Scope scope, Operand input, Strin } return new UnicodeTranscode(opBuilder.build()); } - + /** + * Sets the errors option. + * * @param errors 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 - * `replacement_char` codepoint. A value of 'ignore' will cause the operation to + * {@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. + * @return this Options instance. */ public static Options errors(String errors) { return new Options().errors(errors); } - + /** + * Sets the replacementChar option. + * * @param replacementChar The replacement character codepoint to be used in place of any invalid - * formatting in the input when `errors='replace'`. Any valid unicode codepoint may + * 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 + *

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. + * @return this Options instance. */ public static Options replacementChar(Long replacementChar) { return new Options().replacementChar(replacementChar); } - + /** + * Sets the replaceControlCharacters option. + * * @param replaceControlCharacters Whether to replace the C0 control characters (00-1F) with the - * `replacement_char`. Default is false. + * {@code replacement_char}. Default is false. + * @return this Options instance. */ public static Options replaceControlCharacters(Boolean replaceControlCharacters) { return new Options().replaceControlCharacters(replaceControlCharacters); } - + /** - * A string tensor containing unicode text encoded using `output_encoding`. + * Gets output. + * A string tensor containing unicode text encoded using {@code output_encoding}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnicodeTranscode"; - - private Output output; - - private UnicodeTranscode(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.UnicodeTranscode} + */ + public static class Options { + private String errors; + + private Long replacementChar; + + private Boolean replaceControlCharacters; + + private Options() { + } + + /** + * Sets the errors option. + * + * @param errors 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. + * @return this Options instance. + */ + public Options errors(String errors) { + this.errors = errors; + return this; + } + + /** + * Sets the replacementChar option. + * + * @param replacementChar 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. + * @return this Options instance. + */ + public Options replacementChar(Long replacementChar) { + this.replacementChar = replacementChar; + return this; + } + + /** + * Sets the replaceControlCharacters option. + * + * @param replaceControlCharacters Whether to replace the C0 control characters (00-1F) with the + * {@code replacement_char}. Default is false. + * @return this Options instance. + */ + public Options replaceControlCharacters(Boolean replaceControlCharacters) { + this.replaceControlCharacters = 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 790196f34e3..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,87 +17,67 @@ 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 `inputs` based on `segment_ids`. - *

- * Computes the string join along segments of a tensor. - * Given `segment_ids` with rank `N` and `data` with rank `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: - *

{@code
- * 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 */ -@Operator(group = "strings") +@OpMetadata( + opType = UnsortedSegmentJoin.OP_NAME, + inputsClass = UnsortedSegmentJoin.Inputs.class +) +@Operator( + group = "strings" +) public final class UnsortedSegmentJoin extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.UnsortedSegmentJoin} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param separator The separator to use when joining. - */ - public Options separator(String separator) { - this.separator = separator; - return this; - } - - private String separator; - - private Options() { - } + public static final String OP_NAME = "UnsortedSegmentJoin"; + + private Output output; + + public UnsortedSegmentJoin(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * 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 options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static UnsortedSegmentJoin create(Scope scope, Operand inputs, Operand segmentIds, Operand numSegments, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("UnsortedSegmentJoin", scope.makeOpName("UnsortedSegmentJoin")); + @Endpoint( + describeByClass = true + ) + public static UnsortedSegmentJoin create(Scope scope, Operand inputs, + Operand segmentIds, Operand numSegments, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UnsortedSegmentJoin"); opBuilder.addInput(inputs.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder.addInput(numSegments.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.separator != null) { @@ -107,33 +87,95 @@ public static UnsortedSegmentJoin create(Scope scope, Operand inputs, O } return new UnsortedSegmentJoin(opBuilder.build()); } - + /** - * @param separator The separator to use when joining. + * Sets the separator option. + * + * @param separator the separator option + * @return this Options instance. */ public static Options separator(String separator) { return new Options().separator(separator); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnsortedSegmentJoin"; - - private Output output; - - private UnsortedSegmentJoin(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.UnsortedSegmentJoin} + */ + public static class Options { + private String separator; + + private Options() { + } + + /** + * Sets the separator option. + * + * @param separator the separator option + * @return this Options instance. + */ + public Options separator(String separator) { + this.separator = 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 6a531f4878d..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,60 +17,68 @@ 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; /** * Converts all lowercase characters into their respective uppercase replacements. - *

* Example: - *

- * >>> tf.strings.upper("CamelCase string and ALL CAPS") - * - * + *

+ *
+ *
+ *

tf.strings.upper("CamelCase string and ALL CAPS") + * <tf.Tensor: shape=(), dtype=string, numpy=b'CAMELCASE STRING AND ALL CAPS'> + *

+ *
+ *
*/ -@Operator(group = "strings") +@OpMetadata( + opType = Upper.OP_NAME, + inputsClass = Upper.Inputs.class +) +@Operator( + group = "strings" +) public final class Upper extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.Upper} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param encoding - */ - public Options encoding(String encoding) { - this.encoding = encoding; - return this; - } - - private String encoding; - - private Options() { - } + public static final String OP_NAME = "StringUpper"; + + private Output output; + + public Upper(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Upper operation. - * + * Factory method to create a class wrapping a new StringUpper operation. + * * @param scope current scope - * @param input - * @param options carries optional attributes values + * @param input The input to be upper-cased. + * @param options carries optional attribute values * @return a new instance of Upper */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Upper create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("StringUpper", scope.makeOpName("Upper")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Upper"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.encoding != null) { @@ -80,33 +88,74 @@ public static Upper create(Scope scope, Operand input, Options... optio } return new Upper(opBuilder.build()); } - + /** - * @param encoding + * Sets the encoding option. + * + * @param encoding Character encoding of {@code input}. Allowed values are '' and 'utf-8'. + * Value '' is interpreted as ASCII. + * @return this Options instance. */ public static Options encoding(String encoding) { return new Options().encoding(encoding); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringUpper"; - - private Output output; - - private Upper(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.Upper} + */ + public static class Options { + private String encoding; + + private Options() { + } + + /** + * Sets the encoding option. + * + * @param encoding Character encoding of {@code input}. Allowed values are '' and 'utf-8'. + * Value '' is interpreted as ASCII. + * @return this Options instance. + */ + public Options encoding(String encoding) { + this.encoding = 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 ce960396e7b..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,74 +17,75 @@ 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; /** - * Outputs a `Summary` protocol buffer with audio. - *

- * The summary has up to `max_outputs` summary values containing audio. The - * audio is built from `tensor` which must be 3-D with shape `[batch_size, - * frames, channels]` or 2-D with shape `[batch_size, frames]`. The values are - * assumed to be in the range of `[-1.0, 1.0]` with a sample rate of `sample_rate`. - *

- * The `tag` argument is a scalar `Tensor` of type `string`. It is used to - * build the `tag` of the summary values: + * Outputs a {@code Summary} protocol buffer with audio. + * The summary has up to {@code max_outputs} summary values containing audio. The + * audio is built from {@code tensor} which must be 3-D with shape {@code [batch_size, frames, channels]} or 2-D with shape {@code [batch_size, frames]}. The values are + * assumed to be in the range of {@code [-1.0, 1.0]} with a sample rate of {@code sample_rate}. + *

The {@code tag} argument is a scalar {@code Tensor} of type {@code string}. It is used to + * build the {@code tag} of the summary values: *

    - *
  • - * If `max_outputs` is 1, the summary value tag is 'tag/audio'. - *
  • - *
  • - * If `max_outputs` is greater than 1, the summary value tags are - * generated sequentially as 'tag/audio/0', 'tag/audio/1', etc. + *
  • If {@code max_outputs} is 1, the summary value tag is 'tag/audio'.
  • + *
  • If {@code max_outputs} is greater than 1, the summary value tags are + * generated sequentially as 'tag/audio/0', 'tag/audio/1', etc.
  • + *
*/ -@Operator(group = "summary") +@OpMetadata( + opType = AudioSummary.OP_NAME, + inputsClass = AudioSummary.Inputs.class +) +@Operator( + group = "summary" +) public final class AudioSummary extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.summary.AudioSummary} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param maxOutputs Max number of batch elements to generate audio for. - */ - public Options maxOutputs(Long maxOutputs) { - this.maxOutputs = maxOutputs; - return this; - } - - private Long maxOutputs; - - private Options() { - } + public static final String OP_NAME = "AudioSummaryV2"; + + private Output summary; + + public AudioSummary(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + summary = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new AudioSummary operation. - * + * Factory method to create a class wrapping a new AudioSummaryV2 operation. + * * @param scope current scope - * @param tag Scalar. Used to build the `tag` attribute of the summary values. - * @param tensor 2-D of shape `[batch_size, frames]`. + * @param tag Scalar. Used to build the {@code tag} attribute of the summary values. + * @param tensor 2-D of shape {@code [batch_size, frames]}. * @param sampleRate The sample rate of the signal in hertz. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of AudioSummary */ - @Endpoint(describeByClass = true) - public static AudioSummary create(Scope scope, Operand tag, Operand tensor, Operand sampleRate, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("AudioSummaryV2", scope.makeOpName("AudioSummary")); + @Endpoint( + describeByClass = true + ) + public static AudioSummary create(Scope scope, Operand tag, Operand tensor, + Operand sampleRate, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AudioSummary"); opBuilder.addInput(tag.asOutput()); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(sampleRate.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.maxOutputs != null) { @@ -94,34 +95,83 @@ public static AudioSummary create(Scope scope, Operand tag, Operand summary() { return summary; } - + @Override public Output asOutput() { return summary; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AudioSummaryV2"; - - private Output summary; - - private AudioSummary(Operation operation) { - super(operation); - int outputIdx = 0; - summary = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.summary.AudioSummary} + */ + public static class Options { + private Long maxOutputs; + + private Options() { + } + + /** + * Sets the maxOutputs option. + * + * @param maxOutputs Max number of batch elements to generate audio for. + * @return this Options instance. + */ + public Options maxOutputs(Long maxOutputs) { + this.maxOutputs = 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 914a83cbcb8..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,37 +17,69 @@ 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"; + + 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 + * @param writer The writer value * @return a new instance of CloseSummaryWriter */ - @Endpoint(describeByClass = true) - public static CloseSummaryWriter create(Scope scope, Operand writer) { - OperationBuilder opBuilder = scope.env().opBuilder("CloseSummaryWriter", scope.makeOpName("CloseSummaryWriter")); + @Endpoint( + describeByClass = true + ) + public static CloseSummaryWriter create(Scope scope, Operand writer) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CloseSummaryWriter"); opBuilder.addInput(writer.asOutput()); - opBuilder = scope.apply(opBuilder); return new CloseSummaryWriter(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CloseSummaryWriter"; - - private CloseSummaryWriter(Operation operation) { - super(operation); + + @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 c704ba6ab41..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,46 +17,104 @@ 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"; + + 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 - * @param dbUri - * @param experimentName - * @param runName - * @param userName + * @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(describeByClass = true) - public static CreateSummaryDbWriter create(Scope scope, Operand writer, Operand dbUri, Operand experimentName, Operand runName, Operand userName) { - OperationBuilder opBuilder = scope.env().opBuilder("CreateSummaryDbWriter", scope.makeOpName("CreateSummaryDbWriter")); + @Endpoint( + describeByClass = true + ) + public static CreateSummaryDbWriter create(Scope scope, Operand writer, + Operand dbUri, Operand experimentName, Operand runName, + Operand userName) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CreateSummaryDbWriter"); opBuilder.addInput(writer.asOutput()); opBuilder.addInput(dbUri.asOutput()); opBuilder.addInput(experimentName.asOutput()); opBuilder.addInput(runName.asOutput()); opBuilder.addInput(userName.asOutput()); - opBuilder = scope.apply(opBuilder); return new CreateSummaryDbWriter(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CreateSummaryDbWriter"; - - private CreateSummaryDbWriter(Operation operation) { - super(operation); + + @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 e24b292c37a..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,47 +17,105 @@ 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; /** + * 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"; + + 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 - * @param logdir - * @param maxQueue - * @param flushMillis - * @param filenameSuffix + * @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(describeByClass = true) - public static CreateSummaryFileWriter create(Scope scope, Operand writer, Operand logdir, Operand maxQueue, Operand flushMillis, Operand filenameSuffix) { - OperationBuilder opBuilder = scope.env().opBuilder("CreateSummaryFileWriter", scope.makeOpName("CreateSummaryFileWriter")); + @Endpoint( + describeByClass = true + ) + public static CreateSummaryFileWriter create(Scope scope, Operand writer, + Operand logdir, Operand maxQueue, Operand flushMillis, + Operand filenameSuffix) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CreateSummaryFileWriter"); opBuilder.addInput(writer.asOutput()); opBuilder.addInput(logdir.asOutput()); opBuilder.addInput(maxQueue.asOutput()); opBuilder.addInput(flushMillis.asOutput()); opBuilder.addInput(filenameSuffix.asOutput()); - opBuilder = scope.apply(opBuilder); return new CreateSummaryFileWriter(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CreateSummaryFileWriter"; - - private CreateSummaryFileWriter(Operation operation) { - super(operation); + + @OpInputsMetadata( + outputsClass = CreateSummaryFileWriter.class + ) + public static class Inputs extends RawOpInputs { + /** + * 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 98dad5552ea..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,37 +17,69 @@ 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"; + + 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 + * @param writer The writer value * @return a new instance of FlushSummaryWriter */ - @Endpoint(describeByClass = true) - public static FlushSummaryWriter create(Scope scope, Operand writer) { - OperationBuilder opBuilder = scope.env().opBuilder("FlushSummaryWriter", scope.makeOpName("FlushSummaryWriter")); + @Endpoint( + describeByClass = true + ) + public static FlushSummaryWriter create(Scope scope, Operand writer) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FlushSummaryWriter"); opBuilder.addInput(writer.asOutput()); - opBuilder = scope.apply(opBuilder); return new FlushSummaryWriter(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FlushSummaryWriter"; - - private FlushSummaryWriter(Operation operation) { - super(operation); + + @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 34ed418e986..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,66 +17,109 @@ 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; /** - * Outputs a `Summary` protocol buffer with a histogram. - *

+ * Outputs a {@code Summary} protocol buffer with a histogram. * The generated - * [`Summary`](https://www.tensorflow.org/code/tensorflow/core/framework/summary.proto) - * has one summary value containing a histogram for `values`. - *

- * This op reports an `InvalidArgument` error if any value is not finite. + * {@code Summary} + * has one summary value containing a histogram for {@code values}. + *

This op reports an {@code InvalidArgument} error if any value is not finite. */ -@Operator(group = "summary") +@OpMetadata( + opType = HistogramSummary.OP_NAME, + inputsClass = HistogramSummary.Inputs.class +) +@Operator( + group = "summary" +) public final class HistogramSummary extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "HistogramSummary"; + + private Output summary; + + public HistogramSummary(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + summary = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new HistogramSummary operation. - * + * * @param scope current scope - * @param tag Scalar. Tag to use for the `Summary.Value`. + * @param tag Scalar. Tag to use for the {@code Summary.Value}. * @param values Any shape. Values to use to build the histogram. * @return a new instance of HistogramSummary */ - @Endpoint(describeByClass = true) - public static HistogramSummary create(Scope scope, Operand tag, Operand values) { - OperationBuilder opBuilder = scope.env().opBuilder("HistogramSummary", scope.makeOpName("HistogramSummary")); + @Endpoint( + describeByClass = true + ) + public static HistogramSummary create(Scope scope, Operand tag, + Operand values) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "HistogramSummary"); opBuilder.addInput(tag.asOutput()); opBuilder.addInput(values.asOutput()); - opBuilder = scope.apply(opBuilder); return new HistogramSummary(opBuilder.build()); } - + /** - * Scalar. Serialized `Summary` protocol buffer. + * Gets summary. + * Scalar. Serialized {@code Summary} protocol buffer. + * @return summary. */ public Output summary() { return summary; } - + @Override public Output asOutput() { return summary; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "HistogramSummary"; - - private Output summary; - - private HistogramSummary(Operation operation) { - super(operation); - int outputIdx = 0; - summary = operation.output(outputIdx++); + + @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 c5c4a9b30a7..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,115 +17,101 @@ 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; /** - * Outputs a `Summary` protocol buffer with images. - *

- * The summary has up to `max_images` summary values containing images. The - * images are built from `tensor` which must be 4-D with shape `[batch_size, - * height, width, channels]` and where `channels` can be: + * Outputs a {@code Summary} protocol buffer with images. + * The summary has up to {@code max_images} summary values containing images. The + * images are built from {@code tensor} which must be 4-D with shape {@code [batch_size, height, width, channels]} and where {@code channels} can be: *

    - *
  • - * 1: `tensor` is interpreted as Grayscale. - *
  • - *
  • - * 3: `tensor` is interpreted as RGB. - *
  • - *
  • - * 4: `tensor` is interpreted as RGBA. - *
  • + *
  • 1: {@code tensor} is interpreted as Grayscale.
  • + *
  • 3: {@code tensor} is interpreted as RGB.
  • + *
  • 4: {@code tensor} is interpreted as RGBA.
  • *
- * The images have the same number of channels as the input tensor. For float + *

The images have the same number of channels as the input tensor. For float * input, the values are normalized one image at a time to fit in the range - * `[0, 255]`. `uint8` values are unchanged. The op uses two different + * {@code [0, 255]}. {@code uint8} values are unchanged. The op uses two different * normalization algorithms: *

    *
  • - * If the input values are all positive, they are rescaled so the largest one - * is 255. + *

    If the input values are all positive, they are rescaled so the largest one + * is 255. *

  • *
  • - * If any input value is negative, the values are shifted so input value 0.0 - * is at 127. They are then rescaled so that either the smallest value is 0, - * or the largest one is 255. + *

    If any input value is negative, the values are shifted so input value 0.0 + * is at 127. They are then rescaled so that either the smallest value is 0, + * or the largest one is 255. *

  • *
- * The `tag` argument is a scalar `Tensor` of type `string`. It is used to - * build the `tag` of the summary values: + *

The {@code tag} argument is a scalar {@code Tensor} of type {@code string}. It is used to + * build the {@code tag} of the summary values: *

    - *
  • - * If `max_images` is 1, the summary value tag is 'tag/image'. - *
  • - *
  • - * If `max_images` is greater than 1, the summary value tags are - * generated sequentially as 'tag/image/0', 'tag/image/1', etc. - *
  • + *
  • If {@code max_images} is 1, the summary value tag is 'tag/image'.
  • + *
  • If {@code max_images} is greater than 1, the summary value tags are + * generated sequentially as 'tag/image/0', 'tag/image/1', etc.
  • *
- * The `bad_color` argument is the color to use in the generated images for - * non-finite input values. It is a `uint8` 1-D tensor of length `channels`. - * Each element must be in the range `[0, 255]` (It represents the value of a + *

The {@code bad_color} argument is the color to use in the generated images for + * non-finite input values. It is a {@code uint8} 1-D tensor of length {@code channels}. + * Each element must be in the range {@code [0, 255]} (It represents the value of a * pixel in the output image). Non-finite values in the input tensor are * replaced by this tensor in the output image. The default value is the color * red. */ -@Operator(group = "summary") +@OpMetadata( + opType = ImageSummary.OP_NAME, + inputsClass = ImageSummary.Inputs.class +) +@Operator( + group = "summary" +) public final class ImageSummary extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.summary.ImageSummary} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param maxImages Max number of batch elements to generate images for. - */ - public Options maxImages(Long maxImages) { - this.maxImages = maxImages; - return this; - } - - /** - * @param badColor Color to use for pixels with non-finite values. - */ - public Options badColor(Tensor badColor) { - this.badColor = badColor; - return this; - } - - private Long maxImages; - private Tensor badColor; - - private Options() { - } + public static final String OP_NAME = "ImageSummary"; + + private Output summary; + + public ImageSummary(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + summary = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ImageSummary operation. - * + * * @param scope current scope - * @param tag Scalar. Used to build the `tag` attribute of the summary values. - * @param tensor 4-D of shape `[batch_size, height, width, channels]` where - * `channels` is 1, 3, or 4. - * @param options carries optional attributes values + * @param tag Scalar. Used to build the {@code tag} attribute of the summary values. + * @param tensor 4-D of shape {@code [batch_size, height, width, channels]} where + * {@code channels} is 1, 3, or 4. + * @param options carries optional attribute values * @return a new instance of ImageSummary */ - @Endpoint(describeByClass = true) - public static ImageSummary create(Scope scope, Operand tag, Operand tensor, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ImageSummary", scope.makeOpName("ImageSummary")); + @Endpoint( + describeByClass = true + ) + public static ImageSummary create(Scope scope, Operand tag, + Operand tensor, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ImageSummary"); opBuilder.addInput(tag.asOutput()); opBuilder.addInput(tensor.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.maxImages != null) { @@ -138,41 +124,113 @@ public static ImageSummary create(Scope scope, Operand tag, Operand summary() { return summary; } - + @Override public Output asOutput() { return summary; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ImageSummary"; - - private Output summary; - - private ImageSummary(Operation operation) { - super(operation); - int outputIdx = 0; - summary = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.summary.ImageSummary} + */ + public static class Options { + private Long maxImages; + + private Tensor badColor; + + private Options() { + } + + /** + * Sets the maxImages option. + * + * @param maxImages Max number of batch elements to generate images for. + * @return this Options instance. + */ + public Options maxImages(Long maxImages) { + this.maxImages = maxImages; + return this; + } + + /** + * Sets the badColor option. + * + * @param badColor Color to use for pixels with non-finite values. + * @return this Options instance. + */ + public Options badColor(Tensor badColor) { + this.badColor = 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 0089a7d5257..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,40 +17,79 @@ 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"; + + 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 - * @param event + * @param writer The writer value + * @param event The event value * @return a new instance of ImportEvent */ - @Endpoint(describeByClass = true) - public static ImportEvent create(Scope scope, Operand writer, Operand event) { - OperationBuilder opBuilder = scope.env().opBuilder("ImportEvent", scope.makeOpName("ImportEvent")); + @Endpoint( + describeByClass = true + ) + public static ImportEvent create(Scope scope, Operand writer, + Operand event) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ImportEvent"); opBuilder.addInput(writer.asOutput()); opBuilder.addInput(event.asOutput()); - opBuilder = scope.apply(opBuilder); return new ImportEvent(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ImportEvent"; - - private ImportEvent(Operation operation) { - super(operation); + + @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 96c3be8ec4e..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,67 +17,99 @@ 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; /** * Merges summaries. - *

* This op creates a - * [`Summary`](https://www.tensorflow.org/code/tensorflow/core/framework/summary.proto) + * {@code Summary} * protocol buffer that contains the union of all the values in the input * summaries. - *

- * When the Op is run, it reports an `InvalidArgument` error if multiple values + *

When the Op is run, it reports an {@code InvalidArgument} error if multiple values * in the summaries to merge use the same tag. */ -@Operator(group = "summary") +@OpMetadata( + opType = MergeSummary.OP_NAME, + inputsClass = MergeSummary.Inputs.class +) +@Operator( + group = "summary" +) public final class MergeSummary extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MergeSummary"; + + private Output summary; + + public MergeSummary(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + summary = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MergeSummary operation. - * + * * @param scope current scope - * @param inputs Can be of any shape. Each must contain serialized `Summary` protocol + * @param inputs Can be of any shape. Each must contain serialized {@code Summary} protocol * buffers. * @return a new instance of MergeSummary */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static MergeSummary create(Scope scope, Iterable> inputs) { - OperationBuilder opBuilder = scope.env().opBuilder("MergeSummary", scope.makeOpName("MergeSummary")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MergeSummary"); opBuilder.addInputList(Operands.asOutputs(inputs)); - opBuilder = scope.apply(opBuilder); return new MergeSummary(opBuilder.build()); } - + /** - * Scalar. Serialized `Summary` protocol buffer. + * Gets summary. + * Scalar. Serialized {@code Summary} protocol buffer. + * @return summary. */ public Output summary() { return summary; } - + @Override public Output asOutput() { return summary; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MergeSummary"; - - private Output summary; - - private MergeSummary(Operation operation) { - super(operation); - int outputIdx = 0; - summary = operation.output(outputIdx++); + + @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 27989bc1fed..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,63 +17,107 @@ 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; /** - * Outputs a `Summary` protocol buffer with scalar values. - *

- * The input `tags` and `values` must have the same shape. The generated summary - * has a summary value for each tag-value pair in `tags` and `values`. + * Outputs a {@code Summary} protocol buffer with scalar values. + * 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}. */ -@Operator(group = "summary") +@OpMetadata( + opType = ScalarSummary.OP_NAME, + inputsClass = ScalarSummary.Inputs.class +) +@Operator( + group = "summary" +) public final class ScalarSummary extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ScalarSummary"; + + private Output summary; + + public ScalarSummary(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + summary = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ScalarSummary operation. - * + * * @param scope current scope * @param tags Tags for the summary. * @param values Same shape as `tags. Values for the summary. * @return a new instance of ScalarSummary */ - @Endpoint(describeByClass = true) - public static ScalarSummary create(Scope scope, Operand tags, Operand values) { - OperationBuilder opBuilder = scope.env().opBuilder("ScalarSummary", scope.makeOpName("ScalarSummary")); + @Endpoint( + describeByClass = true + ) + public static ScalarSummary create(Scope scope, Operand tags, + Operand values) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ScalarSummary"); opBuilder.addInput(tags.asOutput()); opBuilder.addInput(values.asOutput()); - opBuilder = scope.apply(opBuilder); return new ScalarSummary(opBuilder.build()); } - + /** - * Scalar. Serialized `Summary` protocol buffer. + * Gets summary. + * Scalar. Serialized {@code Summary} protocol buffer. + * @return summary. */ public Output summary() { return summary; } - + @Override public Output asOutput() { return summary; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScalarSummary"; - - private Output summary; - - private ScalarSummary(Operation operation) { - super(operation); - int outputIdx = 0; - summary = operation.output(outputIdx++); + + @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 bf1bcf65513..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,55 +17,89 @@ 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 + */ + public static final String OP_NAME = "StatsAggregatorSummary"; + + private Output summary; + + public StatsAggregatorSummary(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + summary = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatsAggregatorSummary operation. - * + * * @param scope current scope - * @param iterator + * @param iterator The iterator value * @return a new instance of StatsAggregatorSummary */ - @Endpoint(describeByClass = true) - public static StatsAggregatorSummary create(Scope scope, Operand iterator) { - OperationBuilder opBuilder = scope.env().opBuilder("StatsAggregatorSummary", scope.makeOpName("StatsAggregatorSummary")); + @Endpoint( + describeByClass = true + ) + public static StatsAggregatorSummary create(Scope scope, Operand iterator) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatsAggregatorSummary"); opBuilder.addInput(iterator.asOutput()); - opBuilder = scope.apply(opBuilder); return new StatsAggregatorSummary(opBuilder.build()); } - + /** + * Gets summary. + * + * @return summary. */ public Output summary() { return summary; } - + @Override public Output asOutput() { return summary; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatsAggregatorSummary"; - - private Output summary; - - private StatsAggregatorSummary(Operation operation) { - super(operation); - int outputIdx = 0; - summary = operation.output(outputIdx++); + + @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 459a16dc62c..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,59 +17,58 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.summary.SummaryWriter} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - private String sharedName; - private String container; - - private Options() { - } + public static final String OP_NAME = "SummaryWriter"; + + private Output writer; + + @SuppressWarnings("unchecked") + public SummaryWriter(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + writer = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SummaryWriter operation. - * + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of SummaryWriter */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static SummaryWriter create(Scope scope, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SummaryWriter", scope.makeOpName("SummaryWriter")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SummaryWriter"); if (options != null) { for (Options opts : options) { if (opts.sharedName != null) { @@ -82,41 +81,95 @@ public static SummaryWriter create(Scope scope, Options... options) { } return new SummaryWriter(opBuilder.build()); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Gets writer. + * + * @return writer. */ - public Output writer() { + public Output writer() { return writer; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) writer; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SummaryWriter"; - - private Output writer; - - private SummaryWriter(Operation operation) { - super(operation); - int outputIdx = 0; - writer = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.summary.SummaryWriter} + */ + public static class Options { + private String sharedName; + + private String container; + + private Options() { + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = 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 be4ceff4fb4..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,26 +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.Output; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.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 `Summary` protocol buffer with a tensor and per-plugin data. + * Outputs a {@code Summary} protocol buffer with a tensor and per-plugin data. */ -@Operator(group = "summary") +@OpMetadata( + opType = TensorSummary.OP_NAME, + inputsClass = TensorSummary.Inputs.class +) +@Operator( + group = "summary" +) public final class TensorSummary extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TensorSummary operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorSummaryV2"; + + private Output summary; + + public TensorSummary(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + summary = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorSummaryV2 operation. + * * @param scope current scope * @param tag A string attached to this summary. Used for organization in TensorBoard. * @param tensor A tensor to serialize. @@ -44,35 +68,64 @@ public final class TensorSummary extends RawOp implements Operand { * data. * @return a new instance of TensorSummary */ - @Endpoint(describeByClass = true) - public static TensorSummary create(Scope scope, Operand tag, Operand tensor, Operand serializedSummaryMetadata) { - OperationBuilder opBuilder = scope.env().opBuilder("TensorSummaryV2", scope.makeOpName("TensorSummary")); + @Endpoint( + describeByClass = true + ) + public static TensorSummary create(Scope scope, Operand tag, + Operand tensor, Operand serializedSummaryMetadata) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorSummary"); opBuilder.addInput(tag.asOutput()); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(serializedSummaryMetadata.asOutput()); - opBuilder = scope.apply(opBuilder); return new TensorSummary(opBuilder.build()); } - + /** + * Gets summary. + * + * @return summary. */ public Output summary() { return summary; } - + @Override public Output asOutput() { return summary; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorSummaryV2"; - - private Output summary; - - private TensorSummary(Operation operation) { - super(operation); - int outputIdx = 0; - summary = operation.output(outputIdx++); + + @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 e905a1b0291..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,65 +17,69 @@ 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; +import org.tensorflow.types.family.TType; /** * Writes an audio summary. - *

- * Writes encoded audio summary `tensor` at `step` with `tag` using summary `writer`. - * `sample_rate` is the audio sample rate is Hz. + * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.summary.WriteAudioSummary} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param maxOutputs - */ - public Options maxOutputs(Long maxOutputs) { - this.maxOutputs = maxOutputs; - return this; - } - - private Long maxOutputs; - - private Options() { - } + public static final String OP_NAME = "WriteAudioSummary"; + + 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 - * @param step - * @param tag - * @param tensor - * @param sampleRate - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static WriteAudioSummary create(Scope scope, Operand writer, Operand step, Operand tag, Operand tensor, Operand sampleRate, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("WriteAudioSummary", scope.makeOpName("WriteAudioSummary")); + @Endpoint( + describeByClass = true + ) + public static WriteAudioSummary create(Scope scope, Operand writer, + Operand step, Operand tag, Operand tensor, + Operand sampleRate, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "WriteAudioSummary"); opBuilder.addInput(writer.asOutput()); opBuilder.addInput(step.asOutput()); opBuilder.addInput(tag.asOutput()); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(sampleRate.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.maxOutputs != null) { @@ -85,18 +89,81 @@ public static WriteAudioSummary create(Scope scope, Operand writer, Operand { + /** + * 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 054c478815b..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,46 +17,89 @@ 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; /** * Writes a graph summary. - *

- * Writes TensorFlow graph `tensor` at `step` using summary `writer`. + * 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"; + + 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 - * @param step - * @param tensor + * @param writer The writer value + * @param step The step value + * @param tensor The tensor value * @return a new instance of WriteGraphSummary */ - @Endpoint(describeByClass = true) - public static WriteGraphSummary create(Scope scope, Operand writer, Operand step, Operand tensor) { - OperationBuilder opBuilder = scope.env().opBuilder("WriteGraphSummary", scope.makeOpName("WriteGraphSummary")); + @Endpoint( + describeByClass = true + ) + public static WriteGraphSummary create(Scope scope, Operand writer, + Operand step, Operand tensor) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "WriteGraphSummary"); opBuilder.addInput(writer.asOutput()); opBuilder.addInput(step.asOutput()); opBuilder.addInput(tensor.asOutput()); - opBuilder = scope.apply(opBuilder); return new WriteGraphSummary(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "WriteGraphSummary"; - - private WriteGraphSummary(Operation operation) { - super(operation); + + @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 24543c08b7c..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,49 +17,104 @@ 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; +import org.tensorflow.types.family.TType; /** * Writes a histogram summary. - *

- * Writes histogram `values` at `step` with `tag` using summary `writer`. + * 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"; + + 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 - * @param step - * @param tag - * @param values + * @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(describeByClass = true) - public static WriteHistogramSummary create(Scope scope, Operand writer, Operand step, Operand tag, Operand values) { - OperationBuilder opBuilder = scope.env().opBuilder("WriteHistogramSummary", scope.makeOpName("WriteHistogramSummary")); + @Endpoint( + describeByClass = true + ) + public static WriteHistogramSummary create(Scope scope, Operand writer, + Operand step, Operand tag, Operand values) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "WriteHistogramSummary"); opBuilder.addInput(writer.asOutput()); opBuilder.addInput(step.asOutput()); opBuilder.addInput(tag.asOutput()); opBuilder.addInput(values.asOutput()); - opBuilder = scope.apply(opBuilder); return new WriteHistogramSummary(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "WriteHistogramSummary"; - - private WriteHistogramSummary(Operation operation) { - super(operation); + + @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 e3be2892cd0..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,66 +17,71 @@ 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; import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Writes an image summary. - *

- * Writes image `tensor` at `step` with `tag` using summary `writer`. - * `tensor` is image with shape [height, width, channels]. + * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.summary.WriteImageSummary} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param maxImages - */ - public Options maxImages(Long maxImages) { - this.maxImages = maxImages; - return this; - } - - private Long maxImages; - - private Options() { - } + public static final String OP_NAME = "WriteImageSummary"; + + 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 - * @param step - * @param tag - * @param tensor - * @param badColor - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static WriteImageSummary create(Scope scope, Operand writer, Operand step, Operand tag, Operand tensor, Operand badColor, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("WriteImageSummary", scope.makeOpName("WriteImageSummary")); + @Endpoint( + describeByClass = true + ) + public static WriteImageSummary create(Scope scope, Operand writer, + Operand step, Operand tag, Operand tensor, + Operand badColor, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "WriteImageSummary"); opBuilder.addInput(writer.asOutput()); opBuilder.addInput(step.asOutput()); opBuilder.addInput(tag.asOutput()); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(badColor.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.maxImages != null) { @@ -86,18 +91,87 @@ public static WriteImageSummary create(Scope scope, Operand writer, Operand { + /** + * 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 76fda8646b3..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,46 +17,89 @@ 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; /** * Writes a serialized proto summary. - *

- * Writes `tensor`, a serialized proto at `step` using summary `writer`. + * 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"; + + 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 - * @param step - * @param tensor + * @param writer The writer value + * @param step The step value + * @param tensor The tensor value * @return a new instance of WriteRawProtoSummary */ - @Endpoint(describeByClass = true) - public static WriteRawProtoSummary create(Scope scope, Operand writer, Operand step, Operand tensor) { - OperationBuilder opBuilder = scope.env().opBuilder("WriteRawProtoSummary", scope.makeOpName("WriteRawProtoSummary")); + @Endpoint( + describeByClass = true + ) + public static WriteRawProtoSummary create(Scope scope, Operand writer, + Operand step, Operand tensor) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "WriteRawProtoSummary"); opBuilder.addInput(writer.asOutput()); opBuilder.addInput(step.asOutput()); opBuilder.addInput(tensor.asOutput()); - opBuilder = scope.apply(opBuilder); return new WriteRawProtoSummary(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "WriteRawProtoSummary"; - - private WriteRawProtoSummary(Operation operation) { - super(operation); + + @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 5fddaff353c..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,49 +17,105 @@ 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; +import org.tensorflow.types.family.TType; /** * Writes a scalar summary. - *

- * Writes scalar `value` at `step` with `tag` using summary `writer`. + * 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"; + + 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 - * @param step - * @param tag - * @param 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(describeByClass = true) - public static WriteScalarSummary create(Scope scope, Operand writer, Operand step, Operand tag, Operand value) { - OperationBuilder opBuilder = scope.env().opBuilder("WriteScalarSummary", scope.makeOpName("WriteScalarSummary")); + @Endpoint( + describeByClass = true + ) + public static WriteScalarSummary create(Scope scope, Operand writer, + Operand step, Operand tag, Operand value) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "WriteScalarSummary"); opBuilder.addInput(writer.asOutput()); opBuilder.addInput(step.asOutput()); opBuilder.addInput(tag.asOutput()); opBuilder.addInput(value.asOutput()); - opBuilder = scope.apply(opBuilder); return new WriteScalarSummary(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "WriteScalarSummary"; - - private WriteScalarSummary(Operation operation) { - super(operation); + + @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 337c585a8c9..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,51 +17,113 @@ 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; /** * Writes a tensor summary. - *

- * Writes `tensor` at `step` with `tag` using summary `writer`. + * 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"; + + 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 - * @param step - * @param tensor - * @param tag - * @param summaryMetadata + * @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(describeByClass = true) - public static WriteSummary create(Scope scope, Operand writer, Operand step, Operand tensor, Operand tag, Operand summaryMetadata) { - OperationBuilder opBuilder = scope.env().opBuilder("WriteSummary", scope.makeOpName("WriteSummary")); + @Endpoint( + describeByClass = true + ) + public static WriteSummary create(Scope scope, Operand writer, + Operand step, Operand tensor, Operand tag, + Operand summaryMetadata) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "WriteSummary"); opBuilder.addInput(writer.asOutput()); opBuilder.addInput(step.asOutput()); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(tag.asOutput()); opBuilder.addInput(summaryMetadata.asOutput()); - opBuilder = scope.apply(opBuilder); return new WriteSummary(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "WriteSummary"; - - private WriteSummary(Operation operation) { - super(operation); + + @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 afc01cae05e..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,87 +17,149 @@ 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; /** * An Op to exchange data across TPU replicas. - *

- * On each replica, the input is split into `split_count` blocks along - * `split_dimension` and send to the other replicas given group_assignment. After - * receiving `split_count` - 1 blocks from other replicas, we concatenate the - * blocks along `concat_dimension` as the output. - *

- * For example, suppose there are 2 TPU replicas: - * replica 0 receives input: `[[A, B]]` - * replica 1 receives input: `[[C, D]]` - *

- * group_assignment=`[[0, 1]]` + * 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: `[[A], [C]]` - * replica 1's output: `[[B], [D]]` - * - * @param data type for {@code output()} output + *

replica 0's output: {@code [[A], [C]]} + * replica 1's output: {@code [[B], [D]]} */ +@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 + */ + public static final String OP_NAME = "AllToAll"; + + private Output output; + + public AllToAll(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new AllToAll operation. - * + * * @param scope current scope * @param input The local input to the sum. * @param groupAssignment An int32 tensor with shape - * [num_groups, num_replicas_per_group]. `group_assignment[i]` represents the + * [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 */ - @Endpoint(describeByClass = true) - public static AllToAll create(Scope scope, Operand input, Operand groupAssignment, Long concatDimension, Long splitDimension, Long splitCount) { - OperationBuilder opBuilder = scope.env().opBuilder("AllToAll", scope.makeOpName("AllToAll")); + @Endpoint( + describeByClass = true + ) + public static AllToAll create(Scope scope, Operand input, + Operand groupAssignment, Long concatDimension, Long splitDimension, Long splitCount) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AllToAll"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(groupAssignment.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("concat_dimension", concatDimension); opBuilder.setAttr("split_dimension", splitDimension); opBuilder.setAttr("split_count", splitCount); - return new AllToAll(opBuilder.build()); + return new AllToAll<>(opBuilder.build()); } - + /** + * Gets output. * The exchanged result. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AllToAll"; - - private Output output; - - private AllToAll(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 43fe40a06dc..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CollectivePermute.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.tpu; - -import org.tensorflow.Operand; -import org.tensorflow.Operation; -import org.tensorflow.OperationBuilder; -import org.tensorflow.Output; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.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: `[A, B, C, D]`. Passing - * source_target_pairs=`[[0,1],[1,2],[2,3],[3,0]]` gets the outputs: - * `[D, A, B, C]`. - * - * @param data type for {@code output()} output - */ -public final class CollectivePermute extends RawOp implements Operand { - - /** - * 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]. - * @return a new instance of CollectivePermute - */ - @Endpoint(describeByClass = true) - public static CollectivePermute create(Scope scope, Operand input, Operand sourceTargetPairs) { - OperationBuilder opBuilder = scope.env().opBuilder("CollectivePermute", scope.makeOpName("CollectivePermute")); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(sourceTargetPairs.asOutput()); - opBuilder = scope.apply(opBuilder); - return new CollectivePermute(opBuilder.build()); - } - - /** - * The permuted input. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CollectivePermute"; - - private Output output; - - private CollectivePermute(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CompilationResult.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CompilationResult.java index bd0cbda42c4..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,57 +17,83 @@ 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; /** * 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. */ +@OpMetadata( + opType = CompilationResult.OP_NAME, + inputsClass = CompilationResult.Inputs.class +) +@Operator( + group = "tpu" +) public final class CompilationResult extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new CompilationResult operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPUCompilationResult"; + + private Output output; + + public CompilationResult(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TPUCompilationResult operation. + * * @param scope current scope * @return a new instance of CompilationResult */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static CompilationResult create(Scope scope) { - OperationBuilder opBuilder = scope.env().opBuilder("TPUCompilationResult", scope.makeOpName("CompilationResult")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CompilationResult"); return new CompilationResult(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUCompilationResult"; - - private Output output; - - private CompilationResult(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 new file mode 100644 index 00000000000..ed24b8e762c --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/Compile.java @@ -0,0 +1,180 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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; + +/** + * Compiles a computations for execution on one or more TPU devices. + * For the internal use of the distributed TPU compiler. + *

'num_computations' is the number of computations to be compiled. + * 'function' is a function containing the computation to compile. + * 'dynamic_shapes' contains dynamic shapes of arguments whose shapes were not + * known statically at TPUReplication rewrite time. + * 'guaranteed_constants' is a list of tensors which have been guaranteed to not + * change their values during the session lifetime. These contain tensors marked as + * constant using the GuaranteeConstOp. + * 'metadata' is a serialized TPUCompileMetadataProto describing + * the shapes and types of the inputs to the computation, as well as a mapping onto + * the TPU pod topology. + * Each 'program' output is a string key that is passed to the _TPUExecute op and + * 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" +) +public final class Compile extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPUCompile"; + + private Output compilationStatus; + + private List> program; + + private List> mayModifyVariables; + + @SuppressWarnings("unchecked") + public Compile(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + compilationStatus = operation.output(outputIdx++); + int programLength = operation.outputListLength("program"); + program = Arrays.asList((Output[]) operation.outputList(outputIdx, programLength)); + outputIdx += programLength; + int mayModifyVariablesLength = operation.outputListLength("may_modify_variables"); + mayModifyVariables = Arrays.asList((Output[]) operation.outputList(outputIdx, mayModifyVariablesLength)); + outputIdx += mayModifyVariablesLength; + } + + /** + * 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 attribute + * @param function The value of the function attribute + * @param metadata The value of the metadata attribute + * @return a new instance of Compile + */ + @Endpoint( + describeByClass = true + ) + public static Compile create(Scope scope, Iterable> dynamicShapes, + Iterable> guaranteedConstants, Long numComputations, ConcreteFunction function, + String metadata) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Compile"); + opBuilder.addInputList(Operands.asOutputs(dynamicShapes)); + opBuilder.addInputList(Operands.asOutputs(guaranteedConstants)); + opBuilder.setAttr("num_computations", numComputations); + opBuilder.setAttr("function", function); + opBuilder.setAttr("metadata", metadata); + return new Compile(opBuilder.build()); + } + + /** + * Gets compilationStatus. + * + * @return compilationStatus. + */ + public Output compilationStatus() { + return compilationStatus; + } + + /** + * Gets program. + * + * @return program. + */ + public List> program() { + return program; + } + + /** + * Gets mayModifyVariables. + * + * @return mayModifyVariables. + */ + 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 bf5abddcdd2..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,44 +17,72 @@ 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; /** - * Asserts that compilation succeeded. This op produces no output and closes the - *

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

- * 'compilation_status' is a serialized CompilationResultProto. + * Asserts that compilation succeeded. + * This op produces no output and closes the device during failure to ensure all + * pending device interactions fail. + *

'compilation_status' is a serialized CompilationResultProto. */ -@Operator(group = "tpu") +@OpMetadata( + opType = CompileSucceededAssert.OP_NAME, + inputsClass = CompileSucceededAssert.Inputs.class +) +@Operator( + group = "tpu" +) public final class CompileSucceededAssert extends RawOp { - /** - * Factory method to create a class wrapping a new CompileSucceededAssert operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPUCompileSucceededAssert"; + + 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 + * @param compilationStatus The compilationStatus value * @return a new instance of CompileSucceededAssert */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static CompileSucceededAssert create(Scope scope, Operand compilationStatus) { - OperationBuilder opBuilder = scope.env().opBuilder("TPUCompileSucceededAssert", scope.makeOpName("CompileSucceededAssert")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CompileSucceededAssert"); opBuilder.addInput(compilationStatus.asOutput()); - opBuilder = scope.apply(opBuilder); return new CompileSucceededAssert(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUCompileSucceededAssert"; - - private CompileSucceededAssert(Operation operation) { - super(operation); + + @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 35853993c2e..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,88 +17,57 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.ConfigureDistributedTPU} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param embeddingConfig Reserved. Do not use. - */ - public Options embeddingConfig(String embeddingConfig) { - this.embeddingConfig = embeddingConfig; - return this; - } - - /** - * @param tpuEmbeddingConfig Serialized tensorflow.tpu.TPUEmbeddingConfiguration that - * describes the embedding lookups of the program. - */ - public Options tpuEmbeddingConfig(String tpuEmbeddingConfig) { - this.tpuEmbeddingConfig = tpuEmbeddingConfig; - return this; - } - - /** - * @param isGlobalInit Reserved. Do not use. - */ - public Options isGlobalInit(Boolean isGlobalInit) { - this.isGlobalInit = isGlobalInit; - return this; - } - - /** - * @param enableWholeMeshCompilations - */ - public Options enableWholeMeshCompilations(Boolean enableWholeMeshCompilations) { - this.enableWholeMeshCompilations = enableWholeMeshCompilations; - return this; - } - - /** - * @param compilationFailureClosesChips - */ - public Options compilationFailureClosesChips(Boolean compilationFailureClosesChips) { - this.compilationFailureClosesChips = compilationFailureClosesChips; - return this; - } - - private String embeddingConfig; - private String tpuEmbeddingConfig; - private Boolean isGlobalInit; - private Boolean enableWholeMeshCompilations; - private Boolean compilationFailureClosesChips; - - private Options() { - } + public static final String OP_NAME = "ConfigureDistributedTPU"; + + private Output topology; + + public ConfigureDistributedTPU(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + topology = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ConfigureDistributedTPU operation. - * + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ConfigureDistributedTPU */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ConfigureDistributedTPU create(Scope scope, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ConfigureDistributedTPU", scope.makeOpName("ConfigureDistributedTPU")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ConfigureDistributedTPU"); if (options != null) { for (Options opts : options) { if (opts.embeddingConfig != null) { @@ -116,68 +85,221 @@ 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()); } - + /** + * Sets the embeddingConfig option. + * * @param embeddingConfig Reserved. Do not use. + * @return this Options instance. */ public static Options embeddingConfig(String embeddingConfig) { return new Options().embeddingConfig(embeddingConfig); } - + /** + * Sets the tpuEmbeddingConfig option. + * * @param tpuEmbeddingConfig Serialized tensorflow.tpu.TPUEmbeddingConfiguration that * describes the embedding lookups of the program. + * @return this Options instance. */ public static Options tpuEmbeddingConfig(String tpuEmbeddingConfig) { return new Options().tpuEmbeddingConfig(tpuEmbeddingConfig); } - + /** + * Sets the isGlobalInit option. + * * @param isGlobalInit Reserved. Do not use. + * @return this Options instance. */ public static Options isGlobalInit(Boolean isGlobalInit) { return new Options().isGlobalInit(isGlobalInit); } - + /** - * @param enableWholeMeshCompilations + * Sets the enableWholeMeshCompilations option. + * + * @param enableWholeMeshCompilations the enableWholeMeshCompilations option + * @return this Options instance. */ public static Options enableWholeMeshCompilations(Boolean enableWholeMeshCompilations) { return new Options().enableWholeMeshCompilations(enableWholeMeshCompilations); } - + /** - * @param compilationFailureClosesChips + * Sets the compilationFailureClosesChips option. + * + * @param compilationFailureClosesChips the compilationFailureClosesChips option + * @return this Options instance. */ public static Options compilationFailureClosesChips(Boolean compilationFailureClosesChips) { 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 * topology. + * @return topology. */ public Output topology() { return topology; } - + @Override public Output asOutput() { return topology; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ConfigureDistributedTPU"; - - private Output topology; - - private ConfigureDistributedTPU(Operation operation) { - super(operation); - int outputIdx = 0; - topology = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.ConfigureDistributedTPU} + */ + public static class Options { + private String embeddingConfig; + + private String tpuEmbeddingConfig; + + private Boolean isGlobalInit; + + private Boolean enableWholeMeshCompilations; + + private Boolean compilationFailureClosesChips; + + private Long tpuCancellationClosesChips; + + private Options() { + } + + /** + * Sets the embeddingConfig option. + * + * @param embeddingConfig Reserved. Do not use. + * @return this Options instance. + */ + public Options embeddingConfig(String embeddingConfig) { + this.embeddingConfig = embeddingConfig; + return this; + } + + /** + * Sets the tpuEmbeddingConfig option. + * + * @param tpuEmbeddingConfig Serialized tensorflow.tpu.TPUEmbeddingConfiguration that + * describes the embedding lookups of the program. + * @return this Options instance. + */ + public Options tpuEmbeddingConfig(String tpuEmbeddingConfig) { + this.tpuEmbeddingConfig = tpuEmbeddingConfig; + return this; + } + + /** + * Sets the isGlobalInit option. + * + * @param isGlobalInit Reserved. Do not use. + * @return this Options instance. + */ + public Options isGlobalInit(Boolean isGlobalInit) { + this.isGlobalInit = isGlobalInit; + return this; + } + + /** + * Sets the enableWholeMeshCompilations option. + * + * @param enableWholeMeshCompilations the enableWholeMeshCompilations option + * @return this Options instance. + */ + public Options enableWholeMeshCompilations(Boolean enableWholeMeshCompilations) { + this.enableWholeMeshCompilations = enableWholeMeshCompilations; + return this; + } + + /** + * Sets the compilationFailureClosesChips option. + * + * @param compilationFailureClosesChips the compilationFailureClosesChips option + * @return this Options instance. + */ + public Options compilationFailureClosesChips(Boolean compilationFailureClosesChips) { + 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 2083167b0ec..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,38 +17,69 @@ 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"; + + public ConfigureTPUEmbedding(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new ConfigureTPUEmbedding operation. - * + * * @param scope current scope * @param config Serialized tensorflow.tpu.TPUEmbeddingConfiguration that * describes the embedding lookups of the program. * @return a new instance of ConfigureTPUEmbedding */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ConfigureTPUEmbedding create(Scope scope, String config) { - OperationBuilder opBuilder = scope.env().opBuilder("ConfigureTPUEmbedding", scope.makeOpName("ConfigureTPUEmbedding")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ConfigureTPUEmbedding"); opBuilder.setAttr("config", config); return new ConfigureTPUEmbedding(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ConfigureTPUEmbedding"; - - private ConfigureTPUEmbedding(Operation operation) { - super(operation); + + @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 ff2cb8390be..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,70 +17,115 @@ 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; /** * An Op to sum inputs across replicated TPU instances. - *

* Each instance supplies its own input. - *

- * For example, suppose there are 8 TPU instances: `[A, B, C, D, E, F, G, H]`. - * Passing group_assignment=`[[0,2,4,6],[1,3,5,7]]` sets `A, C, E, G` as group 0, - * and `B, D, F, H` as group 1. Thus we get the outputs: - * `[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 + *

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]}. */ +@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 + */ + public static final String OP_NAME = "CrossReplicaSum"; + + private Output output; + + public CrossReplicaSum(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new CrossReplicaSum operation. - * + * * @param scope current scope * @param input The local input to the sum. * @param groupAssignment An int32 tensor with shape - * [num_groups, num_replicas_per_group]. `group_assignment[i]` represents the + * [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 */ - @Endpoint(describeByClass = true) - public static CrossReplicaSum create(Scope scope, Operand input, Operand groupAssignment) { - OperationBuilder opBuilder = scope.env().opBuilder("CrossReplicaSum", scope.makeOpName("CrossReplicaSum")); + @Endpoint( + describeByClass = true + ) + public static CrossReplicaSum create(Scope scope, Operand input, + Operand groupAssignment) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CrossReplicaSum"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(groupAssignment.asOutput()); - opBuilder = scope.apply(opBuilder); - return new CrossReplicaSum(opBuilder.build()); + return new CrossReplicaSum<>(opBuilder.build()); } - + /** + * Gets output. * The sum of all the distributed inputs. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CrossReplicaSum"; - - private Output output; - - private CrossReplicaSum(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 88547e9358d..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,30 +17,53 @@ 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; /** * 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. */ +@OpMetadata( + opType = EmbeddingActivations.OP_NAME, + inputsClass = EmbeddingActivations.Inputs.class +) +@Operator( + group = "tpu" +) public final class EmbeddingActivations extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new EmbeddingActivations operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPUEmbeddingActivations"; + + private Output output; + + public EmbeddingActivations(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TPUEmbeddingActivations operation. + * * @param scope current scope * @param embeddingVariable A trainable variable, enabling optimizers to find this op. * @param slicedActivations The embedding activations Tensor to return. @@ -50,36 +73,66 @@ public final class EmbeddingActivations extends RawOp implements Operand embeddingVariable, Operand slicedActivations, Long tableId, Long lookupId) { - OperationBuilder opBuilder = scope.env().opBuilder("TPUEmbeddingActivations", scope.makeOpName("EmbeddingActivations")); + @Endpoint( + describeByClass = true + ) + public static EmbeddingActivations create(Scope scope, Operand embeddingVariable, + Operand slicedActivations, Long tableId, Long lookupId) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "EmbeddingActivations"); opBuilder.addInput(embeddingVariable.asOutput()); opBuilder.addInput(slicedActivations.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("table_id", tableId); opBuilder.setAttr("lookup_id", lookupId); return new EmbeddingActivations(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUEmbeddingActivations"; - - private Output output; - - private EmbeddingActivations(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 a7457ea77de..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,13 +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.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.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,31 +36,26 @@ /** * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.EnqueueTPUEmbeddingIntegerBatch} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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. - */ - public Options deviceOrdinal(Long deviceOrdinal) { - this.deviceOrdinal = deviceOrdinal; - return this; - } - - private Long deviceOrdinal; - - private Options() { - } + public static final String OP_NAME = "EnqueueTPUEmbeddingIntegerBatch"; + + public EnqueueTPUEmbeddingIntegerBatch(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new EnqueueTPUEmbeddingIntegerBatch operation. - * + * * @param scope current scope * @param batch A list of 1D tensors, one for each embedding table, containing the * indices into the tables. @@ -63,15 +63,17 @@ private Options() { * 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 attributes values + * @param options carries optional attribute values * @return a new instance of EnqueueTPUEmbeddingIntegerBatch */ - @Endpoint(describeByClass = true) - public static EnqueueTPUEmbeddingIntegerBatch create(Scope scope, Iterable> batch, Operand modeOverride, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("EnqueueTPUEmbeddingIntegerBatch", scope.makeOpName("EnqueueTPUEmbeddingIntegerBatch")); + @Endpoint( + describeByClass = true + ) + public static EnqueueTPUEmbeddingIntegerBatch create(Scope scope, Iterable> batch, + Operand modeOverride, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "EnqueueTPUEmbeddingIntegerBatch"); opBuilder.addInputList(Operands.asOutputs(batch)); opBuilder.addInput(modeOverride.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.deviceOrdinal != null) { @@ -81,19 +83,72 @@ public static EnqueueTPUEmbeddingIntegerBatch create(Scope scope, Iterable= 0 and less than the number + * 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); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EnqueueTPUEmbeddingIntegerBatch"; - - private EnqueueTPUEmbeddingIntegerBatch(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.EnqueueTPUEmbeddingIntegerBatch} + */ + public static class Options { + private Long deviceOrdinal; + + 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; + } + } + + @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 a6256e829fa..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. @@ -17,78 +17,54 @@ 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(). - *

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

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. */ +@OpMetadata( + opType = EnqueueTPUEmbeddingRaggedTensorBatch.OP_NAME, + inputsClass = EnqueueTPUEmbeddingRaggedTensorBatch.Inputs.class +) +@Operator( + group = "tpu" +) public final class EnqueueTPUEmbeddingRaggedTensorBatch extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.EnqueueTPUEmbeddingRaggedTensorBatch} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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. - */ - public Options deviceOrdinal(Long deviceOrdinal) { - this.deviceOrdinal = deviceOrdinal; - return this; - } - - /** - * @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. - */ - public Options combiners(List combiners) { - this.combiners = combiners; - return this; - } - - /** - * @param maxSequenceLengths - */ - public Options maxSequenceLengths(List maxSequenceLengths) { - this.maxSequenceLengths = maxSequenceLengths; - return this; - } - - private Long deviceOrdinal; - private List combiners; - private List maxSequenceLengths; - - private Options() { - } + public static final String OP_NAME = "EnqueueTPUEmbeddingRaggedTensorBatch"; + + public EnqueueTPUEmbeddingRaggedTensorBatch(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new EnqueueTPUEmbeddingRaggedTensorBatch operation. - * + * * @param scope current scope * @param sampleSplits A list of rank 1 Tensors specifying the break points for splitting * embedding_indices and aggregation_weights into rows. @@ -109,19 +85,24 @@ private Options() { * 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 attributes values + * @param options carries optional attribute values * @return a new instance of EnqueueTPUEmbeddingRaggedTensorBatch */ - @Endpoint(describeByClass = true) - public static EnqueueTPUEmbeddingRaggedTensorBatch create(Scope scope, Iterable> sampleSplits, Iterable> embeddingIndices, Iterable> aggregationWeights, Operand modeOverride, List tableIds, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("EnqueueTPUEmbeddingRaggedTensorBatch", scope.makeOpName("EnqueueTPUEmbeddingRaggedTensorBatch")); + @Endpoint( + describeByClass = true + ) + public static EnqueueTPUEmbeddingRaggedTensorBatch create(Scope scope, + Iterable> sampleSplits, + Iterable> embeddingIndices, + Iterable> aggregationWeights, Operand modeOverride, + List tableIds, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "EnqueueTPUEmbeddingRaggedTensorBatch"); opBuilder.addInputList(Operands.asOutputs(sampleSplits)); opBuilder.addInputList(Operands.asOutputs(embeddingIndices)); opBuilder.addInputList(Operands.asOutputs(aggregationWeights)); opBuilder.addInput(modeOverride.asOutput()); - opBuilder = scope.apply(opBuilder); long[] tableIdsArray = new long[tableIds.size()]; - for (int i = 0; i < tableIdsArray.length; ++i) { + for (int i = 0 ; i < tableIdsArray.length ; i++) { tableIdsArray[i] = tableIds.get(i); } opBuilder.setAttr("table_ids", tableIdsArray); @@ -132,54 +113,320 @@ public static EnqueueT } if (opts.combiners != null) { String[] combinersArray = new String[opts.combiners.size()]; - for (int i = 0; i < combinersArray.length; ++i) { + 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) { + 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 EnqueueTPUEmbeddingRaggedTensorBatch(opBuilder.build()); } - + /** - * @param deviceOrdinal The TPU device to use. Should be >= 0 and less than the number + * 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); } - + /** - * @param maxSequenceLengths + * 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); + } + + /** + * Sets the maxSequenceLengths option. + * + * @param maxSequenceLengths the maxSequenceLengths option + * @return this Options instance. */ public static Options maxSequenceLengths(List maxSequenceLengths) { return new Options().maxSequenceLengths(maxSequenceLengths); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EnqueueTPUEmbeddingRaggedTensorBatch"; - - private EnqueueTPUEmbeddingRaggedTensorBatch(Operation operation) { - super(operation); + + /** + * 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.EnqueueTPUEmbeddingRaggedTensorBatch} + */ + public static class Options { + private Long deviceOrdinal; + + private List combiners; + + private List maxSequenceLengths; + + private List numFeatures; + + 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; + } + + /** + * 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 = 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 f302cf7ad5f..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. @@ -17,70 +17,55 @@ 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; /** * 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 + *

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. */ +@OpMetadata( + opType = EnqueueTPUEmbeddingSparseBatch.OP_NAME, + inputsClass = EnqueueTPUEmbeddingSparseBatch.Inputs.class +) +@Operator( + group = "tpu" +) public final class EnqueueTPUEmbeddingSparseBatch extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.EnqueueTPUEmbeddingSparseBatch} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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. - */ - public Options deviceOrdinal(Long deviceOrdinal) { - this.deviceOrdinal = deviceOrdinal; - return this; - } - - /** - * @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. - */ - public Options combiners(List combiners) { - this.combiners = combiners; - return this; - } - - private Long deviceOrdinal; - private List combiners; - - private Options() { - } + public static final String OP_NAME = "EnqueueTPUEmbeddingSparseBatch"; + + public EnqueueTPUEmbeddingSparseBatch(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new EnqueueTPUEmbeddingSparseBatch operation. - * + * * @param scope current scope * @param sampleIndices A list of rank 1 Tensors specifying the training example and * feature to which the corresponding embedding_indices and aggregation_weights @@ -94,17 +79,22 @@ private Options() { * 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 attributes values + * @param options carries optional attribute values * @return a new instance of EnqueueTPUEmbeddingSparseBatch */ - @Endpoint(describeByClass = true) - public static EnqueueTPUEmbeddingSparseBatch create(Scope scope, Iterable> sampleIndices, Iterable> embeddingIndices, Iterable> aggregationWeights, Operand modeOverride, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("EnqueueTPUEmbeddingSparseBatch", scope.makeOpName("EnqueueTPUEmbeddingSparseBatch")); + @Endpoint( + describeByClass = true + ) + public static EnqueueTPUEmbeddingSparseBatch create(Scope scope, + Iterable> sampleIndices, + Iterable> embeddingIndices, + Iterable> aggregationWeights, Operand modeOverride, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "EnqueueTPUEmbeddingSparseBatch"); opBuilder.addInputList(Operands.asOutputs(sampleIndices)); opBuilder.addInputList(Operands.asOutputs(embeddingIndices)); opBuilder.addInputList(Operands.asOutputs(aggregationWeights)); opBuilder.addInput(modeOverride.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.deviceOrdinal != null) { @@ -112,7 +102,7 @@ public static EnqueueT } if (opts.combiners != null) { String[] combinersArray = new String[opts.combiners.size()]; - for (int i = 0; i < combinersArray.length; ++i) { + for (int i = 0 ; i < combinersArray.length ; i++) { combinersArray[i] = opts.combiners.get(i); } opBuilder.setAttr("combiners", combinersArray); @@ -121,31 +111,185 @@ public static EnqueueT } return new EnqueueTPUEmbeddingSparseBatch(opBuilder.build()); } - + /** - * @param deviceOrdinal The TPU device to use. Should be >= 0 and less than the number + * 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); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EnqueueTPUEmbeddingSparseBatch"; - - private EnqueueTPUEmbeddingSparseBatch(Operation operation) { - super(operation); + + /** + * 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.EnqueueTPUEmbeddingSparseBatch} + */ + 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 = 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 a482e5f5ebf..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. @@ -17,78 +17,54 @@ 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(). - *

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

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 = EnqueueTPUEmbeddingSparseTensorBatch.OP_NAME, + inputsClass = EnqueueTPUEmbeddingSparseTensorBatch.Inputs.class +) +@Operator( + group = "tpu" +) public final class EnqueueTPUEmbeddingSparseTensorBatch extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.EnqueueTPUEmbeddingSparseTensorBatch} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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. - */ - public Options deviceOrdinal(Long deviceOrdinal) { - this.deviceOrdinal = deviceOrdinal; - return this; - } - - /** - * @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. - */ - public Options combiners(List combiners) { - this.combiners = combiners; - return this; - } - - /** - * @param maxSequenceLengths - */ - public Options maxSequenceLengths(List maxSequenceLengths) { - this.maxSequenceLengths = maxSequenceLengths; - return this; - } - - private Long deviceOrdinal; - private List combiners; - private List maxSequenceLengths; - - private Options() { - } + public static final String OP_NAME = "EnqueueTPUEmbeddingSparseTensorBatch"; + + public EnqueueTPUEmbeddingSparseTensorBatch(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new EnqueueTPUEmbeddingSparseTensorBatch operation. - * + * * @param scope current scope * @param sampleIndices A list of rank 1 Tensors specifying the training example to * which the corresponding embedding_indices and aggregation_weights values @@ -107,19 +83,24 @@ private Options() { * 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 attributes values + * @param options carries optional attribute values * @return a new instance of EnqueueTPUEmbeddingSparseTensorBatch */ - @Endpoint(describeByClass = true) - public static EnqueueTPUEmbeddingSparseTensorBatch create(Scope scope, Iterable> sampleIndices, Iterable> embeddingIndices, Iterable> aggregationWeights, Operand modeOverride, List tableIds, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("EnqueueTPUEmbeddingSparseTensorBatch", scope.makeOpName("EnqueueTPUEmbeddingSparseTensorBatch")); + @Endpoint( + describeByClass = true + ) + public static EnqueueTPUEmbeddingSparseTensorBatch create(Scope scope, + Iterable> sampleIndices, + Iterable> embeddingIndices, + Iterable> aggregationWeights, Operand modeOverride, + List tableIds, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "EnqueueTPUEmbeddingSparseTensorBatch"); opBuilder.addInputList(Operands.asOutputs(sampleIndices)); opBuilder.addInputList(Operands.asOutputs(embeddingIndices)); opBuilder.addInputList(Operands.asOutputs(aggregationWeights)); opBuilder.addInput(modeOverride.asOutput()); - opBuilder = scope.apply(opBuilder); long[] tableIdsArray = new long[tableIds.size()]; - for (int i = 0; i < tableIdsArray.length; ++i) { + for (int i = 0 ; i < tableIdsArray.length ; i++) { tableIdsArray[i] = tableIds.get(i); } opBuilder.setAttr("table_ids", tableIdsArray); @@ -130,54 +111,318 @@ public static EnqueueT } if (opts.combiners != null) { String[] combinersArray = new String[opts.combiners.size()]; - for (int i = 0; i < combinersArray.length; ++i) { + 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) { + 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 EnqueueTPUEmbeddingSparseTensorBatch(opBuilder.build()); } - + /** - * @param deviceOrdinal The TPU device to use. Should be >= 0 and less than the number + * 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); } - + /** - * @param maxSequenceLengths + * 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); + } + + /** + * Sets the maxSequenceLengths option. + * + * @param maxSequenceLengths the maxSequenceLengths option + * @return this Options instance. */ public static Options maxSequenceLengths(List maxSequenceLengths) { return new Options().maxSequenceLengths(maxSequenceLengths); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EnqueueTPUEmbeddingSparseTensorBatch"; - - private EnqueueTPUEmbeddingSparseTensorBatch(Operation operation) { - super(operation); + + /** + * 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.EnqueueTPUEmbeddingSparseTensorBatch} + */ + public static class Options { + private Long deviceOrdinal; + + private List combiners; + + private List maxSequenceLengths; + + private List numFeatures; + + 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; + } + + /** + * 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 = 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 dfcb6333097..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,67 +20,120 @@ 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; /** * Op that loads and executes a TPU program on a TPU device. - *

* For the internal use of the distributed TPU compiler. */ -@Operator(group = "tpu") +@OpMetadata( + opType = Execute.OP_NAME, + inputsClass = Execute.Inputs.class +) +@Operator( + group = "tpu" +) public final class Execute extends RawOp implements Iterable> { - /** - * Factory method to create a class wrapping a new Execute operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPUExecute"; + + private List> results; + + @SuppressWarnings("unchecked") + public Execute(Operation operation) { + super(operation, OP_NAME); + 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 TPUExecute operation. + * * @param scope current scope - * @param args - * @param key - * @param Tresults + * @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(describeByClass = true) - public static Execute create(Scope scope, Iterable> args, Operand key, List> Tresults) { - OperationBuilder opBuilder = scope.env().opBuilder("TPUExecute", scope.makeOpName("Execute")); + @Endpoint( + describeByClass = true + ) + public static Execute create(Scope scope, Iterable> args, Operand key, + List> Tresults) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Execute"); opBuilder.addInputList(Operands.asOutputs(args)); opBuilder.addInput(key.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tresults", Operands.toDataTypes(Tresults)); return new Execute(opBuilder.build()); } - + /** + * Gets results. + * + * @return results. */ public List> results() { return results; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) results.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUExecute"; - - private List> results; - - private Execute(Operation operation) { - super(operation); - int outputIdx = 0; - int resultsLength = operation.outputListLength("results"); - results = Arrays.asList(operation.outputList(outputIdx, resultsLength)); - outputIdx += resultsLength; + + @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 74269767bd1..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,21 +20,25 @@ 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; /** * Op that executes a program with optional in-place variable updates. - *

* It (optionally) reads device variables, loads and executes a TPU program on a * TPU device, and then (optionally) in-place updates variables using the program * outputs, as specified in attributes device_var_reads_indices (program input @@ -43,62 +47,124 @@ * program outputs are consumed by these variables will not appear in the op * output. For the internal use of the distributed TPU compiler. */ -@Operator(group = "tpu") +@OpMetadata( + opType = ExecuteAndUpdateVariables.OP_NAME, + inputsClass = ExecuteAndUpdateVariables.Inputs.class +) +@Operator( + group = "tpu" +) public final class ExecuteAndUpdateVariables extends RawOp implements Iterable> { - /** - * Factory method to create a class wrapping a new ExecuteAndUpdateVariables operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPUExecuteAndUpdateVariables"; + + private List> results; + + @SuppressWarnings("unchecked") + public ExecuteAndUpdateVariables(Operation operation) { + super(operation, OP_NAME); + 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 TPUExecuteAndUpdateVariables operation. + * * @param scope current scope - * @param args - * @param key - * @param Tresults - * @param deviceVarReadsIndices - * @param deviceVarUpdatesIndices + * @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(describeByClass = true) - public static ExecuteAndUpdateVariables create(Scope scope, Iterable> args, Operand key, List> Tresults, List deviceVarReadsIndices, List deviceVarUpdatesIndices) { - OperationBuilder opBuilder = scope.env().opBuilder("TPUExecuteAndUpdateVariables", scope.makeOpName("ExecuteAndUpdateVariables")); + @Endpoint( + describeByClass = true + ) + public static ExecuteAndUpdateVariables create(Scope scope, Iterable> args, + Operand key, List> Tresults, List deviceVarReadsIndices, + List deviceVarUpdatesIndices) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ExecuteAndUpdateVariables"); opBuilder.addInputList(Operands.asOutputs(args)); opBuilder.addInput(key.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tresults", Operands.toDataTypes(Tresults)); long[] deviceVarReadsIndicesArray = new long[deviceVarReadsIndices.size()]; - for (int i = 0; i < deviceVarReadsIndicesArray.length; ++i) { + for (int i = 0 ; i < deviceVarReadsIndicesArray.length ; i++) { deviceVarReadsIndicesArray[i] = deviceVarReadsIndices.get(i); } opBuilder.setAttr("device_var_reads_indices", deviceVarReadsIndicesArray); long[] deviceVarUpdatesIndicesArray = new long[deviceVarUpdatesIndices.size()]; - for (int i = 0; i < deviceVarUpdatesIndicesArray.length; ++i) { + for (int i = 0 ; i < deviceVarUpdatesIndicesArray.length ; i++) { deviceVarUpdatesIndicesArray[i] = deviceVarUpdatesIndices.get(i); } opBuilder.setAttr("device_var_updates_indices", deviceVarUpdatesIndicesArray); return new ExecuteAndUpdateVariables(opBuilder.build()); } - + /** + * Gets results. + * + * @return results. */ public List> results() { return results; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) results.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUExecuteAndUpdateVariables"; - - private List> results; - - private ExecuteAndUpdateVariables(Operation operation) { - super(operation); - int outputIdx = 0; - int resultsLength = operation.outputListLength("results"); - results = Arrays.asList(operation.outputList(outputIdx, resultsLength)); - outputIdx += resultsLength; + + @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 325db448246..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,55 +26,92 @@ 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 + */ + public static final String OP_NAME = "InfeedDequeue"; + + private Output output; + + public InfeedDequeue(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new InfeedDequeue operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static InfeedDequeue create(Scope scope, Class dtype, Shape shape) { - OperationBuilder opBuilder = scope.env().opBuilder("InfeedDequeue", scope.makeOpName("InfeedDequeue")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static InfeedDequeue create(Scope scope, Class dtype, + Shape shape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "InfeedDequeue"); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); opBuilder.setAttr("shape", shape); - return new InfeedDequeue(opBuilder.build()); + return new InfeedDequeue<>(opBuilder.build()); } - + /** + * Gets output. * A tensor that will be provided using the infeed mechanism. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InfeedDequeue"; - - private Output output; - - private InfeedDequeue(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 4816ea0a306..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,60 +28,99 @@ 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 + */ + public static final String OP_NAME = "InfeedDequeueTuple"; + + private List> outputs; + + @SuppressWarnings("unchecked") + public InfeedDequeueTuple(Operation operation) { + super(operation, OP_NAME); + 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 InfeedDequeueTuple operation. - * + * * @param scope current scope - * @param dtypes The element types of each element in `outputs`. - * @param shapes The shapes of each tensor in `outputs`. + * @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 */ - @Endpoint(describeByClass = true) - public static InfeedDequeueTuple create(Scope scope, List> dtypes, List shapes) { - OperationBuilder opBuilder = scope.env().opBuilder("InfeedDequeueTuple", scope.makeOpName("InfeedDequeueTuple")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static InfeedDequeueTuple create(Scope scope, List> dtypes, + List shapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "InfeedDequeueTuple"); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); Shape[] shapesArray = new Shape[shapes.size()]; - for (int i = 0; i < shapesArray.length; ++i) { + for (int i = 0 ; i < shapesArray.length ; i++) { shapesArray[i] = shapes.get(i); } opBuilder.setAttr("shapes", shapesArray); return new InfeedDequeueTuple(opBuilder.build()); } - + /** + * Gets outputs. * A list of tensors that will be provided using the infeed mechanism. + * @return outputs. */ public List> outputs() { return outputs; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) outputs.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InfeedDequeueTuple"; - - private List> outputs; - - private InfeedDequeueTuple(Operation operation) { - super(operation); - int outputIdx = 0; - int outputsLength = operation.outputListLength("outputs"); - outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength)); - outputIdx += outputsLength; + + @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 f5964ccbde5..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. @@ -17,76 +17,58 @@ 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.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 { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.InfeedEnqueue} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param shape The shape of the tensor. - */ - public Options shape(Shape shape) { - this.shape = shape; - return this; - } - - /** - * @param layout 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 Options layout(List layout) { - this.layout = layout; - return this; - } - - /** - * @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. - */ - public Options deviceOrdinal(Long deviceOrdinal) { - this.deviceOrdinal = deviceOrdinal; - return this; - } - - private Shape shape; - private List layout; - private Long deviceOrdinal; - - private Options() { - } + public static final String OP_NAME = "InfeedEnqueue"; + + public InfeedEnqueue(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new InfeedEnqueue operation. - * + * * @param scope current scope * @param input A tensor that will be provided using the infeed mechanism. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of InfeedEnqueue */ - @Endpoint(describeByClass = true) - public static InfeedEnqueue create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("InfeedEnqueue", scope.makeOpName("InfeedEnqueue")); + @Endpoint( + describeByClass = true + ) + public static InfeedEnqueue create(Scope scope, Operand input, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "InfeedEnqueue"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.shape != null) { @@ -94,7 +76,7 @@ public static InfeedEnqueue create(Scope scope, Operand input, } if (opts.layout != null) { long[] layoutArray = new long[opts.layout.size()]; - for (int i = 0; i < layoutArray.length; ++i) { + for (int i = 0 ; i < layoutArray.length ; i++) { layoutArray[i] = opts.layout.get(i); } opBuilder.setAttr("layout", layoutArray); @@ -106,36 +88,158 @@ public static InfeedEnqueue create(Scope scope, Operand input, } return new InfeedEnqueue(opBuilder.build()); } - + /** + * Sets the shape option. + * * @param shape The shape of the tensor. + * @return this Options instance. */ public static Options shape(Shape shape) { return new Options().shape(shape); } - + /** + * Sets the layout option. + * * @param layout 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. + * @return this Options instance. */ public static Options layout(List layout) { return new Options().layout(layout); } - + /** + * Sets the layout option. + * + * @param layout 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. + * @return this Options instance. + */ + public static Options layout(Long... layout) { + return new Options().layout(layout); + } + + /** + * 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 + * 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); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InfeedEnqueue"; - - private InfeedEnqueue(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.InfeedEnqueue} + */ + public static class Options { + private Shape shape; + + private List layout; + + private Long deviceOrdinal; + + private Options() { + } + + /** + * Sets the shape option. + * + * @param shape The shape of the tensor. + * @return this Options instance. + */ + public Options shape(Shape shape) { + this.shape = shape; + return this; + } + + /** + * Sets the layout option. + * + * @param layout 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. + * @return this Options instance. + */ + public Options layout(List layout) { + this.layout = layout; + return this; + } + + /** + * Sets the layout option. + * + * @param layout 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. + * @return this Options instance. + */ + public Options layout(Long... layout) { + this.layout = Arrays.asList(layout); + return this; + } + + /** + * 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; + } + } + + @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 11c71e10f32..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,52 +17,55 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.InfeedEnqueuePrelinearizedBuffer} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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. - */ - public Options deviceOrdinal(Long deviceOrdinal) { - this.deviceOrdinal = deviceOrdinal; - return this; - } - - private Long deviceOrdinal; - - private Options() { - } + public static final String OP_NAME = "InfeedEnqueuePrelinearizedBuffer"; + + public InfeedEnqueuePrelinearizedBuffer(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new InfeedEnqueuePrelinearizedBuffer operation. - * + * * @param scope current scope * @param input A variant tensor representing linearized output. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of InfeedEnqueuePrelinearizedBuffer */ - @Endpoint(describeByClass = true) - public static InfeedEnqueuePrelinearizedBuffer create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("InfeedEnqueuePrelinearizedBuffer", scope.makeOpName("InfeedEnqueuePrelinearizedBuffer")); + @Endpoint( + describeByClass = true + ) + public static InfeedEnqueuePrelinearizedBuffer create(Scope scope, Operand input, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "InfeedEnqueuePrelinearizedBuffer"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.deviceOrdinal != null) { @@ -72,19 +75,60 @@ public static InfeedEnqueuePrelinearizedBuffer create(Scope scope, Operand in } return new InfeedEnqueuePrelinearizedBuffer(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); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InfeedEnqueuePrelinearizedBuffer"; - - private InfeedEnqueuePrelinearizedBuffer(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.InfeedEnqueuePrelinearizedBuffer} + */ + public static class Options { + private Long deviceOrdinal; + + 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; + } + } + + @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 694a536703f..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. @@ -17,71 +17,61 @@ 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.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 { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.InfeedEnqueueTuple} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param layouts 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 Options layouts(List layouts) { - this.layouts = layouts; - return this; - } - - /** - * @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. - */ - public Options deviceOrdinal(Long deviceOrdinal) { - this.deviceOrdinal = deviceOrdinal; - return this; - } - - private List layouts; - private Long deviceOrdinal; - - private Options() { - } + public static final String OP_NAME = "InfeedEnqueueTuple"; + + public InfeedEnqueueTuple(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new InfeedEnqueueTuple operation. - * + * * @param scope current scope * @param inputs A list of tensors that will be provided using the infeed mechanism. - * @param shapes The shapes of each tensor in `inputs`. - * @param options carries optional attributes values + * @param shapes The shapes of each tensor in {@code inputs}. + * @param options carries optional attribute values * @return a new instance of InfeedEnqueueTuple */ - @Endpoint(describeByClass = true) - public static InfeedEnqueueTuple create(Scope scope, Iterable> inputs, List shapes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("InfeedEnqueueTuple", scope.makeOpName("InfeedEnqueueTuple")); + @Endpoint( + describeByClass = true + ) + public static InfeedEnqueueTuple create(Scope scope, Iterable> inputs, + List shapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "InfeedEnqueueTuple"); opBuilder.addInputList(Operands.asOutputs(inputs)); - opBuilder = scope.apply(opBuilder); Shape[] shapesArray = new Shape[shapes.size()]; - for (int i = 0; i < shapesArray.length; ++i) { + for (int i = 0 ; i < shapesArray.length ; i++) { shapesArray[i] = shapes.get(i); } opBuilder.setAttr("shapes", shapesArray); @@ -89,7 +79,7 @@ public static InfeedEnqueueTuple create(Scope scope, Iterable> inputs for (Options opts : options) { if (opts.layouts != null) { long[] layoutsArray = new long[opts.layouts.size()]; - for (int i = 0; i < layoutsArray.length; ++i) { + for (int i = 0 ; i < layoutsArray.length ; i++) { layoutsArray[i] = opts.layouts.get(i); } opBuilder.setAttr("layouts", layoutsArray); @@ -101,30 +91,142 @@ public static InfeedEnqueueTuple create(Scope scope, Iterable> inputs } return new InfeedEnqueueTuple(opBuilder.build()); } - + /** + * Sets the layouts option. + * * @param layouts 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. + * 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. + * @return this Options instance. */ public static Options layouts(List layouts) { return new Options().layouts(layouts); } - + + /** + * Sets the layouts option. + * + * @param layouts 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. + * @return this Options instance. + */ + public static Options layouts(Long... layouts) { + return new Options().layouts(layouts); + } + /** + * 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 + * 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); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InfeedEnqueueTuple"; - - private InfeedEnqueueTuple(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.InfeedEnqueueTuple} + */ + public static class Options { + private List layouts; + + private Long deviceOrdinal; + + private Options() { + } + + /** + * Sets the layouts option. + * + * @param layouts 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. + * @return this Options instance. + */ + public Options layouts(List layouts) { + this.layouts = layouts; + return this; + } + + /** + * Sets the layouts option. + * + * @param layouts 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. + * @return this Options instance. + */ + public Options layouts(Long... layouts) { + this.layouts = Arrays.asList(layouts); + return this; + } + + /** + * 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; + } + } + + @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 65747b5e8fe..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,82 +17,67 @@ 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 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. */ +@OpMetadata( + opType = LoadTPUEmbeddingADAMParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingADAMParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class LoadTPUEmbeddingADAMParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingADAMParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingADAMParameters"; + + public LoadTPUEmbeddingADAMParameters(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingADAMParameters 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 numShards - * @param shardId - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingADAMParameters create(Scope scope, Operand parameters, Operand momenta, Operand velocities, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingADAMParameters", scope.makeOpName("LoadTPUEmbeddingADAMParameters")); + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingADAMParameters create(Scope scope, Operand parameters, + Operand momenta, Operand velocities, Long numShards, Long shardId, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingADAMParameters"); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(momenta.asOutput()); opBuilder.addInput(velocities.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); opBuilder.setAttr("shard_id", shardId); if (options != null) { @@ -110,32 +95,139 @@ public static LoadTPUEmbeddingADAMParameters create(Scope scope, Operand { + /** + * 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 86cdb90daf9..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingADAMParametersGradAccumDebug.java +++ /dev/null @@ -1,143 +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.op.annotation.Operator; -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 { - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingADAMParametersGradAccumDebug} - */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } - } - - /** - * 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 - * @param shardId - * @param options carries optional attributes 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.env().opBuilder("LoadTPUEmbeddingADAMParametersGradAccumDebug", scope.makeOpName("LoadTPUEmbeddingADAMParametersGradAccumDebug")); - opBuilder.addInput(parameters.asOutput()); - opBuilder.addInput(momenta.asOutput()); - opBuilder.addInput(velocities.asOutput()); - opBuilder.addInput(gradientAccumulators.asOutput()); - opBuilder = scope.apply(opBuilder); - 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()); - } - - /** - * @param tableId - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * @param tableName - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * @param config - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingADAMParametersGradAccumDebug"; - - private LoadTPUEmbeddingADAMParametersGradAccumDebug(Operation operation) { - super(operation); - } -} 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 988aa11983e..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,82 +17,67 @@ 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 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. */ +@OpMetadata( + opType = LoadTPUEmbeddingAdadeltaParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingAdadeltaParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class LoadTPUEmbeddingAdadeltaParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingAdadeltaParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingAdadeltaParameters"; + + public LoadTPUEmbeddingAdadeltaParameters(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingAdadeltaParameters 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 numShards - * @param shardId - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingAdadeltaParameters create(Scope scope, Operand parameters, Operand accumulators, Operand updates, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingAdadeltaParameters", scope.makeOpName("LoadTPUEmbeddingAdadeltaParameters")); + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingAdadeltaParameters create(Scope scope, Operand parameters, + Operand accumulators, Operand updates, Long numShards, Long shardId, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingAdadeltaParameters"); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(accumulators.asOutput()); opBuilder.addInput(updates.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); opBuilder.setAttr("shard_id", shardId); if (options != null) { @@ -110,32 +95,139 @@ public static LoadTPUEmbeddingAdadeltaParameters create(Scope scope, Operand { + /** + * 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 a651e716f5d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdadeltaParametersGradAccumDebug.java +++ /dev/null @@ -1,143 +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.op.annotation.Operator; -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 { - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingAdadeltaParametersGradAccumDebug} - */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } - } - - /** - * 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 - * @param shardId - * @param options carries optional attributes 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.env().opBuilder("LoadTPUEmbeddingAdadeltaParametersGradAccumDebug", scope.makeOpName("LoadTPUEmbeddingAdadeltaParametersGradAccumDebug")); - opBuilder.addInput(parameters.asOutput()); - opBuilder.addInput(accumulators.asOutput()); - opBuilder.addInput(updates.asOutput()); - opBuilder.addInput(gradientAccumulators.asOutput()); - opBuilder = scope.apply(opBuilder); - 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()); - } - - /** - * @param tableId - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * @param tableName - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * @param config - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingAdadeltaParametersGradAccumDebug"; - - private LoadTPUEmbeddingAdadeltaParametersGradAccumDebug(Operation operation) { - super(operation); - } -} 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 f5136a9b431..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,80 +17,64 @@ 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 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 = LoadTPUEmbeddingAdagradParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingAdagradParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class LoadTPUEmbeddingAdagradParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingAdagradParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingAdagradParameters"; + + public LoadTPUEmbeddingAdagradParameters(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingAdagradParameters 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 - * @param shardId - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingAdagradParameters create(Scope scope, Operand parameters, Operand accumulators, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingAdagradParameters", scope.makeOpName("LoadTPUEmbeddingAdagradParameters")); + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingAdagradParameters create(Scope scope, Operand parameters, + Operand accumulators, Long numShards, Long shardId, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingAdagradParameters"); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(accumulators.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); opBuilder.setAttr("shard_id", shardId); if (options != null) { @@ -108,32 +92,133 @@ public static LoadTPUEmbeddingAdagradParameters create(Scope scope, Operand { + /** + * 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 2462382c6fc..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdagradParametersGradAccumDebug.java +++ /dev/null @@ -1,141 +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.op.annotation.Operator; -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 { - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingAdagradParametersGradAccumDebug} - */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } - } - - /** - * 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 - * @param shardId - * @param options carries optional attributes 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.env().opBuilder("LoadTPUEmbeddingAdagradParametersGradAccumDebug", scope.makeOpName("LoadTPUEmbeddingAdagradParametersGradAccumDebug")); - opBuilder.addInput(parameters.asOutput()); - opBuilder.addInput(accumulators.asOutput()); - opBuilder.addInput(gradientAccumulators.asOutput()); - opBuilder = scope.apply(opBuilder); - 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()); - } - - /** - * @param tableId - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * @param tableName - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * @param config - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingAdagradParametersGradAccumDebug"; - - private LoadTPUEmbeddingAdagradParametersGradAccumDebug(Operation operation) { - super(operation); - } -} 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 c5bb1300a86..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,84 +17,69 @@ 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 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. */ +@OpMetadata( + opType = LoadTPUEmbeddingCenteredRMSPropParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingCenteredRMSPropParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class LoadTPUEmbeddingCenteredRMSPropParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingCenteredRMSPropParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingCenteredRMSPropParameters"; + + public LoadTPUEmbeddingCenteredRMSPropParameters(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingCenteredRMSPropParameters operation. - * + * * @param scope current scope * @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 - * @param shardId - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingCenteredRMSPropParameters create(Scope scope, Operand parameters, Operand ms, Operand mom, Operand mg, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingCenteredRMSPropParameters", scope.makeOpName("LoadTPUEmbeddingCenteredRMSPropParameters")); + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingCenteredRMSPropParameters create(Scope scope, + Operand parameters, Operand ms, Operand mom, + Operand mg, Long numShards, Long shardId, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingCenteredRMSPropParameters"); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(ms.asOutput()); opBuilder.addInput(mom.asOutput()); opBuilder.addInput(mg.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); opBuilder.setAttr("shard_id", shardId); if (options != null) { @@ -112,32 +97,145 @@ public static LoadTPUEmbeddingCenteredRMSPropParameters create(Scope scope, Oper } return new LoadTPUEmbeddingCenteredRMSPropParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingCenteredRMSPropParameters"; - - private LoadTPUEmbeddingCenteredRMSPropParameters(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingCenteredRMSPropParameters} + */ + 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 = 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 2766f2dd3c3..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,82 +17,67 @@ 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 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. */ +@OpMetadata( + opType = LoadTPUEmbeddingFTRLParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingFTRLParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class LoadTPUEmbeddingFTRLParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingFTRLParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingFTRLParameters"; + + public LoadTPUEmbeddingFTRLParameters(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingFTRLParameters 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 numShards - * @param shardId - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingFTRLParameters create(Scope scope, Operand parameters, Operand accumulators, Operand linears, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingFTRLParameters", scope.makeOpName("LoadTPUEmbeddingFTRLParameters")); + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingFTRLParameters create(Scope scope, Operand parameters, + Operand accumulators, Operand linears, Long numShards, Long shardId, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingFTRLParameters"); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(accumulators.asOutput()); opBuilder.addInput(linears.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); opBuilder.setAttr("shard_id", shardId); if (options != null) { @@ -110,32 +95,139 @@ public static LoadTPUEmbeddingFTRLParameters create(Scope scope, Operand { + /** + * 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 f35f36b77df..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingFTRLParametersGradAccumDebug.java +++ /dev/null @@ -1,143 +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.op.annotation.Operator; -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 { - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingFTRLParametersGradAccumDebug} - */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } - } - - /** - * 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 - * @param shardId - * @param options carries optional attributes 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.env().opBuilder("LoadTPUEmbeddingFTRLParametersGradAccumDebug", scope.makeOpName("LoadTPUEmbeddingFTRLParametersGradAccumDebug")); - opBuilder.addInput(parameters.asOutput()); - opBuilder.addInput(accumulators.asOutput()); - opBuilder.addInput(linears.asOutput()); - opBuilder.addInput(gradientAccumulators.asOutput()); - opBuilder = scope.apply(opBuilder); - 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()); - } - - /** - * @param tableId - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * @param tableName - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * @param config - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingFTRLParametersGradAccumDebug"; - - private LoadTPUEmbeddingFTRLParametersGradAccumDebug(Operation operation) { - super(operation); - } -} 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 0a066f25c34..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,84 +17,69 @@ 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 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. */ +@OpMetadata( + opType = LoadTPUEmbeddingMDLAdagradLightParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingMDLAdagradLightParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class LoadTPUEmbeddingMDLAdagradLightParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingMDLAdagradLightParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingMDLAdagradLightParameters"; + + public LoadTPUEmbeddingMDLAdagradLightParameters(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingMDLAdagradLightParameters operation. - * + * * @param scope current scope * @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 - * @param shardId - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingMDLAdagradLightParameters create(Scope scope, Operand parameters, Operand accumulators, Operand weights, Operand benefits, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingMDLAdagradLightParameters", scope.makeOpName("LoadTPUEmbeddingMDLAdagradLightParameters")); + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingMDLAdagradLightParameters create(Scope scope, + Operand parameters, Operand accumulators, Operand weights, + Operand benefits, Long numShards, Long shardId, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingMDLAdagradLightParameters"); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(accumulators.asOutput()); opBuilder.addInput(weights.asOutput()); opBuilder.addInput(benefits.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); opBuilder.setAttr("shard_id", shardId); if (options != null) { @@ -112,32 +97,145 @@ public static LoadTPUEmbeddingMDLAdagradLightParameters create(Scope scope, Oper } return new LoadTPUEmbeddingMDLAdagradLightParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingMDLAdagradLightParameters"; - - private LoadTPUEmbeddingMDLAdagradLightParameters(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingMDLAdagradLightParameters} + */ + 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 = 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 4f5fe8467bb..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,80 +17,64 @@ 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 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 = LoadTPUEmbeddingMomentumParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingMomentumParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class LoadTPUEmbeddingMomentumParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingMomentumParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingMomentumParameters"; + + public LoadTPUEmbeddingMomentumParameters(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingMomentumParameters 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 - * @param shardId - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingMomentumParameters create(Scope scope, Operand parameters, Operand momenta, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingMomentumParameters", scope.makeOpName("LoadTPUEmbeddingMomentumParameters")); + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingMomentumParameters create(Scope scope, Operand parameters, + Operand momenta, Long numShards, Long shardId, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingMomentumParameters"); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(momenta.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); opBuilder.setAttr("shard_id", shardId); if (options != null) { @@ -108,32 +92,133 @@ public static LoadTPUEmbeddingMomentumParameters create(Scope scope, Operand { + /** + * 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 008b4ae8b78..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingMomentumParametersGradAccumDebug.java +++ /dev/null @@ -1,141 +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.op.annotation.Operator; -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 { - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingMomentumParametersGradAccumDebug} - */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } - } - - /** - * 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 - * @param shardId - * @param options carries optional attributes 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.env().opBuilder("LoadTPUEmbeddingMomentumParametersGradAccumDebug", scope.makeOpName("LoadTPUEmbeddingMomentumParametersGradAccumDebug")); - opBuilder.addInput(parameters.asOutput()); - opBuilder.addInput(momenta.asOutput()); - opBuilder.addInput(gradientAccumulators.asOutput()); - opBuilder = scope.apply(opBuilder); - 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()); - } - - /** - * @param tableId - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * @param tableName - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * @param config - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingMomentumParametersGradAccumDebug"; - - private LoadTPUEmbeddingMomentumParametersGradAccumDebug(Operation operation) { - super(operation); - } -} 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 064e81fe5cc..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,80 +17,65 @@ 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 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. */ +@OpMetadata( + opType = LoadTPUEmbeddingProximalAdagradParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingProximalAdagradParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class LoadTPUEmbeddingProximalAdagradParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingProximalAdagradParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingProximalAdagradParameters"; + + public LoadTPUEmbeddingProximalAdagradParameters(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingProximalAdagradParameters 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 - * @param shardId - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingProximalAdagradParameters create(Scope scope, Operand parameters, Operand accumulators, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingProximalAdagradParameters", scope.makeOpName("LoadTPUEmbeddingProximalAdagradParameters")); + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingProximalAdagradParameters create(Scope scope, + Operand parameters, Operand accumulators, Long numShards, Long shardId, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingProximalAdagradParameters"); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(accumulators.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); opBuilder.setAttr("shard_id", shardId); if (options != null) { @@ -108,32 +93,133 @@ public static LoadTPUEmbeddingProximalAdagradParameters create(Scope scope, Oper } return new LoadTPUEmbeddingProximalAdagradParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingProximalAdagradParameters"; - - private LoadTPUEmbeddingProximalAdagradParameters(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingProximalAdagradParameters} + */ + 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 = 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 318d1e53220..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug.java +++ /dev/null @@ -1,141 +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.op.annotation.Operator; -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 { - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug} - */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } - } - - /** - * 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 - * @param shardId - * @param options carries optional attributes 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.env().opBuilder("LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug", scope.makeOpName("LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug")); - opBuilder.addInput(parameters.asOutput()); - opBuilder.addInput(accumulators.asOutput()); - opBuilder.addInput(gradientAccumulators.asOutput()); - opBuilder = scope.apply(opBuilder); - 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()); - } - - /** - * @param tableId - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * @param tableName - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * @param config - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug"; - - private LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug(Operation operation) { - super(operation); - } -} 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 d7d35b46513..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,75 +17,62 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingProximalYogiParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingProximalYogiParameters"; + + 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 - * @param v - * @param m - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingProximalYogiParameters create(Scope scope, Operand parameters, Operand v, Operand m, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingProximalYogiParameters", scope.makeOpName("LoadTPUEmbeddingProximalYogiParameters")); + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingProximalYogiParameters create(Scope scope, + Operand parameters, Operand v, Operand m, Long numShards, + Long shardId, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingProximalYogiParameters"); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(v.asOutput()); opBuilder.addInput(m.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); opBuilder.setAttr("shard_id", shardId); if (options != null) { @@ -103,32 +90,139 @@ public static LoadTPUEmbeddingProximalYogiParameters create(Scope scope, Operand } return new LoadTPUEmbeddingProximalYogiParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingProximalYogiParameters"; - - private LoadTPUEmbeddingProximalYogiParameters(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingProximalYogiParameters} + */ + 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 = 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 2f70ec714d0..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalYogiParametersGradAccumDebug.java +++ /dev/null @@ -1,136 +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.op.annotation.Operator; -import org.tensorflow.types.TFloat32; - -/** - */ -public final class LoadTPUEmbeddingProximalYogiParametersGradAccumDebug extends RawOp { - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingProximalYogiParametersGradAccumDebug} - */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new LoadTPUEmbeddingProximalYogiParametersGradAccumDebug operation. - * - * @param scope current scope - * @param parameters - * @param v - * @param m - * @param gradientAccumulators - * @param numShards - * @param shardId - * @param options carries optional attributes 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.env().opBuilder("LoadTPUEmbeddingProximalYogiParametersGradAccumDebug", scope.makeOpName("LoadTPUEmbeddingProximalYogiParametersGradAccumDebug")); - opBuilder.addInput(parameters.asOutput()); - opBuilder.addInput(v.asOutput()); - opBuilder.addInput(m.asOutput()); - opBuilder.addInput(gradientAccumulators.asOutput()); - opBuilder = scope.apply(opBuilder); - 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()); - } - - /** - * @param tableId - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * @param tableName - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * @param config - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingProximalYogiParametersGradAccumDebug"; - - private LoadTPUEmbeddingProximalYogiParametersGradAccumDebug(Operation operation) { - super(operation); - } -} 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 5ac3a0a58ee..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,82 +17,67 @@ 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 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. */ +@OpMetadata( + opType = LoadTPUEmbeddingRMSPropParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingRMSPropParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class LoadTPUEmbeddingRMSPropParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingRMSPropParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingRMSPropParameters"; + + public LoadTPUEmbeddingRMSPropParameters(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingRMSPropParameters 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 numShards - * @param shardId - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingRMSPropParameters create(Scope scope, Operand parameters, Operand ms, Operand mom, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingRMSPropParameters", scope.makeOpName("LoadTPUEmbeddingRMSPropParameters")); + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingRMSPropParameters create(Scope scope, Operand parameters, + Operand ms, Operand mom, Long numShards, Long shardId, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingRMSPropParameters"); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(ms.asOutput()); opBuilder.addInput(mom.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); opBuilder.setAttr("shard_id", shardId); if (options != null) { @@ -110,32 +95,139 @@ public static LoadTPUEmbeddingRMSPropParameters create(Scope scope, Operand { + /** + * 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 32c4d9ed6e0..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingRMSPropParametersGradAccumDebug.java +++ /dev/null @@ -1,143 +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.op.annotation.Operator; -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 { - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingRMSPropParametersGradAccumDebug} - */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } - } - - /** - * 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 - * @param shardId - * @param options carries optional attributes 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.env().opBuilder("LoadTPUEmbeddingRMSPropParametersGradAccumDebug", scope.makeOpName("LoadTPUEmbeddingRMSPropParametersGradAccumDebug")); - opBuilder.addInput(parameters.asOutput()); - opBuilder.addInput(ms.asOutput()); - opBuilder.addInput(mom.asOutput()); - opBuilder.addInput(gradientAccumulators.asOutput()); - opBuilder = scope.apply(opBuilder); - 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()); - } - - /** - * @param tableId - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * @param tableName - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * @param config - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingRMSPropParametersGradAccumDebug"; - - private LoadTPUEmbeddingRMSPropParametersGradAccumDebug(Operation operation) { - super(operation); - } -} 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 43bf95cb2fa..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,78 +17,62 @@ 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 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. */ +@OpMetadata( + opType = LoadTPUEmbeddingStochasticGradientDescentParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingStochasticGradientDescentParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class LoadTPUEmbeddingStochasticGradientDescentParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingStochasticGradientDescentParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingStochasticGradientDescentParameters"; + + public LoadTPUEmbeddingStochasticGradientDescentParameters(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingStochasticGradientDescentParameters operation. - * + * * @param scope current scope * @param parameters Value of parameters used in the stochastic gradient descent optimization algorithm. - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingStochasticGradientDescentParameters create(Scope scope, Operand parameters, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingStochasticGradientDescentParameters", scope.makeOpName("LoadTPUEmbeddingStochasticGradientDescentParameters")); + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingStochasticGradientDescentParameters create(Scope scope, + Operand parameters, Long numShards, Long shardId, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingStochasticGradientDescentParameters"); opBuilder.addInput(parameters.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); opBuilder.setAttr("shard_id", shardId); if (options != null) { @@ -106,32 +90,127 @@ public static LoadTPUEmbeddingStochasticGradientDescentParameters create(Scope s } return new LoadTPUEmbeddingStochasticGradientDescentParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingStochasticGradientDescentParameters"; - - private LoadTPUEmbeddingStochasticGradientDescentParameters(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingStochasticGradientDescentParameters} + */ + 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 = 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 ed7b16f59b5..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.java +++ /dev/null @@ -1,139 +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.op.annotation.Operator; -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 { - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug} - */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } - } - - /** - * 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 - * @param shardId - * @param options carries optional attributes 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.env().opBuilder("LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug", scope.makeOpName("LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug")); - opBuilder.addInput(parameters.asOutput()); - opBuilder.addInput(gradientAccumulators.asOutput()); - opBuilder = scope.apply(opBuilder); - 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()); - } - - /** - * @param tableId - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * @param tableName - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * @param config - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug"; - - private LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug(Operation operation) { - super(operation); - } -} 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 1490def25ad..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,58 +17,83 @@ 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; /** * 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. */ +@OpMetadata( + opType = OrdinalSelector.OP_NAME, + inputsClass = OrdinalSelector.Inputs.class +) +@Operator( + group = "tpu" +) public final class OrdinalSelector extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new OrdinalSelector operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPUOrdinalSelector"; + + private Output deviceOrdinals; + + public OrdinalSelector(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + deviceOrdinals = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TPUOrdinalSelector operation. + * * @param scope current scope * @return a new instance of OrdinalSelector */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static OrdinalSelector create(Scope scope) { - OperationBuilder opBuilder = scope.env().opBuilder("TPUOrdinalSelector", scope.makeOpName("OrdinalSelector")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OrdinalSelector"); return new OrdinalSelector(opBuilder.build()); } - + /** + * Gets deviceOrdinals. * A vector 1 or more TPU cores. + * @return deviceOrdinals. */ public Output deviceOrdinals() { return deviceOrdinals; } - + @Override public Output asOutput() { return deviceOrdinals; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUOrdinalSelector"; - - private Output deviceOrdinals; - - private OrdinalSelector(Operation operation) { - super(operation); - int outputIdx = 0; - deviceOrdinals = operation.output(outputIdx++); + + @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 e5aa5a35ed7..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,54 +26,56 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.OutfeedDequeue} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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. - */ - public Options deviceOrdinal(Long deviceOrdinal) { - this.deviceOrdinal = deviceOrdinal; - return this; - } - - private Long deviceOrdinal; - - private Options() { - } + public static final String OP_NAME = "OutfeedDequeue"; + + private Output output; + + public OutfeedDequeue(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new OutfeedDequeue operation. - * + * * @param scope current scope * @param dtype The type of elements in the tensor. * @param shape The shape of the tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code OutfeedDequeue} output and operands * @return a new instance of OutfeedDequeue */ - @Endpoint(describeByClass = true) - public static OutfeedDequeue create(Scope scope, Class dtype, Shape shape, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("OutfeedDequeue", scope.makeOpName("OutfeedDequeue")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static OutfeedDequeue create(Scope scope, Class dtype, Shape shape, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OutfeedDequeue"); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); opBuilder.setAttr("shape", shape); if (options != null) { @@ -81,38 +85,85 @@ public static OutfeedDequeue create(Scope scope, Class d } } } - return new OutfeedDequeue(opBuilder.build()); + return new OutfeedDequeue<>(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 + * 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); } - + /** + * Gets output. * A tensor that will be read from the device outfeed. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OutfeedDequeue"; - - private Output output; - - private OutfeedDequeue(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.OutfeedDequeue} + */ + public static class Options { + private Long deviceOrdinal; + + 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; + } + } + + @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 705666e1f02..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,56 +28,62 @@ 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; /** * Retrieve multiple values from the computation outfeed. - *

- * This operation will block indefinitely until data is available. Output `i` - * corresponds to XLA tuple element `i`. + * 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> { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.OutfeedDequeueTuple} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @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. - */ - public Options deviceOrdinal(Long deviceOrdinal) { - this.deviceOrdinal = deviceOrdinal; - return this; - } - - private Long deviceOrdinal; - - private Options() { - } + public static final String OP_NAME = "OutfeedDequeueTuple"; + + private List> outputs; + + @SuppressWarnings("unchecked") + public OutfeedDequeueTuple(Operation operation) { + super(operation, OP_NAME); + 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 OutfeedDequeueTuple operation. - * + * * @param scope current scope - * @param dtypes The element types of each element in `outputs`. - * @param shapes The shapes of each tensor in `outputs`. - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static OutfeedDequeueTuple create(Scope scope, List> dtypes, List shapes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("OutfeedDequeueTuple", scope.makeOpName("OutfeedDequeueTuple")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static OutfeedDequeueTuple create(Scope scope, List> dtypes, + List shapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OutfeedDequeueTuple"); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); Shape[] shapesArray = new Shape[shapes.size()]; - for (int i = 0; i < shapesArray.length; ++i) { + for (int i = 0 ; i < shapesArray.length ; i++) { shapesArray[i] = shapes.get(i); } opBuilder.setAttr("shapes", shapesArray); @@ -89,39 +96,84 @@ public static OutfeedDequeueTuple create(Scope scope, List= 0 when the Op is running on the CPU + * 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); } - + /** + * Gets outputs. * A list of tensors that will be read from the outfeed. + * @return outputs. */ public List> outputs() { return outputs; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) outputs.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OutfeedDequeueTuple"; - - private List> outputs; - - private OutfeedDequeueTuple(Operation operation) { - super(operation); - int outputIdx = 0; - int outputsLength = operation.outputListLength("outputs"); - outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength)); - outputIdx += outputsLength; + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.OutfeedDequeueTuple} + */ + public static class Options { + private Long deviceOrdinal; + + 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; + } + } + + @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 b3eb52c50c6..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,69 +28,115 @@ 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; /** * Retrieve multiple values from the computation outfeed. Device ordinal is a * tensor allowing dynamic outfeed. - *

- * This operation will block indefinitely until data is available. Output `i` - * corresponds to XLA tuple element `i`. + * 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 + */ + public static final String OP_NAME = "OutfeedDequeueTupleV2"; + + private List> outputs; + + @SuppressWarnings("unchecked") + public OutfeedDequeueTupleV2(Operation operation) { + super(operation, OP_NAME); + 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 OutfeedDequeueTupleV2 operation. - * + * * @param scope current scope * @param deviceOrdinal An int scalar tensor, representing the TPU device to use. This should be -1 when - * the Op is running on a TPU device, and >= 0 when the Op is running on the CPU + * the Op is running on a TPU device, and >= 0 when the Op is running on the CPU * device. - * @param dtypes The element types of each element in `outputs`. - * @param shapes The shapes of each tensor in `outputs`. + * @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 */ - @Endpoint(describeByClass = true) - public static OutfeedDequeueTupleV2 create(Scope scope, Operand deviceOrdinal, List> dtypes, List shapes) { - OperationBuilder opBuilder = scope.env().opBuilder("OutfeedDequeueTupleV2", scope.makeOpName("OutfeedDequeueTupleV2")); + @Endpoint( + describeByClass = true + ) + public static OutfeedDequeueTupleV2 create(Scope scope, Operand deviceOrdinal, + List> dtypes, List shapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OutfeedDequeueTupleV2"); opBuilder.addInput(deviceOrdinal.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); Shape[] shapesArray = new Shape[shapes.size()]; - for (int i = 0; i < shapesArray.length; ++i) { + for (int i = 0 ; i < shapesArray.length ; i++) { shapesArray[i] = shapes.get(i); } opBuilder.setAttr("shapes", shapesArray); return new OutfeedDequeueTupleV2(opBuilder.build()); } - + /** + * Gets outputs. * A list of tensors that will be read from the outfeed. + * @return outputs. */ public List> outputs() { return outputs; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) outputs.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OutfeedDequeueTupleV2"; - - private List> outputs; - - private OutfeedDequeueTupleV2(Operation operation) { - super(operation); - int outputIdx = 0; - int outputsLength = operation.outputListLength("outputs"); - outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength)); - outputIdx += outputsLength; + + @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 a461869f5bc..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,63 +26,107 @@ 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; /** * 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 + */ + public static final String OP_NAME = "OutfeedDequeueV2"; + + private Output output; + + public OutfeedDequeueV2(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new OutfeedDequeueV2 operation. - * + * * @param scope current scope * @param deviceOrdinal An int scalar tensor, representing the TPU device to use. This should be -1 when - * the Op is running on a TPU device, and >= 0 when the Op is running on the CPU + * 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 */ - @Endpoint(describeByClass = true) - public static OutfeedDequeueV2 create(Scope scope, Operand deviceOrdinal, Class dtype, Shape shape) { - OperationBuilder opBuilder = scope.env().opBuilder("OutfeedDequeueV2", scope.makeOpName("OutfeedDequeueV2")); + @Endpoint( + describeByClass = true + ) + public static OutfeedDequeueV2 create(Scope scope, + Operand deviceOrdinal, Class dtype, Shape shape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OutfeedDequeueV2"); opBuilder.addInput(deviceOrdinal.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); opBuilder.setAttr("shape", shape); - return new OutfeedDequeueV2(opBuilder.build()); + return new OutfeedDequeueV2<>(opBuilder.build()); } - + /** + * Gets output. * A tensor that will be read from the device outfeed. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OutfeedDequeueV2"; - - private Output output; - - private OutfeedDequeueV2(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 27b13bcae61..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,39 +17,76 @@ 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"; + + public OutfeedEnqueue(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new OutfeedEnqueue operation. - * + * * @param scope current scope * @param input A tensor that will be inserted into the outfeed queue. * @return a new instance of OutfeedEnqueue */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static OutfeedEnqueue create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("OutfeedEnqueue", scope.makeOpName("OutfeedEnqueue")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OutfeedEnqueue"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); return new OutfeedEnqueue(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OutfeedEnqueue"; - - private OutfeedEnqueue(Operation operation) { - super(operation); + + @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 8826f495013..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,40 +17,80 @@ 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"; + + public OutfeedEnqueueTuple(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new OutfeedEnqueueTuple operation. - * + * * @param scope current scope * @param inputs A list of tensors that will be inserted into the outfeed queue as an * XLA tuple. * @return a new instance of OutfeedEnqueueTuple */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static OutfeedEnqueueTuple create(Scope scope, Iterable> inputs) { - OperationBuilder opBuilder = scope.env().opBuilder("OutfeedEnqueueTuple", scope.makeOpName("OutfeedEnqueueTuple")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OutfeedEnqueueTuple"); opBuilder.addInputList(Operands.asOutputs(inputs)); - opBuilder = scope.apply(opBuilder); return new OutfeedEnqueueTuple(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OutfeedEnqueueTuple"; - - private OutfeedEnqueueTuple(Operation operation) { - super(operation); + + @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 new file mode 100644 index 00000000000..f20a2de4bda --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PartitionedCall.java @@ -0,0 +1,187 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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 + */ + public static final String OP_NAME = "TPUPartitionedCall"; + + 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 TPUPartitionedCall operation. + * + * @param scope current scope + * @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 + */ + @Endpoint( + describeByClass = true + ) + public static PartitionedCall create(Scope scope, Iterable> args, + Operand deviceOrdinal, List> Tout, ConcreteFunction f, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "PartitionedCall"); + opBuilder.addInputList(Operands.asOutputs(args)); + opBuilder.addInput(deviceOrdinal.asOutput()); + opBuilder.setAttr("Tout", Operands.toDataTypes(Tout)); + opBuilder.setAttr("f", f); + if (options != null) { + for (Options opts : options) { + if (opts.autotunerThresh != null) { + opBuilder.setAttr("autotuner_thresh", opts.autotunerThresh); + } + } + } + return new PartitionedCall(opBuilder.build()); + } + + /** + * Sets the autotunerThresh option. + * + * @param autotunerThresh the autotunerThresh option + * @return this Options instance. + */ + public static Options autotunerThresh(Long autotunerThresh) { + return new Options().autotunerThresh(autotunerThresh); + } + + /** + * Gets output. + * The output of the function call. + * @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.tpu.PartitionedCall} + */ + public static class Options { + private Long autotunerThresh; + + private Options() { + } + + /** + * Sets the autotunerThresh option. + * + * @param autotunerThresh the autotunerThresh option + * @return this Options instance. + */ + public Options autotunerThresh(Long autotunerThresh) { + this.autotunerThresh = 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 6d93c007546..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,96 +17,160 @@ 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. */ -@Operator(group = "tpu") +@OpMetadata( + opType = PartitionedInput.OP_NAME, + inputsClass = PartitionedInput.Inputs.class +) +@Operator( + group = "tpu" +) public final class PartitionedInput extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.PartitionedInput} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param partitionDim An integer describles which dimension is partitioned. -1 means - * those inputs are replicated. - */ - public Options partitionDim(Long partitionDim) { - this.partitionDim = partitionDim; - return this; - } - - private Long partitionDim; - - private Options() { - } + public static final String OP_NAME = "TPUPartitionedInputV2"; + + private Output output; + + public PartitionedInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new PartitionedInput 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 options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static PartitionedInput create(Scope scope, Iterable> inputs, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("TPUPartitionedInput", scope.makeOpName("PartitionedInput")); + @Endpoint( + describeByClass = true + ) + public static PartitionedInput create(Scope scope, + Iterable> inputs, List partitionDims, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "PartitionedInput"); opBuilder.addInputList(Operands.asOutputs(inputs)); - opBuilder = scope.apply(opBuilder); + 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); } } } - return new PartitionedInput(opBuilder.build()); + return new PartitionedInput<>(opBuilder.build()); } - + /** - * @param partitionDim An integer describles which dimension is partitioned. -1 means - * those inputs are replicated. + * Sets the isPacked option. + * + * @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); } - + /** + * Gets output. * A handle which represents the full shape of partitioned tensors. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUPartitionedInput"; - - private Output output; - - private PartitionedInput(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.PartitionedInput} + */ + public static class Options { + private Boolean isPacked; + + private Options() { + } + + /** + * Sets the isPacked option. + * + * @param isPacked Indicates whether the input is a packed resource. + * @return this Options instance. + */ + 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 6d14d2fd307..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,101 +20,117 @@ 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. */ -@Operator(group = "tpu") +@OpMetadata( + opType = PartitionedOutput.OP_NAME, + inputsClass = PartitionedOutput.Inputs.class +) +@Operator( + group = "tpu" +) public final class PartitionedOutput extends RawOp implements Iterable> { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.PartitionedOutput} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param partitionDim An integer describles which dimension is partitioned. - */ - public Options partitionDim(Long partitionDim) { - this.partitionDim = partitionDim; - return this; - } - - private Long partitionDim; - - private Options() { - } + public static final String OP_NAME = "TPUPartitionedOutputV2"; + + private List> output; + + @SuppressWarnings("unchecked") + public PartitionedOutput(Operation operation) { + super(operation, OP_NAME); + 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 PartitionedOutput 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 - * @param options carries optional attributes values + * @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) { - OperationBuilder opBuilder = scope.env().opBuilder("TPUPartitionedOutput", scope.makeOpName("PartitionedOutput")); + @Endpoint( + describeByClass = true + ) + public static PartitionedOutput create(Scope scope, Operand inputs, + Long numSplits, List partitionDims) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "PartitionedOutput"); opBuilder.addInput(inputs.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_splits", numSplits); - if (options != null) { - for (Options opts : options) { - if (opts.partitionDim != null) { - opBuilder.setAttr("partition_dim", opts.partitionDim); - } - } + long[] partitionDimsArray = new long[partitionDims.size()]; + for (int i = 0 ; i < partitionDimsArray.length ; i++) { + partitionDimsArray[i] = partitionDims.get(i); } - return new PartitionedOutput(opBuilder.build()); - } - - /** - * @param partitionDim An integer describles which dimension is partitioned. - */ - public static Options partitionDim(Long partitionDim) { - return new Options().partitionDim(partitionDim); + opBuilder.setAttr("partition_dims", partitionDimsArray); + return new PartitionedOutput<>(opBuilder.build()); } - + /** - * A list of partitioned inputs which must have the same shape. + * Gets output. + * A list of partitioned outputs which have the same shape. + * @return output. */ public List> output() { return output; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) output.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUPartitionedOutput"; - - private List> output; - - @SuppressWarnings("unchecked") - private PartitionedOutput(Operation operation) { - super(operation); - int outputIdx = 0; - int outputLength = operation.outputListLength("output"); - output = Arrays.asList((Output[])operation.outputList(outputIdx, outputLength)); - outputIdx += outputLength; + + @OpInputsMetadata( + outputsClass = PartitionedOutput.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A tensor which represents the full shape of partitioned tensors. + */ + public final Operand 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; + + 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 5cce51a5bf2..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. @@ -17,66 +17,64 @@ 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.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 { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.Prelinearize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param shape The shape of the tensor. - */ - public Options shape(Shape shape) { - this.shape = shape; - return this; - } - - /** - * @param layout 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 Options layout(List layout) { - this.layout = layout; - return this; - } - - private Shape shape; - private List layout; - - private Options() { - } + public static final String OP_NAME = "Prelinearize"; + + private Output output; + + @SuppressWarnings("unchecked") + public Prelinearize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Prelinearize operation. - * + * * @param scope current scope * @param input A tensor that will be linearized. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Prelinearize */ - @Endpoint(describeByClass = true) - public static Prelinearize create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("Prelinearize", scope.makeOpName("Prelinearize")); + @Endpoint( + describeByClass = true + ) + public static Prelinearize create(Scope scope, Operand input, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Prelinearize"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.shape != null) { @@ -84,7 +82,7 @@ public static Prelinearize create(Scope scope, Operand input, O } if (opts.layout != null) { long[] layoutArray = new long[opts.layout.size()]; - for (int i = 0; i < layoutArray.length; ++i) { + for (int i = 0 ; i < layoutArray.length ; i++) { layoutArray[i] = opts.layout.get(i); } opBuilder.setAttr("layout", layoutArray); @@ -93,43 +91,138 @@ public static Prelinearize create(Scope scope, Operand input, O } return new Prelinearize(opBuilder.build()); } - + /** + * Sets the shape option. + * * @param shape The shape of the tensor. + * @return this Options instance. */ public static Options shape(Shape shape) { return new Options().shape(shape); } - + /** + * Sets the layout option. + * * @param layout 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. + * @return this Options instance. */ public static Options layout(List layout) { return new Options().layout(layout); } - + + /** + * Sets the layout option. + * + * @param layout 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. + * @return this Options instance. + */ + public static Options layout(Long... layout) { + return new Options().layout(layout); + } + /** + * Gets output. + * + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Prelinearize"; - - private Output output; - - private Prelinearize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.Prelinearize} + */ + public static class Options { + private Shape shape; + + private List layout; + + private Options() { + } + + /** + * Sets the shape option. + * + * @param shape The shape of the tensor. + * @return this Options instance. + */ + public Options shape(Shape shape) { + this.shape = shape; + return this; + } + + /** + * Sets the layout option. + * + * @param layout 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. + * @return this Options instance. + */ + public Options layout(List layout) { + this.layout = layout; + return this; + } + + /** + * Sets the layout option. + * + * @param layout 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. + * @return this Options instance. + */ + public Options layout(Long... layout) { + this.layout = Arrays.asList(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 73385063175..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. @@ -17,7 +17,9 @@ 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; @@ -25,54 +27,58 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.PrelinearizeTuple} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param layouts 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 Options layouts(List layouts) { - this.layouts = layouts; - return this; - } - - private List layouts; - - private Options() { - } + public static final String OP_NAME = "PrelinearizeTuple"; + + private Output output; + + @SuppressWarnings("unchecked") + public PrelinearizeTuple(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new PrelinearizeTuple operation. - * + * * @param scope current scope * @param inputs A list of tensors that will be provided using the infeed mechanism. - * @param shapes The shapes of each tensor in `inputs`. - * @param options carries optional attributes values + * @param shapes The shapes of each tensor in {@code inputs}. + * @param options carries optional attribute values * @return a new instance of PrelinearizeTuple */ - @Endpoint(describeByClass = true) - public static PrelinearizeTuple create(Scope scope, Iterable> inputs, List shapes, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("PrelinearizeTuple", scope.makeOpName("PrelinearizeTuple")); + @Endpoint( + describeByClass = true + ) + public static PrelinearizeTuple create(Scope scope, Iterable> inputs, + List shapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "PrelinearizeTuple"); opBuilder.addInputList(Operands.asOutputs(inputs)); - opBuilder = scope.apply(opBuilder); Shape[] shapesArray = new Shape[shapes.size()]; - for (int i = 0; i < shapesArray.length; ++i) { + for (int i = 0 ; i < shapesArray.length ; i++) { shapesArray[i] = shapes.get(i); } opBuilder.setAttr("shapes", shapesArray); @@ -80,7 +86,7 @@ public static PrelinearizeTuple create(Scope scope, Iterable> inputs, for (Options opts : options) { if (opts.layouts != null) { long[] layoutsArray = new long[opts.layouts.size()]; - for (int i = 0; i < layoutsArray.length; ++i) { + for (int i = 0 ; i < layoutsArray.length ; i++) { layoutsArray[i] = opts.layouts.get(i); } opBuilder.setAttr("layouts", layoutsArray); @@ -89,37 +95,122 @@ public static PrelinearizeTuple create(Scope scope, Iterable> inputs, } return new PrelinearizeTuple(opBuilder.build()); } - + /** + * Sets the layouts option. + * * @param layouts 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 + * 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. + * @return this Options instance. */ public static Options layouts(List layouts) { return new Options().layouts(layouts); } - + + /** + * Sets the layouts option. + * + * @param layouts 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. + * @return this Options instance. + */ + public static Options layouts(Long... layouts) { + return new Options().layouts(layouts); + } + /** + * Gets output. + * + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "PrelinearizeTuple"; - - private Output output; - - private PrelinearizeTuple(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.PrelinearizeTuple} + */ + public static class Options { + private List layouts; + + private Options() { + } + + /** + * Sets the layouts option. + * + * @param layouts 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. + * @return this Options instance. + */ + public Options layouts(List layouts) { + this.layouts = layouts; + return this; + } + + /** + * Sets the layouts option. + * + * @param layouts 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. + * @return this Options instance. + */ + public Options layouts(Long... layouts) { + this.layouts = Arrays.asList(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 ac19cb8fc81..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,19 +20,22 @@ 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; /** * 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 @@ -40,51 +43,78 @@ * 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 + */ + public static final String OP_NAME = "RecvTPUEmbeddingActivations"; + + private List> outputs; + + @SuppressWarnings("unchecked") + public RecvTPUEmbeddingActivations(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 RecvTPUEmbeddingActivations operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static RecvTPUEmbeddingActivations create(Scope scope, Long numOutputs, String config) { - OperationBuilder opBuilder = scope.env().opBuilder("RecvTPUEmbeddingActivations", scope.makeOpName("RecvTPUEmbeddingActivations")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RecvTPUEmbeddingActivations"); opBuilder.setAttr("num_outputs", numOutputs); opBuilder.setAttr("config", config); return new RecvTPUEmbeddingActivations(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(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RecvTPUEmbeddingActivations"; - - private List> outputs; - - @SuppressWarnings("unchecked") - private RecvTPUEmbeddingActivations(Operation operation) { - super(operation); - int outputIdx = 0; - int outputsLength = operation.outputListLength("outputs"); - outputs = Arrays.asList((Output[])operation.outputList(outputIdx, outputsLength)); - outputIdx += outputsLength; + + @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 99ef67f0fd4..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. @@ -17,133 +17,53 @@ 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.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; 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 `tpu.replicate()` computation subgraph. + * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.ReplicateMetadata} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param numCoresPerReplica Number of cores per replica. Used for model parallelism. - */ - public Options numCoresPerReplica(Long numCoresPerReplica) { - this.numCoresPerReplica = numCoresPerReplica; - return this; - } - - /** - * @param topology TopologyProto indicating the topology of the TPU pod slice. - */ - public Options topology(String topology) { - this.topology = topology; - return this; - } - - /** - * @param useTpu Whether to place the computation on the TPU. - */ - public Options useTpu(Boolean useTpu) { - this.useTpu = useTpu; - return this; - } - - /** - * @param deviceAssignment The assignment of devices for the computation. - */ - public Options deviceAssignment(List deviceAssignment) { - this.deviceAssignment = deviceAssignment; - return this; - } - - /** - * @param computationShape DEPRECATED. Use num_cores_per_replica instead. - */ - public Options computationShape(List computationShape) { - this.computationShape = computationShape; - return this; - } - - /** - * @param hostComputeCore - */ - public Options hostComputeCore(List hostComputeCore) { - this.hostComputeCore = hostComputeCore; - return this; - } - - /** - * @param paddingMap - */ - public Options paddingMap(List paddingMap) { - this.paddingMap = paddingMap; - return this; - } - - /** - * @param stepMarkerLocation - */ - public Options stepMarkerLocation(String stepMarkerLocation) { - this.stepMarkerLocation = stepMarkerLocation; - return this; - } - - /** - * @param allowSoftPlacement - */ - public Options allowSoftPlacement(Boolean allowSoftPlacement) { - this.allowSoftPlacement = allowSoftPlacement; - return this; - } - - /** - * @param useSpmdForXlaPartitioning - */ - public Options useSpmdForXlaPartitioning(Boolean useSpmdForXlaPartitioning) { - this.useSpmdForXlaPartitioning = useSpmdForXlaPartitioning; - return this; - } - - private Long numCoresPerReplica; - private String topology; - private Boolean useTpu; - private List deviceAssignment; - private List computationShape; - private List hostComputeCore; - private List paddingMap; - private String stepMarkerLocation; - private Boolean allowSoftPlacement; - private Boolean useSpmdForXlaPartitioning; - - private Options() { - } + public static final String OP_NAME = "TPUReplicateMetadata"; + + public ReplicateMetadata(Operation operation) { + super(operation, OP_NAME); } - + /** - * Factory method to create a class wrapping a new ReplicateMetadata operation. - * + * Factory method to create a class wrapping a new TPUReplicateMetadata operation. + * * @param scope current scope * @param numReplicas Number of replicas of the computation - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ReplicateMetadata */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ReplicateMetadata create(Scope scope, Long numReplicas, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("TPUReplicateMetadata", scope.makeOpName("ReplicateMetadata")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReplicateMetadata"); opBuilder.setAttr("num_replicas", numReplicas); if (options != null) { for (Options opts : options) { @@ -158,28 +78,28 @@ public static ReplicateMetadata create(Scope scope, Long numReplicas, Options... } if (opts.deviceAssignment != null) { long[] deviceAssignmentArray = new long[opts.deviceAssignment.size()]; - for (int i = 0; i < deviceAssignmentArray.length; ++i) { + for (int i = 0 ; i < deviceAssignmentArray.length ; i++) { deviceAssignmentArray[i] = opts.deviceAssignment.get(i); } opBuilder.setAttr("device_assignment", deviceAssignmentArray); } if (opts.computationShape != null) { long[] computationShapeArray = new long[opts.computationShape.size()]; - for (int i = 0; i < computationShapeArray.length; ++i) { + for (int i = 0 ; i < computationShapeArray.length ; i++) { computationShapeArray[i] = opts.computationShape.get(i); } opBuilder.setAttr("computation_shape", computationShapeArray); } if (opts.hostComputeCore != null) { String[] hostComputeCoreArray = new String[opts.hostComputeCore.size()]; - for (int i = 0; i < hostComputeCoreArray.length; ++i) { + for (int i = 0 ; i < hostComputeCoreArray.length ; i++) { hostComputeCoreArray[i] = opts.hostComputeCore.get(i); } opBuilder.setAttr("host_compute_core", hostComputeCoreArray); } if (opts.paddingMap != null) { String[] paddingMapArray = new String[opts.paddingMap.size()]; - for (int i = 0; i < paddingMapArray.length; ++i) { + for (int i = 0 ; i < paddingMapArray.length ; i++) { paddingMapArray[i] = opts.paddingMap.get(i); } opBuilder.setAttr("padding_map", paddingMapArray); @@ -193,85 +113,470 @@ 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()); } - + /** + * Sets the numCoresPerReplica option. + * * @param numCoresPerReplica Number of cores per replica. Used for model parallelism. + * @return this Options instance. */ public static Options numCoresPerReplica(Long numCoresPerReplica) { return new Options().numCoresPerReplica(numCoresPerReplica); } - + /** + * Sets the topology option. + * * @param topology TopologyProto indicating the topology of the TPU pod slice. + * @return this Options instance. */ public static Options topology(String topology) { return new Options().topology(topology); } - + /** + * Sets the useTpu option. + * * @param useTpu Whether to place the computation on the TPU. + * @return this Options instance. */ public static Options useTpu(Boolean useTpu) { return new Options().useTpu(useTpu); } - + /** + * Sets the deviceAssignment option. + * * @param deviceAssignment The assignment of devices for the computation. + * @return this Options instance. */ public static Options deviceAssignment(List deviceAssignment) { return new Options().deviceAssignment(deviceAssignment); } - + + /** + * Sets the deviceAssignment option. + * + * @param deviceAssignment The assignment of devices for the computation. + * @return this Options instance. + */ + public static Options deviceAssignment(Long... deviceAssignment) { + return new Options().deviceAssignment(deviceAssignment); + } + /** + * Sets the computationShape option. + * * @param computationShape DEPRECATED. Use num_cores_per_replica instead. + * @return this Options instance. */ public static Options computationShape(List computationShape) { return new Options().computationShape(computationShape); } - + + /** + * Sets the computationShape option. + * + * @param computationShape DEPRECATED. Use num_cores_per_replica instead. + * @return this Options instance. + */ + public static Options computationShape(Long... computationShape) { + return new Options().computationShape(computationShape); + } + /** - * @param hostComputeCore + * Sets the hostComputeCore option. + * + * @param hostComputeCore the hostComputeCore option + * @return this Options instance. */ public static Options hostComputeCore(List hostComputeCore) { return new Options().hostComputeCore(hostComputeCore); } - + /** - * @param paddingMap + * Sets the hostComputeCore option. + * + * @param hostComputeCore the hostComputeCore option + * @return this Options instance. + */ + public static Options hostComputeCore(String... hostComputeCore) { + return new Options().hostComputeCore(hostComputeCore); + } + + /** + * Sets the paddingMap option. + * + * @param paddingMap the paddingMap option + * @return this Options instance. */ public static Options paddingMap(List paddingMap) { return new Options().paddingMap(paddingMap); } - + + /** + * Sets the paddingMap option. + * + * @param paddingMap the paddingMap option + * @return this Options instance. + */ + public static Options paddingMap(String... paddingMap) { + return new Options().paddingMap(paddingMap); + } + /** - * @param stepMarkerLocation + * Sets the stepMarkerLocation option. + * + * @param stepMarkerLocation the stepMarkerLocation option + * @return this Options instance. */ public static Options stepMarkerLocation(String stepMarkerLocation) { return new Options().stepMarkerLocation(stepMarkerLocation); } - + /** - * @param allowSoftPlacement + * Sets the allowSoftPlacement option. + * + * @param allowSoftPlacement the allowSoftPlacement option + * @return this Options instance. */ public static Options allowSoftPlacement(Boolean allowSoftPlacement) { return new Options().allowSoftPlacement(allowSoftPlacement); } - + /** - * @param useSpmdForXlaPartitioning + * Sets the useSpmdForXlaPartitioning option. + * + * @param useSpmdForXlaPartitioning the useSpmdForXlaPartitioning option + * @return this Options instance. */ public static Options useSpmdForXlaPartitioning(Boolean useSpmdForXlaPartitioning) { return new Options().useSpmdForXlaPartitioning(useSpmdForXlaPartitioning); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUReplicateMetadata"; - - private ReplicateMetadata(Operation operation) { - super(operation); + + /** + * 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} + */ + public static class Options { + private Long numCoresPerReplica; + + private String topology; + + private Boolean useTpu; + + private List deviceAssignment; + + private List computationShape; + + private List hostComputeCore; + + private List paddingMap; + + private String stepMarkerLocation; + + private Boolean allowSoftPlacement; + + private Boolean useSpmdForXlaPartitioning; + + private Boolean useShardyPartitioner; + + private String tpuCompileOptionsProto; + + private Options() { + } + + /** + * Sets the numCoresPerReplica option. + * + * @param numCoresPerReplica Number of cores per replica. Used for model parallelism. + * @return this Options instance. + */ + public Options numCoresPerReplica(Long numCoresPerReplica) { + this.numCoresPerReplica = numCoresPerReplica; + return this; + } + + /** + * Sets the topology option. + * + * @param topology TopologyProto indicating the topology of the TPU pod slice. + * @return this Options instance. + */ + public Options topology(String topology) { + this.topology = topology; + return this; + } + + /** + * Sets the useTpu option. + * + * @param useTpu Whether to place the computation on the TPU. + * @return this Options instance. + */ + public Options useTpu(Boolean useTpu) { + this.useTpu = useTpu; + return this; + } + + /** + * Sets the deviceAssignment option. + * + * @param deviceAssignment The assignment of devices for the computation. + * @return this Options instance. + */ + public Options deviceAssignment(List deviceAssignment) { + this.deviceAssignment = deviceAssignment; + return this; + } + + /** + * Sets the deviceAssignment option. + * + * @param deviceAssignment The assignment of devices for the computation. + * @return this Options instance. + */ + public Options deviceAssignment(Long... deviceAssignment) { + this.deviceAssignment = Arrays.asList(deviceAssignment); + return this; + } + + /** + * Sets the computationShape option. + * + * @param computationShape DEPRECATED. Use num_cores_per_replica instead. + * @return this Options instance. + */ + public Options computationShape(List computationShape) { + this.computationShape = computationShape; + return this; + } + + /** + * Sets the computationShape option. + * + * @param computationShape DEPRECATED. Use num_cores_per_replica instead. + * @return this Options instance. + */ + public Options computationShape(Long... computationShape) { + this.computationShape = Arrays.asList(computationShape); + return this; + } + + /** + * Sets the hostComputeCore option. + * + * @param hostComputeCore the hostComputeCore option + * @return this Options instance. + */ + public Options hostComputeCore(List hostComputeCore) { + this.hostComputeCore = hostComputeCore; + return this; + } + + /** + * Sets the hostComputeCore option. + * + * @param hostComputeCore the hostComputeCore option + * @return this Options instance. + */ + public Options hostComputeCore(String... hostComputeCore) { + this.hostComputeCore = Arrays.asList(hostComputeCore); + return this; + } + + /** + * Sets the paddingMap option. + * + * @param paddingMap the paddingMap option + * @return this Options instance. + */ + public Options paddingMap(List paddingMap) { + this.paddingMap = paddingMap; + return this; + } + + /** + * Sets the paddingMap option. + * + * @param paddingMap the paddingMap option + * @return this Options instance. + */ + public Options paddingMap(String... paddingMap) { + this.paddingMap = Arrays.asList(paddingMap); + return this; + } + + /** + * Sets the stepMarkerLocation option. + * + * @param stepMarkerLocation the stepMarkerLocation option + * @return this Options instance. + */ + public Options stepMarkerLocation(String stepMarkerLocation) { + this.stepMarkerLocation = stepMarkerLocation; + return this; + } + + /** + * Sets the allowSoftPlacement option. + * + * @param allowSoftPlacement the allowSoftPlacement option + * @return this Options instance. + */ + public Options allowSoftPlacement(Boolean allowSoftPlacement) { + this.allowSoftPlacement = allowSoftPlacement; + return this; + } + + /** + * Sets the useSpmdForXlaPartitioning option. + * + * @param useSpmdForXlaPartitioning the useSpmdForXlaPartitioning option + * @return this Options instance. + */ + 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 b6092c934ee..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,86 +17,73 @@ 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; /** * Connects N inputs to an N-way replicated TPU computation. - *

- * This operation holds a replicated input to a `tpu.replicate()` computation subgraph. + * 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: - *

{@code
- * %a = "tf.opA"()
- * %b = "tf.opB"()
- * %replicated_input = "tf.TPUReplicatedInput"(%a, %b)
- * %computation = "tf.Computation"(%replicated_input)
- * }
- * The above computation has a replicated input of two replicas. - * - * @param data type for {@code output()} output + *

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. */ +@OpMetadata( + opType = ReplicatedInput.OP_NAME, + inputsClass = ReplicatedInput.Inputs.class +) +@Operator( + group = "tpu" +) public final class ReplicatedInput extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.ReplicatedInput} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param isMirroredVariable - */ - public Options isMirroredVariable(Boolean isMirroredVariable) { - this.isMirroredVariable = isMirroredVariable; - return this; - } - - /** - * @param index - */ - public Options index(Long index) { - this.index = index; - return this; - } - - /** - * @param isPacked - */ - public Options isPacked(Boolean isPacked) { - this.isPacked = isPacked; - return this; - } - - private Boolean isMirroredVariable; - private Long index; - private Boolean isPacked; - - private Options() { - } + public static final String OP_NAME = "TPUReplicatedInput"; + + private Output output; + + public ReplicatedInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ReplicatedInput operation. - * + * Factory method to create a class wrapping a new TPUReplicatedInput operation. + * * @param scope current scope - * @param inputs - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static ReplicatedInput create(Scope scope, Iterable> inputs, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("TPUReplicatedInput", scope.makeOpName("ReplicatedInput")); + @Endpoint( + describeByClass = true + ) + public static ReplicatedInput create(Scope scope, + Iterable> inputs, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReplicatedInput"); opBuilder.addInputList(Operands.asOutputs(inputs)); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.isMirroredVariable != null) { @@ -110,49 +97,139 @@ public static ReplicatedInput create(Scope scope, Iterable< } } } - return new ReplicatedInput(opBuilder.build()); + return new ReplicatedInput<>(opBuilder.build()); } - + /** - * @param isMirroredVariable + * Sets the isMirroredVariable option. + * + * @param isMirroredVariable the isMirroredVariable option + * @return this Options instance. */ public static Options isMirroredVariable(Boolean isMirroredVariable) { return new Options().isMirroredVariable(isMirroredVariable); } - + /** - * @param index + * Sets the index option. + * + * @param index the index option + * @return this Options instance. */ public static Options index(Long index) { return new Options().index(index); } - + /** - * @param isPacked + * Sets the isPacked option. + * + * @param isPacked the isPacked option + * @return this Options instance. */ public static Options isPacked(Boolean isPacked) { return new Options().isPacked(isPacked); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUReplicatedInput"; - - private Output output; - - private ReplicatedInput(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.ReplicatedInput} + */ + public static class Options { + private Boolean isMirroredVariable; + + private Long index; + + private Boolean isPacked; + + private Options() { + } + + /** + * Sets the isMirroredVariable option. + * + * @param isMirroredVariable the isMirroredVariable option + * @return this Options instance. + */ + public Options isMirroredVariable(Boolean isMirroredVariable) { + this.isMirroredVariable = isMirroredVariable; + return this; + } + + /** + * Sets the index option. + * + * @param index the index option + * @return this Options instance. + */ + public Options index(Long index) { + this.index = index; + return this; + } + + /** + * Sets the isPacked option. + * + * @param isPacked the isPacked option + * @return this Options instance. + */ + public Options isPacked(Boolean isPacked) { + this.isPacked = 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 d092faa8df9..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,73 +20,110 @@ 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; /** * Connects N outputs from an N-way replicated TPU computation. - *

- * This operation holds a replicated output from a `tpu.replicate()` computation subgraph. + * 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: - *

{@code
- * %computation = "tf.Computation"()
- * %replicated_output:2 = "tf.TPUReplicatedOutput"(%computation)
- * }
- * The above computation has a replicated output of two replicas. - * - * @param data type for {@code outputs()} output + *

For example: + *

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

The above computation has a replicated output of two replicas. */ +@OpMetadata( + opType = ReplicatedOutput.OP_NAME, + inputsClass = ReplicatedOutput.Inputs.class +) +@Operator( + group = "tpu" +) public final class ReplicatedOutput extends RawOp implements Iterable> { - /** - * Factory method to create a class wrapping a new ReplicatedOutput operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPUReplicatedOutput"; + + private List> outputs; + + @SuppressWarnings("unchecked") + public ReplicatedOutput(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 TPUReplicatedOutput operation. + * * @param scope current scope - * @param input - * @param numReplicas + * @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 */ - @Endpoint(describeByClass = true) - public static ReplicatedOutput create(Scope scope, Operand input, Long numReplicas) { - OperationBuilder opBuilder = scope.env().opBuilder("TPUReplicatedOutput", scope.makeOpName("ReplicatedOutput")); + @Endpoint( + describeByClass = true + ) + public static ReplicatedOutput create(Scope scope, Operand input, + Long numReplicas) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReplicatedOutput"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_replicas", numReplicas); - return new ReplicatedOutput(opBuilder.build()); + return new ReplicatedOutput<>(opBuilder.build()); } - + /** + * Gets outputs. + * + * @return outputs. */ public List> outputs() { return outputs; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) outputs.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUReplicatedOutput"; - - private List> outputs; - - @SuppressWarnings("unchecked") - private ReplicatedOutput(Operation operation) { - super(operation); - int outputIdx = 0; - int outputsLength = operation.outputListLength("outputs"); - outputs = Arrays.asList((Output[])operation.outputList(outputIdx, outputsLength)); - outputIdx += outputsLength; + + @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 63614394c3d..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,75 +17,69 @@ 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 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. */ +@OpMetadata( + opType = RetrieveTPUEmbeddingADAMParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingADAMParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class RetrieveTPUEmbeddingADAMParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingADAMParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingADAMParameters"; + + private Output parameters; + + private Output momenta; + + private Output velocities; + + public RetrieveTPUEmbeddingADAMParameters(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + momenta = operation.output(outputIdx++); + velocities = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingADAMParameters operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingADAMParameters create(Scope scope, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingADAMParameters", scope.makeOpName("RetrieveTPUEmbeddingADAMParameters")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingADAMParameters create(Scope scope, Long numShards, Long shardId, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingADAMParameters"); opBuilder.setAttr("num_shards", numShards); opBuilder.setAttr("shard_id", shardId); if (options != null) { @@ -103,61 +97,148 @@ public static RetrieveTPUEmbeddingADAMParameters create(Scope scope, Long numSha } return new RetrieveTPUEmbeddingADAMParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingADAMParameters"; - - private Output parameters; - private Output momenta; - private Output velocities; - - private RetrieveTPUEmbeddingADAMParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - momenta = operation.output(outputIdx++); - velocities = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingADAMParameters} + */ + 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 = 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 06112fd6a38..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingADAMParametersGradAccumDebug.java +++ /dev/null @@ -1,172 +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.op.annotation.Operator; -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 { - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingADAMParametersGradAccumDebug} - */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new RetrieveTPUEmbeddingADAMParametersGradAccumDebug operation. - * - * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes 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.env().opBuilder("RetrieveTPUEmbeddingADAMParametersGradAccumDebug", scope.makeOpName("RetrieveTPUEmbeddingADAMParametersGradAccumDebug")); - opBuilder = scope.apply(opBuilder); - 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()); - } - - /** - * @param tableId - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * @param tableName - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * @param config - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Parameter parameters updated by the ADAM optimization algorithm. - */ - public Output parameters() { - return parameters; - } - - /** - * Parameter momenta updated by the ADAM optimization algorithm. - */ - public Output momenta() { - return momenta; - } - - /** - * Parameter velocities updated by the ADAM optimization algorithm. - */ - public Output velocities() { - return velocities; - } - - /** - * Parameter gradient_accumulators updated by the ADAM optimization algorithm. - */ - public Output gradientAccumulators() { - return gradientAccumulators; - } - - /** 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++); - } -} 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 dc1ee88d9de..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,75 +17,69 @@ 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 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. */ +@OpMetadata( + opType = RetrieveTPUEmbeddingAdadeltaParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingAdadeltaParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class RetrieveTPUEmbeddingAdadeltaParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingAdadeltaParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingAdadeltaParameters"; + + private Output parameters; + + private Output accumulators; + + private Output updates; + + public RetrieveTPUEmbeddingAdadeltaParameters(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + accumulators = operation.output(outputIdx++); + updates = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingAdadeltaParameters operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingAdadeltaParameters create(Scope scope, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingAdadeltaParameters", scope.makeOpName("RetrieveTPUEmbeddingAdadeltaParameters")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingAdadeltaParameters create(Scope scope, Long numShards, + Long shardId, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingAdadeltaParameters"); opBuilder.setAttr("num_shards", numShards); opBuilder.setAttr("shard_id", shardId); if (options != null) { @@ -103,61 +97,148 @@ public static RetrieveTPUEmbeddingAdadeltaParameters create(Scope scope, Long nu } return new RetrieveTPUEmbeddingAdadeltaParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingAdadeltaParameters"; - - private Output parameters; - private Output accumulators; - private Output updates; - - private RetrieveTPUEmbeddingAdadeltaParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - accumulators = operation.output(outputIdx++); - updates = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingAdadeltaParameters} + */ + 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 = 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 c6749fdd3a2..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug.java +++ /dev/null @@ -1,172 +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.op.annotation.Operator; -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 { - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug} - */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug operation. - * - * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes 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.env().opBuilder("RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug", scope.makeOpName("RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug")); - opBuilder = scope.apply(opBuilder); - 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()); - } - - /** - * @param tableId - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * @param tableName - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * @param config - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Parameter parameters updated by the Adadelta optimization algorithm. - */ - public Output parameters() { - return parameters; - } - - /** - * Parameter accumulators updated by the Adadelta optimization algorithm. - */ - public Output accumulators() { - return accumulators; - } - - /** - * Parameter updates updated by the Adadelta optimization algorithm. - */ - public Output updates() { - return updates; - } - - /** - * Parameter gradient_accumulators updated by the Adadelta optimization algorithm. - */ - public Output gradientAccumulators() { - return gradientAccumulators; - } - - /** 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++); - } -} 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 bbc8f9984f1..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,75 +17,66 @@ 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 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 = RetrieveTPUEmbeddingAdagradParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingAdagradParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class RetrieveTPUEmbeddingAdagradParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingAdagradParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingAdagradParameters"; + + private Output parameters; + + private Output accumulators; + + public RetrieveTPUEmbeddingAdagradParameters(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + accumulators = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingAdagradParameters operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingAdagradParameters create(Scope scope, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingAdagradParameters", scope.makeOpName("RetrieveTPUEmbeddingAdagradParameters")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingAdagradParameters create(Scope scope, Long numShards, + Long shardId, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingAdagradParameters"); opBuilder.setAttr("num_shards", numShards); opBuilder.setAttr("shard_id", shardId); if (options != null) { @@ -103,52 +94,139 @@ public static RetrieveTPUEmbeddingAdagradParameters create(Scope scope, Long num } return new RetrieveTPUEmbeddingAdagradParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingAdagradParameters"; - - private Output parameters; - private Output accumulators; - - private RetrieveTPUEmbeddingAdagradParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - accumulators = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingAdagradParameters} + */ + 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 = 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 b0c27d9ae36..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdagradParametersGradAccumDebug.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.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.op.annotation.Operator; -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 { - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingAdagradParametersGradAccumDebug} - */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new RetrieveTPUEmbeddingAdagradParametersGradAccumDebug operation. - * - * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes 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.env().opBuilder("RetrieveTPUEmbeddingAdagradParametersGradAccumDebug", scope.makeOpName("RetrieveTPUEmbeddingAdagradParametersGradAccumDebug")); - opBuilder = scope.apply(opBuilder); - 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()); - } - - /** - * @param tableId - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * @param tableName - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * @param config - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Parameter parameters updated by the Adagrad optimization algorithm. - */ - public Output parameters() { - return parameters; - } - - /** - * Parameter accumulators updated by the Adagrad optimization algorithm. - */ - public Output accumulators() { - return accumulators; - } - - /** - * Parameter gradient_accumulators updated by the Adagrad optimization algorithm. - */ - public Output gradientAccumulators() { - return gradientAccumulators; - } - - /** 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++); - } -} 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 b23f32857b0..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,75 +17,72 @@ 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 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. */ +@OpMetadata( + opType = RetrieveTPUEmbeddingCenteredRMSPropParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingCenteredRMSPropParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class RetrieveTPUEmbeddingCenteredRMSPropParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingCenteredRMSPropParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingCenteredRMSPropParameters"; + + private Output parameters; + + private Output ms; + + private Output mom; + + private Output mg; + + public RetrieveTPUEmbeddingCenteredRMSPropParameters(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + ms = operation.output(outputIdx++); + mom = operation.output(outputIdx++); + mg = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingCenteredRMSPropParameters operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingCenteredRMSPropParameters create(Scope scope, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingCenteredRMSPropParameters", scope.makeOpName("RetrieveTPUEmbeddingCenteredRMSPropParameters")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingCenteredRMSPropParameters create(Scope scope, Long numShards, + Long shardId, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingCenteredRMSPropParameters"); opBuilder.setAttr("num_shards", numShards); opBuilder.setAttr("shard_id", shardId); if (options != null) { @@ -103,70 +100,157 @@ public static RetrieveTPUEmbeddingCenteredRMSPropParameters create(Scope scope, } return new RetrieveTPUEmbeddingCenteredRMSPropParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * 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 centered RMSProp optimization algorithm. + * @return parameters. */ public Output parameters() { return parameters; } - + /** + * Gets ms. * Parameter ms updated by the centered RMSProp optimization algorithm. + * @return ms. */ public Output ms() { return ms; } - + /** + * Gets mom. * Parameter mom updated by the centered RMSProp optimization algorithm. + * @return mom. */ public Output mom() { return mom; } - + /** + * Gets mg. * Parameter mg updated by the centered RMSProp optimization algorithm. + * @return mg. */ public Output mg() { return mg; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingCenteredRMSPropParameters"; - - private Output parameters; - private Output ms; - private Output mom; - private Output mg; - - private RetrieveTPUEmbeddingCenteredRMSPropParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - ms = operation.output(outputIdx++); - mom = operation.output(outputIdx++); - mg = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingCenteredRMSPropParameters} + */ + 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 = 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 ea4e7d8b7cc..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,75 +17,69 @@ 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 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. */ +@OpMetadata( + opType = RetrieveTPUEmbeddingFTRLParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingFTRLParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class RetrieveTPUEmbeddingFTRLParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingFTRLParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingFTRLParameters"; + + private Output parameters; + + private Output accumulators; + + private Output linears; + + public RetrieveTPUEmbeddingFTRLParameters(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + accumulators = operation.output(outputIdx++); + linears = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingFTRLParameters operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingFTRLParameters create(Scope scope, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingFTRLParameters", scope.makeOpName("RetrieveTPUEmbeddingFTRLParameters")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingFTRLParameters create(Scope scope, Long numShards, Long shardId, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingFTRLParameters"); opBuilder.setAttr("num_shards", numShards); opBuilder.setAttr("shard_id", shardId); if (options != null) { @@ -103,61 +97,148 @@ public static RetrieveTPUEmbeddingFTRLParameters create(Scope scope, Long numSha } return new RetrieveTPUEmbeddingFTRLParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingFTRLParameters"; - - private Output parameters; - private Output accumulators; - private Output linears; - - private RetrieveTPUEmbeddingFTRLParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - accumulators = operation.output(outputIdx++); - linears = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingFTRLParameters} + */ + 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 = 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 ae3103b45de..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingFTRLParametersGradAccumDebug.java +++ /dev/null @@ -1,172 +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.op.annotation.Operator; -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 { - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingFTRLParametersGradAccumDebug} - */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new RetrieveTPUEmbeddingFTRLParametersGradAccumDebug operation. - * - * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes 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.env().opBuilder("RetrieveTPUEmbeddingFTRLParametersGradAccumDebug", scope.makeOpName("RetrieveTPUEmbeddingFTRLParametersGradAccumDebug")); - opBuilder = scope.apply(opBuilder); - 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()); - } - - /** - * @param tableId - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * @param tableName - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * @param config - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Parameter parameters updated by the FTRL optimization algorithm. - */ - public Output parameters() { - return parameters; - } - - /** - * Parameter accumulators updated by the FTRL optimization algorithm. - */ - public Output accumulators() { - return accumulators; - } - - /** - * Parameter linears updated by the FTRL optimization algorithm. - */ - public Output linears() { - return linears; - } - - /** - * Parameter gradient_accumulators updated by the FTRL optimization algorithm. - */ - public Output gradientAccumulators() { - return gradientAccumulators; - } - - /** 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++); - } -} 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 6e14c023852..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,75 +17,72 @@ 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 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. */ +@OpMetadata( + opType = RetrieveTPUEmbeddingMDLAdagradLightParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingMDLAdagradLightParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class RetrieveTPUEmbeddingMDLAdagradLightParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingMDLAdagradLightParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingMDLAdagradLightParameters"; + + private Output parameters; + + private Output accumulators; + + private Output weights; + + private Output benefits; + + public RetrieveTPUEmbeddingMDLAdagradLightParameters(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + accumulators = operation.output(outputIdx++); + weights = operation.output(outputIdx++); + benefits = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingMDLAdagradLightParameters operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingMDLAdagradLightParameters create(Scope scope, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingMDLAdagradLightParameters", scope.makeOpName("RetrieveTPUEmbeddingMDLAdagradLightParameters")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingMDLAdagradLightParameters create(Scope scope, Long numShards, + Long shardId, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingMDLAdagradLightParameters"); opBuilder.setAttr("num_shards", numShards); opBuilder.setAttr("shard_id", shardId); if (options != null) { @@ -103,70 +100,157 @@ public static RetrieveTPUEmbeddingMDLAdagradLightParameters create(Scope scope, } return new RetrieveTPUEmbeddingMDLAdagradLightParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * 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 MDL Adagrad Light optimization algorithm. + * @return parameters. */ public Output parameters() { return parameters; } - + /** + * Gets accumulators. * Parameter accumulators updated by the MDL Adagrad Light optimization algorithm. + * @return accumulators. */ public Output accumulators() { return accumulators; } - + /** + * Gets weights. * Parameter weights updated by the MDL Adagrad Light optimization algorithm. + * @return weights. */ public Output weights() { return weights; } - + /** + * Gets benefits. * Parameter benefits updated by the MDL Adagrad Light optimization algorithm. + * @return benefits. */ public Output benefits() { return benefits; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingMDLAdagradLightParameters"; - - private Output parameters; - private Output accumulators; - private Output weights; - private Output benefits; - - private RetrieveTPUEmbeddingMDLAdagradLightParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - accumulators = operation.output(outputIdx++); - weights = operation.output(outputIdx++); - benefits = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingMDLAdagradLightParameters} + */ + 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 = 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 b7c5466f9ab..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,75 +17,66 @@ 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 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 = RetrieveTPUEmbeddingMomentumParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingMomentumParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class RetrieveTPUEmbeddingMomentumParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingMomentumParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingMomentumParameters"; + + private Output parameters; + + private Output momenta; + + public RetrieveTPUEmbeddingMomentumParameters(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + momenta = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingMomentumParameters operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingMomentumParameters create(Scope scope, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingMomentumParameters", scope.makeOpName("RetrieveTPUEmbeddingMomentumParameters")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingMomentumParameters create(Scope scope, Long numShards, + Long shardId, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingMomentumParameters"); opBuilder.setAttr("num_shards", numShards); opBuilder.setAttr("shard_id", shardId); if (options != null) { @@ -103,52 +94,139 @@ public static RetrieveTPUEmbeddingMomentumParameters create(Scope scope, Long nu } return new RetrieveTPUEmbeddingMomentumParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingMomentumParameters"; - - private Output parameters; - private Output momenta; - - private RetrieveTPUEmbeddingMomentumParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - momenta = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingMomentumParameters} + */ + 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 = 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 730a7ca9da5..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMomentumParametersGradAccumDebug.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.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.op.annotation.Operator; -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 { - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingMomentumParametersGradAccumDebug} - */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new RetrieveTPUEmbeddingMomentumParametersGradAccumDebug operation. - * - * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes 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.env().opBuilder("RetrieveTPUEmbeddingMomentumParametersGradAccumDebug", scope.makeOpName("RetrieveTPUEmbeddingMomentumParametersGradAccumDebug")); - opBuilder = scope.apply(opBuilder); - 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()); - } - - /** - * @param tableId - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * @param tableName - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * @param config - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Parameter parameters updated by the Momentum optimization algorithm. - */ - public Output parameters() { - return parameters; - } - - /** - * Parameter momenta updated by the Momentum optimization algorithm. - */ - public Output momenta() { - return momenta; - } - - /** - * Parameter gradient_accumulators updated by the Momentum optimization algorithm. - */ - public Output gradientAccumulators() { - return gradientAccumulators; - } - - /** 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++); - } -} 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 97cc1e69f5a..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,75 +17,66 @@ 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 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. */ +@OpMetadata( + opType = RetrieveTPUEmbeddingProximalAdagradParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingProximalAdagradParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class RetrieveTPUEmbeddingProximalAdagradParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingProximalAdagradParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingProximalAdagradParameters"; + + private Output parameters; + + private Output accumulators; + + public RetrieveTPUEmbeddingProximalAdagradParameters(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + accumulators = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingProximalAdagradParameters operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingProximalAdagradParameters create(Scope scope, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingProximalAdagradParameters", scope.makeOpName("RetrieveTPUEmbeddingProximalAdagradParameters")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingProximalAdagradParameters create(Scope scope, Long numShards, + Long shardId, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingProximalAdagradParameters"); opBuilder.setAttr("num_shards", numShards); opBuilder.setAttr("shard_id", shardId); if (options != null) { @@ -103,52 +94,139 @@ public static RetrieveTPUEmbeddingProximalAdagradParameters create(Scope scope, } return new RetrieveTPUEmbeddingProximalAdagradParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingProximalAdagradParameters"; - - private Output parameters; - private Output accumulators; - - private RetrieveTPUEmbeddingProximalAdagradParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - accumulators = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingProximalAdagradParameters} + */ + 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 = 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 c6c07d28081..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug.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.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.op.annotation.Operator; -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 { - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug} - */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug operation. - * - * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes 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.env().opBuilder("RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug", scope.makeOpName("RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug")); - opBuilder = scope.apply(opBuilder); - 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()); - } - - /** - * @param tableId - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * @param tableName - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * @param config - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Parameter parameters updated by the proximal Adagrad optimization algorithm. - */ - public Output parameters() { - return parameters; - } - - /** - * Parameter accumulators updated by the proximal Adagrad optimization algorithm. - */ - public Output accumulators() { - return accumulators; - } - - /** - * Parameter gradient_accumulators updated by the proximal Adagrad optimization algorithm. - */ - public Output gradientAccumulators() { - return gradientAccumulators; - } - - /** 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++); - } -} 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 bf7af3b3084..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,69 +17,65 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingProximalYogiParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingProximalYogiParameters"; + + private Output parameters; + + private Output v; + + private Output m; + + public RetrieveTPUEmbeddingProximalYogiParameters(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + v = operation.output(outputIdx++); + m = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingProximalYogiParameters operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingProximalYogiParameters create(Scope scope, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingProximalYogiParameters", scope.makeOpName("RetrieveTPUEmbeddingProximalYogiParameters")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingProximalYogiParameters create(Scope scope, Long numShards, + Long shardId, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingProximalYogiParameters"); opBuilder.setAttr("num_shards", numShards); opBuilder.setAttr("shard_id", shardId); if (options != null) { @@ -97,58 +93,148 @@ public static RetrieveTPUEmbeddingProximalYogiParameters create(Scope scope, Lon } return new RetrieveTPUEmbeddingProximalYogiParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingProximalYogiParameters"; - - private Output parameters; - private Output v; - private Output m; - - private RetrieveTPUEmbeddingProximalYogiParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - v = operation.output(outputIdx++); - m = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingProximalYogiParameters} + */ + 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 = 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 109c1d82716..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug.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.Operation; -import org.tensorflow.OperationBuilder; -import org.tensorflow.Output; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.TFloat32; - -/** - */ -public final class RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug extends RawOp { - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug} - */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug operation. - * - * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes 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.env().opBuilder("RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug", scope.makeOpName("RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug")); - opBuilder = scope.apply(opBuilder); - 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()); - } - - /** - * @param tableId - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * @param tableName - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * @param config - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - */ - public Output parameters() { - return parameters; - } - - /** - */ - public Output v() { - return v; - } - - /** - */ - public Output m() { - return m; - } - - /** - */ - public Output gradientAccumulators() { - return gradientAccumulators; - } - - /** 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++); - } -} 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 13a95cae5c2..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,75 +17,69 @@ 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 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. */ +@OpMetadata( + opType = RetrieveTPUEmbeddingRMSPropParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingRMSPropParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class RetrieveTPUEmbeddingRMSPropParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingRMSPropParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingRMSPropParameters"; + + private Output parameters; + + private Output ms; + + private Output mom; + + public RetrieveTPUEmbeddingRMSPropParameters(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + ms = operation.output(outputIdx++); + mom = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingRMSPropParameters operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingRMSPropParameters create(Scope scope, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingRMSPropParameters", scope.makeOpName("RetrieveTPUEmbeddingRMSPropParameters")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingRMSPropParameters create(Scope scope, Long numShards, + Long shardId, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingRMSPropParameters"); opBuilder.setAttr("num_shards", numShards); opBuilder.setAttr("shard_id", shardId); if (options != null) { @@ -103,61 +97,148 @@ public static RetrieveTPUEmbeddingRMSPropParameters create(Scope scope, Long num } return new RetrieveTPUEmbeddingRMSPropParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * 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; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingRMSPropParameters"; - - private Output parameters; - private Output ms; - private Output mom; - - private RetrieveTPUEmbeddingRMSPropParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - ms = operation.output(outputIdx++); - mom = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingRMSPropParameters} + */ + 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 = 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 97b915ecc3b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug.java +++ /dev/null @@ -1,172 +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.op.annotation.Operator; -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 { - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug} - */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug operation. - * - * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes 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.env().opBuilder("RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug", scope.makeOpName("RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug")); - opBuilder = scope.apply(opBuilder); - 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()); - } - - /** - * @param tableId - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * @param tableName - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * @param config - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Parameter parameters updated by the RMSProp optimization algorithm. - */ - public Output parameters() { - return parameters; - } - - /** - * Parameter ms updated by the RMSProp optimization algorithm. - */ - public Output ms() { - return ms; - } - - /** - * Parameter mom updated by the RMSProp optimization algorithm. - */ - public Output mom() { - return mom; - } - - /** - * Parameter gradient_accumulators updated by the RMSProp optimization algorithm. - */ - public Output gradientAccumulators() { - return gradientAccumulators; - } - - /** 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++); - } -} 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 9d9d1a5c29a..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,76 +17,64 @@ 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; /** * 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. */ +@OpMetadata( + opType = RetrieveTPUEmbeddingStochasticGradientDescentParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingStochasticGradientDescentParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class RetrieveTPUEmbeddingStochasticGradientDescentParameters extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingStochasticGradientDescentParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingStochasticGradientDescentParameters"; + + private Output parameters; + + public RetrieveTPUEmbeddingStochasticGradientDescentParameters(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + parameters = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingStochasticGradientDescentParameters operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingStochasticGradientDescentParameters create(Scope scope, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingStochasticGradientDescentParameters", scope.makeOpName("RetrieveTPUEmbeddingStochasticGradientDescentParameters")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingStochasticGradientDescentParameters create(Scope scope, + Long numShards, Long shardId, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingStochasticGradientDescentParameters"); opBuilder.setAttr("num_shards", numShards); opBuilder.setAttr("shard_id", shardId); if (options != null) { @@ -104,48 +92,135 @@ public static RetrieveTPUEmbeddingStochasticGradientDescentParameters create(Sco } return new RetrieveTPUEmbeddingStochasticGradientDescentParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * 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; } - + @Override public Output asOutput() { return parameters; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingStochasticGradientDescentParameters"; - - private Output parameters; - - private RetrieveTPUEmbeddingStochasticGradientDescentParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingStochasticGradientDescentParameters} + */ + 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 = 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 6c0ac7d76a7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.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.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.op.annotation.Operator; -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 { - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug} - */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } - } - - /** - * Factory method to create a class wrapping a new RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug operation. - * - * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes 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.env().opBuilder("RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug", scope.makeOpName("RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug")); - opBuilder = scope.apply(opBuilder); - 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()); - } - - /** - * @param tableId - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * @param tableName - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * @param config - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Parameter parameters updated by the stochastic gradient descent optimization algorithm. - */ - public Output parameters() { - return parameters; - } - - /** - * Parameter gradient_accumulators updated by the Adadelta optimization algorithm. - */ - public Output gradientAccumulators() { - return gradientAccumulators; - } - - /** 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++); - } -} 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 e46d77e7506..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,24 +17,44 @@ 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"; + + public SendTPUEmbeddingGradients(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new SendTPUEmbeddingGradients operation. - * + * * @param scope current scope * @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 @@ -49,22 +69,98 @@ public final class SendTPUEmbeddingGradients extends RawOp { * 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 */ - @Endpoint(describeByClass = true) - public static SendTPUEmbeddingGradients create(Scope scope, Iterable> inputs, Iterable> learningRates, String config) { - OperationBuilder opBuilder = scope.env().opBuilder("SendTPUEmbeddingGradients", scope.makeOpName("SendTPUEmbeddingGradients")); + @Endpoint( + describeByClass = true + ) + public static SendTPUEmbeddingGradients create(Scope scope, Iterable> inputs, + Iterable> learningRates, String config, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SendTPUEmbeddingGradients"); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder.addInputList(Operands.asOutputs(learningRates)); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("config", config); + if (options != null) { + for (Options opts : options) { + if (opts.NN != null) { + opBuilder.setAttr("NN", opts.NN); + } + } + } return new SendTPUEmbeddingGradients(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SendTPUEmbeddingGradients"; - - private SendTPUEmbeddingGradients(Operation operation) { - super(operation); + + /** + * Sets the NN option. + * + * @param NN the NN option + * @return this Options instance. + */ + public static Options NN(Long NN) { + return new Options().NN(NN); + } + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.SendTPUEmbeddingGradients} + */ + public static class Options { + private Long NN; + + private Options() { + } + + /** + * Sets the NN option. + * + * @param NN the NN option + * @return this Options instance. + */ + public Options NN(Long NN) { + this.NN = 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 b97a63c97f4..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,37 +17,60 @@ 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"; + + public ShutdownDistributedTPU(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new ShutdownDistributedTPU operation. - * + * * @param scope current scope * @return a new instance of ShutdownDistributedTPU */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ShutdownDistributedTPU create(Scope scope) { - OperationBuilder opBuilder = scope.env().opBuilder("ShutdownDistributedTPU", scope.makeOpName("ShutdownDistributedTPU")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ShutdownDistributedTPU"); return new ShutdownDistributedTPU(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ShutdownDistributedTPU"; - - private ShutdownDistributedTPU(Operation operation) { - super(operation); + + @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 0f6e8fdd736..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,57 +17,86 @@ 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; /** * 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 */ +@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 + */ + public static final String OP_NAME = "TPUCompilationResult"; + + private Output output; + + public TPUCompilationResult(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TPUCompilationResult operation. - * + * * @param scope current scope * @return a new instance of TPUCompilationResult */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TPUCompilationResult create(Scope scope) { - OperationBuilder opBuilder = scope.env().opBuilder("TPUCompilationResult", scope.makeOpName("TPUCompilationResult")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TPUCompilationResult"); return new TPUCompilationResult(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUCompilationResult"; - - private Output output; - - private TPUCompilationResult(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 77c2036379c..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,30 +17,56 @@ 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; /** * 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 */ +@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 + */ + public static final String OP_NAME = "TPUEmbeddingActivations"; + + private Output output; + + public TPUEmbeddingActivations(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TPUEmbeddingActivations operation. - * + * * @param scope current scope * @param embeddingVariable A trainable variable, enabling optimizers to find this op. * @param slicedActivations The embedding activations Tensor to return. @@ -50,36 +76,66 @@ public final class TPUEmbeddingActivations extends RawOp implements Operand embeddingVariable, Operand slicedActivations, Long tableId, Long lookupId) { - OperationBuilder opBuilder = scope.env().opBuilder("TPUEmbeddingActivations", scope.makeOpName("TPUEmbeddingActivations")); + @Endpoint( + describeByClass = true + ) + public static TPUEmbeddingActivations create(Scope scope, Operand embeddingVariable, + Operand slicedActivations, Long tableId, Long lookupId) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TPUEmbeddingActivations"); opBuilder.addInput(embeddingVariable.asOutput()); opBuilder.addInput(slicedActivations.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("table_id", tableId); opBuilder.setAttr("lookup_id", lookupId); return new TPUEmbeddingActivations(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUEmbeddingActivations"; - - private Output output; - - private TPUEmbeddingActivations(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 32d9db030d3..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. @@ -17,133 +17,56 @@ 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.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; 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 `tpu.replicate()` computation subgraph. + * This operation holds the metadata common to operations of a {@code tpu.replicate()} computation subgraph. + * + * @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 { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.TPUReplicateMetadata} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param numCoresPerReplica Number of cores per replica. Used for model parallelism. - */ - public Options numCoresPerReplica(Long numCoresPerReplica) { - this.numCoresPerReplica = numCoresPerReplica; - return this; - } - - /** - * @param topology TopologyProto indicating the topology of the TPU pod slice. - */ - public Options topology(String topology) { - this.topology = topology; - return this; - } - - /** - * @param useTpu Whether to place the computation on the TPU. - */ - public Options useTpu(Boolean useTpu) { - this.useTpu = useTpu; - return this; - } - - /** - * @param deviceAssignment The assignment of devices for the computation. - */ - public Options deviceAssignment(List deviceAssignment) { - this.deviceAssignment = deviceAssignment; - return this; - } - - /** - * @param computationShape DEPRECATED. Use num_cores_per_replica instead. - */ - public Options computationShape(List computationShape) { - this.computationShape = computationShape; - return this; - } - - /** - * @param hostComputeCore - */ - public Options hostComputeCore(List hostComputeCore) { - this.hostComputeCore = hostComputeCore; - return this; - } - - /** - * @param paddingMap - */ - public Options paddingMap(List paddingMap) { - this.paddingMap = paddingMap; - return this; - } - - /** - * @param stepMarkerLocation - */ - public Options stepMarkerLocation(String stepMarkerLocation) { - this.stepMarkerLocation = stepMarkerLocation; - return this; - } - - /** - * @param allowSoftPlacement - */ - public Options allowSoftPlacement(Boolean allowSoftPlacement) { - this.allowSoftPlacement = allowSoftPlacement; - return this; - } - - /** - * @param useSpmdForXlaPartitioning - */ - public Options useSpmdForXlaPartitioning(Boolean useSpmdForXlaPartitioning) { - this.useSpmdForXlaPartitioning = useSpmdForXlaPartitioning; - return this; - } - - private Long numCoresPerReplica; - private String topology; - private Boolean useTpu; - private List deviceAssignment; - private List computationShape; - private List hostComputeCore; - private List paddingMap; - private String stepMarkerLocation; - private Boolean allowSoftPlacement; - private Boolean useSpmdForXlaPartitioning; - - private Options() { - } + public static final String OP_NAME = "TPUReplicateMetadata"; + + public TPUReplicateMetadata(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new TPUReplicateMetadata operation. - * + * * @param scope current scope * @param numReplicas Number of replicas of the computation - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of TPUReplicateMetadata */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TPUReplicateMetadata create(Scope scope, Long numReplicas, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("TPUReplicateMetadata", scope.makeOpName("TPUReplicateMetadata")); - opBuilder = scope.apply(opBuilder); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TPUReplicateMetadata"); opBuilder.setAttr("num_replicas", numReplicas); if (options != null) { for (Options opts : options) { @@ -158,28 +81,28 @@ public static TPUReplicateMetadata create(Scope scope, Long numReplicas, Options } if (opts.deviceAssignment != null) { long[] deviceAssignmentArray = new long[opts.deviceAssignment.size()]; - for (int i = 0; i < deviceAssignmentArray.length; ++i) { + for (int i = 0 ; i < deviceAssignmentArray.length ; i++) { deviceAssignmentArray[i] = opts.deviceAssignment.get(i); } opBuilder.setAttr("device_assignment", deviceAssignmentArray); } if (opts.computationShape != null) { long[] computationShapeArray = new long[opts.computationShape.size()]; - for (int i = 0; i < computationShapeArray.length; ++i) { + for (int i = 0 ; i < computationShapeArray.length ; i++) { computationShapeArray[i] = opts.computationShape.get(i); } opBuilder.setAttr("computation_shape", computationShapeArray); } if (opts.hostComputeCore != null) { String[] hostComputeCoreArray = new String[opts.hostComputeCore.size()]; - for (int i = 0; i < hostComputeCoreArray.length; ++i) { + for (int i = 0 ; i < hostComputeCoreArray.length ; i++) { hostComputeCoreArray[i] = opts.hostComputeCore.get(i); } opBuilder.setAttr("host_compute_core", hostComputeCoreArray); } if (opts.paddingMap != null) { String[] paddingMapArray = new String[opts.paddingMap.size()]; - for (int i = 0; i < paddingMapArray.length; ++i) { + for (int i = 0 ; i < paddingMapArray.length ; i++) { paddingMapArray[i] = opts.paddingMap.get(i); } opBuilder.setAttr("padding_map", paddingMapArray); @@ -193,85 +116,470 @@ 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()); } - + /** + * Sets the numCoresPerReplica option. + * * @param numCoresPerReplica Number of cores per replica. Used for model parallelism. + * @return this Options instance. */ public static Options numCoresPerReplica(Long numCoresPerReplica) { return new Options().numCoresPerReplica(numCoresPerReplica); } - + /** + * Sets the topology option. + * * @param topology TopologyProto indicating the topology of the TPU pod slice. + * @return this Options instance. */ public static Options topology(String topology) { return new Options().topology(topology); } - + /** + * Sets the useTpu option. + * * @param useTpu Whether to place the computation on the TPU. + * @return this Options instance. */ public static Options useTpu(Boolean useTpu) { return new Options().useTpu(useTpu); } - + /** + * Sets the deviceAssignment option. + * * @param deviceAssignment The assignment of devices for the computation. + * @return this Options instance. */ public static Options deviceAssignment(List deviceAssignment) { return new Options().deviceAssignment(deviceAssignment); } - + + /** + * Sets the deviceAssignment option. + * + * @param deviceAssignment The assignment of devices for the computation. + * @return this Options instance. + */ + public static Options deviceAssignment(Long... deviceAssignment) { + return new Options().deviceAssignment(deviceAssignment); + } + /** + * Sets the computationShape option. + * * @param computationShape DEPRECATED. Use num_cores_per_replica instead. + * @return this Options instance. */ public static Options computationShape(List computationShape) { return new Options().computationShape(computationShape); } - + + /** + * Sets the computationShape option. + * + * @param computationShape DEPRECATED. Use num_cores_per_replica instead. + * @return this Options instance. + */ + public static Options computationShape(Long... computationShape) { + return new Options().computationShape(computationShape); + } + /** - * @param hostComputeCore + * Sets the hostComputeCore option. + * + * @param hostComputeCore the hostComputeCore option + * @return this Options instance. */ public static Options hostComputeCore(List hostComputeCore) { return new Options().hostComputeCore(hostComputeCore); } - + /** - * @param paddingMap + * Sets the hostComputeCore option. + * + * @param hostComputeCore the hostComputeCore option + * @return this Options instance. + */ + public static Options hostComputeCore(String... hostComputeCore) { + return new Options().hostComputeCore(hostComputeCore); + } + + /** + * Sets the paddingMap option. + * + * @param paddingMap the paddingMap option + * @return this Options instance. */ public static Options paddingMap(List paddingMap) { return new Options().paddingMap(paddingMap); } - + + /** + * Sets the paddingMap option. + * + * @param paddingMap the paddingMap option + * @return this Options instance. + */ + public static Options paddingMap(String... paddingMap) { + return new Options().paddingMap(paddingMap); + } + /** - * @param stepMarkerLocation + * Sets the stepMarkerLocation option. + * + * @param stepMarkerLocation the stepMarkerLocation option + * @return this Options instance. */ public static Options stepMarkerLocation(String stepMarkerLocation) { return new Options().stepMarkerLocation(stepMarkerLocation); } - + /** - * @param allowSoftPlacement + * Sets the allowSoftPlacement option. + * + * @param allowSoftPlacement the allowSoftPlacement option + * @return this Options instance. */ public static Options allowSoftPlacement(Boolean allowSoftPlacement) { return new Options().allowSoftPlacement(allowSoftPlacement); } - + /** - * @param useSpmdForXlaPartitioning + * Sets the useSpmdForXlaPartitioning option. + * + * @param useSpmdForXlaPartitioning the useSpmdForXlaPartitioning option + * @return this Options instance. */ public static Options useSpmdForXlaPartitioning(Boolean useSpmdForXlaPartitioning) { return new Options().useSpmdForXlaPartitioning(useSpmdForXlaPartitioning); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUReplicateMetadata"; - - private TPUReplicateMetadata(Operation operation) { - super(operation); + + /** + * 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} + */ + public static class Options { + private Long numCoresPerReplica; + + private String topology; + + private Boolean useTpu; + + private List deviceAssignment; + + private List computationShape; + + private List hostComputeCore; + + private List paddingMap; + + private String stepMarkerLocation; + + private Boolean allowSoftPlacement; + + private Boolean useSpmdForXlaPartitioning; + + private Boolean useShardyPartitioner; + + private String tpuCompileOptionsProto; + + private Options() { + } + + /** + * Sets the numCoresPerReplica option. + * + * @param numCoresPerReplica Number of cores per replica. Used for model parallelism. + * @return this Options instance. + */ + public Options numCoresPerReplica(Long numCoresPerReplica) { + this.numCoresPerReplica = numCoresPerReplica; + return this; + } + + /** + * Sets the topology option. + * + * @param topology TopologyProto indicating the topology of the TPU pod slice. + * @return this Options instance. + */ + public Options topology(String topology) { + this.topology = topology; + return this; + } + + /** + * Sets the useTpu option. + * + * @param useTpu Whether to place the computation on the TPU. + * @return this Options instance. + */ + public Options useTpu(Boolean useTpu) { + this.useTpu = useTpu; + return this; + } + + /** + * Sets the deviceAssignment option. + * + * @param deviceAssignment The assignment of devices for the computation. + * @return this Options instance. + */ + public Options deviceAssignment(List deviceAssignment) { + this.deviceAssignment = deviceAssignment; + return this; + } + + /** + * Sets the deviceAssignment option. + * + * @param deviceAssignment The assignment of devices for the computation. + * @return this Options instance. + */ + public Options deviceAssignment(Long... deviceAssignment) { + this.deviceAssignment = Arrays.asList(deviceAssignment); + return this; + } + + /** + * Sets the computationShape option. + * + * @param computationShape DEPRECATED. Use num_cores_per_replica instead. + * @return this Options instance. + */ + public Options computationShape(List computationShape) { + this.computationShape = computationShape; + return this; + } + + /** + * Sets the computationShape option. + * + * @param computationShape DEPRECATED. Use num_cores_per_replica instead. + * @return this Options instance. + */ + public Options computationShape(Long... computationShape) { + this.computationShape = Arrays.asList(computationShape); + return this; + } + + /** + * Sets the hostComputeCore option. + * + * @param hostComputeCore the hostComputeCore option + * @return this Options instance. + */ + public Options hostComputeCore(List hostComputeCore) { + this.hostComputeCore = hostComputeCore; + return this; + } + + /** + * Sets the hostComputeCore option. + * + * @param hostComputeCore the hostComputeCore option + * @return this Options instance. + */ + public Options hostComputeCore(String... hostComputeCore) { + this.hostComputeCore = Arrays.asList(hostComputeCore); + return this; + } + + /** + * Sets the paddingMap option. + * + * @param paddingMap the paddingMap option + * @return this Options instance. + */ + public Options paddingMap(List paddingMap) { + this.paddingMap = paddingMap; + return this; + } + + /** + * Sets the paddingMap option. + * + * @param paddingMap the paddingMap option + * @return this Options instance. + */ + public Options paddingMap(String... paddingMap) { + this.paddingMap = Arrays.asList(paddingMap); + return this; + } + + /** + * Sets the stepMarkerLocation option. + * + * @param stepMarkerLocation the stepMarkerLocation option + * @return this Options instance. + */ + public Options stepMarkerLocation(String stepMarkerLocation) { + this.stepMarkerLocation = stepMarkerLocation; + return this; + } + + /** + * Sets the allowSoftPlacement option. + * + * @param allowSoftPlacement the allowSoftPlacement option + * @return this Options instance. + */ + public Options allowSoftPlacement(Boolean allowSoftPlacement) { + this.allowSoftPlacement = allowSoftPlacement; + return this; + } + + /** + * Sets the useSpmdForXlaPartitioning option. + * + * @param useSpmdForXlaPartitioning the useSpmdForXlaPartitioning option + * @return this Options instance. + */ + 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 7063310c20d..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,86 +17,76 @@ 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; /** * Connects N inputs to an N-way replicated TPU computation. - *

- * This operation holds a replicated input to a `tpu.replicate()` computation subgraph. + * 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: - *

{@code
- * %a = "tf.opA"()
- * %b = "tf.opB"()
- * %replicated_input = "tf.TPUReplicatedInput"(%a, %b)
- * %computation = "tf.Computation"(%replicated_input)
- * }
- * The above computation has a replicated input of two replicas. - * - * @param data type for {@code output()} output + *

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 */ +@OpMetadata( + opType = TPUReplicatedInput.OP_NAME, + inputsClass = TPUReplicatedInput.Inputs.class +) +@Deprecated +@Operator( + group = "tpu" +) public final class TPUReplicatedInput extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.TPUReplicatedInput} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param isMirroredVariable - */ - public Options isMirroredVariable(Boolean isMirroredVariable) { - this.isMirroredVariable = isMirroredVariable; - return this; - } - - /** - * @param index - */ - public Options index(Long index) { - this.index = index; - return this; - } - - /** - * @param isPacked - */ - public Options isPacked(Boolean isPacked) { - this.isPacked = isPacked; - return this; - } - - private Boolean isMirroredVariable; - private Long index; - private Boolean isPacked; - - private Options() { - } + public static final String OP_NAME = "TPUReplicatedInput"; + + private Output output; + + public TPUReplicatedInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new TPUReplicatedInput operation. - * + * * @param scope current scope - * @param inputs - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static TPUReplicatedInput create(Scope scope, Iterable> inputs, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("TPUReplicatedInput", scope.makeOpName("TPUReplicatedInput")); + @Endpoint( + describeByClass = true + ) + public static TPUReplicatedInput create(Scope scope, + Iterable> inputs, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TPUReplicatedInput"); opBuilder.addInputList(Operands.asOutputs(inputs)); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.isMirroredVariable != null) { @@ -110,49 +100,139 @@ public static TPUReplicatedInput create(Scope scope, Iterab } } } - return new TPUReplicatedInput(opBuilder.build()); + return new TPUReplicatedInput<>(opBuilder.build()); } - + /** - * @param isMirroredVariable + * Sets the isMirroredVariable option. + * + * @param isMirroredVariable the isMirroredVariable option + * @return this Options instance. */ public static Options isMirroredVariable(Boolean isMirroredVariable) { return new Options().isMirroredVariable(isMirroredVariable); } - + /** - * @param index + * Sets the index option. + * + * @param index the index option + * @return this Options instance. */ public static Options index(Long index) { return new Options().index(index); } - + /** - * @param isPacked + * Sets the isPacked option. + * + * @param isPacked the isPacked option + * @return this Options instance. */ public static Options isPacked(Boolean isPacked) { return new Options().isPacked(isPacked); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUReplicatedInput"; - - private Output output; - - private TPUReplicatedInput(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.TPUReplicatedInput} + */ + public static class Options { + private Boolean isMirroredVariable; + + private Long index; + + private Boolean isPacked; + + private Options() { + } + + /** + * Sets the isMirroredVariable option. + * + * @param isMirroredVariable the isMirroredVariable option + * @return this Options instance. + */ + public Options isMirroredVariable(Boolean isMirroredVariable) { + this.isMirroredVariable = isMirroredVariable; + return this; + } + + /** + * Sets the index option. + * + * @param index the index option + * @return this Options instance. + */ + public Options index(Long index) { + this.index = index; + return this; + } + + /** + * Sets the isPacked option. + * + * @param isPacked the isPacked option + * @return this Options instance. + */ + public Options isPacked(Boolean isPacked) { + this.isPacked = 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 b6571949586..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,73 +20,113 @@ 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; /** * Connects N outputs from an N-way replicated TPU computation. - *

- * This operation holds a replicated output from a `tpu.replicate()` computation subgraph. + * 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: - *

{@code
- * %computation = "tf.Computation"()
- * %replicated_output:2 = "tf.TPUReplicatedOutput"(%computation)
- * }
- * The above computation has a replicated output of two replicas. - * - * @param data type for {@code outputs()} output + *

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 */ +@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 + */ + public static final String OP_NAME = "TPUReplicatedOutput"; + + private List> outputs; + + @SuppressWarnings("unchecked") + public TPUReplicatedOutput(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 TPUReplicatedOutput operation. - * + * * @param scope current scope - * @param input - * @param numReplicas + * @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 */ - @Endpoint(describeByClass = true) - public static TPUReplicatedOutput create(Scope scope, Operand input, Long numReplicas) { - OperationBuilder opBuilder = scope.env().opBuilder("TPUReplicatedOutput", scope.makeOpName("TPUReplicatedOutput")); + @Endpoint( + describeByClass = true + ) + public static TPUReplicatedOutput create(Scope scope, Operand input, + Long numReplicas) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TPUReplicatedOutput"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_replicas", numReplicas); - return new TPUReplicatedOutput(opBuilder.build()); + return new TPUReplicatedOutput<>(opBuilder.build()); } - + /** + * Gets outputs. + * + * @return outputs. */ public List> outputs() { return outputs; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) outputs.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUReplicatedOutput"; - - private List> outputs; - - @SuppressWarnings("unchecked") - private TPUReplicatedOutput(Operation operation) { - super(operation); - int outputIdx = 0; - int outputsLength = operation.outputListLength("outputs"); - outputs = Arrays.asList((Output[])operation.outputList(outputIdx, outputsLength)); - outputIdx += outputsLength; + + @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 new file mode 100644 index 00000000000..c1ddadbc8a5 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReshardVariables.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.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.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; + +/** + * 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. + */ +@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"; + + 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 + * @return a new instance of TPUReshardVariables + */ + @Endpoint( + describeByClass = true + ) + public static TPUReshardVariables create(Scope scope, Iterable> vars, + Operand newFormatKey, Operand formatStateVar) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TPUReshardVariables"); + opBuilder.addInputList(Operands.asOutputs(vars)); + opBuilder.addInput(newFormatKey.asOutput()); + opBuilder.addInput(formatStateVar.asOutput()); + return new TPUReshardVariables(opBuilder.build()); + } + + @OpInputsMetadata( + outputsClass = TPUReshardVariables.class + ) + public static class Inputs extends RawOpInputs { + /** + * 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 507d13eab75..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,59 +17,90 @@ 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; /** * 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. */ +@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 + */ + public static final String OP_NAME = "WorkerHeartbeat"; + + private Output response; + + public WorkerHeartbeat(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + response = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new WorkerHeartbeat operation. - * + * * @param scope current scope * @param request A string tensor containing a serialized WorkerHeartbeatRequest * @return a new instance of WorkerHeartbeat */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static WorkerHeartbeat create(Scope scope, Operand request) { - OperationBuilder opBuilder = scope.env().opBuilder("WorkerHeartbeat", scope.makeOpName("WorkerHeartbeat")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "WorkerHeartbeat"); opBuilder.addInput(request.asOutput()); - opBuilder = scope.apply(opBuilder); return new WorkerHeartbeat(opBuilder.build()); } - + /** + * Gets response. * A string tensor containing a serialized WorkerHeartbeatResponse + * @return response. */ public Output response() { return response; } - + @Override public Output asOutput() { return response; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "WorkerHeartbeat"; - - private Output response; - - private WorkerHeartbeat(Operation operation) { - super(operation); - int outputIdx = 0; - response = operation.output(outputIdx++); + + @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 ee5fe7db4b5..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,48 +17,97 @@ 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; /** * Applies a gradient to a given accumulator. - *

* Does not add if local_step is lesser than the accumulator's global_step. */ -@Operator(group = "train") +@OpMetadata( + opType = AccumulatorApplyGradient.OP_NAME, + inputsClass = AccumulatorApplyGradient.Inputs.class +) +@Operator( + group = "train" +) public final class AccumulatorApplyGradient extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AccumulatorApplyGradient"; + + public AccumulatorApplyGradient(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new AccumulatorApplyGradient operation. - * + * * @param scope current scope * @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 AccumulatorApplyGradient */ - @Endpoint(describeByClass = true) - public static AccumulatorApplyGradient create(Scope scope, Operand handle, Operand localStep, Operand gradient) { - OperationBuilder opBuilder = scope.env().opBuilder("AccumulatorApplyGradient", scope.makeOpName("AccumulatorApplyGradient")); + @Endpoint( + describeByClass = true + ) + public static AccumulatorApplyGradient create(Scope scope, Operand handle, + Operand localStep, Operand gradient) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AccumulatorApplyGradient"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(localStep.asOutput()); opBuilder.addInput(gradient.asOutput()); - opBuilder = scope.apply(opBuilder); return new AccumulatorApplyGradient(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AccumulatorApplyGradient"; - - private AccumulatorApplyGradient(Operation operation) { - super(operation); + + @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 400f8951523..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,44 +36,70 @@ /** * Returns the number of gradients aggregated in the given accumulators. */ -@Operator(group = "train") +@OpMetadata( + opType = AccumulatorNumAccumulated.OP_NAME, + inputsClass = AccumulatorNumAccumulated.Inputs.class +) +@Operator( + group = "train" +) public final class AccumulatorNumAccumulated extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AccumulatorNumAccumulated"; + + private Output numAccumulated; + + public AccumulatorNumAccumulated(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + numAccumulated = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new AccumulatorNumAccumulated operation. - * + * * @param scope current scope * @param handle The handle to an accumulator. * @return a new instance of AccumulatorNumAccumulated */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static AccumulatorNumAccumulated create(Scope scope, Operand handle) { - OperationBuilder opBuilder = scope.env().opBuilder("AccumulatorNumAccumulated", scope.makeOpName("AccumulatorNumAccumulated")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AccumulatorNumAccumulated"); opBuilder.addInput(handle.asOutput()); - opBuilder = scope.apply(opBuilder); return new AccumulatorNumAccumulated(opBuilder.build()); } - + /** + * Gets numAccumulated. * The number of gradients aggregated in the given accumulator. + * @return numAccumulated. */ public Output numAccumulated() { return numAccumulated; } - + @Override public Output asOutput() { return numAccumulated; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AccumulatorNumAccumulated"; - - private Output numAccumulated; - - private AccumulatorNumAccumulated(Operation operation) { - super(operation); - int outputIdx = 0; - numAccumulated = operation.output(outputIdx++); + + @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 3b4cd9c093b..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,46 +17,81 @@ 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; /** * Updates the accumulator with a new value for global_step. - *

* Logs warning if the accumulator's value is already higher than * new_global_step. */ -@Operator(group = "train") +@OpMetadata( + opType = AccumulatorSetGlobalStep.OP_NAME, + inputsClass = AccumulatorSetGlobalStep.Inputs.class +) +@Operator( + group = "train" +) public final class AccumulatorSetGlobalStep extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AccumulatorSetGlobalStep"; + + public AccumulatorSetGlobalStep(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new AccumulatorSetGlobalStep operation. - * + * * @param scope current scope * @param handle The handle to an accumulator. * @param newGlobalStep The new global_step value to set. * @return a new instance of AccumulatorSetGlobalStep */ - @Endpoint(describeByClass = true) - public static AccumulatorSetGlobalStep create(Scope scope, Operand handle, Operand newGlobalStep) { - OperationBuilder opBuilder = scope.env().opBuilder("AccumulatorSetGlobalStep", scope.makeOpName("AccumulatorSetGlobalStep")); + @Endpoint( + describeByClass = true + ) + public static AccumulatorSetGlobalStep create(Scope scope, Operand handle, + Operand newGlobalStep) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AccumulatorSetGlobalStep"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(newGlobalStep.asOutput()); - opBuilder = scope.apply(opBuilder); return new AccumulatorSetGlobalStep(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AccumulatorSetGlobalStep"; - - private AccumulatorSetGlobalStep(Operation operation) { - super(operation); + + @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 ed8becceee2..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,73 +17,117 @@ 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; /** * 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 data type for {@code average()} output */ -@Operator(group = "train") +@OpMetadata( + opType = AccumulatorTakeGradient.OP_NAME, + inputsClass = AccumulatorTakeGradient.Inputs.class +) +@Operator( + group = "train" +) public final class AccumulatorTakeGradient extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AccumulatorTakeGradient"; + + private Output average; + + public AccumulatorTakeGradient(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + average = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new AccumulatorTakeGradient operation. - * + * * @param scope current scope * @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 AccumulatorTakeGradient} output and operands * @return a new instance of AccumulatorTakeGradient */ - @Endpoint(describeByClass = true) - public static AccumulatorTakeGradient create(Scope scope, Operand handle, Operand numRequired, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("AccumulatorTakeGradient", scope.makeOpName("AccumulatorTakeGradient")); + @Endpoint( + describeByClass = true + ) + public static AccumulatorTakeGradient create(Scope scope, + Operand handle, Operand numRequired, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AccumulatorTakeGradient"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(numRequired.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new AccumulatorTakeGradient(opBuilder.build()); + return new AccumulatorTakeGradient<>(opBuilder.build()); } - + /** + * Gets average. * The average of the accumulated gradients. + * @return average. */ public Output average() { return average; } - + @Override public Output asOutput() { return average; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AccumulatorTakeGradient"; - - private Output average; - - private AccumulatorTakeGradient(Operation operation) { - super(operation); - int outputIdx = 0; - average = operation.output(outputIdx++); + + @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 d44777f59f0..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,51 +17,52 @@ 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 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 data type for {@code out()} output + * 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) */ +@OpMetadata( + opType = ApplyAdaMax.OP_NAME, + inputsClass = ApplyAdaMax.Inputs.class +) +@Operator( + group = "train" +) public final class ApplyAdaMax extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyAdaMax} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ApplyAdaMax"; + + private Output out; + + public ApplyAdaMax(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApplyAdaMax operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param m Should be from a Variable(). @@ -72,12 +73,17 @@ private Options() { * @param beta2 Momentum factor. Must be a scalar. * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyAdaMax} output and operands * @return a new instance of ApplyAdaMax */ - @Endpoint(describeByClass = true) - public static ApplyAdaMax create(Scope scope, Operand var, Operand m, Operand v, Operand beta1Power, Operand lr, Operand beta1, Operand beta2, Operand epsilon, Operand grad, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ApplyAdaMax", scope.makeOpName("ApplyAdaMax")); + @Endpoint( + describeByClass = true + ) + public static ApplyAdaMax create(Scope scope, Operand var, Operand m, + Operand v, Operand beta1Power, Operand lr, Operand beta1, Operand beta2, + Operand epsilon, Operand grad, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ApplyAdaMax"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(m.asOutput()); opBuilder.addInput(v.asOutput()); @@ -87,7 +93,6 @@ public static ApplyAdaMax create(Scope scope, Operand va opBuilder.addInput(beta2.asOutput()); opBuilder.addInput(epsilon.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -95,38 +100,133 @@ public static ApplyAdaMax create(Scope scope, Operand va } } } - return new ApplyAdaMax(opBuilder.build()); + return new ApplyAdaMax<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, m, and v tensors will be protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyAdaMax"; - - private Output out; - - private ApplyAdaMax(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyAdaMax} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 b780e2040da..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,52 +17,53 @@ 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 adadelta scheme. - *

* accum = rho() * accum + (1 - rho()) * grad.square(); * 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 */ -@Operator(group = "train") +@OpMetadata( + opType = ApplyAdadelta.OP_NAME, + inputsClass = ApplyAdadelta.Inputs.class +) +@Operator( + group = "train" +) public final class ApplyAdadelta extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyAdadelta} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ApplyAdadelta"; + + private Output out; + + public ApplyAdadelta(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApplyAdadelta operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -71,12 +72,17 @@ private Options() { * @param rho Decay factor. Must be a scalar. * @param epsilon Constant factor. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyAdadelta} output and operands * @return a new instance of ApplyAdadelta */ - @Endpoint(describeByClass = true) - public static ApplyAdadelta create(Scope scope, Operand var, Operand accum, Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, Operand grad, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ApplyAdadelta", scope.makeOpName("ApplyAdadelta")); + @Endpoint( + describeByClass = true + ) + public static ApplyAdadelta create(Scope scope, Operand var, + Operand accum, Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, + Operand grad, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ApplyAdadelta"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(accumUpdate.asOutput()); @@ -84,7 +90,6 @@ public static ApplyAdadelta create(Scope scope, Operand opBuilder.addInput(rho.asOutput()); opBuilder.addInput(epsilon.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -92,37 +97,118 @@ public static ApplyAdadelta create(Scope scope, Operand } } } - return new ApplyAdadelta(opBuilder.build()); + return new ApplyAdadelta<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyAdadelta"; - - private Output out; - - private ApplyAdadelta(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyAdadelta} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 e519957a71d..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,76 +17,70 @@ 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 */ -@Operator(group = "train") +@OpMetadata( + opType = ApplyAdagrad.OP_NAME, + inputsClass = ApplyAdagrad.Inputs.class +) +@Operator( + group = "train" +) public final class ApplyAdagrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyAdagrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param updateSlots - */ - public Options updateSlots(Boolean updateSlots) { - this.updateSlots = updateSlots; - return this; - } - - private Boolean useLocking; - private Boolean updateSlots; - - private Options() { - } + public static final String OP_NAME = "ApplyAdagrad"; + + private Output out; + + public ApplyAdagrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApplyAdagrad operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyAdagrad} output and operands * @return a new instance of ApplyAdagrad */ - @Endpoint(describeByClass = true) - public static ApplyAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ApplyAdagrad", scope.makeOpName("ApplyAdagrad")); + @Endpoint( + describeByClass = true + ) + public static ApplyAdagrad create(Scope scope, Operand var, + Operand accum, Operand lr, Operand grad, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ApplyAdagrad"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(lr.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -97,45 +91,132 @@ public static ApplyAdagrad create(Scope scope, Operand v } } } - return new ApplyAdagrad(opBuilder.build()); + return new ApplyAdagrad<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param updateSlots + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. */ public static Options updateSlots(Boolean updateSlots) { return new Options().updateSlots(updateSlots); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyAdagrad"; - - private Output out; - - private ApplyAdagrad(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyAdagrad} + */ + public static class Options { + private Boolean useLocking; + + private Boolean updateSlots; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. + */ + public Options updateSlots(Boolean updateSlots) { + this.updateSlots = 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 815c64c23f8..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,48 +17,50 @@ 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 */ -@Operator(group = "train") +@OpMetadata( + opType = ApplyAdagradDa.OP_NAME, + inputsClass = ApplyAdagradDa.Inputs.class +) +@Operator( + group = "train" +) public final class ApplyAdagradDa extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyAdagradDa} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ApplyAdagradDA"; + + private Output out; + + public ApplyAdagradDa(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ApplyAdagradDa operation. - * + * Factory method to create a class wrapping a new ApplyAdagradDA operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param gradientAccumulator Should be from a Variable(). @@ -68,12 +70,17 @@ private Options() { * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 regularization. Must be a scalar. * @param globalStep Training step number. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyAdagradDA} output and operands * @return a new instance of ApplyAdagradDa */ - @Endpoint(describeByClass = true) - public static ApplyAdagradDa create(Scope scope, Operand var, Operand gradientAccumulator, Operand gradientSquaredAccumulator, Operand grad, Operand lr, Operand l1, Operand l2, Operand globalStep, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ApplyAdagradDA", scope.makeOpName("ApplyAdagradDa")); + @Endpoint( + describeByClass = true + ) + public static ApplyAdagradDa create(Scope scope, Operand var, + Operand gradientAccumulator, Operand gradientSquaredAccumulator, Operand grad, + Operand lr, Operand l1, Operand l2, Operand globalStep, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ApplyAdagradDa"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(gradientAccumulator.asOutput()); opBuilder.addInput(gradientSquaredAccumulator.asOutput()); @@ -82,7 +89,6 @@ public static ApplyAdagradDa create(Scope scope, Operand opBuilder.addInput(l1.asOutput()); opBuilder.addInput(l2.asOutput()); opBuilder.addInput(globalStep.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -90,37 +96,124 @@ public static ApplyAdagradDa create(Scope scope, Operand } } } - return new ApplyAdagradDa(opBuilder.build()); + return new ApplyAdagradDa<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyAdagradDA"; - - private Output out; - - private ApplyAdagradDa(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyAdagradDa} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 b74a36ef265..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,77 +17,72 @@ 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 { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyAdagradV2} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param updateSlots - */ - public Options updateSlots(Boolean updateSlots) { - this.updateSlots = updateSlots; - return this; - } - - private Boolean useLocking; - private Boolean updateSlots; - - private Options() { - } + public static final String OP_NAME = "ApplyAdagradV2"; + + private Output out; + + public ApplyAdagradV2(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApplyAdagradV2 operation. - * + * * @param scope current scope * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyAdagradV2} output and operands * @return a new instance of ApplyAdagradV2 */ - @Endpoint(describeByClass = true) - public static ApplyAdagradV2 create(Scope scope, Operand var, Operand accum, Operand lr, Operand epsilon, Operand grad, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ApplyAdagradV2", scope.makeOpName("ApplyAdagradV2")); + @Endpoint( + describeByClass = true + ) + public static ApplyAdagradV2 create(Scope scope, Operand var, + Operand accum, Operand lr, Operand epsilon, Operand grad, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ApplyAdagradV2"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(lr.asOutput()); opBuilder.addInput(epsilon.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -98,45 +93,138 @@ public static ApplyAdagradV2 create(Scope scope, Operand } } } - return new ApplyAdagradV2(opBuilder.build()); + return new ApplyAdagradV2<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param updateSlots + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. */ public static Options updateSlots(Boolean updateSlots) { return new Options().updateSlots(updateSlots); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyAdagradV2"; - - private Output out; - - private ApplyAdagradV2(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyAdagradV2} + */ + public static class Options { + private Boolean useLocking; + + private Boolean updateSlots; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. + */ + public Options updateSlots(Boolean updateSlots) { + this.updateSlots = 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 ce33080b7a1..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,62 +17,53 @@ 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}$$ */ -@Operator(group = "train") +@OpMetadata( + opType = ApplyAdam.OP_NAME, + inputsClass = ApplyAdam.Inputs.class +) +@Operator( + group = "train" +) public final class ApplyAdam extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyAdam} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param useNesterov If `True`, uses the nesterov update. - */ - public Options useNesterov(Boolean useNesterov) { - this.useNesterov = useNesterov; - return this; - } - - private Boolean useLocking; - private Boolean useNesterov; - - private Options() { - } + public static final String OP_NAME = "ApplyAdam"; + + private Output out; + + public ApplyAdam(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApplyAdam operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param m Should be from a Variable(). @@ -84,12 +75,17 @@ private Options() { * @param beta2 Momentum factor. Must be a scalar. * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyAdam} output and operands * @return a new instance of ApplyAdam */ - @Endpoint(describeByClass = true) - public static ApplyAdam create(Scope scope, Operand var, Operand m, Operand v, Operand beta1Power, Operand beta2Power, Operand lr, Operand beta1, Operand beta2, Operand epsilon, Operand grad, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ApplyAdam", scope.makeOpName("ApplyAdam")); + @Endpoint( + describeByClass = true + ) + public static ApplyAdam create(Scope scope, Operand var, Operand m, + Operand v, Operand beta1Power, Operand beta2Power, Operand lr, Operand beta1, + Operand beta2, Operand epsilon, Operand grad, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ApplyAdam"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(m.asOutput()); opBuilder.addInput(v.asOutput()); @@ -100,7 +96,6 @@ public static ApplyAdam create(Scope scope, Operand var, opBuilder.addInput(beta2.asOutput()); opBuilder.addInput(epsilon.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -111,45 +106,168 @@ public static ApplyAdam create(Scope scope, Operand var, } } } - return new ApplyAdam(opBuilder.build()); + return new ApplyAdam<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, m, and v tensors will be protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param useNesterov If `True`, uses the nesterov update. + * Sets the useNesterov option. + * + * @param useNesterov If {@code True}, uses the nesterov update. + * @return this Options instance. */ public static Options useNesterov(Boolean useNesterov) { return new Options().useNesterov(useNesterov); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyAdam"; - - private Output out; - - private ApplyAdam(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyAdam} + */ + public static class Options { + private Boolean useLocking; + + private Boolean useNesterov; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the useNesterov option. + * + * @param useNesterov If {@code True}, uses the nesterov update. + * @return this Options instance. + */ + public Options useNesterov(Boolean useNesterov) { + this.useNesterov = 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 9d86187da98..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,52 +17,52 @@ 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 AddSign update. - *

- * 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 + * m_t <- beta1 * m_{t-1} + (1 - beta1) * g + * update <- (alpha + sign_decay * sign(g) *sign(m)) * g + * variable <- variable - lr_t * update */ -@Operator(group = "train") +@OpMetadata( + opType = ApplyAddSign.OP_NAME, + inputsClass = ApplyAddSign.Inputs.class +) +@Operator( + group = "train" +) public final class ApplyAddSign extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyAddSign} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and m tensors is - * protected by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ApplyAddSign"; + + private Output out; + + public ApplyAddSign(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApplyAddSign operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param m Should be from a Variable(). @@ -71,12 +71,17 @@ private Options() { * @param signDecay Must be a scalar. * @param beta Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyAddSign} output and operands * @return a new instance of ApplyAddSign */ - @Endpoint(describeByClass = true) - public static ApplyAddSign create(Scope scope, Operand var, Operand m, Operand lr, Operand alpha, Operand signDecay, Operand beta, Operand grad, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ApplyAddSign", scope.makeOpName("ApplyAddSign")); + @Endpoint( + describeByClass = true + ) + public static ApplyAddSign create(Scope scope, Operand var, Operand m, + Operand lr, Operand alpha, Operand signDecay, Operand beta, Operand grad, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ApplyAddSign"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(m.asOutput()); opBuilder.addInput(lr.asOutput()); @@ -84,7 +89,6 @@ public static ApplyAddSign create(Scope scope, Operand v opBuilder.addInput(signDecay.asOutput()); opBuilder.addInput(beta.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -92,38 +96,121 @@ public static ApplyAddSign create(Scope scope, Operand v } } } - return new ApplyAddSign(opBuilder.build()); + return new ApplyAddSign<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and m tensors is + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyAddSign"; - - private Output out; - - private ApplyAddSign(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyAddSign} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 a56382a9044..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,67 +17,63 @@ 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 centered RMSProp algorithm. - *

* The centered RMSProp algorithm uses an estimate of the centered second moment * (i.e., the variance) for normalization, as opposed to regular RMSProp, which * uses the (uncentered) second moment. This often helps with training, but is * slightly more expensive in terms of computation and memory. - *

- * Note that in dense implementation of this algorithm, mg, ms, and mom will + *

Note that in dense implementation of this algorithm, mg, ms, and mom will * update even if the grad is zero, but in this sparse implementation, mg, ms, * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * mean_grad = decay * mean_grad + (1-decay) * gradient - *

- * Delta = learning_rate * gradient / sqrt(mean_square + epsilon - mean_grad ** 2) - *

- * mg <- rho * mg_{t-1} + (1-rho) * grad - * 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 + *

Delta = learning_rate * gradient / sqrt(mean_square + epsilon - mean_grad ** 2) + *

mg <- rho * mg_{t-1} + (1-rho) * grad + * ms <- rho * ms_{t-1} + (1-rho) * grad * grad + * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms - mg * mg + epsilon) + * var <- var - mom */ -@Operator(group = "train") +@OpMetadata( + opType = ApplyCenteredRmsProp.OP_NAME, + inputsClass = ApplyCenteredRmsProp.Inputs.class +) +@Operator( + group = "train" +) public final class ApplyCenteredRmsProp extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyCenteredRmsProp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ApplyCenteredRMSProp"; + + private Output out; + + public ApplyCenteredRmsProp(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ApplyCenteredRmsProp operation. - * + * Factory method to create a class wrapping a new ApplyCenteredRMSProp operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param mg Should be from a Variable(). @@ -88,12 +84,17 @@ private Options() { * @param momentum Momentum Scale. Must be a scalar. * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyCenteredRMSProp} output and operands * @return a new instance of ApplyCenteredRmsProp */ - @Endpoint(describeByClass = true) - public static ApplyCenteredRmsProp create(Scope scope, Operand var, Operand mg, Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ApplyCenteredRMSProp", scope.makeOpName("ApplyCenteredRmsProp")); + @Endpoint( + describeByClass = true + ) + public static ApplyCenteredRmsProp create(Scope scope, Operand var, + Operand mg, Operand ms, Operand mom, Operand lr, Operand rho, + Operand momentum, Operand epsilon, Operand grad, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ApplyCenteredRmsProp"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(mg.asOutput()); opBuilder.addInput(ms.asOutput()); @@ -103,7 +104,6 @@ public static ApplyCenteredRmsProp create(Scope scope, Oper opBuilder.addInput(momentum.asOutput()); opBuilder.addInput(epsilon.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -111,38 +111,133 @@ public static ApplyCenteredRmsProp create(Scope scope, Oper } } } - return new ApplyCenteredRmsProp(opBuilder.build()); + return new ApplyCenteredRmsProp<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, mg, ms, and mom tensors is + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyCenteredRMSProp"; - - private Output out; - - private ApplyCenteredRmsProp(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyCenteredRmsProp} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 71b3488d323..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,65 +17,56 @@ 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 Ftrl-proximal scheme. - *

* grad_with_shrinkage = grad + 2 * l2_shrinkage * var * accum_new = accum + grad * grad * linear += grad_with_shrinkage - - * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var + * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var * quadratic = 1.0 / (accum_new^(lr_power) * lr) + 2 * l2 - * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 + * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 * accum = accum_new - * - * @param data type for {@code out()} output */ -@Operator(group = "train") +@OpMetadata( + opType = ApplyFtrl.OP_NAME, + inputsClass = ApplyFtrl.Inputs.class +) +@Operator( + group = "train" +) public final class ApplyFtrl extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyFtrl} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param multiplyLinearByLr - */ - public Options multiplyLinearByLr(Boolean multiplyLinearByLr) { - this.multiplyLinearByLr = multiplyLinearByLr; - return this; - } - - private Boolean useLocking; - private Boolean multiplyLinearByLr; - - private Options() { - } + public static final String OP_NAME = "ApplyFtrlV2"; + + private Output out; + + public ApplyFtrl(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ApplyFtrl operation. - * + * Factory method to create a class wrapping a new ApplyFtrlV2 operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -84,14 +75,19 @@ private Options() { * @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 + * @param l2Shrinkage The l2Shrinkage value * @param lrPower Scaling factor. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyFtrlV2} output and operands * @return a new instance of ApplyFtrl */ - @Endpoint(describeByClass = true) - public static ApplyFtrl create(Scope scope, Operand var, Operand accum, Operand linear, Operand grad, Operand lr, Operand l1, Operand l2, Operand l2Shrinkage, Operand lrPower, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ApplyFtrlV2", scope.makeOpName("ApplyFtrl")); + @Endpoint( + describeByClass = true + ) + public static ApplyFtrl create(Scope scope, Operand var, Operand accum, + Operand linear, Operand grad, Operand lr, Operand l1, Operand l2, + Operand l2Shrinkage, Operand lrPower, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ApplyFtrl"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(linear.asOutput()); @@ -101,7 +97,6 @@ public static ApplyFtrl create(Scope scope, Operand var, opBuilder.addInput(l2.asOutput()); opBuilder.addInput(l2Shrinkage.asOutput()); opBuilder.addInput(lrPower.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -112,45 +107,162 @@ public static ApplyFtrl create(Scope scope, Operand var, } } } - return new ApplyFtrl(opBuilder.build()); + return new ApplyFtrl<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param multiplyLinearByLr + * Sets the multiplyLinearByLr option. + * + * @param multiplyLinearByLr the multiplyLinearByLr option + * @return this Options instance. */ public static Options multiplyLinearByLr(Boolean multiplyLinearByLr) { return new Options().multiplyLinearByLr(multiplyLinearByLr); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyFtrlV2"; - - private Output out; - - private ApplyFtrl(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyFtrl} + */ + public static class Options { + private Boolean useLocking; + + private Boolean multiplyLinearByLr; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the multiplyLinearByLr option. + * + * @param multiplyLinearByLr the multiplyLinearByLr option + * @return this Options instance. + */ + public Options multiplyLinearByLr(Boolean multiplyLinearByLr) { + this.multiplyLinearByLr = 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 049ec73a76d..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,61 +17,66 @@ 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 */ -@Operator(group = "train") +@OpMetadata( + opType = ApplyGradientDescent.OP_NAME, + inputsClass = ApplyGradientDescent.Inputs.class +) +@Operator( + group = "train" +) public final class ApplyGradientDescent extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyGradientDescent} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, the subtraction will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ApplyGradientDescent"; + + private Output out; + + public ApplyGradientDescent(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApplyGradientDescent operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param alpha Scaling factor. Must be a scalar. * @param delta The change. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyGradientDescent} output and operands * @return a new instance of ApplyGradientDescent */ - @Endpoint(describeByClass = true) - public static ApplyGradientDescent create(Scope scope, Operand var, Operand alpha, Operand delta, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ApplyGradientDescent", scope.makeOpName("ApplyGradientDescent")); + @Endpoint( + describeByClass = true + ) + public static ApplyGradientDescent create(Scope scope, Operand var, + Operand alpha, Operand delta, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ApplyGradientDescent"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(alpha.asOutput()); opBuilder.addInput(delta.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -79,37 +84,94 @@ public static ApplyGradientDescent create(Scope scope, Oper } } } - return new ApplyGradientDescent(opBuilder.build()); + return new ApplyGradientDescent<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, the subtraction will be protected by a lock; + * Sets the useLocking option. + * + * @param useLocking If {@code True}, the subtraction will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyGradientDescent"; - - private Output out; - - private ApplyGradientDescent(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyGradientDescent} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 320edadbfb0..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,82 +17,73 @@ 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 momentum scheme. - *

* Set use_nesterov = True if you want to use Nesterov momentum. - *

- * accum = accum * momentum + grad + *

accum = accum * momentum + grad * var -= lr * accum - * - * @param data type for {@code out()} output */ -@Operator(group = "train") +@OpMetadata( + opType = ApplyMomentum.OP_NAME, + inputsClass = ApplyMomentum.Inputs.class +) +@Operator( + group = "train" +) public final class ApplyMomentum extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyMomentum} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param useNesterov If `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 Options useNesterov(Boolean useNesterov) { - this.useNesterov = useNesterov; - return this; - } - - private Boolean useLocking; - private Boolean useNesterov; - - private Options() { - } + public static final String OP_NAME = "ApplyMomentum"; + + private Output out; + + public ApplyMomentum(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApplyMomentum operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param grad The gradient. * @param momentum Momentum. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyMomentum} output and operands * @return a new instance of ApplyMomentum */ - @Endpoint(describeByClass = true) - public static ApplyMomentum create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand momentum, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ApplyMomentum", scope.makeOpName("ApplyMomentum")); + @Endpoint( + describeByClass = true + ) + public static ApplyMomentum create(Scope scope, Operand var, + Operand accum, Operand lr, Operand grad, Operand momentum, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ApplyMomentum"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(lr.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(momentum.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -103,47 +94,144 @@ public static ApplyMomentum create(Scope scope, Operand } } } - return new ApplyMomentum(opBuilder.build()); + return new ApplyMomentum<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param useNesterov If `True`, the tensor passed to compute grad will be + * Sets the useNesterov option. + * + * @param useNesterov 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. + * @return this Options instance. */ public static Options useNesterov(Boolean useNesterov) { return new Options().useNesterov(useNesterov); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyMomentum"; - - private Output out; - - private ApplyMomentum(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyMomentum} + */ + public static class Options { + private Boolean useLocking; + + private Boolean useNesterov; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the useNesterov option. + * + * @param useNesterov 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. + * @return this Options instance. + */ + public Options useNesterov(Boolean useNesterov) { + this.useNesterov = 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 bea7429ed04..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,52 +17,52 @@ 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 AddSign update. - *

- * 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 + * 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 */ -@Operator(group = "train") +@OpMetadata( + opType = ApplyPowerSign.OP_NAME, + inputsClass = ApplyPowerSign.Inputs.class +) +@Operator( + group = "train" +) public final class ApplyPowerSign extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyPowerSign} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and m tensors is - * protected by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ApplyPowerSign"; + + private Output out; + + public ApplyPowerSign(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApplyPowerSign operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param m Should be from a Variable(). @@ -71,12 +71,17 @@ private Options() { * @param signDecay Must be a scalar. * @param beta Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyPowerSign} output and operands * @return a new instance of ApplyPowerSign */ - @Endpoint(describeByClass = true) - public static ApplyPowerSign create(Scope scope, Operand var, Operand m, Operand lr, Operand logbase, Operand signDecay, Operand beta, Operand grad, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ApplyPowerSign", scope.makeOpName("ApplyPowerSign")); + @Endpoint( + describeByClass = true + ) + public static ApplyPowerSign create(Scope scope, Operand var, + Operand m, Operand lr, Operand logbase, Operand signDecay, Operand beta, + Operand grad, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ApplyPowerSign"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(m.asOutput()); opBuilder.addInput(lr.asOutput()); @@ -84,7 +89,6 @@ public static ApplyPowerSign create(Scope scope, Operand opBuilder.addInput(signDecay.asOutput()); opBuilder.addInput(beta.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -92,38 +96,121 @@ public static ApplyPowerSign create(Scope scope, Operand } } } - return new ApplyPowerSign(opBuilder.build()); + return new ApplyPowerSign<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and m tensors is + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyPowerSign"; - - private Output out; - - private ApplyPowerSign(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyPowerSign} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 da570a57223..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,51 +17,52 @@ 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' and '*accum' according to FOBOS with Adagrad learning rate. - *

- * 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 + * accum += grad * grad + * prox_v = var - lr * grad * (1 / sqrt(accum)) + * var = sign(prox_v)/(1+lrl2) * max{|prox_v|-lrl1,0} */ -@Operator(group = "train") +@OpMetadata( + opType = ApplyProximalAdagrad.OP_NAME, + inputsClass = ApplyProximalAdagrad.Inputs.class +) +@Operator( + group = "train" +) public final class ApplyProximalAdagrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyProximalAdagrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ApplyProximalAdagrad"; + + private Output out; + + public ApplyProximalAdagrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApplyProximalAdagrad operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -69,19 +70,23 @@ private Options() { * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 regularization. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyProximalAdagrad} output and operands * @return a new instance of ApplyProximalAdagrad */ - @Endpoint(describeByClass = true) - public static ApplyProximalAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand l1, Operand l2, Operand grad, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ApplyProximalAdagrad", scope.makeOpName("ApplyProximalAdagrad")); + @Endpoint( + describeByClass = true + ) + public static ApplyProximalAdagrad create(Scope scope, Operand var, + Operand accum, Operand lr, Operand l1, Operand l2, Operand grad, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ApplyProximalAdagrad"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(lr.asOutput()); opBuilder.addInput(l1.asOutput()); opBuilder.addInput(l2.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -89,37 +94,112 @@ public static ApplyProximalAdagrad create(Scope scope, Oper } } } - return new ApplyProximalAdagrad(opBuilder.build()); + return new ApplyProximalAdagrad<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyProximalAdagrad"; - - private Output out; - - private ApplyProximalAdagrad(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyProximalAdagrad} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 12ea6d3a84a..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,68 +17,73 @@ 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 + * prox_v = var - alpha * delta + * var = sign(prox_v)/(1+alphal2) * max{|prox_v|-alphal1,0} */ -@Operator(group = "train") +@OpMetadata( + opType = ApplyProximalGradientDescent.OP_NAME, + inputsClass = ApplyProximalGradientDescent.Inputs.class +) +@Operator( + group = "train" +) public final class ApplyProximalGradientDescent extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyProximalGradientDescent} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the subtraction will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ApplyProximalGradientDescent"; + + private Output out; + + public ApplyProximalGradientDescent(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApplyProximalGradientDescent operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param alpha Scaling factor. Must be a scalar. * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 regularization. Must be a scalar. * @param delta The change. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyProximalGradientDescent} output and operands * @return a new instance of ApplyProximalGradientDescent */ - @Endpoint(describeByClass = true) - public static ApplyProximalGradientDescent create(Scope scope, Operand var, Operand alpha, Operand l1, Operand l2, Operand delta, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ApplyProximalGradientDescent", scope.makeOpName("ApplyProximalGradientDescent")); + @Endpoint( + describeByClass = true + ) + public static ApplyProximalGradientDescent create(Scope scope, + Operand var, Operand alpha, Operand l1, Operand l2, Operand delta, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ApplyProximalGradientDescent"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(alpha.asOutput()); opBuilder.addInput(l1.asOutput()); opBuilder.addInput(l2.asOutput()); opBuilder.addInput(delta.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -86,37 +91,106 @@ public static ApplyProximalGradientDescent create(Scope sco } } } - return new ApplyProximalGradientDescent(opBuilder.build()); + return new ApplyProximalGradientDescent<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the subtraction will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyProximalGradientDescent"; - - private Output out; - - private ApplyProximalGradientDescent(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyProximalGradientDescent} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 df9be3f00d5..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,74 +17,77 @@ 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 RMSProp algorithm. - *

* Note that in dense implementation of this algorithm, ms and mom will * update even if the grad is zero, but in this sparse implementation, ms * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * Delta = learning_rate * gradient / sqrt(mean_square + epsilon) - *

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

ms <- rho * ms_{t-1} + (1-rho) * grad * grad + * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) + * var <- var - mom */ -@Operator(group = "train") +@OpMetadata( + opType = ApplyRmsProp.OP_NAME, + inputsClass = ApplyRmsProp.Inputs.class +) +@Operator( + group = "train" +) public final class ApplyRmsProp extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyRmsProp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ApplyRMSProp"; + + private Output out; + + public ApplyRmsProp(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ApplyRmsProp operation. - * + * Factory method to create a class wrapping a new ApplyRMSProp operation. + * * @param scope current scope * @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 + * @param momentum The momentum value * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyRMSProp} output and operands * @return a new instance of ApplyRmsProp */ - @Endpoint(describeByClass = true) - public static ApplyRmsProp create(Scope scope, Operand var, Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ApplyRMSProp", scope.makeOpName("ApplyRmsProp")); + @Endpoint( + describeByClass = true + ) + public static ApplyRmsProp create(Scope scope, Operand var, Operand ms, + Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, + Operand grad, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ApplyRmsProp"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(ms.asOutput()); opBuilder.addInput(mom.asOutput()); @@ -93,7 +96,6 @@ public static ApplyRmsProp create(Scope scope, Operand v opBuilder.addInput(momentum.asOutput()); opBuilder.addInput(epsilon.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -101,38 +103,127 @@ public static ApplyRmsProp create(Scope scope, Operand v } } } - return new ApplyRmsProp(opBuilder.build()); + return new ApplyRmsProp<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, ms, and mom tensors is protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyRMSProp"; - - private Output out; - - private ApplyRmsProp(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyRmsProp} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 87a25fa3ff4..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,91 +17,87 @@ 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; /** * Multiplies slices of two tensors in batches. - *

- * Multiplies all slices of `Tensor` `x` and `y` (each slice can be + * Multiplies all slices of {@code Tensor} {@code x} and {@code y} (each slice can be * viewed as an element of a batch), and arranges the individual results * in a single output tensor of the same batch size. Each of the * individual slices can optionally be adjointed (to adjoint a matrix * means to transpose and conjugate it) before multiplication by setting - * the `adj_x` or `adj_y` flag to `True`, which are by default `False`. - *

- * The input tensors `x` and `y` are 2-D or higher with shape `[..., r_x, c_x]` - * and `[..., r_y, c_y]`. - *

- * The output tensor is 2-D or higher with shape `[..., r_o, c_o]`, where: - *

- * r_o = c_x if adj_x else r_x - * c_o = r_y if adj_y else c_y - *

- * It is computed as: - *

- * output[..., :, :] = matrix(x[..., :, :]) * matrix(y[..., :, :]) - *

- * NOTE: `train.BatchMatMul` supports broadcasting in the batch dimensions. More + * the {@code adj_x} or {@code adj_y} flag to {@code True}, which are by default {@code False}. + *

The input tensors {@code x} and {@code y} are 2-D or higher with shape {@code [..., r_x, c_x]} + * and {@code [..., r_y, c_y]}. + *

The output tensor is 2-D or higher with shape {@code [..., r_o, c_o]}, where: + *

+ * r_o = c_x if adj_x else r_x
+ * c_o = r_y if adj_y else c_y
+ * 
+ *

It is computed as: + *

+ * output[..., :, :] = matrix(x[..., :, :]) * matrix(y[..., :, :])
+ * 
+ *

NOTE: {@code train.BatchMatMul} supports broadcasting in the batch dimensions. More * about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html). - * - * - * @param data type for {@code output()} output + * here . */ -@Operator(group = "train") -public final class BatchMatMul extends RawOp implements Operand { - +@OpMetadata( + opType = BatchMatMul.OP_NAME, + inputsClass = BatchMatMul.Inputs.class +) +@Operator( + group = "train" +) +public final class BatchMatMul extends RawOp implements Operand { /** - * Optional attributes for {@link org.tensorflow.op.train.BatchMatMul} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param adjX If `True`, adjoint the slices of `x`. Defaults to `False`. - */ - public Options adjX(Boolean adjX) { - this.adjX = adjX; - return this; - } - - /** - * @param adjY If `True`, adjoint the slices of `y`. Defaults to `False`. - */ - public Options adjY(Boolean adjY) { - this.adjY = adjY; - return this; - } - - private Boolean adjX; - private Boolean adjY; - - private Options() { - } + public static final String OP_NAME = "BatchMatMulV3"; + + private Output output; + + public BatchMatMul(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new BatchMatMul operation. - * + * Factory method to create a class wrapping a new BatchMatMulV3 operation. + * * @param scope current scope - * @param x 2-D or higher with shape `[..., r_x, c_x]`. - * @param y 2-D or higher with shape `[..., r_y, c_y]`. - * @param options carries optional attributes values + * @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. + * @param options carries optional attribute values + * @param data type for {@code BatchMatMulV3} output and operands * @return a new instance of BatchMatMul */ - @Endpoint(describeByClass = true) - public static BatchMatMul create(Scope scope, Operand x, Operand y, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("BatchMatMulV2", scope.makeOpName("BatchMatMul")); + @Endpoint( + describeByClass = true + ) + public static BatchMatMul create(Scope scope, Operand x, + Operand y, Class Tout, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BatchMatMul"); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); - opBuilder = scope.apply(opBuilder); + opBuilder.setAttr("Tout", Operands.toDataType(Tout)); if (options != null) { for (Options opts : options) { if (opts.adjX != null) { @@ -110,45 +106,192 @@ public static BatchMatMul create(Scope scope, Operand x, if (opts.adjY != null) { opBuilder.setAttr("adj_y", opts.adjY); } + if (opts.gradX != null) { + opBuilder.setAttr("grad_x", opts.gradX); + } + if (opts.gradY != null) { + opBuilder.setAttr("grad_y", opts.gradY); + } } } - return new BatchMatMul(opBuilder.build()); + return new BatchMatMul<>(opBuilder.build()); } - + /** - * @param adjX If `True`, adjoint the slices of `x`. Defaults to `False`. + * Sets the adjX option. + * + * @param adjX If {@code True}, adjoint the slices of {@code x}. Defaults to {@code False}. + * @return this Options instance. */ public static Options adjX(Boolean adjX) { return new Options().adjX(adjX); } - + /** - * @param adjY If `True`, adjoint the slices of `y`. Defaults to `False`. + * Sets the adjY option. + * + * @param adjY If {@code True}, adjoint the slices of {@code y}. Defaults to {@code False}. + * @return this Options instance. */ public static Options adjY(Boolean adjY) { return new Options().adjY(adjY); } - + /** - * 3-D or higher with shape `[..., r_o, c_o]` + * Sets the gradX option. + * + * @param gradX the gradX option + * @return this Options instance. */ - public Output output() { + 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]} + * @return output. + */ + public Output output() { return output; } - + @Override - public Output asOutput() { + public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchMatMulV2"; - - private Output output; - - private BatchMatMul(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.BatchMatMul} + */ + public static class Options { + private Boolean adjX; + + private Boolean adjY; + + private Boolean gradX; + + private Boolean gradY; + + private Options() { + } + + /** + * Sets the adjX option. + * + * @param adjX If {@code True}, adjoint the slices of {@code x}. Defaults to {@code False}. + * @return this Options instance. + */ + public Options adjX(Boolean adjX) { + this.adjX = adjX; + return this; + } + + /** + * Sets the adjY option. + * + * @param adjY If {@code True}, adjoint the slices of {@code y}. Defaults to {@code False}. + * @return this Options instance. + */ + 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 fb02d2b47aa..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,55 +17,89 @@ 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 + */ + public static final String OP_NAME = "ComputeBatchSize"; + + private Output batchSize; + + public ComputeBatchSize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + batchSize = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ComputeBatchSize operation. - * + * * @param scope current scope - * @param inputDataset + * @param inputDataset The inputDataset value * @return a new instance of ComputeBatchSize */ - @Endpoint(describeByClass = true) - public static ComputeBatchSize create(Scope scope, Operand inputDataset) { - OperationBuilder opBuilder = scope.env().opBuilder("ComputeBatchSize", scope.makeOpName("ComputeBatchSize")); + @Endpoint( + describeByClass = true + ) + public static ComputeBatchSize create(Scope scope, Operand inputDataset) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ComputeBatchSize"); opBuilder.addInput(inputDataset.asOutput()); - opBuilder = scope.apply(opBuilder); return new ComputeBatchSize(opBuilder.build()); } - + /** + * Gets batchSize. + * + * @return batchSize. */ public Output batchSize() { return batchSize; } - + @Override public Output asOutput() { return batchSize; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ComputeBatchSize"; - - private Output batchSize; - - private ComputeBatchSize(Operation operation) { - super(operation); - int outputIdx = 0; - batchSize = operation.output(outputIdx++); + + @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 684d9e3485e..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,15 +26,18 @@ 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 conditional accumulator for aggregating gradients. - *

* The accumulator accepts gradients marked with local_step greater or * equal to the most recent global_step known to the accumulator. The * average can be extracted from the accumulator, provided sufficient @@ -40,61 +45,43 @@ * resets the aggregate to 0, and increments the global_step recorded by * the accumulator. */ -@Operator(group = "train") +@OpMetadata( + opType = ConditionalAccumulator.OP_NAME, + inputsClass = ConditionalAccumulator.Inputs.class +) +@Operator( + group = "train" +) public final class ConditionalAccumulator extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ConditionalAccumulator} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this accumulator is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this accumulator will be shared under the - * given name across multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param reductionType - */ - public Options reductionType(String reductionType) { - this.reductionType = reductionType; - return this; - } - - private String container; - private String sharedName; - private String reductionType; - - private Options() { - } + public static final String OP_NAME = "ConditionalAccumulator"; + + private Output handle; + + public ConditionalAccumulator(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ConditionalAccumulator operation. - * + * * @param scope current scope * @param dtype The type of the value being accumulated. * @param shape The shape of the values, can be [], in which case shape is unknown. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ConditionalAccumulator} output and operands * @return a new instance of ConditionalAccumulator */ - @Endpoint(describeByClass = true) - public static ConditionalAccumulator create(Scope scope, Class dtype, Shape shape, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ConditionalAccumulator", scope.makeOpName("ConditionalAccumulator")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static ConditionalAccumulator create(Scope scope, Class dtype, + Shape shape, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ConditionalAccumulator"); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); opBuilder.setAttr("shape", shape); if (options != null) { @@ -112,50 +99,141 @@ public static ConditionalAccumulator create(Scope scope, Class } return new ConditionalAccumulator(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this accumulator is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this accumulator will be shared under the * given name across multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * @param reductionType + * Sets the reductionType option. + * + * @param reductionType the reductionType option + * @return this Options instance. */ public static Options reductionType(String reductionType) { return new Options().reductionType(reductionType); } - + /** + * Gets handle. * The handle to the accumulator. + * @return handle. */ public Output handle() { return handle; } - + @Override public Output asOutput() { return handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ConditionalAccumulator"; - - private Output handle; - - private ConditionalAccumulator(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ConditionalAccumulator} + */ + public static class Options { + private String container; + + private String sharedName; + + private String reductionType; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this accumulator is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this accumulator will be shared under the + * given name across multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the reductionType option. + * + * @param reductionType the reductionType option + * @return this Options instance. + */ + public Options reductionType(String reductionType) { + this.reductionType = 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 f5e47b453d0..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; @@ -31,29 +36,24 @@ /** * Given a path to new and old vocabulary files, returns a remapping Tensor of - *

- * length `num_new_vocab`, where `remapping[i]` contains the row number in the old - * vocabulary that corresponds to row `i` in the new vocabulary (starting at line - * `new_vocab_offset` and up to `num_new_vocab` entities), or `-1` if entry `i` + * length {@code num_new_vocab}, where {@code remapping[i]} contains the row number in the old + * vocabulary that corresponds to row {@code i} in the new vocabulary (starting at line + * {@code new_vocab_offset} and up to {@code num_new_vocab} entities), or {@code -1} if entry {@code i} * in the new vocabulary is not in the old vocabulary. The old vocabulary is - * constrained to the first `old_vocab_size` entries if `old_vocab_size` is not the + * constrained to the first {@code old_vocab_size} entries if {@code old_vocab_size} is not the * default value of -1. - *

- * `num_vocab_offset` enables + *

{@code num_vocab_offset} enables * use in the partitioned variable case, and should generally be set through * examining partitioning info. The format of the files should be a text file, * with each line containing a single entity within the vocabulary. - *

- * For example, with `new_vocab_file` a text file containing each of the following - * elements on a single line: `[f0, f1, f2, f3]`, old_vocab_file = [f1, f0, f3], - * `num_new_vocab = 3, new_vocab_offset = 1`, the returned remapping would be - * `[0, -1, 2]`. - *

- * The op also returns a count of how many entries in the new vocabulary + *

For example, with {@code new_vocab_file} a text file containing each of the following + * elements on a single line: {@code [f0, f1, f2, f3]}, old_vocab_file = [f1, f0, f3], + * {@code num_new_vocab = 3, new_vocab_offset = 1}, the returned remapping would be + * {@code [0, -1, 2]}. + *

The op also returns a count of how many entries in the new vocabulary * were present in the old vocabulary, which is used to calculate the number of * values to initialize in a weight matrix remapping - *

- * This functionality can be used to remap both row vocabularies (typically, + *

This functionality can be used to remap both row vocabularies (typically, * features) and column vocabularies (typically, classes) from TensorFlow * checkpoints. Note that the partitioning logic relies on contiguous vocabularies * corresponding to div-partitioned variables. Moreover, the underlying remapping @@ -61,46 +61,49 @@ * use the corresponding index_table_from_file() as the FeatureColumn framework * does (as opposed to tf.feature_to_id(), which uses a CuckooTable). */ -@Operator(group = "train") +@OpMetadata( + opType = GenerateVocabRemapping.OP_NAME, + inputsClass = GenerateVocabRemapping.Inputs.class +) +@Operator( + group = "train" +) public final class GenerateVocabRemapping extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.GenerateVocabRemapping} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param oldVocabSize Number of entries in the old vocab file to consider. If -1, - * use the entire old vocabulary. - */ - public Options oldVocabSize(Long oldVocabSize) { - this.oldVocabSize = oldVocabSize; - return this; - } - - private Long oldVocabSize; - - private Options() { - } + public static final String OP_NAME = "GenerateVocabRemapping"; + + private Output remapping; + + private Output numPresent; + + public GenerateVocabRemapping(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + remapping = operation.output(outputIdx++); + numPresent = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new GenerateVocabRemapping operation. - * + * * @param scope current scope * @param newVocabFile Path to the new vocab file. * @param oldVocabFile Path to the old vocab file. * @param newVocabOffset How many entries into the new vocab file to start reading. * @param numNewVocab Number of entries in the new vocab file to remap. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of GenerateVocabRemapping */ - @Endpoint(describeByClass = true) - public static GenerateVocabRemapping create(Scope scope, Operand newVocabFile, Operand oldVocabFile, Long newVocabOffset, Long numNewVocab, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("GenerateVocabRemapping", scope.makeOpName("GenerateVocabRemapping")); + @Endpoint( + describeByClass = true + ) + public static GenerateVocabRemapping create(Scope scope, Operand newVocabFile, + Operand oldVocabFile, Long newVocabOffset, Long numNewVocab, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GenerateVocabRemapping"); opBuilder.addInput(newVocabFile.asOutput()); opBuilder.addInput(oldVocabFile.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("new_vocab_offset", newVocabOffset); opBuilder.setAttr("num_new_vocab", numNewVocab); if (options != null) { @@ -112,41 +115,98 @@ public static GenerateVocabRemapping create(Scope scope, Operand newVoc } return new GenerateVocabRemapping(opBuilder.build()); } - + /** + * Sets the oldVocabSize option. + * * @param oldVocabSize Number of entries in the old vocab file to consider. If -1, * use the entire old vocabulary. + * @return this Options instance. */ public static Options oldVocabSize(Long oldVocabSize) { return new Options().oldVocabSize(oldVocabSize); } - + /** + * Gets remapping. * A Tensor of length num_new_vocab where the element at index i * is equal to the old ID that maps to the new ID i. This element is -1 for any * new ID that is not found in the old vocabulary. + * @return remapping. */ public Output remapping() { return remapping; } - + /** + * Gets numPresent. * Number of new vocab entries found in old vocab. + * @return numPresent. */ public Output numPresent() { return numPresent; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "GenerateVocabRemapping"; - - private Output remapping; - private Output numPresent; - - private GenerateVocabRemapping(Operation operation) { - super(operation); - int outputIdx = 0; - remapping = operation.output(outputIdx++); - numPresent = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.GenerateVocabRemapping} + */ + public static class Options { + private Long oldVocabSize; + + private Options() { + } + + /** + * Sets the oldVocabSize option. + * + * @param oldVocabSize Number of entries in the old vocab file to consider. If -1, + * use the entire old vocabulary. + * @return this Options instance. + */ + public Options oldVocabSize(Long oldVocabSize) { + this.oldVocabSize = 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 47a71b701ba..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,86 +17,166 @@ 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; /** * V2 format specific: merges the metadata files of sharded checkpoints. The - *

* result is one logical checkpoint, with one physical metadata file and renamed * data files. - *

- * Intended for "grouping" multiple checkpoints in a sharded checkpoint setup. - *

- * If delete_old_dirs is true, attempts to delete recursively the dirname of each + *

Intended for "grouping" multiple checkpoints in a sharded checkpoint setup. + *

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. */ -@Operator(group = "train") +@OpMetadata( + opType = MergeV2Checkpoints.OP_NAME, + inputsClass = MergeV2Checkpoints.Inputs.class +) +@Operator( + group = "train" +) public final class MergeV2Checkpoints extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.MergeV2Checkpoints} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param deleteOldDirs see above. - */ - public Options deleteOldDirs(Boolean deleteOldDirs) { - this.deleteOldDirs = deleteOldDirs; - return this; - } - - private Boolean deleteOldDirs; - - private Options() { - } + public static final String OP_NAME = "MergeV2Checkpoints"; + + public MergeV2Checkpoints(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new MergeV2Checkpoints operation. - * + * * @param scope current scope * @param checkpointPrefixes prefixes of V2 checkpoints to merge. * @param destinationPrefix scalar. The desired final prefix. Allowed to be the same * as one of the checkpoint_prefixes. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of MergeV2Checkpoints */ - @Endpoint(describeByClass = true) - public static MergeV2Checkpoints create(Scope scope, Operand checkpointPrefixes, Operand destinationPrefix, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("MergeV2Checkpoints", scope.makeOpName("MergeV2Checkpoints")); + @Endpoint( + describeByClass = true + ) + public static MergeV2Checkpoints create(Scope scope, Operand checkpointPrefixes, + Operand destinationPrefix, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MergeV2Checkpoints"); opBuilder.addInput(checkpointPrefixes.asOutput()); opBuilder.addInput(destinationPrefix.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { 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()); } - + /** + * Sets the deleteOldDirs option. + * * @param deleteOldDirs see above. + * @return this Options instance. */ public static Options deleteOldDirs(Boolean deleteOldDirs) { return new Options().deleteOldDirs(deleteOldDirs); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MergeV2Checkpoints"; - - private MergeV2Checkpoints(Operation operation) { - super(operation); + + /** + * 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() { + } + + /** + * Sets the deleteOldDirs option. + * + * @param deleteOldDirs see above. + * @return this Options instance. + */ + 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 03a2d2fd49c..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,44 +36,106 @@ /** * Training via negative sampling. */ -@Operator(group = "train") +@OpMetadata( + opType = NegTrain.OP_NAME, + inputsClass = NegTrain.Inputs.class +) +@Operator( + group = "train" +) public final class NegTrain extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "NegTrain"; + + public NegTrain(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new NegTrain operation. - * + * * @param scope current scope * @param wIn input word embedding. * @param wOut output word embedding. * @param examples A vector of word ids. * @param labels A vector of word ids. - * @param lr + * @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 */ - @Endpoint(describeByClass = true) - public static NegTrain create(Scope scope, Operand wIn, Operand wOut, Operand examples, Operand labels, Operand lr, List vocabCount, Long numNegativeSamples) { - OperationBuilder opBuilder = scope.env().opBuilder("NegTrain", scope.makeOpName("NegTrain")); + @Endpoint( + describeByClass = true + ) + public static NegTrain create(Scope scope, Operand wIn, Operand wOut, + Operand examples, Operand labels, Operand lr, List vocabCount, + Long numNegativeSamples) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "NegTrain"); opBuilder.addInput(wIn.asOutput()); opBuilder.addInput(wOut.asOutput()); opBuilder.addInput(examples.asOutput()); opBuilder.addInput(labels.asOutput()); opBuilder.addInput(lr.asOutput()); - opBuilder = scope.apply(opBuilder); long[] vocabCountArray = new long[vocabCount.size()]; - for (int i = 0; i < vocabCountArray.length; ++i) { + for (int i = 0 ; i < vocabCountArray.length ; i++) { vocabCountArray[i] = vocabCount.get(i); } opBuilder.setAttr("vocab_count", vocabCountArray); opBuilder.setAttr("num_negative_samples", numNegativeSamples); return new NegTrain(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NegTrain"; - - private NegTrain(Operation operation) { - super(operation); + + @OpInputsMetadata( + outputsClass = NegTrain.class + ) + public static class Inputs extends RawOpInputs { + /** + * 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 d6fe993126b..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,65 +17,68 @@ 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; /** * An identity op that triggers an error if a gradient is requested. - *

* When executed in a graph, this op outputs its input tensor as-is. - *

- * When building ops to compute gradients, the TensorFlow gradient system + *

When building ops to compute gradients, the TensorFlow gradient system * will return an error when trying to lookup the gradient of this op, * 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 */ -@Operator(group = "train") +@OpMetadata( + opType = PreventGradient.OP_NAME, + inputsClass = PreventGradient.Inputs.class +) +@Operator( + group = "train" +) public final class PreventGradient extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.PreventGradient} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param message Will be printed in the error when anyone tries to differentiate - * this operation. - */ - public Options message(String message) { - this.message = message; - return this; - } - - private String message; - - private Options() { - } + public static final String OP_NAME = "PreventGradient"; + + private Output output; + + public PreventGradient(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new PreventGradient operation. - * + * * @param scope current scope * @param input any tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code PreventGradient} output and operands * @return a new instance of PreventGradient */ - @Endpoint(describeByClass = true) - public static PreventGradient create(Scope scope, Operand input, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("PreventGradient", scope.makeOpName("PreventGradient")); + @Endpoint( + describeByClass = true + ) + public static PreventGradient create(Scope scope, Operand input, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "PreventGradient"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.message != null) { @@ -83,37 +86,82 @@ public static PreventGradient create(Scope scope, Operand(opBuilder.build()); + return new PreventGradient<>(opBuilder.build()); } - + /** + * Sets the message option. + * * @param message Will be printed in the error when anyone tries to differentiate * this operation. + * @return this Options instance. */ public static Options message(String message) { return new Options().message(message); } - + /** + * Gets output. * the same input tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "PreventGradient"; - - private Output output; - - private PreventGradient(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.PreventGradient} + */ + public static class Options { + private String message; + + private Options() { + } + + /** + * Sets the message option. + * + * @param message Will be printed in the error when anyone tries to differentiate + * this operation. + * @return this Options instance. + */ + public Options message(String message) { + this.message = 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 373d5efe501..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,46 +17,97 @@ 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; /** * 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"; + + public ResourceAccumulatorApplyGradient(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new ResourceAccumulatorApplyGradient operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static ResourceAccumulatorApplyGradient create(Scope scope, Operand handle, Operand localStep, Operand gradient) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceAccumulatorApplyGradient", scope.makeOpName("ResourceAccumulatorApplyGradient")); + @Endpoint( + describeByClass = true + ) + public static ResourceAccumulatorApplyGradient create(Scope scope, + Operand handle, Operand localStep, + Operand gradient) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceAccumulatorApplyGradient"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(localStep.asOutput()); opBuilder.addInput(gradient.asOutput()); - opBuilder = scope.apply(opBuilder); return new ResourceAccumulatorApplyGradient(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceAccumulatorApplyGradient"; - - private ResourceAccumulatorApplyGradient(Operation operation) { - super(operation); + + @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 9c77e31351f..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,56 +17,90 @@ 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 + */ + public static final String OP_NAME = "ResourceAccumulatorNumAccumulated"; + + private Output numAccumulated; + + public ResourceAccumulatorNumAccumulated(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + numAccumulated = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ResourceAccumulatorNumAccumulated operation. - * + * * @param scope current scope * @param handle The handle to an accumulator. * @return a new instance of ResourceAccumulatorNumAccumulated */ - @Endpoint(describeByClass = true) - public static ResourceAccumulatorNumAccumulated create(Scope scope, Operand handle) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceAccumulatorNumAccumulated", scope.makeOpName("ResourceAccumulatorNumAccumulated")); + @Endpoint( + describeByClass = true + ) + public static ResourceAccumulatorNumAccumulated create(Scope scope, + Operand handle) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceAccumulatorNumAccumulated"); opBuilder.addInput(handle.asOutput()); - opBuilder = scope.apply(opBuilder); return new ResourceAccumulatorNumAccumulated(opBuilder.build()); } - + /** + * Gets numAccumulated. * The number of gradients aggregated in the given accumulator. + * @return numAccumulated. */ public Output numAccumulated() { return numAccumulated; } - + @Override public Output asOutput() { return numAccumulated; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceAccumulatorNumAccumulated"; - - private Output numAccumulated; - - private ResourceAccumulatorNumAccumulated(Operation operation) { - super(operation); - int outputIdx = 0; - numAccumulated = operation.output(outputIdx++); + + @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 7f2f421c6e6..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,44 +17,81 @@ 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; /** * Updates the accumulator with a new value for global_step. - *

* 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"; + + public ResourceAccumulatorSetGlobalStep(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new ResourceAccumulatorSetGlobalStep operation. - * + * * @param scope current scope * @param handle The handle to an accumulator. * @param newGlobalStep The new global_step value to set. * @return a new instance of ResourceAccumulatorSetGlobalStep */ - @Endpoint(describeByClass = true) - public static ResourceAccumulatorSetGlobalStep create(Scope scope, Operand handle, Operand newGlobalStep) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceAccumulatorSetGlobalStep", scope.makeOpName("ResourceAccumulatorSetGlobalStep")); + @Endpoint( + describeByClass = true + ) + public static ResourceAccumulatorSetGlobalStep create(Scope scope, + Operand handle, Operand newGlobalStep) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceAccumulatorSetGlobalStep"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(newGlobalStep.asOutput()); - opBuilder = scope.apply(opBuilder); return new ResourceAccumulatorSetGlobalStep(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceAccumulatorSetGlobalStep"; - - private ResourceAccumulatorSetGlobalStep(Operation operation) { - super(operation); + + @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 62e33a44749..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,71 +17,116 @@ 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; /** * 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 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 + */ + public static final String OP_NAME = "ResourceAccumulatorTakeGradient"; + + private Output average; + + public ResourceAccumulatorTakeGradient(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + average = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ResourceAccumulatorTakeGradient operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static ResourceAccumulatorTakeGradient create(Scope scope, Operand handle, Operand numRequired, Class dtype) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceAccumulatorTakeGradient", scope.makeOpName("ResourceAccumulatorTakeGradient")); + @Endpoint( + describeByClass = true + ) + public static ResourceAccumulatorTakeGradient create(Scope scope, + Operand handle, Operand numRequired, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceAccumulatorTakeGradient"); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(numRequired.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new ResourceAccumulatorTakeGradient(opBuilder.build()); + return new ResourceAccumulatorTakeGradient<>(opBuilder.build()); } - + /** + * Gets average. * The average of the accumulated gradients. + * @return average. */ public Output average() { return average; } - + @Override public Output asOutput() { return average; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceAccumulatorTakeGradient"; - - private Output average; - - private ResourceAccumulatorTakeGradient(Operation operation) { - super(operation); - int outputIdx = 0; - average = operation.output(outputIdx++); + + @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 868d8664fa2..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,48 +17,47 @@ 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 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) + * 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) */ +@OpMetadata( + opType = ResourceApplyAdaMax.OP_NAME, + inputsClass = ResourceApplyAdaMax.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceApplyAdaMax extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdaMax} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyAdaMax"; + + public ResourceApplyAdaMax(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new ResourceApplyAdaMax operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param m Should be from a Variable(). @@ -69,12 +68,18 @@ private Options() { * @param beta2 Momentum factor. Must be a scalar. * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyAdaMax} output and operands * @return a new instance of ResourceApplyAdaMax */ - @Endpoint(describeByClass = true) - public static ResourceApplyAdaMax create(Scope scope, Operand var, Operand m, Operand v, Operand beta1Power, Operand lr, Operand beta1, Operand beta2, Operand epsilon, Operand grad, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyAdaMax", scope.makeOpName("ResourceApplyAdaMax")); + @Endpoint( + describeByClass = true + ) + public static ResourceApplyAdaMax create(Scope scope, + Operand var, Operand m, Operand v, + Operand beta1Power, Operand lr, Operand beta1, Operand beta2, Operand epsilon, + Operand grad, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceApplyAdaMax"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(m.asOutput()); opBuilder.addInput(v.asOutput()); @@ -84,7 +89,6 @@ public static ResourceApplyAdaMax create(Scope scope, Operand< opBuilder.addInput(beta2.asOutput()); opBuilder.addInput(epsilon.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -94,20 +98,117 @@ public static ResourceApplyAdaMax create(Scope scope, Operand< } return new ResourceApplyAdaMax(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, m, and v tensors will be protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyAdaMax"; - - private ResourceApplyAdaMax(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdaMax} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 0897bb4a2bd..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,49 +17,48 @@ 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 adadelta scheme. - *

* accum = rho() * accum + (1 - rho()) * grad.square(); * update = (update_accum + epsilon).sqrt() * (accum + epsilon()).rsqrt() * grad; * update_accum = rho() * update_accum + (1 - rho()) * update.square(); * var -= update; */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceApplyAdadelta.OP_NAME, + inputsClass = ResourceApplyAdadelta.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceApplyAdadelta extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdadelta} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyAdadelta"; + + public ResourceApplyAdadelta(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new ResourceApplyAdadelta operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -68,12 +67,18 @@ private Options() { * @param rho Decay factor. Must be a scalar. * @param epsilon Constant factor. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyAdadelta} output and operands * @return a new instance of ResourceApplyAdadelta */ - @Endpoint(describeByClass = true) - public static ResourceApplyAdadelta create(Scope scope, Operand var, Operand accum, Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, Operand grad, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyAdadelta", scope.makeOpName("ResourceApplyAdadelta")); + @Endpoint( + describeByClass = true + ) + public static ResourceApplyAdadelta create(Scope scope, + Operand var, Operand accum, + Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, + Operand grad, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceApplyAdadelta"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(accumUpdate.asOutput()); @@ -81,7 +86,6 @@ public static ResourceApplyAdadelta create(Scope scope, Operan opBuilder.addInput(rho.asOutput()); opBuilder.addInput(epsilon.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -91,19 +95,102 @@ public static ResourceApplyAdadelta create(Scope scope, Operan } return new ResourceApplyAdadelta(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyAdadelta"; - - private ResourceApplyAdadelta(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdadelta} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 8cf24a3e443..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,74 +17,68 @@ 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 adagrad scheme. - *

* 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 { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdagrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param updateSlots - */ - public Options updateSlots(Boolean updateSlots) { - this.updateSlots = updateSlots; - return this; - } - - private Boolean useLocking; - private Boolean updateSlots; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyAdagradV2"; + + public ResourceApplyAdagrad(Operation operation) { + super(operation, OP_NAME); } - + /** - * Factory method to create a class wrapping a new ResourceApplyAdagrad operation. - * + * Factory method to create a class wrapping a new ResourceApplyAdagradV2 operation. + * * @param scope current scope * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyAdagradV2} output and operands * @return a new instance of ResourceApplyAdagrad */ - @Endpoint(describeByClass = true) - public static ResourceApplyAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand epsilon, Operand grad, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyAdagradV2", scope.makeOpName("ResourceApplyAdagrad")); + @Endpoint( + describeByClass = true + ) + public static ResourceApplyAdagrad create(Scope scope, + Operand var, Operand accum, Operand lr, + Operand epsilon, Operand grad, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceApplyAdagrad"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(lr.asOutput()); opBuilder.addInput(epsilon.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -97,27 +91,122 @@ public static ResourceApplyAdagrad create(Scope scope, Operand } return new ResourceApplyAdagrad(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param updateSlots + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. */ public static Options updateSlots(Boolean updateSlots) { return new Options().updateSlots(updateSlots); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyAdagradV2"; - - private ResourceApplyAdagrad(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdagrad} + */ + public static class Options { + private Boolean useLocking; + + private Boolean updateSlots; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. + */ + public Options updateSlots(Boolean updateSlots) { + this.updateSlots = 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 cf572e06da5..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,45 +17,45 @@ 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. */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceApplyAdagradDa.OP_NAME, + inputsClass = ResourceApplyAdagradDa.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceApplyAdagradDa extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdagradDa} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyAdagradDA"; + + public ResourceApplyAdagradDa(Operation operation) { + super(operation, OP_NAME); } - + /** - * Factory method to create a class wrapping a new ResourceApplyAdagradDa operation. - * + * Factory method to create a class wrapping a new ResourceApplyAdagradDA operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param gradientAccumulator Should be from a Variable(). @@ -65,12 +65,18 @@ private Options() { * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 regularization. Must be a scalar. * @param globalStep Training step number. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyAdagradDA} output and operands * @return a new instance of ResourceApplyAdagradDa */ - @Endpoint(describeByClass = true) - public static ResourceApplyAdagradDa create(Scope scope, Operand var, Operand gradientAccumulator, Operand gradientSquaredAccumulator, Operand grad, Operand lr, Operand l1, Operand l2, Operand globalStep, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyAdagradDA", scope.makeOpName("ResourceApplyAdagradDa")); + @Endpoint( + describeByClass = true + ) + public static ResourceApplyAdagradDa create(Scope scope, + Operand var, Operand gradientAccumulator, + Operand gradientSquaredAccumulator, Operand grad, Operand lr, + Operand l1, Operand l2, Operand globalStep, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceApplyAdagradDa"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(gradientAccumulator.asOutput()); opBuilder.addInput(gradientSquaredAccumulator.asOutput()); @@ -79,7 +85,6 @@ public static ResourceApplyAdagradDa create(Scope scope, Opera opBuilder.addInput(l1.asOutput()); opBuilder.addInput(l2.asOutput()); opBuilder.addInput(globalStep.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -89,19 +94,108 @@ public static ResourceApplyAdagradDa create(Scope scope, Opera } return new ResourceApplyAdagradDa(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyAdagradDA"; - - private ResourceApplyAdagradDa(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdagradDa} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 d2a570aa424..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,59 +17,48 @@ 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}$$ */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceApplyAdam.OP_NAME, + inputsClass = ResourceApplyAdam.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceApplyAdam extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdam} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param useNesterov If `True`, uses the nesterov update. - */ - public Options useNesterov(Boolean useNesterov) { - this.useNesterov = useNesterov; - return this; - } - - private Boolean useLocking; - private Boolean useNesterov; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyAdam"; + + public ResourceApplyAdam(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new ResourceApplyAdam operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param m Should be from a Variable(). @@ -81,12 +70,18 @@ private Options() { * @param beta2 Momentum factor. Must be a scalar. * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyAdam} output and operands * @return a new instance of ResourceApplyAdam */ - @Endpoint(describeByClass = true) - public static ResourceApplyAdam create(Scope scope, Operand var, Operand m, Operand v, Operand beta1Power, Operand beta2Power, Operand lr, Operand beta1, Operand beta2, Operand epsilon, Operand grad, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyAdam", scope.makeOpName("ResourceApplyAdam")); + @Endpoint( + describeByClass = true + ) + public static ResourceApplyAdam create(Scope scope, + Operand var, Operand m, Operand v, + Operand beta1Power, Operand beta2Power, Operand lr, Operand beta1, + Operand beta2, Operand epsilon, Operand grad, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceApplyAdam"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(m.asOutput()); opBuilder.addInput(v.asOutput()); @@ -97,7 +92,6 @@ public static ResourceApplyAdam create(Scope scope, Operand opBuilder.addInput(beta2.asOutput()); opBuilder.addInput(epsilon.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -110,27 +104,152 @@ public static ResourceApplyAdam create(Scope scope, Operand } return new ResourceApplyAdam(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, m, and v tensors will be protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param useNesterov If `True`, uses the nesterov update. + * Sets the useNesterov option. + * + * @param useNesterov If {@code True}, uses the nesterov update. + * @return this Options instance. */ public static Options useNesterov(Boolean useNesterov) { return new Options().useNesterov(useNesterov); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyAdam"; - - private ResourceApplyAdam(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdam} + */ + public static class Options { + private Boolean useLocking; + + private Boolean useNesterov; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the useNesterov option. + * + * @param useNesterov If {@code True}, uses the nesterov update. + * @return this Options instance. + */ + public Options useNesterov(Boolean useNesterov) { + this.useNesterov = 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 2c9f48fc751..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,51 +17,49 @@ 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$$ + * $$\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$$ - * $$\hat{v}_t := max{\hat{v}_{t-1}, v_t}$$ + * $$\hat{v}t := max{\hat{v}{t-1}, v_t}$$ * $$\text{variable} := \text{variable} - \text{lr}_t * m_t / (\sqrt{\hat{v}_t} + \epsilon)$$ */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceApplyAdamWithAmsgrad.OP_NAME, + inputsClass = ResourceApplyAdamWithAmsgrad.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceApplyAdamWithAmsgrad extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdamWithAmsgrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyAdamWithAmsgrad"; + + public ResourceApplyAdamWithAmsgrad(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new ResourceApplyAdamWithAmsgrad operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param m Should be from a Variable(). @@ -74,12 +72,18 @@ private Options() { * @param beta2 Momentum factor. Must be a scalar. * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyAdamWithAmsgrad} output and operands * @return a new instance of ResourceApplyAdamWithAmsgrad */ - @Endpoint(describeByClass = true) - public static ResourceApplyAdamWithAmsgrad create(Scope scope, Operand var, Operand m, Operand v, Operand vhat, Operand beta1Power, Operand beta2Power, Operand lr, Operand beta1, Operand beta2, Operand epsilon, Operand grad, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyAdamWithAmsgrad", scope.makeOpName("ResourceApplyAdamWithAmsgrad")); + @Endpoint( + describeByClass = true + ) + public static ResourceApplyAdamWithAmsgrad create(Scope scope, + Operand var, Operand m, Operand v, + Operand vhat, Operand beta1Power, Operand beta2Power, Operand lr, + Operand beta1, Operand beta2, Operand epsilon, Operand grad, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceApplyAdamWithAmsgrad"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(m.asOutput()); opBuilder.addInput(v.asOutput()); @@ -91,7 +95,6 @@ public static ResourceApplyAdamWithAmsgrad create(Scope scope, opBuilder.addInput(beta2.asOutput()); opBuilder.addInput(epsilon.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -101,20 +104,129 @@ public static ResourceApplyAdamWithAmsgrad create(Scope scope, } return new ResourceApplyAdamWithAmsgrad(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, m, and v tensors will be protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyAdamWithAmsgrad"; - - private ResourceApplyAdamWithAmsgrad(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdamWithAmsgrad} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 c8d64fc2894..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,49 +17,47 @@ 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 AddSign update. - *

- * m_t <- beta1 * m_{t-1} + (1 - beta1) * g - * update <- (alpha + sign_decay * sign(g) *sign(m)) * g - * variable <- variable - lr_t * update + * m_t <- beta1 * m_{t-1} + (1 - beta1) * g + * update <- (alpha + sign_decay * sign(g) *sign(m)) * g + * variable <- variable - lr_t * update */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceApplyAddSign.OP_NAME, + inputsClass = ResourceApplyAddSign.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceApplyAddSign extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAddSign} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and m tensors is - * protected by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyAddSign"; + + public ResourceApplyAddSign(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new ResourceApplyAddSign operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param m Should be from a Variable(). @@ -68,12 +66,17 @@ private Options() { * @param signDecay Must be a scalar. * @param beta Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyAddSign} output and operands * @return a new instance of ResourceApplyAddSign */ - @Endpoint(describeByClass = true) - public static ResourceApplyAddSign create(Scope scope, Operand var, Operand m, Operand lr, Operand alpha, Operand signDecay, Operand beta, Operand grad, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyAddSign", scope.makeOpName("ResourceApplyAddSign")); + @Endpoint( + describeByClass = true + ) + public static ResourceApplyAddSign create(Scope scope, + Operand var, Operand m, Operand lr, Operand alpha, + Operand signDecay, Operand beta, Operand grad, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceApplyAddSign"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(m.asOutput()); opBuilder.addInput(lr.asOutput()); @@ -81,7 +84,6 @@ public static ResourceApplyAddSign create(Scope scope, Operand opBuilder.addInput(signDecay.asOutput()); opBuilder.addInput(beta.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -91,20 +93,105 @@ public static ResourceApplyAddSign create(Scope scope, Operand } return new ResourceApplyAddSign(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and m tensors is + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyAddSign"; - - private ResourceApplyAddSign(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAddSign} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 722555f4f20..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,64 +17,58 @@ 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 centered RMSProp algorithm. - *

* The centered RMSProp algorithm uses an estimate of the centered second moment * (i.e., the variance) for normalization, as opposed to regular RMSProp, which * uses the (uncentered) second moment. This often helps with training, but is * slightly more expensive in terms of computation and memory. - *

- * Note that in dense implementation of this algorithm, mg, ms, and mom will + *

Note that in dense implementation of this algorithm, mg, ms, and mom will * update even if the grad is zero, but in this sparse implementation, mg, ms, * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * mean_grad = decay * mean_grad + (1-decay) * gradient - *

- * Delta = learning_rate * gradient / sqrt(mean_square + epsilon - mean_grad ** 2) - *

- * mg <- rho * mg_{t-1} + (1-rho) * grad - * ms <- rho * ms_{t-1} + (1-rho) * grad * grad - * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms - mg * mg + epsilon) - * var <- var - mom + *

Delta = learning_rate * gradient / sqrt(mean_square + epsilon - mean_grad ** 2) + *

mg <- rho * mg_{t-1} + (1-rho) * grad + * ms <- rho * ms_{t-1} + (1-rho) * grad * grad + * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms - mg * mg + epsilon) + * var <- var - mom */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceApplyCenteredRmsProp.OP_NAME, + inputsClass = ResourceApplyCenteredRmsProp.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceApplyCenteredRmsProp extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyCenteredRmsProp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyCenteredRMSProp"; + + public ResourceApplyCenteredRmsProp(Operation operation) { + super(operation, OP_NAME); } - + /** - * Factory method to create a class wrapping a new ResourceApplyCenteredRmsProp operation. - * + * Factory method to create a class wrapping a new ResourceApplyCenteredRMSProp operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param mg Should be from a Variable(). @@ -85,12 +79,18 @@ private Options() { * @param momentum Momentum Scale. Must be a scalar. * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyCenteredRMSProp} output and operands * @return a new instance of ResourceApplyCenteredRmsProp */ - @Endpoint(describeByClass = true) - public static ResourceApplyCenteredRmsProp create(Scope scope, Operand var, Operand mg, Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyCenteredRMSProp", scope.makeOpName("ResourceApplyCenteredRmsProp")); + @Endpoint( + describeByClass = true + ) + public static ResourceApplyCenteredRmsProp create(Scope scope, + Operand var, Operand mg, Operand ms, + Operand mom, Operand lr, Operand rho, Operand momentum, + Operand epsilon, Operand grad, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceApplyCenteredRmsProp"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(mg.asOutput()); opBuilder.addInput(ms.asOutput()); @@ -100,7 +100,6 @@ public static ResourceApplyCenteredRmsProp create(Scope scope, opBuilder.addInput(momentum.asOutput()); opBuilder.addInput(epsilon.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -110,20 +109,117 @@ public static ResourceApplyCenteredRmsProp create(Scope scope, } return new ResourceApplyCenteredRmsProp(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, mg, ms, and mom tensors is + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyCenteredRMSProp"; - - private ResourceApplyCenteredRmsProp(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyCenteredRmsProp} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 3c86fc8c313..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,62 +17,51 @@ 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 Ftrl-proximal scheme. - *

+ * accum_new = accum + grad * grad * grad_with_shrinkage = grad + 2 * l2_shrinkage * var - * accum_new = accum + grad_with_shrinkage * grad_with_shrinkage * linear += grad_with_shrinkage + - * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var + * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var * quadratic = 1.0 / (accum_new^(lr_power) * lr) + 2 * l2 - * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 + * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 * accum = accum_new */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceApplyFtrl.OP_NAME, + inputsClass = ResourceApplyFtrl.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceApplyFtrl extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyFtrl} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param multiplyLinearByLr - */ - public Options multiplyLinearByLr(Boolean multiplyLinearByLr) { - this.multiplyLinearByLr = multiplyLinearByLr; - return this; - } - - private Boolean useLocking; - private Boolean multiplyLinearByLr; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyFtrlV2"; + + public ResourceApplyFtrl(Operation operation) { + super(operation, OP_NAME); } - + /** - * Factory method to create a class wrapping a new ResourceApplyFtrl operation. - * + * Factory method to create a class wrapping a new ResourceApplyFtrlV2 operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -81,14 +70,20 @@ private Options() { * @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 + * @param l2Shrinkage The l2Shrinkage value * @param lrPower Scaling factor. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyFtrlV2} output and operands * @return a new instance of ResourceApplyFtrl */ - @Endpoint(describeByClass = true) - public static ResourceApplyFtrl create(Scope scope, Operand var, Operand accum, Operand linear, Operand grad, Operand lr, Operand l1, Operand l2, Operand l2Shrinkage, Operand lrPower, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyFtrlV2", scope.makeOpName("ResourceApplyFtrl")); + @Endpoint( + describeByClass = true + ) + public static ResourceApplyFtrl create(Scope scope, + Operand var, Operand accum, Operand linear, + Operand grad, Operand lr, Operand l1, Operand l2, Operand l2Shrinkage, + Operand lrPower, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceApplyFtrl"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(linear.asOutput()); @@ -98,7 +93,6 @@ public static ResourceApplyFtrl create(Scope scope, Operand opBuilder.addInput(l2.asOutput()); opBuilder.addInput(l2Shrinkage.asOutput()); opBuilder.addInput(lrPower.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -111,27 +105,146 @@ public static ResourceApplyFtrl create(Scope scope, Operand } return new ResourceApplyFtrl(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param multiplyLinearByLr + * Sets the multiplyLinearByLr option. + * + * @param multiplyLinearByLr the multiplyLinearByLr option + * @return this Options instance. */ public static Options multiplyLinearByLr(Boolean multiplyLinearByLr) { return new Options().multiplyLinearByLr(multiplyLinearByLr); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyFtrlV2"; - - private ResourceApplyFtrl(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyFtrl} + */ + public static class Options { + private Boolean useLocking; + + private Boolean multiplyLinearByLr; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the multiplyLinearByLr option. + * + * @param multiplyLinearByLr the multiplyLinearByLr option + * @return this Options instance. + */ + public Options multiplyLinearByLr(Boolean multiplyLinearByLr) { + this.multiplyLinearByLr = 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 bf119a731ec..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,58 +17,61 @@ 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. */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceApplyGradientDescent.OP_NAME, + inputsClass = ResourceApplyGradientDescent.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceApplyGradientDescent extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyGradientDescent} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, the subtraction will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyGradientDescent"; + + public ResourceApplyGradientDescent(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new ResourceApplyGradientDescent operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param alpha Scaling factor. Must be a scalar. * @param delta The change. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyGradientDescent} output and operands * @return a new instance of ResourceApplyGradientDescent */ - @Endpoint(describeByClass = true) - public static ResourceApplyGradientDescent create(Scope scope, Operand var, Operand alpha, Operand delta, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyGradientDescent", scope.makeOpName("ResourceApplyGradientDescent")); + @Endpoint( + describeByClass = true + ) + public static ResourceApplyGradientDescent create(Scope scope, + Operand var, Operand alpha, Operand delta, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceApplyGradientDescent"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(alpha.asOutput()); opBuilder.addInput(delta.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -78,19 +81,78 @@ public static ResourceApplyGradientDescent create(Scope scope, } return new ResourceApplyGradientDescent(opBuilder.build()); } - + /** - * @param useLocking If `True`, the subtraction will be protected by a lock; + * Sets the useLocking option. + * + * @param useLocking If {@code True}, the subtraction will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyGradientDescent"; - - private ResourceApplyGradientDescent(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyGradientDescent} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 6c55590f8ac..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,79 +17,69 @@ 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 momentum scheme. - *

* Set use_nesterov = True if you want to use Nesterov momentum. - *

- * accum = accum * momentum - lr * grad + *

accum = accum * momentum - lr * grad * var += accum */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceApplyKerasMomentum.OP_NAME, + inputsClass = ResourceApplyKerasMomentum.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceApplyKerasMomentum extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyKerasMomentum} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param useNesterov If `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 Options useNesterov(Boolean useNesterov) { - this.useNesterov = useNesterov; - return this; - } - - private Boolean useLocking; - private Boolean useNesterov; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyKerasMomentum"; + + public ResourceApplyKerasMomentum(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new ResourceApplyKerasMomentum operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param grad The gradient. * @param momentum Momentum. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyKerasMomentum} output and operands * @return a new instance of ResourceApplyKerasMomentum */ - @Endpoint(describeByClass = true) - public static ResourceApplyKerasMomentum create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand momentum, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyKerasMomentum", scope.makeOpName("ResourceApplyKerasMomentum")); + @Endpoint( + describeByClass = true + ) + public static ResourceApplyKerasMomentum create(Scope scope, + Operand var, Operand accum, Operand lr, Operand grad, + Operand momentum, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceApplyKerasMomentum"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(lr.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(momentum.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -102,29 +92,128 @@ public static ResourceApplyKerasMomentum create(Scope scope, O } return new ResourceApplyKerasMomentum(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param useNesterov If `True`, the tensor passed to compute grad will be + * Sets the useNesterov option. + * + * @param useNesterov 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. + * @return this Options instance. */ public static Options useNesterov(Boolean useNesterov) { return new Options().useNesterov(useNesterov); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyKerasMomentum"; - - private ResourceApplyKerasMomentum(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyKerasMomentum} + */ + public static class Options { + private Boolean useLocking; + + private Boolean useNesterov; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the useNesterov option. + * + * @param useNesterov 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. + * @return this Options instance. + */ + public Options useNesterov(Boolean useNesterov) { + this.useNesterov = 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 7d8a4b68f77..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,79 +17,69 @@ 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 momentum scheme. - *

* Set use_nesterov = True if you want to use Nesterov momentum. - *

- * accum = accum * momentum + grad + *

accum = accum * momentum + grad * var -= lr * accum */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceApplyMomentum.OP_NAME, + inputsClass = ResourceApplyMomentum.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceApplyMomentum extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyMomentum} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param useNesterov If `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 Options useNesterov(Boolean useNesterov) { - this.useNesterov = useNesterov; - return this; - } - - private Boolean useLocking; - private Boolean useNesterov; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyMomentum"; + + public ResourceApplyMomentum(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new ResourceApplyMomentum operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param grad The gradient. * @param momentum Momentum. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyMomentum} output and operands * @return a new instance of ResourceApplyMomentum */ - @Endpoint(describeByClass = true) - public static ResourceApplyMomentum create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand momentum, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyMomentum", scope.makeOpName("ResourceApplyMomentum")); + @Endpoint( + describeByClass = true + ) + public static ResourceApplyMomentum create(Scope scope, + Operand var, Operand accum, Operand lr, Operand grad, + Operand momentum, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceApplyMomentum"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(lr.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(momentum.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -102,29 +92,128 @@ public static ResourceApplyMomentum create(Scope scope, Operan } return new ResourceApplyMomentum(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param useNesterov If `True`, the tensor passed to compute grad will be + * Sets the useNesterov option. + * + * @param useNesterov 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. + * @return this Options instance. */ public static Options useNesterov(Boolean useNesterov) { return new Options().useNesterov(useNesterov); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyMomentum"; - - private ResourceApplyMomentum(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyMomentum} + */ + public static class Options { + private Boolean useLocking; + + private Boolean useNesterov; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the useNesterov option. + * + * @param useNesterov 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. + * @return this Options instance. + */ + public Options useNesterov(Boolean useNesterov) { + this.useNesterov = 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 3f4cfe11582..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,49 +17,47 @@ 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 AddSign update. - *

- * 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 + * 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 */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceApplyPowerSign.OP_NAME, + inputsClass = ResourceApplyPowerSign.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceApplyPowerSign extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyPowerSign} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and m tensors is - * protected by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyPowerSign"; + + public ResourceApplyPowerSign(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new ResourceApplyPowerSign operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param m Should be from a Variable(). @@ -68,12 +66,17 @@ private Options() { * @param signDecay Must be a scalar. * @param beta Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyPowerSign} output and operands * @return a new instance of ResourceApplyPowerSign */ - @Endpoint(describeByClass = true) - public static ResourceApplyPowerSign create(Scope scope, Operand var, Operand m, Operand lr, Operand logbase, Operand signDecay, Operand beta, Operand grad, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyPowerSign", scope.makeOpName("ResourceApplyPowerSign")); + @Endpoint( + describeByClass = true + ) + public static ResourceApplyPowerSign create(Scope scope, + Operand var, Operand m, Operand lr, Operand logbase, + Operand signDecay, Operand beta, Operand grad, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceApplyPowerSign"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(m.asOutput()); opBuilder.addInput(lr.asOutput()); @@ -81,7 +84,6 @@ public static ResourceApplyPowerSign create(Scope scope, Opera opBuilder.addInput(signDecay.asOutput()); opBuilder.addInput(beta.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -91,20 +93,105 @@ public static ResourceApplyPowerSign create(Scope scope, Opera } return new ResourceApplyPowerSign(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and m tensors is + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyPowerSign"; - - private ResourceApplyPowerSign(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyPowerSign} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 8c2aab6b265..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,48 +17,47 @@ 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' and '*accum' according to FOBOS with Adagrad learning rate. - *

- * accum += grad grad - * prox_v = var - lr grad (1 / sqrt(accum)) - * var = sign(prox_v)/(1+lrl2) max{|prox_v|-lrl1,0} + * accum += grad * grad + * prox_v = var - lr * grad * (1 / sqrt(accum)) + * var = sign(prox_v)/(1+lrl2) * max{|prox_v|-lrl1,0} */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceApplyProximalAdagrad.OP_NAME, + inputsClass = ResourceApplyProximalAdagrad.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceApplyProximalAdagrad extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyProximalAdagrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyProximalAdagrad"; + + public ResourceApplyProximalAdagrad(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new ResourceApplyProximalAdagrad operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -66,19 +65,23 @@ private Options() { * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 regularization. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyProximalAdagrad} output and operands * @return a new instance of ResourceApplyProximalAdagrad */ - @Endpoint(describeByClass = true) - public static ResourceApplyProximalAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand l1, Operand l2, Operand grad, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyProximalAdagrad", scope.makeOpName("ResourceApplyProximalAdagrad")); + @Endpoint( + describeByClass = true + ) + public static ResourceApplyProximalAdagrad create(Scope scope, + Operand var, Operand accum, Operand lr, Operand l1, + Operand l2, Operand grad, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceApplyProximalAdagrad"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(lr.asOutput()); opBuilder.addInput(l1.asOutput()); opBuilder.addInput(l2.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -88,19 +91,96 @@ public static ResourceApplyProximalAdagrad create(Scope scope, } return new ResourceApplyProximalAdagrad(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyProximalAdagrad"; - - private ResourceApplyProximalAdagrad(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyProximalAdagrad} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 56499971a02..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,65 +17,68 @@ 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' as FOBOS algorithm with fixed learning rate. - *

- * prox_v = var - alpha delta - * var = sign(prox_v)/(1+alphal2) max{|prox_v|-alphal1,0} + * prox_v = var - alpha * delta + * var = sign(prox_v)/(1+alphal2) * max{|prox_v|-alphal1,0} */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceApplyProximalGradientDescent.OP_NAME, + inputsClass = ResourceApplyProximalGradientDescent.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceApplyProximalGradientDescent extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyProximalGradientDescent} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the subtraction will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyProximalGradientDescent"; + + public ResourceApplyProximalGradientDescent(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new ResourceApplyProximalGradientDescent operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param alpha Scaling factor. Must be a scalar. * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 regularization. Must be a scalar. * @param delta The change. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyProximalGradientDescent} output and operands * @return a new instance of ResourceApplyProximalGradientDescent */ - @Endpoint(describeByClass = true) - public static ResourceApplyProximalGradientDescent create(Scope scope, Operand var, Operand alpha, Operand l1, Operand l2, Operand delta, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyProximalGradientDescent", scope.makeOpName("ResourceApplyProximalGradientDescent")); + @Endpoint( + describeByClass = true + ) + public static ResourceApplyProximalGradientDescent create(Scope scope, + Operand var, Operand alpha, Operand l1, Operand l2, + Operand delta, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceApplyProximalGradientDescent"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(alpha.asOutput()); opBuilder.addInput(l1.asOutput()); opBuilder.addInput(l2.asOutput()); opBuilder.addInput(delta.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -85,19 +88,90 @@ public static ResourceApplyProximalGradientDescent create(Scop } return new ResourceApplyProximalGradientDescent(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the subtraction will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyProximalGradientDescent"; - - private ResourceApplyProximalGradientDescent(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyProximalGradientDescent} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 703ae96376d..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,71 +17,73 @@ 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 RMSProp algorithm. - *

* Note that in dense implementation of this algorithm, ms and mom will * update even if the grad is zero, but in this sparse implementation, ms * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * Delta = learning_rate * gradient / sqrt(mean_square + epsilon) - *

- * ms <- rho * ms_{t-1} + (1-rho) * grad * grad - * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) - * var <- var - mom + *

ms <- rho * ms_{t-1} + (1-rho) * grad * grad + * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) + * var <- var - mom */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceApplyRmsProp.OP_NAME, + inputsClass = ResourceApplyRmsProp.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceApplyRmsProp extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyRmsProp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyRMSProp"; + + public ResourceApplyRmsProp(Operation operation) { + super(operation, OP_NAME); } - + /** - * Factory method to create a class wrapping a new ResourceApplyRmsProp operation. - * + * Factory method to create a class wrapping a new ResourceApplyRMSProp operation. + * * @param scope current scope * @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 + * @param momentum The momentum value * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyRMSProp} output and operands * @return a new instance of ResourceApplyRmsProp */ - @Endpoint(describeByClass = true) - public static ResourceApplyRmsProp create(Scope scope, Operand var, Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyRMSProp", scope.makeOpName("ResourceApplyRmsProp")); + @Endpoint( + describeByClass = true + ) + public static ResourceApplyRmsProp create(Scope scope, + Operand var, Operand ms, Operand mom, + Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceApplyRmsProp"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(ms.asOutput()); opBuilder.addInput(mom.asOutput()); @@ -90,7 +92,6 @@ public static ResourceApplyRmsProp create(Scope scope, Operand opBuilder.addInput(momentum.asOutput()); opBuilder.addInput(epsilon.asOutput()); opBuilder.addInput(grad.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -100,20 +101,111 @@ public static ResourceApplyRmsProp create(Scope scope, Operand } return new ResourceApplyRmsProp(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, ms, and mom tensors is protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyRMSProp"; - - private ResourceApplyRmsProp(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyRmsProp} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 d44b93e6ac1..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,14 +26,17 @@ 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 conditional accumulator for aggregating gradients. - *

* The accumulator accepts gradients marked with local_step greater or * equal to the most recent global_step known to the accumulator. The * average can be extracted from the accumulator, provided sufficient @@ -41,60 +46,44 @@ * 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 { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceConditionalAccumulator} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this accumulator is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this accumulator will be shared under the - * given name across multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param reductionType - */ - public Options reductionType(String reductionType) { - this.reductionType = reductionType; - return this; - } - - private String container; - private String sharedName; - private String reductionType; - - private Options() { - } + public static final String OP_NAME = "ResourceConditionalAccumulator"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ResourceConditionalAccumulator(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ResourceConditionalAccumulator operation. - * + * * @param scope current scope * @param dtype The type of the value being accumulated. * @param shape The shape of the values, can be [], in which case shape is unknown. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceConditionalAccumulator} output and operands * @return a new instance of ResourceConditionalAccumulator */ - @Endpoint(describeByClass = true) - public static ResourceConditionalAccumulator create(Scope scope, Class dtype, Shape shape, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceConditionalAccumulator", scope.makeOpName("ResourceConditionalAccumulator")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static ResourceConditionalAccumulator create(Scope scope, Class dtype, + Shape shape, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceConditionalAccumulator"); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); opBuilder.setAttr("shape", shape); if (options != null) { @@ -112,51 +101,142 @@ public static ResourceConditionalAccumulator create(Scope scop } return new ResourceConditionalAccumulator(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this accumulator is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this accumulator will be shared under the * given name across multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * @param reductionType + * Sets the reductionType option. + * + * @param reductionType the reductionType option + * @return this Options instance. */ public static Options reductionType(String reductionType) { return new Options().reductionType(reductionType); } - + /** + * Gets handle. * The handle to the accumulator. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceConditionalAccumulator"; - - private Output handle; - - private ResourceConditionalAccumulator(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceConditionalAccumulator} + */ + public static class Options { + private String container; + + private String sharedName; + + private String reductionType; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this accumulator is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this accumulator will be shared under the + * given name across multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the reductionType option. + * + * @param reductionType the reductionType option + * @return this Options instance. + */ + public Options reductionType(String reductionType) { + this.reductionType = 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 29a2a993245..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,47 +17,47 @@ 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(). */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceSparseApplyAdadelta.OP_NAME, + inputsClass = ResourceSparseApplyAdadelta.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceSparseApplyAdadelta extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyAdadelta} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceSparseApplyAdadelta"; + + 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 + * @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. @@ -65,12 +65,18 @@ private Options() { * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyAdadelta} output and operands * @return a new instance of ResourceSparseApplyAdadelta */ - @Endpoint(describeByClass = true) - public static ResourceSparseApplyAdadelta create(Scope scope, Operand var, Operand accum, Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, Operand grad, Operand indices, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceSparseApplyAdadelta", scope.makeOpName("ResourceSparseApplyAdadelta")); + @Endpoint( + describeByClass = true + ) + public static ResourceSparseApplyAdadelta create(Scope scope, + Operand var, Operand accum, + Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, + Operand grad, Operand indices, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceSparseApplyAdadelta"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(accumUpdate.asOutput()); @@ -79,7 +85,6 @@ public static ResourceSparseApplyAdadelta create(Scope scope, opBuilder.addInput(epsilon.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -89,19 +94,114 @@ public static ResourceSparseApplyAdadelta create(Scope scope, } return new ResourceSparseApplyAdadelta(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceSparseApplyAdadelta"; - - private ResourceSparseApplyAdadelta(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyAdadelta} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 ac0fd69675e..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,77 +17,70 @@ 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; /** * 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)) */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceSparseApplyAdagrad.OP_NAME, + inputsClass = ResourceSparseApplyAdagrad.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceSparseApplyAdagrad extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyAdagrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param updateSlots - */ - public Options updateSlots(Boolean updateSlots) { - this.updateSlots = updateSlots; - return this; - } - - private Boolean useLocking; - private Boolean updateSlots; - - private Options() { - } + public static final String OP_NAME = "ResourceSparseApplyAdagrad"; + + public ResourceSparseApplyAdagrad(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new ResourceSparseApplyAdagrad operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param lr Learning rate. 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyAdagrad} output and operands * @return a new instance of ResourceSparseApplyAdagrad */ - @Endpoint(describeByClass = true) - public static ResourceSparseApplyAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand indices, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceSparseApplyAdagrad", scope.makeOpName("ResourceSparseApplyAdagrad")); + @Endpoint( + describeByClass = true + ) + public static ResourceSparseApplyAdagrad create(Scope scope, + Operand var, Operand accum, Operand lr, Operand grad, + Operand indices, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceSparseApplyAdagrad"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(lr.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -100,27 +93,128 @@ public static ResourceSparseApplyAdagrad create(Scope scope, O } return new ResourceSparseApplyAdagrad(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param updateSlots + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. */ public static Options updateSlots(Boolean updateSlots) { return new Options().updateSlots(updateSlots); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceSparseApplyAdagrad"; - - private ResourceSparseApplyAdagrad(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyAdagrad} + */ + public static class Options { + private Boolean useLocking; + + private Boolean updateSlots; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. + */ + public Options updateSlots(Boolean updateSlots) { + this.updateSlots = 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 cf3c20f69d6..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,32 +37,26 @@ /** * Update entries in '*var' and '*accum' according to the proximal adagrad scheme. */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceSparseApplyAdagradDa.OP_NAME, + inputsClass = ResourceSparseApplyAdagradDa.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceSparseApplyAdagradDa extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyAdagradDa} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceSparseApplyAdagradDA"; + + public ResourceSparseApplyAdagradDa(Operation operation) { + super(operation, OP_NAME); } - + /** - * Factory method to create a class wrapping a new ResourceSparseApplyAdagradDa operation. - * + * Factory method to create a class wrapping a new ResourceSparseApplyAdagradDA operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param gradientAccumulator Should be from a Variable(). @@ -67,12 +67,19 @@ private Options() { * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 regularization. Must be a scalar. * @param globalStep Training step number. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyAdagradDA} output and operands * @return a new instance of ResourceSparseApplyAdagradDa */ - @Endpoint(describeByClass = true) - public static ResourceSparseApplyAdagradDa create(Scope scope, Operand var, Operand gradientAccumulator, Operand gradientSquaredAccumulator, Operand grad, Operand indices, Operand lr, Operand l1, Operand l2, Operand globalStep, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceSparseApplyAdagradDA", scope.makeOpName("ResourceSparseApplyAdagradDa")); + @Endpoint( + describeByClass = true + ) + public static ResourceSparseApplyAdagradDa create(Scope scope, + Operand var, Operand gradientAccumulator, + Operand gradientSquaredAccumulator, Operand grad, + Operand indices, Operand lr, Operand l1, Operand l2, + Operand globalStep, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceSparseApplyAdagradDa"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(gradientAccumulator.asOutput()); opBuilder.addInput(gradientSquaredAccumulator.asOutput()); @@ -82,7 +89,6 @@ public static ResourceSparseApplyAdagradDa create(Scope scope, opBuilder.addInput(l1.asOutput()); opBuilder.addInput(l2.asOutput()); opBuilder.addInput(globalStep.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -92,19 +98,120 @@ public static ResourceSparseApplyAdagradDa create(Scope scope, } return new ResourceSparseApplyAdagradDa(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceSparseApplyAdagradDA"; - - private ResourceSparseApplyAdagradDa(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyAdagradDa} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 0cd880c76d8..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,58 +17,48 @@ 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; /** * 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)) */ +@OpMetadata( + opType = ResourceSparseApplyAdagradV2.OP_NAME, + inputsClass = ResourceSparseApplyAdagradV2.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceSparseApplyAdagradV2 extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyAdagradV2} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param updateSlots - */ - public Options updateSlots(Boolean updateSlots) { - this.updateSlots = updateSlots; - return this; - } - - private Boolean useLocking; - private Boolean updateSlots; - - private Options() { - } + public static final String OP_NAME = "ResourceSparseApplyAdagradV2"; + + public ResourceSparseApplyAdagradV2(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new ResourceSparseApplyAdagradV2 operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -76,19 +66,23 @@ private Options() { * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyAdagradV2} output and operands * @return a new instance of ResourceSparseApplyAdagradV2 */ - @Endpoint(describeByClass = true) - public static ResourceSparseApplyAdagradV2 create(Scope scope, Operand var, Operand accum, Operand lr, Operand epsilon, Operand grad, Operand indices, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceSparseApplyAdagradV2", scope.makeOpName("ResourceSparseApplyAdagradV2")); + @Endpoint( + describeByClass = true + ) + public static ResourceSparseApplyAdagradV2 create(Scope scope, + Operand var, Operand accum, Operand lr, + Operand epsilon, Operand grad, Operand indices, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceSparseApplyAdagradV2"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(lr.asOutput()); opBuilder.addInput(epsilon.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -101,27 +95,134 @@ public static ResourceSparseApplyAdagradV2 create(Scope scope, } return new ResourceSparseApplyAdagradV2(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param updateSlots + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. */ public static Options updateSlots(Boolean updateSlots) { return new Options().updateSlots(updateSlots); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceSparseApplyAdagradV2"; - - private ResourceSparseApplyAdagradV2(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyAdagradV2} + */ + public static class Options { + private Boolean useLocking; + + private Boolean updateSlots; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. + */ + public Options updateSlots(Boolean updateSlots) { + this.updateSlots = 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 aa0cdb54cb5..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,63 +17,58 @@ 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; /** * Update '*var' according to the centered RMSProp algorithm. - *

* The centered RMSProp algorithm uses an estimate of the centered second moment * (i.e., the variance) for normalization, as opposed to regular RMSProp, which * uses the (uncentered) second moment. This often helps with training, but is * slightly more expensive in terms of computation and memory. - *

- * Note that in dense implementation of this algorithm, mg, ms, and mom will + *

Note that in dense implementation of this algorithm, mg, ms, and mom will * update even if the grad is zero, but in this sparse implementation, mg, ms, * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * mean_grad = decay * mean_grad + (1-decay) * gradient * Delta = learning_rate * gradient / sqrt(mean_square + epsilon - mean_grad ** 2) - *

- * ms <- rho * ms_{t-1} + (1-rho) * grad * grad - * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) - * var <- var - mom + *

ms <- rho * ms_{t-1} + (1-rho) * grad * grad + * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) + * var <- var - mom */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceSparseApplyCenteredRmsProp.OP_NAME, + inputsClass = ResourceSparseApplyCenteredRmsProp.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceSparseApplyCenteredRmsProp extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyCenteredRmsProp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceSparseApplyCenteredRMSProp"; + + public ResourceSparseApplyCenteredRmsProp(Operation operation) { + super(operation, OP_NAME); } - + /** - * Factory method to create a class wrapping a new ResourceSparseApplyCenteredRmsProp operation. - * + * Factory method to create a class wrapping a new ResourceSparseApplyCenteredRMSProp operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param mg Should be from a Variable(). @@ -81,16 +76,22 @@ private Options() { * @param mom Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param rho Decay rate. Must be a scalar. - * @param momentum + * @param momentum 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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyCenteredRMSProp} output and operands * @return a new instance of ResourceSparseApplyCenteredRmsProp */ - @Endpoint(describeByClass = true) - public static ResourceSparseApplyCenteredRmsProp create(Scope scope, Operand var, Operand mg, Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, Operand indices, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceSparseApplyCenteredRMSProp", scope.makeOpName("ResourceSparseApplyCenteredRmsProp")); + @Endpoint( + describeByClass = true + ) + public static ResourceSparseApplyCenteredRmsProp create(Scope scope, + Operand var, Operand mg, Operand ms, + Operand mom, Operand lr, Operand rho, Operand momentum, + Operand epsilon, Operand grad, Operand indices, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceSparseApplyCenteredRmsProp"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(mg.asOutput()); opBuilder.addInput(ms.asOutput()); @@ -101,7 +102,6 @@ public static ResourceSparseApplyCenteredRmsProp create(Scope opBuilder.addInput(epsilon.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -111,20 +111,129 @@ public static ResourceSparseApplyCenteredRmsProp create(Scope } return new ResourceSparseApplyCenteredRmsProp(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, mg, ms, and mom tensors is + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceSparseApplyCenteredRMSProp"; - - private ResourceSparseApplyCenteredRmsProp(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyCenteredRmsProp} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 802a1d86d5e..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,64 +17,53 @@ 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; /** * Update relevant entries in '*var' according to the Ftrl-proximal scheme. - *

* That is for rows we have grad for, we update var, accum and linear as follows: * grad_with_shrinkage = grad + 2 * l2_shrinkage * var * accum_new = accum + grad_with_shrinkage * grad_with_shrinkage * linear += grad_with_shrinkage + - * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var + * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var * quadratic = 1.0 / (accum_new^(lr_power) * lr) + 2 * l2 - * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 + * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 * accum = accum_new */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceSparseApplyFtrl.OP_NAME, + inputsClass = ResourceSparseApplyFtrl.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceSparseApplyFtrl extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyFtrl} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param multiplyLinearByLr - */ - public Options multiplyLinearByLr(Boolean multiplyLinearByLr) { - this.multiplyLinearByLr = multiplyLinearByLr; - return this; - } - - private Boolean useLocking; - private Boolean multiplyLinearByLr; - - private Options() { - } + public static final String OP_NAME = "ResourceSparseApplyFtrlV2"; + + public ResourceSparseApplyFtrl(Operation operation) { + super(operation, OP_NAME); } - + /** - * Factory method to create a class wrapping a new ResourceSparseApplyFtrl operation. - * + * Factory method to create a class wrapping a new ResourceSparseApplyFtrlV2 operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -84,14 +73,20 @@ private Options() { * @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 + * @param l2Shrinkage The l2Shrinkage value * @param lrPower Scaling factor. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyFtrlV2} output and operands * @return a new instance of ResourceSparseApplyFtrl */ - @Endpoint(describeByClass = true) - public static ResourceSparseApplyFtrl create(Scope scope, Operand var, Operand accum, Operand linear, Operand grad, Operand indices, Operand lr, Operand l1, Operand l2, Operand l2Shrinkage, Operand lrPower, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceSparseApplyFtrlV2", scope.makeOpName("ResourceSparseApplyFtrl")); + @Endpoint( + describeByClass = true + ) + public static ResourceSparseApplyFtrl create(Scope scope, + Operand var, Operand accum, Operand linear, + Operand grad, Operand indices, Operand lr, Operand l1, + Operand l2, Operand l2Shrinkage, Operand lrPower, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceSparseApplyFtrl"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(linear.asOutput()); @@ -102,7 +97,6 @@ public static ResourceSparseApplyFtrl create(Scope scope, Oper opBuilder.addInput(l2.asOutput()); opBuilder.addInput(l2Shrinkage.asOutput()); opBuilder.addInput(lrPower.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -115,27 +109,158 @@ public static ResourceSparseApplyFtrl create(Scope scope, Oper } return new ResourceSparseApplyFtrl(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param multiplyLinearByLr + * Sets the multiplyLinearByLr option. + * + * @param multiplyLinearByLr the multiplyLinearByLr option + * @return this Options instance. */ public static Options multiplyLinearByLr(Boolean multiplyLinearByLr) { return new Options().multiplyLinearByLr(multiplyLinearByLr); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceSparseApplyFtrlV2"; - - private ResourceSparseApplyFtrl(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyFtrl} + */ + public static class Options { + private Boolean useLocking; + + private Boolean multiplyLinearByLr; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the multiplyLinearByLr option. + * + * @param multiplyLinearByLr the multiplyLinearByLr option + * @return this Options instance. + */ + public Options multiplyLinearByLr(Boolean multiplyLinearByLr) { + this.multiplyLinearByLr = 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 e0a6eac37e3..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,64 +17,49 @@ 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; /** * Update relevant entries in '*var' and '*accum' according to the momentum scheme. - *

* Set use_nesterov = True if you want to use Nesterov momentum. - *

- * That is for rows we have grad for, we update var and accum as follows: - *

- * accum = accum * momentum - lr * grad + *

That is for rows we have grad for, we update var and accum as follows: + *

accum = accum * momentum - lr * grad * var += accum */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceSparseApplyKerasMomentum.OP_NAME, + inputsClass = ResourceSparseApplyKerasMomentum.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceSparseApplyKerasMomentum extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyKerasMomentum} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param useNesterov If `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 Options useNesterov(Boolean useNesterov) { - this.useNesterov = useNesterov; - return this; - } - - private Boolean useLocking; - private Boolean useNesterov; - - private Options() { - } + public static final String OP_NAME = "ResourceSparseApplyKerasMomentum"; + + public ResourceSparseApplyKerasMomentum(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new ResourceSparseApplyKerasMomentum operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -82,19 +67,23 @@ private Options() { * @param grad The gradient. * @param indices A vector of indices into the first dimension of var and accum. * @param momentum Momentum. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyKerasMomentum} output and operands * @return a new instance of ResourceSparseApplyKerasMomentum */ - @Endpoint(describeByClass = true) - public static ResourceSparseApplyKerasMomentum create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand indices, Operand momentum, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceSparseApplyKerasMomentum", scope.makeOpName("ResourceSparseApplyKerasMomentum")); + @Endpoint( + describeByClass = true + ) + public static ResourceSparseApplyKerasMomentum create(Scope scope, + Operand var, Operand accum, Operand lr, Operand grad, + Operand indices, Operand momentum, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceSparseApplyKerasMomentum"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(lr.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(momentum.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -107,29 +96,140 @@ public static ResourceSparseApplyKerasMomentum create(Scope sc } return new ResourceSparseApplyKerasMomentum(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param useNesterov If `True`, the tensor passed to compute grad will be + * Sets the useNesterov option. + * + * @param useNesterov 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. + * @return this Options instance. */ public static Options useNesterov(Boolean useNesterov) { return new Options().useNesterov(useNesterov); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceSparseApplyKerasMomentum"; - - private ResourceSparseApplyKerasMomentum(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyKerasMomentum} + */ + public static class Options { + private Boolean useLocking; + + private Boolean useNesterov; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the useNesterov option. + * + * @param useNesterov 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. + * @return this Options instance. + */ + public Options useNesterov(Boolean useNesterov) { + this.useNesterov = 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 60ca59ace25..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,64 +17,49 @@ 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; /** * Update relevant entries in '*var' and '*accum' according to the momentum scheme. - *

* Set use_nesterov = True if you want to use Nesterov momentum. - *

- * That is for rows we have grad for, we update var and accum as follows: - *

- * accum = accum * momentum + grad + *

That is for rows we have grad for, we update var and accum as follows: + *

accum = accum * momentum + grad * var -= lr * accum */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceSparseApplyMomentum.OP_NAME, + inputsClass = ResourceSparseApplyMomentum.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceSparseApplyMomentum extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyMomentum} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param useNesterov If `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 Options useNesterov(Boolean useNesterov) { - this.useNesterov = useNesterov; - return this; - } - - private Boolean useLocking; - private Boolean useNesterov; - - private Options() { - } + public static final String OP_NAME = "ResourceSparseApplyMomentum"; + + public ResourceSparseApplyMomentum(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new ResourceSparseApplyMomentum operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -82,19 +67,23 @@ private Options() { * @param grad The gradient. * @param indices A vector of indices into the first dimension of var and accum. * @param momentum Momentum. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyMomentum} output and operands * @return a new instance of ResourceSparseApplyMomentum */ - @Endpoint(describeByClass = true) - public static ResourceSparseApplyMomentum create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand indices, Operand momentum, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceSparseApplyMomentum", scope.makeOpName("ResourceSparseApplyMomentum")); + @Endpoint( + describeByClass = true + ) + public static ResourceSparseApplyMomentum create(Scope scope, + Operand var, Operand accum, Operand lr, Operand grad, + Operand indices, Operand momentum, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceSparseApplyMomentum"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(lr.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(momentum.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -107,29 +96,140 @@ public static ResourceSparseApplyMomentum create(Scope scope, } return new ResourceSparseApplyMomentum(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param useNesterov If `True`, the tensor passed to compute grad will be + * Sets the useNesterov option. + * + * @param useNesterov 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. + * @return this Options instance. */ public static Options useNesterov(Boolean useNesterov) { return new Options().useNesterov(useNesterov); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceSparseApplyMomentum"; - - private ResourceSparseApplyMomentum(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyMomentum} + */ + public static class Options { + private Boolean useLocking; + + private Boolean useNesterov; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the useNesterov option. + * + * @param useNesterov 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. + * @return this Options instance. + */ + public Options useNesterov(Boolean useNesterov) { + this.useNesterov = 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 9fff6b866ff..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,51 +17,50 @@ 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; /** * Sparse update entries in '*var' and '*accum' according to FOBOS algorithm. - *

* That is for rows we have grad for, we update var and accum as follows: - * accum += grad grad + * accum += grad * grad * prox_v = var - * prox_v -= lr grad (1 / sqrt(accum)) - * var = sign(prox_v)/(1+lrl2) max{|prox_v|-lrl1,0} + * prox_v -= lr * grad * (1 / sqrt(accum)) + * var = sign(prox_v)/(1+lrl2) * max{|prox_v|-lrl1,0} */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceSparseApplyProximalAdagrad.OP_NAME, + inputsClass = ResourceSparseApplyProximalAdagrad.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceSparseApplyProximalAdagrad extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyProximalAdagrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceSparseApplyProximalAdagrad"; + + public ResourceSparseApplyProximalAdagrad(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new ResourceSparseApplyProximalAdagrad operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -70,12 +69,17 @@ private Options() { * @param l2 L2 regularization. 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyProximalAdagrad} output and operands * @return a new instance of ResourceSparseApplyProximalAdagrad */ - @Endpoint(describeByClass = true) - public static ResourceSparseApplyProximalAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand l1, Operand l2, Operand grad, Operand indices, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceSparseApplyProximalAdagrad", scope.makeOpName("ResourceSparseApplyProximalAdagrad")); + @Endpoint( + describeByClass = true + ) + public static ResourceSparseApplyProximalAdagrad create(Scope scope, + Operand var, Operand accum, Operand lr, Operand l1, + Operand l2, Operand grad, Operand indices, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceSparseApplyProximalAdagrad"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(lr.asOutput()); @@ -83,7 +87,6 @@ public static ResourceSparseApplyProximalAdagrad create(Scope opBuilder.addInput(l2.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -93,19 +96,108 @@ public static ResourceSparseApplyProximalAdagrad create(Scope } return new ResourceSparseApplyProximalAdagrad(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceSparseApplyProximalAdagrad"; - - private ResourceSparseApplyProximalAdagrad(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyProximalAdagrad} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 bb6cab1e2d3..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,49 +17,48 @@ 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; /** * Sparse update '*var' as FOBOS algorithm with fixed learning rate. - *

* 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} + * prox_v = var - alpha * grad + * var = sign(prox_v)/(1+alphal2) * max{|prox_v|-alphal1,0} */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceSparseApplyProximalGradientDescent.OP_NAME, + inputsClass = ResourceSparseApplyProximalGradientDescent.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceSparseApplyProximalGradientDescent extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyProximalGradientDescent} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the subtraction will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceSparseApplyProximalGradientDescent"; + + public ResourceSparseApplyProximalGradientDescent(Operation operation) { + super(operation, OP_NAME); } - + /** * Factory method to create a class wrapping a new ResourceSparseApplyProximalGradientDescent operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param alpha Scaling factor. Must be a scalar. @@ -67,19 +66,23 @@ private Options() { * @param l2 L2 regularization. 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyProximalGradientDescent} output and operands * @return a new instance of ResourceSparseApplyProximalGradientDescent */ - @Endpoint(describeByClass = true) - public static ResourceSparseApplyProximalGradientDescent create(Scope scope, Operand var, Operand alpha, Operand l1, Operand l2, Operand grad, Operand indices, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceSparseApplyProximalGradientDescent", scope.makeOpName("ResourceSparseApplyProximalGradientDescent")); + @Endpoint( + describeByClass = true + ) + public static ResourceSparseApplyProximalGradientDescent create(Scope scope, + Operand var, Operand alpha, Operand l1, Operand l2, Operand grad, + Operand indices, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceSparseApplyProximalGradientDescent"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(alpha.asOutput()); opBuilder.addInput(l1.asOutput()); opBuilder.addInput(l2.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -89,19 +92,102 @@ public static ResourceSparseApplyProximalGradientDescent creat } return new ResourceSparseApplyProximalGradientDescent(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the subtraction will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceSparseApplyProximalGradientDescent"; - - private ResourceSparseApplyProximalGradientDescent(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyProximalGradientDescent} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 05581cb35c9..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,73 +17,75 @@ 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; /** * Update '*var' according to the RMSProp algorithm. - *

* Note that in dense implementation of this algorithm, ms and mom will * update even if the grad is zero, but in this sparse implementation, ms * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * Delta = learning_rate * gradient / sqrt(mean_square + epsilon) - *

- * ms <- rho * ms_{t-1} + (1-rho) * grad * grad - * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) - * var <- var - mom + *

ms <- rho * ms_{t-1} + (1-rho) * grad * grad + * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) + * var <- var - mom */ -@Operator(group = "train") +@OpMetadata( + opType = ResourceSparseApplyRmsProp.OP_NAME, + inputsClass = ResourceSparseApplyRmsProp.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceSparseApplyRmsProp extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyRmsProp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceSparseApplyRMSProp"; + + public ResourceSparseApplyRmsProp(Operation operation) { + super(operation, OP_NAME); } - + /** - * Factory method to create a class wrapping a new ResourceSparseApplyRmsProp operation. - * + * Factory method to create a class wrapping a new ResourceSparseApplyRMSProp operation. + * * @param scope current scope * @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 + * @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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyRMSProp} output and operands * @return a new instance of ResourceSparseApplyRmsProp */ - @Endpoint(describeByClass = true) - public static ResourceSparseApplyRmsProp create(Scope scope, Operand var, Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, Operand indices, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("ResourceSparseApplyRMSProp", scope.makeOpName("ResourceSparseApplyRmsProp")); + @Endpoint( + describeByClass = true + ) + public static ResourceSparseApplyRmsProp create(Scope scope, + Operand var, Operand ms, Operand mom, + Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, + Operand indices, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ResourceSparseApplyRmsProp"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(ms.asOutput()); opBuilder.addInput(mom.asOutput()); @@ -93,7 +95,6 @@ public static ResourceSparseApplyRmsProp create(Scope scope, O opBuilder.addInput(epsilon.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -103,20 +104,123 @@ public static ResourceSparseApplyRmsProp create(Scope scope, O } return new ResourceSparseApplyRmsProp(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, ms, and mom tensors is protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceSparseApplyRMSProp"; - - private ResourceSparseApplyRmsProp(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyRmsProp} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 bf19384f360..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,41 +20,66 @@ 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; /** * Restores tensors from a V2 checkpoint. - *

* For backward compatibility with the V1 format, this Op currently allows * restoring from a V1 checkpoint as well: - * - This Op first attempts to find the V2 index file pointed to by "prefix", and - * if found proceed to read it as a V2 checkpoint; - * - Otherwise the V1 read path is invoked. + *

    + *
  • This Op first attempts to find the V2 index file pointed to by "prefix", and + * if found proceed to read it as a V2 checkpoint;
  • + *
  • Otherwise the V1 read path is invoked. * Relying on this behavior is not recommended, as the ability to fall back to read - * V1 might be deprecated and eventually removed. - *

    - * By default, restores the named tensors in full. If the caller wishes to restore - * specific slices of stored tensors, "shape_and_slices" should be non-empty + * V1 might be deprecated and eventually removed.

  • + *
+ *

By default, restores the named tensors in full. If the caller wishes to restore + * specific slices of stored tensors, "shape_and_slices" should be non-empty * strings and correspondingly well-formed. - *

- * Callers must ensure all the named tensors are indeed stored in the checkpoint. + *

Callers must ensure all the named tensors are indeed stored in the checkpoint. */ -@Operator(group = "train") +@OpMetadata( + opType = Restore.OP_NAME, + inputsClass = Restore.Inputs.class +) +@Operator( + group = "train" +) public final class Restore extends RawOp implements Iterable> { - /** - * Factory method to create a class wrapping a new Restore operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RestoreV2"; + + private List> tensors; + + @SuppressWarnings("unchecked") + public Restore(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 RestoreV2 operation. + * * @param scope current scope * @param prefix Must have a single element. The prefix of a V2 checkpoint. * @param tensorNames shape {N}. The names of the tensors to be restored. @@ -64,41 +89,68 @@ public final class Restore extends RawOp implements Iterable> { * those stored in the checkpoint. * @return a new instance of Restore */ - @Endpoint(describeByClass = true) - public static Restore create(Scope scope, Operand prefix, Operand tensorNames, Operand shapeAndSlices, List> dtypes) { - OperationBuilder opBuilder = scope.env().opBuilder("RestoreV2", scope.makeOpName("Restore")); + @Endpoint( + describeByClass = true + ) + public static Restore create(Scope scope, Operand prefix, Operand tensorNames, + Operand shapeAndSlices, List> dtypes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Restore"); opBuilder.addInput(prefix.asOutput()); opBuilder.addInput(tensorNames.asOutput()); opBuilder.addInput(shapeAndSlices.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); return new Restore(opBuilder.build()); } - + /** + * Gets tensors. * shape {N}. The restored tensors, whose shapes are read from the * checkpoint directly. + * @return tensors. */ public List> tensors() { return tensors; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) tensors.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RestoreV2"; - - private List> tensors; - - private Restore(Operation operation) { - super(operation); - int outputIdx = 0; - int tensorsLength = operation.outputListLength("tensors"); - tensors = Arrays.asList(operation.outputList(outputIdx, tensorsLength)); - outputIdx += tensorsLength; + + @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 579b5b8dbad..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,56 +17,56 @@ 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; /** * Restores a tensor from checkpoint files. - *

- * This is like `Restore` except that restored tensor can be listed as filling - * only a slice of a larger tensor. `shape_and_slice` specifies the shape of the + * This is like {@code Restore} except that restored tensor can be listed as filling + * only a slice of a larger tensor. {@code shape_and_slice} specifies the shape of the * larger tensor and the slice that the restored tensor covers. - *

- * The `shape_and_slice` input has the same format as the - * elements of the `shapes_and_slices` input of the `SaveSlices` op. - * - * @param data type for {@code tensor()} output + *

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. */ -@Operator(group = "train") +@OpMetadata( + opType = RestoreSlice.OP_NAME, + inputsClass = RestoreSlice.Inputs.class +) +@Operator( + group = "train" +) public final class RestoreSlice extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.RestoreSlice} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param preferredShard Index of file to open first if multiple files match - * `file_pattern`. See the documentation for `Restore`. - */ - public Options preferredShard(Long preferredShard) { - this.preferredShard = preferredShard; - return this; - } - - private Long preferredShard; - - private Options() { - } + public static final String OP_NAME = "RestoreSlice"; + + private Output tensor; + + public RestoreSlice(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + tensor = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RestoreSlice operation. - * + * * @param scope current scope * @param filePattern Must have a single element. The pattern of the files from * which we read the tensor. @@ -75,16 +75,20 @@ private Options() { * @param shapeAndSlice Scalar. The shapes and slice specifications to use when * restoring a tensors. * @param dt The type of the tensor to be restored. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code RestoreSlice} output and operands * @return a new instance of RestoreSlice */ - @Endpoint(describeByClass = true) - public static RestoreSlice create(Scope scope, Operand filePattern, Operand tensorName, Operand shapeAndSlice, Class dt, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("RestoreSlice", scope.makeOpName("RestoreSlice")); + @Endpoint( + describeByClass = true + ) + public static RestoreSlice create(Scope scope, Operand filePattern, + Operand tensorName, Operand shapeAndSlice, Class dt, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RestoreSlice"); opBuilder.addInput(filePattern.asOutput()); opBuilder.addInput(tensorName.asOutput()); opBuilder.addInput(shapeAndSlice.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dt", Operands.toDataType(dt)); if (options != null) { for (Options opts : options) { @@ -93,37 +97,97 @@ public static RestoreSlice create(Scope scope, Operand(opBuilder.build()); + return new RestoreSlice<>(opBuilder.build()); } - + /** + * Sets the preferredShard option. + * * @param preferredShard Index of file to open first if multiple files match - * `file_pattern`. See the documentation for `Restore`. + * {@code file_pattern}. See the documentation for {@code Restore}. + * @return this Options instance. */ public static Options preferredShard(Long preferredShard) { return new Options().preferredShard(preferredShard); } - + /** + * Gets tensor. * The restored tensor. + * @return tensor. */ public Output tensor() { return tensor; } - + @Override public Output asOutput() { return tensor; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RestoreSlice"; - - private Output tensor; - - private RestoreSlice(Operation operation) { - super(operation); - int outputIdx = 0; - tensor = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.RestoreSlice} + */ + public static class Options { + private Long preferredShard; + + private Options() { + } + + /** + * Sets the preferredShard option. + * + * @param preferredShard Index of file to open first if multiple files match + * {@code file_pattern}. See the documentation for {@code Restore}. + * @return this Options instance. + */ + public Options preferredShard(Long preferredShard) { + this.preferredShard = 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 fc4b2167194..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,53 +17,111 @@ 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; /** * Saves tensors in V2 checkpoint format. - *

* By default, saves the named tensors in full. If the caller wishes to save - * specific slices of full tensors, "shape_and_slices" should be non-empty strings + * specific slices of full tensors, "shape_and_slices" should be non-empty strings * and correspondingly well-formed. */ -@Operator(group = "train") +@OpMetadata( + opType = Save.OP_NAME, + inputsClass = Save.Inputs.class +) +@Operator( + group = "train" +) public final class Save extends RawOp { - /** - * Factory method to create a class wrapping a new Save operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SaveV2"; + + public Save(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new SaveV2 operation. + * * @param scope current scope * @param prefix Must have a single element. The prefix of the V2 checkpoint to which we * write the tensors. * @param tensorNames shape {N}. The names of the tensors to be saved. * @param shapeAndSlices shape {N}. The slice specs of the tensors to be saved. * Empty strings indicate that they are non-partitioned tensors. - * @param tensors `N` tensors to save. + * @param tensors {@code N} tensors to save. * @return a new instance of Save */ - @Endpoint(describeByClass = true) - public static Save create(Scope scope, Operand prefix, Operand tensorNames, Operand shapeAndSlices, Iterable> tensors) { - OperationBuilder opBuilder = scope.env().opBuilder("SaveV2", scope.makeOpName("Save")); + @Endpoint( + describeByClass = true + ) + public static Save create(Scope scope, Operand prefix, Operand tensorNames, + Operand shapeAndSlices, Iterable> tensors) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Save"); opBuilder.addInput(prefix.asOutput()); opBuilder.addInput(tensorNames.asOutput()); opBuilder.addInput(shapeAndSlices.asOutput()); opBuilder.addInputList(Operands.asOutputs(tensors)); - opBuilder = scope.apply(opBuilder); return new Save(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SaveV2"; - - private Save(Operation operation) { - super(operation); + + @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 002d3a36fd7..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,79 +17,128 @@ 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; /** * Saves input tensors slices to disk. - *

- * This is like `Save` except that tensors can be listed in the saved file as being - * a slice of a larger tensor. `shapes_and_slices` specifies the shape of the - * larger tensor and the slice that this tensor covers. `shapes_and_slices` must - * have as many elements as `tensor_names`. - *

- * Elements of the `shapes_and_slices` input must either be: + * This is like {@code Save} except that tensors can be listed in the saved file as being + * a slice of a larger tensor. {@code shapes_and_slices} specifies the shape of the + * larger tensor and the slice that this tensor covers. {@code shapes_and_slices} must + * have as many elements as {@code tensor_names}. + *

Elements of the {@code shapes_and_slices} input must either be: *

    - *
  • - * The empty string, in which case the corresponding tensor is - * saved normally. - *
  • - *
  • - * A string of the form `dim0 dim1 ... dimN-1 slice-spec` where the - * `dimI` are the dimensions of the larger tensor and `slice-spec` - * specifies what part is covered by the tensor to save. - *
  • + *
  • The empty string, in which case the corresponding tensor is + * saved normally.
  • + *
  • A string of the form {@code dim0 dim1 ... dimN-1 slice-spec} where the + * {@code dimI} are the dimensions of the larger tensor and {@code slice-spec} + * specifies what part is covered by the tensor to save.
  • *
- * `slice-spec` itself is a `:`-separated list: `slice0:slice1:...:sliceN-1` - * where each `sliceI` is either: + *

{@code slice-spec} itself is a {@code :}-separated list: {@code slice0:slice1:...:sliceN-1} + * where each {@code sliceI} is either: *

    - *
  • - * The string `-` meaning that the slice covers all indices of this dimension - *
  • - *
  • - * `start,length` where `start` and `length` are integers. In that - * case the slice covers `length` indices starting at `start`. - *
  • + *
  • The string {@code -} meaning that the slice covers all indices of this dimension
  • + *
  • {@code start,length} where {@code start} and {@code length} are integers. In that + * case the slice covers {@code length} indices starting at {@code start}.
  • *
- * See also `Save`. + *

See also {@code Save}. */ -@Operator(group = "train") +@OpMetadata( + opType = SaveSlices.OP_NAME, + inputsClass = SaveSlices.Inputs.class +) +@Operator( + group = "train" +) public final class SaveSlices extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SaveSlices"; + + public SaveSlices(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new SaveSlices operation. - * + * * @param scope current scope * @param filename Must have a single element. The name of the file to which we write the * tensor. - * @param tensorNames Shape `[N]`. The names of the tensors to be saved. - * @param shapesAndSlices Shape `[N]`. The shapes and slice specifications to use when + * @param tensorNames Shape {@code [N]}. The names of the tensors to be saved. + * @param shapesAndSlices Shape {@code [N]}. The shapes and slice specifications to use when * saving the tensors. - * @param data `N` tensors to save. + * @param data {@code N} tensors to save. * @return a new instance of SaveSlices */ - @Endpoint(describeByClass = true) - public static SaveSlices create(Scope scope, Operand filename, Operand tensorNames, Operand shapesAndSlices, Iterable> data) { - OperationBuilder opBuilder = scope.env().opBuilder("SaveSlices", scope.makeOpName("SaveSlices")); + @Endpoint( + describeByClass = true + ) + public static SaveSlices create(Scope scope, Operand filename, + Operand tensorNames, Operand shapesAndSlices, Iterable> data) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SaveSlices"); opBuilder.addInput(filename.asOutput()); opBuilder.addInput(tensorNames.asOutput()); opBuilder.addInput(shapesAndSlices.asOutput()); opBuilder.addInputList(Operands.asOutputs(data)); - opBuilder = scope.apply(opBuilder); return new SaveSlices(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SaveSlices"; - - private SaveSlices(Operation operation) { - super(operation); + + @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 ac5d223ec6b..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,45 +36,71 @@ /** * Computes fingerprints of the input strings. */ -@Operator(group = "train") +@OpMetadata( + opType = SdcaFprint.OP_NAME, + inputsClass = SdcaFprint.Inputs.class +) +@Operator( + group = "train" +) public final class SdcaFprint extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SdcaFprint"; + + private Output output; + + public SdcaFprint(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SdcaFprint operation. - * + * * @param scope current scope * @param input vector of strings to compute fingerprints on. * @return a new instance of SdcaFprint */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static SdcaFprint create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("SdcaFprint", scope.makeOpName("SdcaFprint")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SdcaFprint"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); return new SdcaFprint(opBuilder.build()); } - + /** + * Gets output. * a (N,2) shaped matrix where N is the number of elements in the input * vector. Each row contains the low and high parts of the fingerprint. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SdcaFprint"; - - private Output output; - - private SdcaFprint(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 1c2d500faab..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,63 +19,73 @@ 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; /** * 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](http://arxiv.org/pdf/1211.2717v1.pdf).
+ *

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](http://arxiv.org/abs/1502.03508).
+ *

$$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](https://arxiv.org/abs/1502.08053).
+ *

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 { - /** - * Optional attributes for {@link org.tensorflow.op.train.SdcaOptimizer} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param adaptive Whether to use Adaptive SDCA for the inner loop. - */ - public Options adaptive(Boolean adaptive) { - this.adaptive = adaptive; - return this; - } - - private Boolean adaptive; - - private Options() { - } + public static final String OP_NAME = "SdcaOptimizerV2"; + + private Output outExampleStateData; + + private List> outDeltaSparseWeights; + + private List> outDeltaDenseWeights; + + @SuppressWarnings("unchecked") + public SdcaOptimizer(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outExampleStateData = operation.output(outputIdx++); + int outDeltaSparseWeightsLength = operation.outputListLength("out_delta_sparse_weights"); + outDeltaSparseWeights = Arrays.asList((Output[]) operation.outputList(outputIdx, outDeltaSparseWeightsLength)); + outputIdx += outDeltaSparseWeightsLength; + int outDeltaDenseWeightsLength = operation.outputListLength("out_delta_dense_weights"); + outDeltaDenseWeights = Arrays.asList((Output[]) operation.outputList(outputIdx, outDeltaDenseWeightsLength)); + outputIdx += outDeltaDenseWeightsLength; } - + /** - * Factory method to create a class wrapping a new SdcaOptimizer operation. - * + * Factory method to create a class wrapping a new SdcaOptimizerV2 operation. + * * @param scope current scope * @param sparseExampleIndices a list of vectors which contain example indices. * @param sparseFeatureIndices a list of vectors which contain feature indices. @@ -100,12 +110,20 @@ private Options() { * @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 attributes values + * @param options carries optional attribute values * @return a new instance of SdcaOptimizer */ - @Endpoint(describeByClass = true) - public static SdcaOptimizer create(Scope scope, 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, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SdcaOptimizerV2", scope.makeOpName("SdcaOptimizer")); + @Endpoint( + describeByClass = true + ) + public static SdcaOptimizer create(Scope scope, 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, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SdcaOptimizer"); opBuilder.addInputList(Operands.asOutputs(sparseExampleIndices)); opBuilder.addInputList(Operands.asOutputs(sparseFeatureIndices)); opBuilder.addInputList(Operands.asOutputs(sparseFeatureValues)); @@ -116,7 +134,6 @@ public static SdcaOptimizer create(Scope scope, Iterable> sparse opBuilder.addInputList(Operands.asOutputs(sparseWeights)); opBuilder.addInputList(Operands.asOutputs(denseWeights)); opBuilder.addInput(exampleStateData.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("loss_type", lossType); opBuilder.setAttr("l1", l1); opBuilder.setAttr("l2", l2); @@ -131,55 +148,193 @@ public static SdcaOptimizer create(Scope scope, Iterable> sparse } return new SdcaOptimizer(opBuilder.build()); } - + /** + * Sets the adaptive option. + * * @param adaptive Whether to use Adaptive SDCA for the inner loop. + * @return this Options instance. */ public static Options adaptive(Boolean adaptive) { return new Options().adaptive(adaptive); } - + /** + * Gets outExampleStateData. * a list of vectors containing the updated example state * data. + * @return outExampleStateData. */ public Output outExampleStateData() { return outExampleStateData; } - + /** + * Gets outDeltaSparseWeights. * a list of vectors where each value is the delta * weights associated with a sparse feature group. + * @return outDeltaSparseWeights. */ public List> outDeltaSparseWeights() { return outDeltaSparseWeights; } - + /** + * Gets outDeltaDenseWeights. * a list of vectors where the values are the delta * weights associated with a dense feature group. + * @return outDeltaDenseWeights. */ public List> outDeltaDenseWeights() { return outDeltaDenseWeights; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SdcaOptimizerV2"; - - private Output outExampleStateData; - private List> outDeltaSparseWeights; - private List> outDeltaDenseWeights; - - @SuppressWarnings("unchecked") - private SdcaOptimizer(Operation operation) { - super(operation); - int outputIdx = 0; - outExampleStateData = operation.output(outputIdx++); - int outDeltaSparseWeightsLength = operation.outputListLength("out_delta_sparse_weights"); - outDeltaSparseWeights = Arrays.asList((Output[])operation.outputList(outputIdx, outDeltaSparseWeightsLength)); - outputIdx += outDeltaSparseWeightsLength; - int outDeltaDenseWeightsLength = operation.outputListLength("out_delta_dense_weights"); - outDeltaDenseWeights = Arrays.asList((Output[])operation.outputList(outputIdx, outDeltaDenseWeightsLength)); - outputIdx += outDeltaDenseWeightsLength; + + /** + * Optional attributes for {@link org.tensorflow.op.train.SdcaOptimizer} + */ + public static class Options { + private Boolean adaptive; + + private Options() { + } + + /** + * Sets the adaptive option. + * + * @param adaptive Whether to use Adaptive SDCA for the inner loop. + * @return this Options instance. + */ + public Options adaptive(Boolean adaptive) { + this.adaptive = 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 ddd44197c72..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,25 +17,44 @@ 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. */ -@Operator(group = "train") +@OpMetadata( + opType = SdcaShrinkL1.OP_NAME, + inputsClass = SdcaShrinkL1.Inputs.class +) +@Operator( + group = "train" +) public final class SdcaShrinkL1 extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SdcaShrinkL1"; + + public SdcaShrinkL1(Operation operation) { + super(operation, OP_NAME); + } + /** * Factory method to create a class wrapping a new SdcaShrinkL1 operation. - * + * * @param scope current scope * @param weights a list of vectors where each value is the weight associated with a * feature group. @@ -43,20 +62,46 @@ public final class SdcaShrinkL1 extends RawOp { * @param l2 Symmetric l2 regularization strength. Should be a positive float. * @return a new instance of SdcaShrinkL1 */ - @Endpoint(describeByClass = true) - public static SdcaShrinkL1 create(Scope scope, Iterable> weights, Float l1, Float l2) { - OperationBuilder opBuilder = scope.env().opBuilder("SdcaShrinkL1", scope.makeOpName("SdcaShrinkL1")); + @Endpoint( + describeByClass = true + ) + public static SdcaShrinkL1 create(Scope scope, Iterable> weights, Float l1, + Float l2) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SdcaShrinkL1"); opBuilder.addInputList(Operands.asOutputs(weights)); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("l1", l1); opBuilder.setAttr("l2", l2); return new SdcaShrinkL1(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SdcaShrinkL1"; - - private SdcaShrinkL1(Operation operation) { - super(operation); + + @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 174f3bfecd4..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,50 +17,52 @@ 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 */ -@Operator(group = "train") +@OpMetadata( + opType = SparseApplyAdadelta.OP_NAME, + inputsClass = SparseApplyAdadelta.Inputs.class +) +@Operator( + group = "train" +) public final class SparseApplyAdadelta extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.SparseApplyAdadelta} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "SparseApplyAdadelta"; + + private Output out; + + public SparseApplyAdadelta(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseApplyAdadelta operation. - * + * * @param scope current scope - * @param var + * @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. @@ -68,12 +70,17 @@ private Options() { * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyAdadelta} output and operands * @return a new instance of SparseApplyAdadelta */ - @Endpoint(describeByClass = true) - public static SparseApplyAdadelta create(Scope scope, Operand var, Operand accum, Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, Operand grad, Operand indices, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseApplyAdadelta", scope.makeOpName("SparseApplyAdadelta")); + @Endpoint( + describeByClass = true + ) + public static SparseApplyAdadelta create(Scope scope, Operand var, + Operand accum, Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, + Operand grad, Operand indices, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseApplyAdadelta"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(accumUpdate.asOutput()); @@ -82,7 +89,6 @@ public static SparseApplyAdadelta create(Scope scope, Opera opBuilder.addInput(epsilon.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -90,37 +96,130 @@ public static SparseApplyAdadelta create(Scope scope, Opera } } } - return new SparseApplyAdadelta(opBuilder.build()); + return new SparseApplyAdadelta<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseApplyAdadelta"; - - private Output out; - - private SparseApplyAdadelta(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.SparseApplyAdadelta} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 8df06b5e426..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,61 +17,53 @@ 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; /** * 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 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 { - /** - * Optional attributes for {@link org.tensorflow.op.train.SparseApplyAdagrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param updateSlots - */ - public Options updateSlots(Boolean updateSlots) { - this.updateSlots = updateSlots; - return this; - } - - private Boolean useLocking; - private Boolean updateSlots; - - private Options() { - } + public static final String OP_NAME = "SparseApplyAdagradV2"; + + private Output out; + + public SparseApplyAdagrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new SparseApplyAdagrad operation. - * + * Factory method to create a class wrapping a new SparseApplyAdagradV2 operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -79,19 +71,23 @@ private Options() { * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyAdagradV2} output and operands * @return a new instance of SparseApplyAdagrad */ - @Endpoint(describeByClass = true) - public static SparseApplyAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand epsilon, Operand grad, Operand indices, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseApplyAdagradV2", scope.makeOpName("SparseApplyAdagrad")); + @Endpoint( + describeByClass = true + ) + public static SparseApplyAdagrad create(Scope scope, Operand var, + Operand accum, Operand lr, Operand epsilon, Operand grad, + Operand indices, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseApplyAdagrad"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(lr.asOutput()); opBuilder.addInput(epsilon.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -102,45 +98,150 @@ public static SparseApplyAdagrad create(Scope scope, Operan } } } - return new SparseApplyAdagrad(opBuilder.build()); + return new SparseApplyAdagrad<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param updateSlots + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. */ public static Options updateSlots(Boolean updateSlots) { return new Options().updateSlots(updateSlots); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseApplyAdagradV2"; - - private Output out; - - private SparseApplyAdagrad(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.SparseApplyAdagrad} + */ + public static class Options { + private Boolean useLocking; + + private Boolean updateSlots; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. + */ + public Options updateSlots(Boolean updateSlots) { + this.updateSlots = 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 2e8aede1551..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,49 +17,51 @@ 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 */ -@Operator(group = "train") +@OpMetadata( + opType = SparseApplyAdagradDa.OP_NAME, + inputsClass = SparseApplyAdagradDa.Inputs.class +) +@Operator( + group = "train" +) public final class SparseApplyAdagradDa extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.SparseApplyAdagradDa} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "SparseApplyAdagradDA"; + + private Output out; + + public SparseApplyAdagradDa(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new SparseApplyAdagradDa operation. - * + * Factory method to create a class wrapping a new SparseApplyAdagradDA operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param gradientAccumulator Should be from a Variable(). @@ -70,12 +72,18 @@ private Options() { * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 regularization. Must be a scalar. * @param globalStep Training step number. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyAdagradDA} output and operands * @return a new instance of SparseApplyAdagradDa */ - @Endpoint(describeByClass = true) - public static SparseApplyAdagradDa create(Scope scope, Operand var, Operand gradientAccumulator, Operand gradientSquaredAccumulator, Operand grad, Operand indices, Operand lr, Operand l1, Operand l2, Operand globalStep, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseApplyAdagradDA", scope.makeOpName("SparseApplyAdagradDa")); + @Endpoint( + describeByClass = true + ) + public static SparseApplyAdagradDa create(Scope scope, Operand var, + Operand gradientAccumulator, Operand gradientSquaredAccumulator, Operand grad, + Operand indices, Operand lr, Operand l1, Operand l2, + Operand globalStep, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseApplyAdagradDa"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(gradientAccumulator.asOutput()); opBuilder.addInput(gradientSquaredAccumulator.asOutput()); @@ -85,7 +93,6 @@ public static SparseApplyAdagradDa create(Scope scope, Oper opBuilder.addInput(l1.asOutput()); opBuilder.addInput(l2.asOutput()); opBuilder.addInput(globalStep.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -93,37 +100,136 @@ public static SparseApplyAdagradDa create(Scope scope, Oper } } } - return new SparseApplyAdagradDa(opBuilder.build()); + return new SparseApplyAdagradDa<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseApplyAdagradDA"; - - private Output out; - - private SparseApplyAdagradDa(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.SparseApplyAdagradDa} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 88ea8cf91f3..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,66 +17,63 @@ 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; /** * Update '*var' according to the centered RMSProp algorithm. - *

* The centered RMSProp algorithm uses an estimate of the centered second moment * (i.e., the variance) for normalization, as opposed to regular RMSProp, which * uses the (uncentered) second moment. This often helps with training, but is * slightly more expensive in terms of computation and memory. - *

- * Note that in dense implementation of this algorithm, mg, ms, and mom will + *

Note that in dense implementation of this algorithm, mg, ms, and mom will * update even if the grad is zero, but in this sparse implementation, mg, ms, * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * mean_grad = decay * mean_grad + (1-decay) * gradient * Delta = learning_rate * gradient / sqrt(mean_square + epsilon - mean_grad ** 2) - *

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

$$ms <- rho * ms_{t-1} + (1-rho) * grad * grad$$ + * $$mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon)$$ + * $$var <- var - mom$$ */ -@Operator(group = "train") +@OpMetadata( + opType = SparseApplyCenteredRmsProp.OP_NAME, + inputsClass = SparseApplyCenteredRmsProp.Inputs.class +) +@Operator( + group = "train" +) public final class SparseApplyCenteredRmsProp extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.SparseApplyCenteredRmsProp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "SparseApplyCenteredRMSProp"; + + private Output out; + + public SparseApplyCenteredRmsProp(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new SparseApplyCenteredRmsProp operation. - * + * Factory method to create a class wrapping a new SparseApplyCenteredRMSProp operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param mg Should be from a Variable(). @@ -84,16 +81,22 @@ private Options() { * @param mom Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param rho Decay rate. Must be a scalar. - * @param momentum + * @param momentum 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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyCenteredRMSProp} output and operands * @return a new instance of SparseApplyCenteredRmsProp */ - @Endpoint(describeByClass = true) - public static SparseApplyCenteredRmsProp create(Scope scope, Operand var, Operand mg, Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, Operand indices, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseApplyCenteredRMSProp", scope.makeOpName("SparseApplyCenteredRmsProp")); + @Endpoint( + describeByClass = true + ) + public static SparseApplyCenteredRmsProp create(Scope scope, Operand var, + Operand mg, Operand ms, Operand mom, Operand lr, Operand rho, + Operand momentum, Operand epsilon, Operand grad, Operand indices, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseApplyCenteredRmsProp"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(mg.asOutput()); opBuilder.addInput(ms.asOutput()); @@ -104,7 +107,6 @@ public static SparseApplyCenteredRmsProp create(Scope scope opBuilder.addInput(epsilon.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -112,38 +114,145 @@ public static SparseApplyCenteredRmsProp create(Scope scope } } } - return new SparseApplyCenteredRmsProp(opBuilder.build()); + return new SparseApplyCenteredRmsProp<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, mg, ms, and mom tensors is + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseApplyCenteredRMSProp"; - - private Output out; - - private SparseApplyCenteredRmsProp(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.SparseApplyCenteredRmsProp} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 f720183d7e7..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,67 +17,58 @@ 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; /** * Update relevant entries in '*var' according to the Ftrl-proximal scheme. - *

* That is for rows we have grad for, we update var, accum and linear as follows: * grad_with_shrinkage = grad + 2 * l2_shrinkage * var * accum_new = accum + grad * grad * linear += grad_with_shrinkage - - * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var + * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var * quadratic = 1.0 / (accum_new^(lr_power) * lr) + 2 * l2 - * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 + * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 * accum = accum_new - * - * @param data type for {@code out()} output */ -@Operator(group = "train") +@OpMetadata( + opType = SparseApplyFtrl.OP_NAME, + inputsClass = SparseApplyFtrl.Inputs.class +) +@Operator( + group = "train" +) public final class SparseApplyFtrl extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.SparseApplyFtrl} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param multiplyLinearByLr - */ - public Options multiplyLinearByLr(Boolean multiplyLinearByLr) { - this.multiplyLinearByLr = multiplyLinearByLr; - return this; - } - - private Boolean useLocking; - private Boolean multiplyLinearByLr; - - private Options() { - } + public static final String OP_NAME = "SparseApplyFtrlV2"; + + private Output out; + + public SparseApplyFtrl(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new SparseApplyFtrl operation. - * + * Factory method to create a class wrapping a new SparseApplyFtrlV2 operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -87,14 +78,20 @@ private Options() { * @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 + * @param l2Shrinkage The l2Shrinkage value * @param lrPower Scaling factor. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyFtrlV2} output and operands * @return a new instance of SparseApplyFtrl */ - @Endpoint(describeByClass = true) - public static SparseApplyFtrl create(Scope scope, Operand var, Operand accum, Operand linear, Operand grad, Operand indices, Operand lr, Operand l1, Operand l2, Operand l2Shrinkage, Operand lrPower, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseApplyFtrlV2", scope.makeOpName("SparseApplyFtrl")); + @Endpoint( + describeByClass = true + ) + public static SparseApplyFtrl create(Scope scope, Operand var, + Operand accum, Operand linear, Operand grad, Operand indices, + Operand lr, Operand l1, Operand l2, Operand l2Shrinkage, Operand lrPower, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseApplyFtrl"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(linear.asOutput()); @@ -105,7 +102,6 @@ public static SparseApplyFtrl create(Scope scope, Operand SparseApplyFtrl create(Scope scope, Operand(opBuilder.build()); + return new SparseApplyFtrl<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param multiplyLinearByLr + * Sets the multiplyLinearByLr option. + * + * @param multiplyLinearByLr the multiplyLinearByLr option + * @return this Options instance. */ public static Options multiplyLinearByLr(Boolean multiplyLinearByLr) { return new Options().multiplyLinearByLr(multiplyLinearByLr); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseApplyFtrlV2"; - - private Output out; - - private SparseApplyFtrl(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.SparseApplyFtrl} + */ + public static class Options { + private Boolean useLocking; + + private Boolean multiplyLinearByLr; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the multiplyLinearByLr option. + * + * @param multiplyLinearByLr the multiplyLinearByLr option + * @return this Options instance. + */ + public Options multiplyLinearByLr(Boolean multiplyLinearByLr) { + this.multiplyLinearByLr = 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 577ea1ac28b..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,67 +17,54 @@ 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; /** * Update relevant entries in '*var' and '*accum' according to the momentum scheme. - *

* Set use_nesterov = True if you want to use Nesterov momentum. - *

- * That is for rows we have grad for, we update var and accum as follows: - *

- * $$accum = accum * momentum + grad$$ + *

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 */ -@Operator(group = "train") +@OpMetadata( + opType = SparseApplyMomentum.OP_NAME, + inputsClass = SparseApplyMomentum.Inputs.class +) +@Operator( + group = "train" +) public final class SparseApplyMomentum extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.SparseApplyMomentum} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param useNesterov If `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 Options useNesterov(Boolean useNesterov) { - this.useNesterov = useNesterov; - return this; - } - - private Boolean useLocking; - private Boolean useNesterov; - - private Options() { - } + public static final String OP_NAME = "SparseApplyMomentum"; + + private Output out; + + public SparseApplyMomentum(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseApplyMomentum operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -85,19 +72,23 @@ private Options() { * @param grad The gradient. * @param indices A vector of indices into the first dimension of var and accum. * @param momentum Momentum. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyMomentum} output and operands * @return a new instance of SparseApplyMomentum */ - @Endpoint(describeByClass = true) - public static SparseApplyMomentum create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand indices, Operand momentum, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseApplyMomentum", scope.makeOpName("SparseApplyMomentum")); + @Endpoint( + describeByClass = true + ) + public static SparseApplyMomentum create(Scope scope, Operand var, + Operand accum, Operand lr, Operand grad, Operand indices, + Operand momentum, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseApplyMomentum"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(lr.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(momentum.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -108,47 +99,156 @@ public static SparseApplyMomentum create(Scope scope, Opera } } } - return new SparseApplyMomentum(opBuilder.build()); + return new SparseApplyMomentum<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param useNesterov If `True`, the tensor passed to compute grad will be + * Sets the useNesterov option. + * + * @param useNesterov 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. + * @return this Options instance. */ public static Options useNesterov(Boolean useNesterov) { return new Options().useNesterov(useNesterov); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseApplyMomentum"; - - private Output out; - - private SparseApplyMomentum(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.SparseApplyMomentum} + */ + public static class Options { + private Boolean useLocking; + + private Boolean useNesterov; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the useNesterov option. + * + * @param useNesterov 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. + * @return this Options instance. + */ + public Options useNesterov(Boolean useNesterov) { + this.useNesterov = 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 f38f42737ef..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,54 +17,55 @@ 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; /** * Sparse update entries in '*var' and '*accum' according to FOBOS algorithm. - *

* That is for rows we have grad for, we update var and accum as follows: - * $$accum += grad grad$$ + * $$accum += grad * grad$$ * $$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 + * $$prox_v -= lr * grad * (1 / sqrt(accum))$$ + * $$var = sign(prox_v)/(1+lrl2) * max{|prox_v|-lrl1,0}$$ */ -@Operator(group = "train") +@OpMetadata( + opType = SparseApplyProximalAdagrad.OP_NAME, + inputsClass = SparseApplyProximalAdagrad.Inputs.class +) +@Operator( + group = "train" +) public final class SparseApplyProximalAdagrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.SparseApplyProximalAdagrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking 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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "SparseApplyProximalAdagrad"; + + private Output out; + + public SparseApplyProximalAdagrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseApplyProximalAdagrad operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -73,12 +74,17 @@ private Options() { * @param l2 L2 regularization. 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyProximalAdagrad} output and operands * @return a new instance of SparseApplyProximalAdagrad */ - @Endpoint(describeByClass = true) - public static SparseApplyProximalAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand l1, Operand l2, Operand grad, Operand indices, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseApplyProximalAdagrad", scope.makeOpName("SparseApplyProximalAdagrad")); + @Endpoint( + describeByClass = true + ) + public static SparseApplyProximalAdagrad create(Scope scope, Operand var, + Operand accum, Operand lr, Operand l1, Operand l2, Operand grad, + Operand indices, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseApplyProximalAdagrad"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); opBuilder.addInput(lr.asOutput()); @@ -86,7 +92,6 @@ public static SparseApplyProximalAdagrad create(Scope scope opBuilder.addInput(l2.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -94,37 +99,124 @@ public static SparseApplyProximalAdagrad create(Scope scope } } } - return new SparseApplyProximalAdagrad(opBuilder.build()); + return new SparseApplyProximalAdagrad<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseApplyProximalAdagrad"; - - private Output out; - - private SparseApplyProximalAdagrad(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.SparseApplyProximalAdagrad} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 169b8d4f0c2..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,52 +17,53 @@ 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; /** * Sparse update '*var' as FOBOS algorithm with fixed learning rate. - *

* 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 + * $$prox_v = var - alpha * grad$$ + * $$var = sign(prox_v)/(1+alphal2) * max{|prox_v|-alphal1,0}$$ */ -@Operator(group = "train") +@OpMetadata( + opType = SparseApplyProximalGradientDescent.OP_NAME, + inputsClass = SparseApplyProximalGradientDescent.Inputs.class +) +@Operator( + group = "train" +) public final class SparseApplyProximalGradientDescent extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.SparseApplyProximalGradientDescent} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the subtraction will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "SparseApplyProximalGradientDescent"; + + private Output out; + + public SparseApplyProximalGradientDescent(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseApplyProximalGradientDescent operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param alpha Scaling factor. Must be a scalar. @@ -70,19 +71,23 @@ private Options() { * @param l2 L2 regularization. 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyProximalGradientDescent} output and operands * @return a new instance of SparseApplyProximalGradientDescent */ - @Endpoint(describeByClass = true) - public static SparseApplyProximalGradientDescent create(Scope scope, Operand var, Operand alpha, Operand l1, Operand l2, Operand grad, Operand indices, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseApplyProximalGradientDescent", scope.makeOpName("SparseApplyProximalGradientDescent")); + @Endpoint( + describeByClass = true + ) + public static SparseApplyProximalGradientDescent create(Scope scope, + Operand var, Operand alpha, Operand l1, Operand l2, Operand grad, + Operand indices, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseApplyProximalGradientDescent"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(alpha.asOutput()); opBuilder.addInput(l1.asOutput()); opBuilder.addInput(l2.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -90,37 +95,118 @@ public static SparseApplyProximalGradientDescent create(Sco } } } - return new SparseApplyProximalGradientDescent(opBuilder.build()); + return new SparseApplyProximalGradientDescent<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the subtraction will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseApplyProximalGradientDescent"; - - private Output out; - - private SparseApplyProximalGradientDescent(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.SparseApplyProximalGradientDescent} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 6de8f3be05d..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,76 +17,79 @@ 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; /** * Update '*var' according to the RMSProp algorithm. - *

* Note that in dense implementation of this algorithm, ms and mom will * update even if the grad is zero, but in this sparse implementation, ms * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * Delta = learning_rate * gradient / sqrt(mean_square + epsilon) - *

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

$$ms <- rho * ms_{t-1} + (1-rho) * grad * grad$$ + * $$mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon)$$ + * $$var <- var - mom$$ */ -@Operator(group = "train") +@OpMetadata( + opType = SparseApplyRmsProp.OP_NAME, + inputsClass = SparseApplyRmsProp.Inputs.class +) +@Operator( + group = "train" +) public final class SparseApplyRmsProp extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.SparseApplyRmsProp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `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 Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "SparseApplyRMSProp"; + + private Output out; + + public SparseApplyRmsProp(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new SparseApplyRmsProp operation. - * + * Factory method to create a class wrapping a new SparseApplyRMSProp operation. + * * @param scope current scope * @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 + * @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. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyRMSProp} output and operands * @return a new instance of SparseApplyRmsProp */ - @Endpoint(describeByClass = true) - public static SparseApplyRmsProp create(Scope scope, Operand var, Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, Operand indices, Options... options) { - OperationBuilder opBuilder = scope.env().opBuilder("SparseApplyRMSProp", scope.makeOpName("SparseApplyRmsProp")); + @Endpoint( + describeByClass = true + ) + public static SparseApplyRmsProp create(Scope scope, Operand var, + Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, + Operand epsilon, Operand grad, Operand indices, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseApplyRmsProp"); opBuilder.addInput(var.asOutput()); opBuilder.addInput(ms.asOutput()); opBuilder.addInput(mom.asOutput()); @@ -96,7 +99,6 @@ public static SparseApplyRmsProp create(Scope scope, Operan opBuilder.addInput(epsilon.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.useLocking != null) { @@ -104,38 +106,139 @@ public static SparseApplyRmsProp create(Scope scope, Operan } } } - return new SparseApplyRmsProp(opBuilder.build()); + return new SparseApplyRmsProp<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, ms, and mom tensors is protected + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseApplyRMSProp"; - - private Output out; - - private SparseApplyRmsProp(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.SparseApplyRmsProp} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking 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. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = 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 new file mode 100644 index 00000000000..3feef3e7820 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SymbolicGradient.java @@ -0,0 +1,145 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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 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" +) +public final class SymbolicGradient extends RawOp implements Iterable> { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SymbolicGradient"; + + private List> output; + + @SuppressWarnings("unchecked") + public SymbolicGradient(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 SymbolicGradient operation. + * + * @param scope current scope + * @param input a list of input tensors of size N + M; + * @param Tout the type list for the input list. + * @param f The function we want to compute the gradient for. + *

The function 'f' must be a numerical function which takes N inputs and + * produces M outputs. Its gradient function 'g', which is computed by + * this SymbolicGradient op 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. + *

(Needs some math expert to say the comment above better.) + * @return a new instance of SymbolicGradient + */ + @Endpoint( + describeByClass = true + ) + public static SymbolicGradient create(Scope scope, Iterable> input, + List> Tout, ConcreteFunction f) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SymbolicGradient"); + opBuilder.addInputList(Operands.asOutputs(input)); + opBuilder.setAttr("Tout", Operands.toDataTypes(Tout)); + opBuilder.setAttr("f", f); + return new SymbolicGradient(opBuilder.build()); + } + + /** + * Gets output. + * a list of output tensors of size N; + * @return output. + */ + public List> output() { + return output; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + 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 f1b8b1ee444..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,65 +17,109 @@ 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; /** - * Returns the gradient of `Tile`. - *

- * Since `Tile` takes an input and repeats the input `multiples` times - * along each dimension, `train.TileGrad` takes in `multiples` and aggregates - * each repeated tile of `input` into `output`. - * - * @param data type for {@code output()} output + * Returns the gradient of {@code Tile}. + * 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}. */ -@Operator(group = "train") +@OpMetadata( + opType = TileGrad.OP_NAME, + inputsClass = TileGrad.Inputs.class +) +@Operator( + group = "train" +) public final class TileGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TileGrad"; + + private Output output; + + public TileGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TileGrad operation. - * + * * @param scope current scope - * @param input - * @param multiples + * @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 */ - @Endpoint(describeByClass = true) - public static TileGrad create(Scope scope, Operand input, Operand multiples) { - OperationBuilder opBuilder = scope.env().opBuilder("TileGrad", scope.makeOpName("TileGrad")); + @Endpoint( + describeByClass = true + ) + public static TileGrad create(Scope scope, Operand input, + Operand multiples) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TileGrad"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(multiples.asOutput()); - opBuilder = scope.apply(opBuilder); - return new TileGrad(opBuilder.build()); + return new TileGrad<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TileGrad"; - - private Output output; - - private TileGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 0813440fa03..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/BroadcastHelper.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.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 `lhs` and `rhs` to the same rank, by adding size 1 dimensions to - * whichever of `lhs` and `rhs` has the lower rank, using XLA's broadcasting rules - * for binary operators. - * - * @param data type for {@code lhsOutput()} output - */ -@Operator(group = "xla") -public final class BroadcastHelper extends RawOp { - - /** - * Factory method to create a class wrapping a new BroadcastHelper 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 - * @return a new instance of BroadcastHelper - */ - @Endpoint(describeByClass = true) - public static BroadcastHelper create(Scope scope, Operand lhs, Operand rhs, Operand broadcastDims) { - OperationBuilder opBuilder = scope.env().opBuilder("XlaBroadcastHelper", scope.makeOpName("BroadcastHelper")); - opBuilder.addInput(lhs.asOutput()); - opBuilder.addInput(rhs.asOutput()); - opBuilder.addInput(broadcastDims.asOutput()); - opBuilder = scope.apply(opBuilder); - return new BroadcastHelper(opBuilder.build()); - } - - /** - * the broadcasted LHS tensor - */ - public Output lhsOutput() { - return lhsOutput; - } - - /** - * the broadcasted RHS tensor - */ - public Output rhsOutput() { - return rhsOutput; - } - - /** 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++); - } -} 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 ffd282478a5..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ClusterOutput.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.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 { - - /** - * Factory method to create a class wrapping a new ClusterOutput operation. - * - * @param scope current scope - * @param input - * @return a new instance of ClusterOutput - */ - @Endpoint(describeByClass = true) - public static ClusterOutput create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("XlaClusterOutput", scope.makeOpName("ClusterOutput")); - opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new ClusterOutput(opBuilder.build()); - } - - /** - */ - public Output outputs() { - return outputs; - } - - @Override - public Output asOutput() { - return outputs; - } - - /** 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++); - } -} 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 d8daba47f27..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Conv.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.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 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 { - - /** - * Factory method to create a class wrapping a new Conv 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. - * @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) { - OperationBuilder opBuilder = scope.env().opBuilder("XlaConv", scope.makeOpName("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 = scope.apply(opBuilder); - opBuilder.setAttr("dimension_numbers", dimensionNumbers); - opBuilder.setAttr("precision_config", precisionConfig); - return new Conv(opBuilder.build()); - } - - /** - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaConv"; - - private Output output; - - private Conv(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Dequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Dequantize.java deleted file mode 100644 index 9e62c69996a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Dequantize.java +++ /dev/null @@ -1,86 +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; - -/** - * 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 { - - /** - * Factory method to create a class wrapping a new Dequantize 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.env().opBuilder("XlaDequantize", scope.makeOpName("Dequantize")); - opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("min_range", minRange); - opBuilder.setAttr("max_range", maxRange); - opBuilder.setAttr("mode", mode); - opBuilder.setAttr("transpose_output", transposeOutput); - return new Dequantize(opBuilder.build()); - } - - /** - * 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]. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaDequantize"; - - private Output output; - - private Dequantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Dot.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Dot.java deleted file mode 100644 index ea4c485db6d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Dot.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.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 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 { - - /** - * Factory method to create a class wrapping a new Dot 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. - * @return a new instance of Dot - */ - @Endpoint(describeByClass = true) - public static Dot create(Scope scope, Operand lhs, Operand rhs, String dimensionNumbers, String precisionConfig) { - OperationBuilder opBuilder = scope.env().opBuilder("XlaDot", scope.makeOpName("Dot")); - opBuilder.addInput(lhs.asOutput()); - opBuilder.addInput(rhs.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("dimension_numbers", dimensionNumbers); - opBuilder.setAttr("precision_config", precisionConfig); - return new Dot(opBuilder.build()); - } - - /** - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaDot"; - - private Output output; - - private Dot(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/DynamicSlice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/DynamicSlice.java deleted file mode 100644 index 631e22513cf..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/DynamicSlice.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.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 { - - /** - * Factory method to create a class wrapping a new DynamicSlice operation. - * - * @param scope current scope - * @param input A `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 - * @return a new instance of DynamicSlice - */ - @Endpoint(describeByClass = true) - public static DynamicSlice create(Scope scope, Operand input, Operand startIndices, Operand sizeIndices) { - OperationBuilder opBuilder = scope.env().opBuilder("XlaDynamicSlice", scope.makeOpName("DynamicSlice")); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(startIndices.asOutput()); - opBuilder.addInput(sizeIndices.asOutput()); - opBuilder = scope.apply(opBuilder); - return new DynamicSlice(opBuilder.build()); - } - - /** - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaDynamicSlice"; - - private Output output; - - private DynamicSlice(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/DynamicUpdateSlice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/DynamicUpdateSlice.java deleted file mode 100644 index 32653d46869..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/DynamicUpdateSlice.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.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 `input` - * operand, with a slice update overwritten at `indices`. The shape of `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 `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 { - - /** - * Factory method to create a class wrapping a new DynamicUpdateSlice operation. - * - * @param scope current scope - * @param input A `Tensor` of type T. - * @param update A `Tensor` of type T. Same rank as `input`. - * @param indices A vector of indices into `input`. Must have length equal to the rank of - * `input`. - * @return a new instance of DynamicUpdateSlice - */ - @Endpoint(describeByClass = true) - public static DynamicUpdateSlice create(Scope scope, Operand input, Operand update, Operand indices) { - OperationBuilder opBuilder = scope.env().opBuilder("XlaDynamicUpdateSlice", scope.makeOpName("DynamicUpdateSlice")); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(update.asOutput()); - opBuilder.addInput(indices.asOutput()); - opBuilder = scope.apply(opBuilder); - return new DynamicUpdateSlice(opBuilder.build()); - } - - /** - * A `Tensor` of type T. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaDynamicUpdateSlice"; - - private Output output; - - private DynamicUpdateSlice(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Einsum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Einsum.java deleted file mode 100644 index 3ddffcd2e94..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Einsum.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.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 { - - /** - * Factory method to create a class wrapping a new Einsum operation. - * - * @param scope current scope - * @param a - * @param b - * @param equation - * @return a new instance of Einsum - */ - @Endpoint(describeByClass = true) - public static Einsum create(Scope scope, Operand a, Operand b, String equation) { - OperationBuilder opBuilder = scope.env().opBuilder("XlaEinsum", scope.makeOpName("Einsum")); - opBuilder.addInput(a.asOutput()); - opBuilder.addInput(b.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("equation", equation); - return new Einsum(opBuilder.build()); - } - - /** - */ - public Output product() { - return product; - } - - @Override - public Output asOutput() { - return product; - } - - /** 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++); - } -} 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 c01483049dd..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Gather.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.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 { - - /** - * Factory method to create a class wrapping a new Gather 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. - * @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.env().opBuilder("XlaGather", scope.makeOpName("Gather")); - opBuilder.addInput(operand.asOutput()); - opBuilder.addInput(startIndices.asOutput()); - opBuilder.addInput(sliceSizes.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("dimension_numbers", dimensionNumbers); - opBuilder.setAttr("indices_are_sorted", indicesAreSorted); - return new Gather(opBuilder.build()); - } - - /** - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaGather"; - - private Output output; - - private Gather(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/KeyValueSort.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/KeyValueSort.java deleted file mode 100644 index eb657bb4220..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/KeyValueSort.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.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 sortedKeys()} output - * @param data type for {@code sortedValues()} output - */ -@Operator(group = "xla") -public final class KeyValueSort extends RawOp { - - /** - * Factory method to create a class wrapping a new KeyValueSort operation. - * - * @param scope current scope - * @param keys A `Tensor` of type K. - * @param values A `Tensor` of type V. - * @return a new instance of KeyValueSort - */ - @Endpoint(describeByClass = true) - public static KeyValueSort create(Scope scope, Operand keys, Operand values) { - OperationBuilder opBuilder = scope.env().opBuilder("XlaKeyValueSort", scope.makeOpName("KeyValueSort")); - opBuilder.addInput(keys.asOutput()); - opBuilder.addInput(values.asOutput()); - opBuilder = scope.apply(opBuilder); - return new KeyValueSort(opBuilder.build()); - } - - /** - * A `Tensor` of type K. - */ - public Output sortedKeys() { - return sortedKeys; - } - - /** - * A `Tensor` of type V. - */ - public Output sortedValues() { - return sortedValues; - } - - /** 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++); - } -} 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 aa4df05f3e0..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Pad.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.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 { - - /** - * Factory method to create a class wrapping a new Pad operation. - * - * @param scope current scope - * @param input A `Tensor` of type T. - * @param paddingValue A scalar `Tensor` of type T. - * @param paddingLow the padding to apply at the start of each input dimensions - * @param paddingHigh the padding to apply at the end of each input dimension. - * @param paddingInterior the padding to apply between each input element. - * @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.env().opBuilder("XlaPad", scope.makeOpName("Pad")); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(paddingValue.asOutput()); - opBuilder.addInput(paddingLow.asOutput()); - opBuilder.addInput(paddingHigh.asOutput()); - opBuilder.addInput(paddingInterior.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Pad(opBuilder.build()); - } - - /** - * A `Tensor` of type T. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaPad"; - - private Output output; - - private Pad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/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 05781f61017..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Recv.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.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 { - - /** - * Factory method to create a class wrapping a new Recv 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. - * @return a new instance of Recv - */ - @Endpoint(describeByClass = true) - public static Recv create(Scope scope, Class dtype, String tensorName, Shape shape) { - OperationBuilder opBuilder = scope.env().opBuilder("XlaRecv", scope.makeOpName("Recv")); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - opBuilder.setAttr("tensor_name", tensorName); - opBuilder.setAttr("shape", shape); - return new Recv(opBuilder.build()); - } - - /** - * The tensor to receive. - */ - public Output tensor() { - return tensor; - } - - @Override - public Output asOutput() { - return tensor; - } - - /** 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++); - } -} 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 74386cc395d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ReplicaId.java +++ /dev/null @@ -1,70 +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 { - - /** - * Factory method to create a class wrapping a new ReplicaId operation. - * - * @param scope current scope - * @return a new instance of ReplicaId - */ - @Endpoint(describeByClass = true) - public static ReplicaId create(Scope scope) { - OperationBuilder opBuilder = scope.env().opBuilder("XlaReplicaId", scope.makeOpName("ReplicaId")); - opBuilder = scope.apply(opBuilder); - return new ReplicaId(opBuilder.build()); - } - - /** - */ - public Output id() { - return id; - } - - @Override - public Output asOutput() { - return id; - } - - /** 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++); - } -} 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 5f3f8e69c89..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SelfAdjointEig.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.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 { - - /** - * Factory method to create a class wrapping a new SelfAdjointEig 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. - * @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.env().opBuilder("XlaSelfAdjointEig", scope.makeOpName("SelfAdjointEig")); - opBuilder.addInput(a.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("lower", lower); - opBuilder.setAttr("max_iter", maxIter); - opBuilder.setAttr("epsilon", epsilon); - return new SelfAdjointEig(opBuilder.build()); - } - - /** - * The eigenvalues in ascending order, each repeated according to its - * multiplicity. - */ - public Output w() { - return w; - } - - /** - * The column v[..., :, i] is the normalized eigenvector corresponding to the - * eigenvalue w[..., i]. - */ - public Output v() { - return v; - } - - /** 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++); - } -} 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 948cdee567f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Send.java +++ /dev/null @@ -1,61 +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 { - - /** - * Factory method to create a class wrapping a new Send 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.env().opBuilder("XlaSend", scope.makeOpName("Send")); - opBuilder.addInput(tensor.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("tensor_name", tensorName); - return new Send(opBuilder.build()); - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaSend"; - - private Send(Operation operation) { - super(operation); - } -} 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 4404d297105..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Sharding.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.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 { - - /** - * Factory method to create a class wrapping a new Sharding operation. - * - * @param scope current scope - * @param input - * @return a new instance of Sharding - */ - @Endpoint(describeByClass = true) - public static Sharding create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("XlaSharding", scope.makeOpName("Sharding")); - opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Sharding(opBuilder.build()); - } - - /** - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaSharding"; - - private Output output; - - private Sharding(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Sort.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Sort.java deleted file mode 100644 index b8bb34526ba..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Sort.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.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 { - - /** - * Factory method to create a class wrapping a new Sort operation. - * - * @param scope current scope - * @param input A `Tensor` of type T. - * @return a new instance of Sort - */ - @Endpoint(describeByClass = true) - public static Sort create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.env().opBuilder("XlaSort", scope.makeOpName("Sort")); - opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); - return new Sort(opBuilder.build()); - } - - /** - * A `Tensor` of type T. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaSort"; - - private Output output; - - private Sort(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/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/Svd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Svd.java deleted file mode 100644 index 9e7f75bee8c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Svd.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.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 { - - /** - * Factory method to create a class wrapping a new Svd 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. - * @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.env().opBuilder("XlaSvd", scope.makeOpName("Svd")); - opBuilder.addInput(a.asOutput()); - opBuilder = scope.apply(opBuilder); - opBuilder.setAttr("max_iter", maxIter); - opBuilder.setAttr("epsilon", epsilon); - opBuilder.setAttr("precision_config", precisionConfig); - return new Svd(opBuilder.build()); - } - - /** - * 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. - */ - public Output s() { - return s; - } - - /** - * Left singular vectors. - */ - public Output u() { - return u; - } - - /** - * Right singular vectors. - */ - public Output v() { - return v; - } - - /** 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++); - } -} 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 new file mode 100644 index 00000000000..0b25f9f064a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaHostCompute.java @@ -0,0 +1,310 @@ +/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the 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.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" +) +public final class XlaHostCompute extends RawOp implements Iterable> { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaHostCompute"; + + private List> outputs; + + @SuppressWarnings("unchecked") + public XlaHostCompute(Operation operation) { + super(operation, OP_NAME); + 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 XlaHostCompute operation. + * + * @param scope current scope + * @param inputs A list of tensors that will be sent to the host. + * @param Toutputs The element types of each element in {@code outputs}. + * @param ancestors A list of names of HostCompute computations that must be + * sequenced before this computation. + * @param shapes If shape_inference_graph is empty, a list of the shapes of {@code outputs}. + * @param shapeInferenceGraph If non-empty, a serialized GraphDef representing a graph + * that must be analyzed at compile time to determine the shapes of the outputs. + * @param key A unique identifier for this region used to match up host transfers. + * @param options carries optional attribute values + * @return a new instance of XlaHostCompute + */ + @Endpoint( + describeByClass = true + ) + public static XlaHostCompute create(Scope scope, Iterable> inputs, + List> Toutputs, List ancestors, List shapes, + ConcreteFunction shapeInferenceGraph, String key, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaHostCompute"); + opBuilder.addInputList(Operands.asOutputs(inputs)); + opBuilder.setAttr("Toutputs", Operands.toDataTypes(Toutputs)); + String[] ancestorsArray = new String[ancestors.size()]; + for (int i = 0 ; i < ancestorsArray.length ; i++) { + ancestorsArray[i] = ancestors.get(i); + } + opBuilder.setAttr("ancestors", ancestorsArray); + Shape[] shapesArray = new Shape[shapes.size()]; + for (int i = 0 ; i < shapesArray.length ; i++) { + shapesArray[i] = shapes.get(i); + } + opBuilder.setAttr("shapes", shapesArray); + opBuilder.setAttr("shape_inference_graph", shapeInferenceGraph); + opBuilder.setAttr("key", key); + if (options != null) { + for (Options opts : options) { + if (opts.sendKey != null) { + opBuilder.setAttr("send_key", opts.sendKey); + } + if (opts.recvKey != null) { + opBuilder.setAttr("recv_key", opts.recvKey); + } + if (opts.costEstimateNs != null) { + opBuilder.setAttr("cost_estimate_ns", opts.costEstimateNs); + } + if (opts.tpuCore != null) { + opBuilder.setAttr("tpu_core", opts.tpuCore); + } + } + } + return new XlaHostCompute(opBuilder.build()); + } + + /** + * Sets the sendKey option. + * + * @param sendKey the sendKey option + * @return this Options instance. + */ + public static Options sendKey(String sendKey) { + return new Options().sendKey(sendKey); + } + + /** + * Sets the recvKey option. + * + * @param recvKey the recvKey option + * @return this Options instance. + */ + public static Options recvKey(String recvKey) { + return new Options().recvKey(recvKey); + } + + /** + * Sets the costEstimateNs option. + * + * @param costEstimateNs Estimated duration of the host computation in nanoseconds. + * @return this Options instance. + */ + public static Options costEstimateNs(Long costEstimateNs) { + return new Options().costEstimateNs(costEstimateNs); + } + + /** + * Sets the tpuCore option. + * + * @param tpuCore Default core to use for host to device transfers. + * @return this Options instance. + */ + public static Options tpuCore(Long tpuCore) { + return new Options().tpuCore(tpuCore); + } + + /** + * Gets outputs. + * A list of tensors that will be returned to the device. + * @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.XlaHostCompute} + */ + public static class Options { + private String sendKey; + + private String recvKey; + + private Long costEstimateNs; + + private Long tpuCore; + + private Options() { + } + + /** + * Sets the sendKey option. + * + * @param sendKey the sendKey option + * @return this Options instance. + */ + public Options sendKey(String sendKey) { + this.sendKey = sendKey; + return this; + } + + /** + * Sets the recvKey option. + * + * @param recvKey the recvKey option + * @return this Options instance. + */ + public Options recvKey(String recvKey) { + this.recvKey = recvKey; + return this; + } + + /** + * Sets the costEstimateNs option. + * + * @param costEstimateNs Estimated duration of the host computation in nanoseconds. + * @return this Options instance. + */ + public Options costEstimateNs(Long costEstimateNs) { + this.costEstimateNs = costEstimateNs; + return this; + } + + /** + * Sets the tpuCore option. + * + * @param tpuCore Default core to use for host to device transfers. + * @return this Options instance. + */ + public Options tpuCore(Long tpuCore) { + this.tpuCore = 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/XlaRecvFromHost.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaRecvFromHost.java index 64790e8a5bc..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,62 +26,104 @@ 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 to receive a tensor from the host. - *

* output: the tensor that will be received from the host. * Toutput: element type for output. * shape: shape for output. * key: A unique identifier for this region used to match up host transfers. - * - * @param data type for {@code output()} output */ -@Operator(group = "xla") +@OpMetadata( + opType = XlaRecvFromHost.OP_NAME, + inputsClass = XlaRecvFromHost.Inputs.class +) +@Operator( + group = "xla" +) public final class XlaRecvFromHost extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaRecvFromHost"; + + private Output output; + + public XlaRecvFromHost(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new XlaRecvFromHost operation. - * + * * @param scope current scope - * @param Toutput - * @param shape - * @param key + * @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 */ - @Endpoint(describeByClass = true) - public static XlaRecvFromHost create(Scope scope, Class Toutput, Shape shape, String key) { - OperationBuilder opBuilder = scope.env().opBuilder("XlaRecvFromHost", scope.makeOpName("XlaRecvFromHost")); - opBuilder = scope.apply(opBuilder); + @Endpoint( + describeByClass = true + ) + public static XlaRecvFromHost create(Scope scope, Class Toutput, + Shape shape, String key) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaRecvFromHost"); opBuilder.setAttr("Toutput", Operands.toDataType(Toutput)); opBuilder.setAttr("shape", shape); opBuilder.setAttr("key", key); - return new XlaRecvFromHost(opBuilder.build()); + return new XlaRecvFromHost<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaRecvFromHost"; - - private Output output; - - private XlaRecvFromHost(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + @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 61c296710a4..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,46 +17,87 @@ 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; /** * An op to send a tensor to the host. - *

* input: the tensor that will be sent to the host. * Tinput: element type for input. * key: A unique identifier for this region used to match up host transfers. */ -@Operator(group = "xla") +@OpMetadata( + opType = XlaSendToHost.OP_NAME, + inputsClass = XlaSendToHost.Inputs.class +) +@Operator( + group = "xla" +) public final class XlaSendToHost extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSendToHost"; + + 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 - * @param key + * @param input The input value + * @param key The value of the key attribute * @return a new instance of XlaSendToHost */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static XlaSendToHost create(Scope scope, Operand input, String key) { - OperationBuilder opBuilder = scope.env().opBuilder("XlaSendToHost", scope.makeOpName("XlaSendToHost")); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSendToHost"); opBuilder.addInput(input.asOutput()); - opBuilder = scope.apply(opBuilder); opBuilder.setAttr("key", key); return new XlaSendToHost(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaSendToHost"; - - private XlaSendToHost(Operation operation) { - super(operation); + + @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 2ae6581abc0..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSetBound.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.xla; - -import org.tensorflow.Operand; -import org.tensorflow.Operation; -import org.tensorflow.OperationBuilder; -import org.tensorflow.Output; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.TInt32; - -/** - * Set a bound for the given input value as a hint to Xla compiler, - *

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

-     * The port for the dispatcher to bind to. A value of 0 indicates that the
-     * dispatcher may bind to any available port.
-     * 
- * - * int64 port = 1; - */ - long getPort(); - - /** - *
-     * The protocol for the dispatcher to use when connecting to workers.
-     * 
- * - * string protocol = 2; - */ - java.lang.String getProtocol(); - /** - *
-     * The protocol for the dispatcher to use when connecting to workers.
-     * 
- * - * string protocol = 2; - */ - com.google.protobuf.ByteString - getProtocolBytes(); - - /** - *
-     * A work directory to use for storing dispatcher state, and for recovering
-     * during restarts. The empty string indicates not to use any work directory.
-     * 
- * - * string work_dir = 3; - */ - java.lang.String getWorkDir(); - /** - *
-     * A work directory to use for storing dispatcher state, and for recovering
-     * during restarts. The empty string indicates not to use any work directory.
-     * 
- * - * string work_dir = 3; - */ - com.google.protobuf.ByteString - getWorkDirBytes(); - - /** - *
-     * Whether to run in fault tolerant mode, where dispatcher state is saved
-     * across restarts. Requires that `work_dir` is nonempty.
-     * 
- * - * bool fault_tolerant_mode = 4; - */ - boolean getFaultTolerantMode(); - - /** - *
-     * How often the dispatcher should scan through to delete old and unused jobs.
-     * 
- * - * int64 job_gc_check_interval_ms = 5; - */ - long getJobGcCheckIntervalMs(); - - /** - *
-     * How long a job needs to be unused before it becomes a candidate for garbage
-     * collection.
-     * 
- * - * int64 job_gc_timeout_ms = 6; - */ - long getJobGcTimeoutMs(); - } - /** - *
-   * Configuration for a tf.data service DispatchServer.
-   * 
- * - * Protobuf type {@code tensorflow.data.experimental.DispatcherConfig} - */ - public static final class DispatcherConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.data.experimental.DispatcherConfig) - DispatcherConfigOrBuilder { - private static final long serialVersionUID = 0L; - // Use DispatcherConfig.newBuilder() to construct. - private DispatcherConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DispatcherConfig() { - protocol_ = ""; - workDir_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DispatcherConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DispatcherConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - port_ = input.readInt64(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - protocol_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - workDir_ = s; - break; - } - case 32: { - - faultTolerantMode_ = input.readBool(); - break; - } - case 40: { - - jobGcCheckIntervalMs_ = input.readInt64(); - break; - } - case 48: { - - jobGcTimeoutMs_ = input.readInt64(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_DispatcherConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_DispatcherConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig.class, org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig.Builder.class); - } - - public static final int PORT_FIELD_NUMBER = 1; - private long port_; - /** - *
-     * The port for the dispatcher to bind to. A value of 0 indicates that the
-     * dispatcher may bind to any available port.
-     * 
- * - * int64 port = 1; - */ - public long getPort() { - return port_; - } - - public static final int PROTOCOL_FIELD_NUMBER = 2; - private volatile java.lang.Object protocol_; - /** - *
-     * The protocol for the dispatcher to use when connecting to workers.
-     * 
- * - * string protocol = 2; - */ - public java.lang.String getProtocol() { - java.lang.Object ref = protocol_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - protocol_ = s; - return s; - } - } - /** - *
-     * The protocol for the dispatcher to use when connecting to workers.
-     * 
- * - * string protocol = 2; - */ - public com.google.protobuf.ByteString - getProtocolBytes() { - java.lang.Object ref = protocol_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - protocol_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int WORK_DIR_FIELD_NUMBER = 3; - private volatile java.lang.Object workDir_; - /** - *
-     * A work directory to use for storing dispatcher state, and for recovering
-     * during restarts. The empty string indicates not to use any work directory.
-     * 
- * - * string work_dir = 3; - */ - public java.lang.String getWorkDir() { - java.lang.Object ref = workDir_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - workDir_ = s; - return s; - } - } - /** - *
-     * A work directory to use for storing dispatcher state, and for recovering
-     * during restarts. The empty string indicates not to use any work directory.
-     * 
- * - * string work_dir = 3; - */ - public com.google.protobuf.ByteString - getWorkDirBytes() { - java.lang.Object ref = workDir_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - workDir_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FAULT_TOLERANT_MODE_FIELD_NUMBER = 4; - private boolean faultTolerantMode_; - /** - *
-     * Whether to run in fault tolerant mode, where dispatcher state is saved
-     * across restarts. Requires that `work_dir` is nonempty.
-     * 
- * - * bool fault_tolerant_mode = 4; - */ - public boolean getFaultTolerantMode() { - return faultTolerantMode_; - } - - public static final int JOB_GC_CHECK_INTERVAL_MS_FIELD_NUMBER = 5; - private long jobGcCheckIntervalMs_; - /** - *
-     * How often the dispatcher should scan through to delete old and unused jobs.
-     * 
- * - * int64 job_gc_check_interval_ms = 5; - */ - public long getJobGcCheckIntervalMs() { - return jobGcCheckIntervalMs_; - } - - public static final int JOB_GC_TIMEOUT_MS_FIELD_NUMBER = 6; - private long jobGcTimeoutMs_; - /** - *
-     * How long a job needs to be unused before it becomes a candidate for garbage
-     * collection.
-     * 
- * - * int64 job_gc_timeout_ms = 6; - */ - public long getJobGcTimeoutMs() { - return jobGcTimeoutMs_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (port_ != 0L) { - output.writeInt64(1, port_); - } - if (!getProtocolBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, protocol_); - } - if (!getWorkDirBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, workDir_); - } - if (faultTolerantMode_ != false) { - output.writeBool(4, faultTolerantMode_); - } - if (jobGcCheckIntervalMs_ != 0L) { - output.writeInt64(5, jobGcCheckIntervalMs_); - } - if (jobGcTimeoutMs_ != 0L) { - output.writeInt64(6, jobGcTimeoutMs_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (port_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, port_); - } - if (!getProtocolBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, protocol_); - } - if (!getWorkDirBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, workDir_); - } - if (faultTolerantMode_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(4, faultTolerantMode_); - } - if (jobGcCheckIntervalMs_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(5, jobGcCheckIntervalMs_); - } - if (jobGcTimeoutMs_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(6, jobGcTimeoutMs_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig)) { - return super.equals(obj); - } - org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig other = (org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig) obj; - - if (getPort() - != other.getPort()) return false; - if (!getProtocol() - .equals(other.getProtocol())) return false; - if (!getWorkDir() - .equals(other.getWorkDir())) return false; - if (getFaultTolerantMode() - != other.getFaultTolerantMode()) return false; - if (getJobGcCheckIntervalMs() - != other.getJobGcCheckIntervalMs()) return false; - if (getJobGcTimeoutMs() - != other.getJobGcTimeoutMs()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PORT_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getPort()); - hash = (37 * hash) + PROTOCOL_FIELD_NUMBER; - hash = (53 * hash) + getProtocol().hashCode(); - hash = (37 * hash) + WORK_DIR_FIELD_NUMBER; - hash = (53 * hash) + getWorkDir().hashCode(); - hash = (37 * hash) + FAULT_TOLERANT_MODE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getFaultTolerantMode()); - hash = (37 * hash) + JOB_GC_CHECK_INTERVAL_MS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getJobGcCheckIntervalMs()); - hash = (37 * hash) + JOB_GC_TIMEOUT_MS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getJobGcTimeoutMs()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * Configuration for a tf.data service DispatchServer.
-     * 
- * - * Protobuf type {@code tensorflow.data.experimental.DispatcherConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.data.experimental.DispatcherConfig) - org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_DispatcherConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_DispatcherConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig.class, org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig.Builder.class); - } - - // Construct using org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - port_ = 0L; - - protocol_ = ""; - - workDir_ = ""; - - faultTolerantMode_ = false; - - jobGcCheckIntervalMs_ = 0L; - - jobGcTimeoutMs_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_DispatcherConfig_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig getDefaultInstanceForType() { - return org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig build() { - org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig buildPartial() { - org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig result = new org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig(this); - result.port_ = port_; - result.protocol_ = protocol_; - result.workDir_ = workDir_; - result.faultTolerantMode_ = faultTolerantMode_; - result.jobGcCheckIntervalMs_ = jobGcCheckIntervalMs_; - result.jobGcTimeoutMs_ = jobGcTimeoutMs_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig) { - return mergeFrom((org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig other) { - if (other == org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig.getDefaultInstance()) return this; - if (other.getPort() != 0L) { - setPort(other.getPort()); - } - if (!other.getProtocol().isEmpty()) { - protocol_ = other.protocol_; - onChanged(); - } - if (!other.getWorkDir().isEmpty()) { - workDir_ = other.workDir_; - onChanged(); - } - if (other.getFaultTolerantMode() != false) { - setFaultTolerantMode(other.getFaultTolerantMode()); - } - if (other.getJobGcCheckIntervalMs() != 0L) { - setJobGcCheckIntervalMs(other.getJobGcCheckIntervalMs()); - } - if (other.getJobGcTimeoutMs() != 0L) { - setJobGcTimeoutMs(other.getJobGcTimeoutMs()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long port_ ; - /** - *
-       * The port for the dispatcher to bind to. A value of 0 indicates that the
-       * dispatcher may bind to any available port.
-       * 
- * - * int64 port = 1; - */ - public long getPort() { - return port_; - } - /** - *
-       * The port for the dispatcher to bind to. A value of 0 indicates that the
-       * dispatcher may bind to any available port.
-       * 
- * - * int64 port = 1; - */ - public Builder setPort(long value) { - - port_ = value; - onChanged(); - return this; - } - /** - *
-       * The port for the dispatcher to bind to. A value of 0 indicates that the
-       * dispatcher may bind to any available port.
-       * 
- * - * int64 port = 1; - */ - public Builder clearPort() { - - port_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object protocol_ = ""; - /** - *
-       * The protocol for the dispatcher to use when connecting to workers.
-       * 
- * - * string protocol = 2; - */ - public java.lang.String getProtocol() { - java.lang.Object ref = protocol_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - protocol_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-       * The protocol for the dispatcher to use when connecting to workers.
-       * 
- * - * string protocol = 2; - */ - public com.google.protobuf.ByteString - getProtocolBytes() { - java.lang.Object ref = protocol_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - protocol_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-       * The protocol for the dispatcher to use when connecting to workers.
-       * 
- * - * string protocol = 2; - */ - public Builder setProtocol( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - protocol_ = value; - onChanged(); - return this; - } - /** - *
-       * The protocol for the dispatcher to use when connecting to workers.
-       * 
- * - * string protocol = 2; - */ - public Builder clearProtocol() { - - protocol_ = getDefaultInstance().getProtocol(); - onChanged(); - return this; - } - /** - *
-       * The protocol for the dispatcher to use when connecting to workers.
-       * 
- * - * string protocol = 2; - */ - public Builder setProtocolBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - protocol_ = value; - onChanged(); - return this; - } - - private java.lang.Object workDir_ = ""; - /** - *
-       * A work directory to use for storing dispatcher state, and for recovering
-       * during restarts. The empty string indicates not to use any work directory.
-       * 
- * - * string work_dir = 3; - */ - public java.lang.String getWorkDir() { - java.lang.Object ref = workDir_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - workDir_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-       * A work directory to use for storing dispatcher state, and for recovering
-       * during restarts. The empty string indicates not to use any work directory.
-       * 
- * - * string work_dir = 3; - */ - public com.google.protobuf.ByteString - getWorkDirBytes() { - java.lang.Object ref = workDir_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - workDir_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-       * A work directory to use for storing dispatcher state, and for recovering
-       * during restarts. The empty string indicates not to use any work directory.
-       * 
- * - * string work_dir = 3; - */ - public Builder setWorkDir( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - workDir_ = value; - onChanged(); - return this; - } - /** - *
-       * A work directory to use for storing dispatcher state, and for recovering
-       * during restarts. The empty string indicates not to use any work directory.
-       * 
- * - * string work_dir = 3; - */ - public Builder clearWorkDir() { - - workDir_ = getDefaultInstance().getWorkDir(); - onChanged(); - return this; - } - /** - *
-       * A work directory to use for storing dispatcher state, and for recovering
-       * during restarts. The empty string indicates not to use any work directory.
-       * 
- * - * string work_dir = 3; - */ - public Builder setWorkDirBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - workDir_ = value; - onChanged(); - return this; - } - - private boolean faultTolerantMode_ ; - /** - *
-       * Whether to run in fault tolerant mode, where dispatcher state is saved
-       * across restarts. Requires that `work_dir` is nonempty.
-       * 
- * - * bool fault_tolerant_mode = 4; - */ - public boolean getFaultTolerantMode() { - return faultTolerantMode_; - } - /** - *
-       * Whether to run in fault tolerant mode, where dispatcher state is saved
-       * across restarts. Requires that `work_dir` is nonempty.
-       * 
- * - * bool fault_tolerant_mode = 4; - */ - public Builder setFaultTolerantMode(boolean value) { - - faultTolerantMode_ = value; - onChanged(); - return this; - } - /** - *
-       * Whether to run in fault tolerant mode, where dispatcher state is saved
-       * across restarts. Requires that `work_dir` is nonempty.
-       * 
- * - * bool fault_tolerant_mode = 4; - */ - public Builder clearFaultTolerantMode() { - - faultTolerantMode_ = false; - onChanged(); - return this; - } - - private long jobGcCheckIntervalMs_ ; - /** - *
-       * How often the dispatcher should scan through to delete old and unused jobs.
-       * 
- * - * int64 job_gc_check_interval_ms = 5; - */ - public long getJobGcCheckIntervalMs() { - return jobGcCheckIntervalMs_; - } - /** - *
-       * How often the dispatcher should scan through to delete old and unused jobs.
-       * 
- * - * int64 job_gc_check_interval_ms = 5; - */ - public Builder setJobGcCheckIntervalMs(long value) { - - jobGcCheckIntervalMs_ = value; - onChanged(); - return this; - } - /** - *
-       * How often the dispatcher should scan through to delete old and unused jobs.
-       * 
- * - * int64 job_gc_check_interval_ms = 5; - */ - public Builder clearJobGcCheckIntervalMs() { - - jobGcCheckIntervalMs_ = 0L; - onChanged(); - return this; - } - - private long jobGcTimeoutMs_ ; - /** - *
-       * How long a job needs to be unused before it becomes a candidate for garbage
-       * collection.
-       * 
- * - * int64 job_gc_timeout_ms = 6; - */ - public long getJobGcTimeoutMs() { - return jobGcTimeoutMs_; - } - /** - *
-       * How long a job needs to be unused before it becomes a candidate for garbage
-       * collection.
-       * 
- * - * int64 job_gc_timeout_ms = 6; - */ - public Builder setJobGcTimeoutMs(long value) { - - jobGcTimeoutMs_ = value; - onChanged(); - return this; - } - /** - *
-       * How long a job needs to be unused before it becomes a candidate for garbage
-       * collection.
-       * 
- * - * int64 job_gc_timeout_ms = 6; - */ - public Builder clearJobGcTimeoutMs() { - - jobGcTimeoutMs_ = 0L; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:tensorflow.data.experimental.DispatcherConfig) - } - - // @@protoc_insertion_point(class_scope:tensorflow.data.experimental.DispatcherConfig) - private static final org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig(); - } - - public static org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DispatcherConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DispatcherConfig(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface WorkerConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.data.experimental.WorkerConfig) - com.google.protobuf.MessageOrBuilder { - - /** - *
-     * The port for the worker to bind to. A value of 0 indicates that the
-     * worker may bind to any available port.
-     * 
- * - * int64 port = 1; - */ - long getPort(); - - /** - *
-     * The protocol for the worker to use when connecting to the dispatcher.
-     * 
- * - * string protocol = 2; - */ - java.lang.String getProtocol(); - /** - *
-     * The protocol for the worker to use when connecting to the dispatcher.
-     * 
- * - * string protocol = 2; - */ - com.google.protobuf.ByteString - getProtocolBytes(); - - /** - *
-     * The address of the dispatcher to register with.
-     * 
- * - * string dispatcher_address = 3; - */ - java.lang.String getDispatcherAddress(); - /** - *
-     * The address of the dispatcher to register with.
-     * 
- * - * string dispatcher_address = 3; - */ - com.google.protobuf.ByteString - getDispatcherAddressBytes(); - - /** - *
-     * The address of the worker server. The substring "%port%", if specified,
-     * will be replaced with the worker's bound port. This is useful when the port
-     * is set to `0`.
-     * 
- * - * string worker_address = 4; - */ - java.lang.String getWorkerAddress(); - /** - *
-     * The address of the worker server. The substring "%port%", if specified,
-     * will be replaced with the worker's bound port. This is useful when the port
-     * is set to `0`.
-     * 
- * - * string worker_address = 4; - */ - com.google.protobuf.ByteString - getWorkerAddressBytes(); - - /** - *
-     * How often the worker should heartbeat to the master.
-     * 
- * - * int64 heartbeat_interval_ms = 5; - */ - long getHeartbeatIntervalMs(); - - /** - *
-     * How long to retry requests to the dispatcher before giving up and reporting
-     * an error.
-     * 
- * - * int64 dispatcher_timeout_ms = 6; - */ - long getDispatcherTimeoutMs(); - } - /** - *
-   * Configuration for a tf.data service WorkerServer.
-   * 
- * - * Protobuf type {@code tensorflow.data.experimental.WorkerConfig} - */ - public static final class WorkerConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.data.experimental.WorkerConfig) - WorkerConfigOrBuilder { - private static final long serialVersionUID = 0L; - // Use WorkerConfig.newBuilder() to construct. - private WorkerConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private WorkerConfig() { - protocol_ = ""; - dispatcherAddress_ = ""; - workerAddress_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new WorkerConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private WorkerConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - port_ = input.readInt64(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - protocol_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - dispatcherAddress_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - workerAddress_ = s; - break; - } - case 40: { - - heartbeatIntervalMs_ = input.readInt64(); - break; - } - case 48: { - - dispatcherTimeoutMs_ = input.readInt64(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_WorkerConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_WorkerConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig.class, org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig.Builder.class); - } - - public static final int PORT_FIELD_NUMBER = 1; - private long port_; - /** - *
-     * The port for the worker to bind to. A value of 0 indicates that the
-     * worker may bind to any available port.
-     * 
- * - * int64 port = 1; - */ - public long getPort() { - return port_; - } - - public static final int PROTOCOL_FIELD_NUMBER = 2; - private volatile java.lang.Object protocol_; - /** - *
-     * The protocol for the worker to use when connecting to the dispatcher.
-     * 
- * - * string protocol = 2; - */ - public java.lang.String getProtocol() { - java.lang.Object ref = protocol_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - protocol_ = s; - return s; - } - } - /** - *
-     * The protocol for the worker to use when connecting to the dispatcher.
-     * 
- * - * string protocol = 2; - */ - public com.google.protobuf.ByteString - getProtocolBytes() { - java.lang.Object ref = protocol_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - protocol_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DISPATCHER_ADDRESS_FIELD_NUMBER = 3; - private volatile java.lang.Object dispatcherAddress_; - /** - *
-     * The address of the dispatcher to register with.
-     * 
- * - * string dispatcher_address = 3; - */ - public java.lang.String getDispatcherAddress() { - java.lang.Object ref = dispatcherAddress_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - dispatcherAddress_ = s; - return s; - } - } - /** - *
-     * The address of the dispatcher to register with.
-     * 
- * - * string dispatcher_address = 3; - */ - public com.google.protobuf.ByteString - getDispatcherAddressBytes() { - java.lang.Object ref = dispatcherAddress_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - dispatcherAddress_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int WORKER_ADDRESS_FIELD_NUMBER = 4; - private volatile java.lang.Object workerAddress_; - /** - *
-     * The address of the worker server. The substring "%port%", if specified,
-     * will be replaced with the worker's bound port. This is useful when the port
-     * is set to `0`.
-     * 
- * - * string worker_address = 4; - */ - public java.lang.String getWorkerAddress() { - java.lang.Object ref = workerAddress_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - workerAddress_ = s; - return s; - } - } - /** - *
-     * The address of the worker server. The substring "%port%", if specified,
-     * will be replaced with the worker's bound port. This is useful when the port
-     * is set to `0`.
-     * 
- * - * string worker_address = 4; - */ - public com.google.protobuf.ByteString - getWorkerAddressBytes() { - java.lang.Object ref = workerAddress_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - workerAddress_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int HEARTBEAT_INTERVAL_MS_FIELD_NUMBER = 5; - private long heartbeatIntervalMs_; - /** - *
-     * How often the worker should heartbeat to the master.
-     * 
- * - * int64 heartbeat_interval_ms = 5; - */ - public long getHeartbeatIntervalMs() { - return heartbeatIntervalMs_; - } - - public static final int DISPATCHER_TIMEOUT_MS_FIELD_NUMBER = 6; - private long dispatcherTimeoutMs_; - /** - *
-     * How long to retry requests to the dispatcher before giving up and reporting
-     * an error.
-     * 
- * - * int64 dispatcher_timeout_ms = 6; - */ - public long getDispatcherTimeoutMs() { - return dispatcherTimeoutMs_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (port_ != 0L) { - output.writeInt64(1, port_); - } - if (!getProtocolBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, protocol_); - } - if (!getDispatcherAddressBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, dispatcherAddress_); - } - if (!getWorkerAddressBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, workerAddress_); - } - if (heartbeatIntervalMs_ != 0L) { - output.writeInt64(5, heartbeatIntervalMs_); - } - if (dispatcherTimeoutMs_ != 0L) { - output.writeInt64(6, dispatcherTimeoutMs_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (port_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, port_); - } - if (!getProtocolBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, protocol_); - } - if (!getDispatcherAddressBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, dispatcherAddress_); - } - if (!getWorkerAddressBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, workerAddress_); - } - if (heartbeatIntervalMs_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(5, heartbeatIntervalMs_); - } - if (dispatcherTimeoutMs_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(6, dispatcherTimeoutMs_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig)) { - return super.equals(obj); - } - org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig other = (org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig) obj; - - if (getPort() - != other.getPort()) return false; - if (!getProtocol() - .equals(other.getProtocol())) return false; - if (!getDispatcherAddress() - .equals(other.getDispatcherAddress())) return false; - if (!getWorkerAddress() - .equals(other.getWorkerAddress())) return false; - if (getHeartbeatIntervalMs() - != other.getHeartbeatIntervalMs()) return false; - if (getDispatcherTimeoutMs() - != other.getDispatcherTimeoutMs()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PORT_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getPort()); - hash = (37 * hash) + PROTOCOL_FIELD_NUMBER; - hash = (53 * hash) + getProtocol().hashCode(); - hash = (37 * hash) + DISPATCHER_ADDRESS_FIELD_NUMBER; - hash = (53 * hash) + getDispatcherAddress().hashCode(); - hash = (37 * hash) + WORKER_ADDRESS_FIELD_NUMBER; - hash = (53 * hash) + getWorkerAddress().hashCode(); - hash = (37 * hash) + HEARTBEAT_INTERVAL_MS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getHeartbeatIntervalMs()); - hash = (37 * hash) + DISPATCHER_TIMEOUT_MS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getDispatcherTimeoutMs()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * Configuration for a tf.data service WorkerServer.
-     * 
- * - * Protobuf type {@code tensorflow.data.experimental.WorkerConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.data.experimental.WorkerConfig) - org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_WorkerConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_WorkerConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig.class, org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig.Builder.class); - } - - // Construct using org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - port_ = 0L; - - protocol_ = ""; - - dispatcherAddress_ = ""; - - workerAddress_ = ""; - - heartbeatIntervalMs_ = 0L; - - dispatcherTimeoutMs_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.data.experimental.ServiceConfig.internal_static_tensorflow_data_experimental_WorkerConfig_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig getDefaultInstanceForType() { - return org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig build() { - org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig buildPartial() { - org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig result = new org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig(this); - result.port_ = port_; - result.protocol_ = protocol_; - result.dispatcherAddress_ = dispatcherAddress_; - result.workerAddress_ = workerAddress_; - result.heartbeatIntervalMs_ = heartbeatIntervalMs_; - result.dispatcherTimeoutMs_ = dispatcherTimeoutMs_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig) { - return mergeFrom((org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig other) { - if (other == org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig.getDefaultInstance()) return this; - if (other.getPort() != 0L) { - setPort(other.getPort()); - } - if (!other.getProtocol().isEmpty()) { - protocol_ = other.protocol_; - onChanged(); - } - if (!other.getDispatcherAddress().isEmpty()) { - dispatcherAddress_ = other.dispatcherAddress_; - onChanged(); - } - if (!other.getWorkerAddress().isEmpty()) { - workerAddress_ = other.workerAddress_; - onChanged(); - } - if (other.getHeartbeatIntervalMs() != 0L) { - setHeartbeatIntervalMs(other.getHeartbeatIntervalMs()); - } - if (other.getDispatcherTimeoutMs() != 0L) { - setDispatcherTimeoutMs(other.getDispatcherTimeoutMs()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long port_ ; - /** - *
-       * The port for the worker to bind to. A value of 0 indicates that the
-       * worker may bind to any available port.
-       * 
- * - * int64 port = 1; - */ - public long getPort() { - return port_; - } - /** - *
-       * The port for the worker to bind to. A value of 0 indicates that the
-       * worker may bind to any available port.
-       * 
- * - * int64 port = 1; - */ - public Builder setPort(long value) { - - port_ = value; - onChanged(); - return this; - } - /** - *
-       * The port for the worker to bind to. A value of 0 indicates that the
-       * worker may bind to any available port.
-       * 
- * - * int64 port = 1; - */ - public Builder clearPort() { - - port_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object protocol_ = ""; - /** - *
-       * The protocol for the worker to use when connecting to the dispatcher.
-       * 
- * - * string protocol = 2; - */ - public java.lang.String getProtocol() { - java.lang.Object ref = protocol_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - protocol_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-       * The protocol for the worker to use when connecting to the dispatcher.
-       * 
- * - * string protocol = 2; - */ - public com.google.protobuf.ByteString - getProtocolBytes() { - java.lang.Object ref = protocol_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - protocol_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-       * The protocol for the worker to use when connecting to the dispatcher.
-       * 
- * - * string protocol = 2; - */ - public Builder setProtocol( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - protocol_ = value; - onChanged(); - return this; - } - /** - *
-       * The protocol for the worker to use when connecting to the dispatcher.
-       * 
- * - * string protocol = 2; - */ - public Builder clearProtocol() { - - protocol_ = getDefaultInstance().getProtocol(); - onChanged(); - return this; - } - /** - *
-       * The protocol for the worker to use when connecting to the dispatcher.
-       * 
- * - * string protocol = 2; - */ - public Builder setProtocolBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - protocol_ = value; - onChanged(); - return this; - } - - private java.lang.Object dispatcherAddress_ = ""; - /** - *
-       * The address of the dispatcher to register with.
-       * 
- * - * string dispatcher_address = 3; - */ - public java.lang.String getDispatcherAddress() { - java.lang.Object ref = dispatcherAddress_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - dispatcherAddress_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-       * The address of the dispatcher to register with.
-       * 
- * - * string dispatcher_address = 3; - */ - public com.google.protobuf.ByteString - getDispatcherAddressBytes() { - java.lang.Object ref = dispatcherAddress_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - dispatcherAddress_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-       * The address of the dispatcher to register with.
-       * 
- * - * string dispatcher_address = 3; - */ - public Builder setDispatcherAddress( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - dispatcherAddress_ = value; - onChanged(); - return this; - } - /** - *
-       * The address of the dispatcher to register with.
-       * 
- * - * string dispatcher_address = 3; - */ - public Builder clearDispatcherAddress() { - - dispatcherAddress_ = getDefaultInstance().getDispatcherAddress(); - onChanged(); - return this; - } - /** - *
-       * The address of the dispatcher to register with.
-       * 
- * - * string dispatcher_address = 3; - */ - public Builder setDispatcherAddressBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - dispatcherAddress_ = value; - onChanged(); - return this; - } - - private java.lang.Object workerAddress_ = ""; - /** - *
-       * The address of the worker server. The substring "%port%", if specified,
-       * will be replaced with the worker's bound port. This is useful when the port
-       * is set to `0`.
-       * 
- * - * string worker_address = 4; - */ - public java.lang.String getWorkerAddress() { - java.lang.Object ref = workerAddress_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - workerAddress_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-       * The address of the worker server. The substring "%port%", if specified,
-       * will be replaced with the worker's bound port. This is useful when the port
-       * is set to `0`.
-       * 
- * - * string worker_address = 4; - */ - public com.google.protobuf.ByteString - getWorkerAddressBytes() { - java.lang.Object ref = workerAddress_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - workerAddress_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-       * The address of the worker server. The substring "%port%", if specified,
-       * will be replaced with the worker's bound port. This is useful when the port
-       * is set to `0`.
-       * 
- * - * string worker_address = 4; - */ - public Builder setWorkerAddress( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - workerAddress_ = value; - onChanged(); - return this; - } - /** - *
-       * The address of the worker server. The substring "%port%", if specified,
-       * will be replaced with the worker's bound port. This is useful when the port
-       * is set to `0`.
-       * 
- * - * string worker_address = 4; - */ - public Builder clearWorkerAddress() { - - workerAddress_ = getDefaultInstance().getWorkerAddress(); - onChanged(); - return this; - } - /** - *
-       * The address of the worker server. The substring "%port%", if specified,
-       * will be replaced with the worker's bound port. This is useful when the port
-       * is set to `0`.
-       * 
- * - * string worker_address = 4; - */ - public Builder setWorkerAddressBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - workerAddress_ = value; - onChanged(); - return this; - } - - private long heartbeatIntervalMs_ ; - /** - *
-       * How often the worker should heartbeat to the master.
-       * 
- * - * int64 heartbeat_interval_ms = 5; - */ - public long getHeartbeatIntervalMs() { - return heartbeatIntervalMs_; - } - /** - *
-       * How often the worker should heartbeat to the master.
-       * 
- * - * int64 heartbeat_interval_ms = 5; - */ - public Builder setHeartbeatIntervalMs(long value) { - - heartbeatIntervalMs_ = value; - onChanged(); - return this; - } - /** - *
-       * How often the worker should heartbeat to the master.
-       * 
- * - * int64 heartbeat_interval_ms = 5; - */ - public Builder clearHeartbeatIntervalMs() { - - heartbeatIntervalMs_ = 0L; - onChanged(); - return this; - } - - private long dispatcherTimeoutMs_ ; - /** - *
-       * How long to retry requests to the dispatcher before giving up and reporting
-       * an error.
-       * 
- * - * int64 dispatcher_timeout_ms = 6; - */ - public long getDispatcherTimeoutMs() { - return dispatcherTimeoutMs_; - } - /** - *
-       * How long to retry requests to the dispatcher before giving up and reporting
-       * an error.
-       * 
- * - * int64 dispatcher_timeout_ms = 6; - */ - public Builder setDispatcherTimeoutMs(long value) { - - dispatcherTimeoutMs_ = value; - onChanged(); - return this; - } - /** - *
-       * How long to retry requests to the dispatcher before giving up and reporting
-       * an error.
-       * 
- * - * int64 dispatcher_timeout_ms = 6; - */ - public Builder clearDispatcherTimeoutMs() { - - dispatcherTimeoutMs_ = 0L; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:tensorflow.data.experimental.WorkerConfig) - } - - // @@protoc_insertion_point(class_scope:tensorflow.data.experimental.WorkerConfig) - private static final org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig(); - } - - public static org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public WorkerConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new WorkerConfig(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_data_experimental_DispatcherConfig_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_data_experimental_DispatcherConfig_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_data_experimental_WorkerConfig_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_data_experimental_WorkerConfig_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n?tensorflow/core/protobuf/data/experime" + - "ntal/service_config.proto\022\034tensorflow.da" + - "ta.experimental\"\236\001\n\020DispatcherConfig\022\014\n\004" + - "port\030\001 \001(\003\022\020\n\010protocol\030\002 \001(\t\022\020\n\010work_dir" + - "\030\003 \001(\t\022\033\n\023fault_tolerant_mode\030\004 \001(\010\022 \n\030j" + - "ob_gc_check_interval_ms\030\005 \001(\003\022\031\n\021job_gc_" + - "timeout_ms\030\006 \001(\003\"\240\001\n\014WorkerConfig\022\014\n\004por" + - "t\030\001 \001(\003\022\020\n\010protocol\030\002 \001(\t\022\032\n\022dispatcher_" + - "address\030\003 \001(\t\022\026\n\016worker_address\030\004 \001(\t\022\035\n" + - "\025heartbeat_interval_ms\030\005 \001(\003\022\035\n\025dispatch" + - "er_timeout_ms\030\006 \001(\003B(\n&org.tensorflow.pr" + - "oto.data.experimentalb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_data_experimental_DispatcherConfig_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_data_experimental_DispatcherConfig_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_data_experimental_DispatcherConfig_descriptor, - new java.lang.String[] { "Port", "Protocol", "WorkDir", "FaultTolerantMode", "JobGcCheckIntervalMs", "JobGcTimeoutMs", }); - internal_static_tensorflow_data_experimental_WorkerConfig_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_data_experimental_WorkerConfig_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_data_experimental_WorkerConfig_descriptor, - new java.lang.String[] { "Port", "Protocol", "DispatcherAddress", "WorkerAddress", "HeartbeatIntervalMs", "DispatcherTimeoutMs", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/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 696b438c3c8..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/data/experimental/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 97e3dddd818..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/data/experimental/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 b4f4cbceaf4..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotProtos.java +++ /dev/null @@ -1,103 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/data/experimental/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 = { - "\n9tensorflow/core/protobuf/data/experime" + - "ntal/snapshot.proto\022\034tensorflow.data.exp" + - "erimental\032&tensorflow/core/framework/ten" + - "sor.proto\032,tensorflow/core/framework/ten" + - "sor_shape.proto\032%tensorflow/core/framewo" + - "rk/types.proto\"9\n\016SnapshotRecord\022\'\n\006tens" + - "or\030\001 \003(\0132\027.tensorflow.TensorProto\"\270\001\n\026Sn" + - "apshotMetadataRecord\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.t" + - "ensorflow.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.Tensor" + - "ShapeProto\022\031\n\021tensor_size_bytes\030\003 \001(\003\"_\n" + - "\026SnapshotTensorMetadata\022E\n\017tensor_metada" + - "ta\030\001 \003(\0132,.tensorflow.data.experimental." + - "TensorMetadataB:\n&org.tensorflow.proto.d" + - "ata.experimentalB\016SnapshotProtosP\001b\006prot" + - "o3" - }; - 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 e6388b928fc..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/data/experimental/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 485e1656377..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/data/experimental/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 59b0fba153d..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/data/experimental/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 73feb8671a6..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/data/experimental/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 87dfbe8bf78..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/data/experimental/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 0649aabc2ca..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/data/experimental/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/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/JobDefOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/JobDefOrBuilder.java deleted file mode 100644 index a9c24b98a74..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/JobDefOrBuilder.java +++ /dev/null @@ -1,96 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/cluster.proto - -package org.tensorflow.proto.distruntime; - -public interface JobDefOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.JobDef) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * The name of this job.
-   * 
- * - * string name = 1; - */ - java.lang.String getName(); - /** - *
-   * The name of this job.
-   * 
- * - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
-   * 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; - */ - int getTasksCount(); - /** - *
-   * 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; - */ - boolean containsTasks( - int key); - /** - * Use {@link #getTasksMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getTasks(); - /** - *
-   * 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; - */ - java.util.Map - 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; - */ - - java.lang.String getTasksOrDefault( - int key, - 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".
-   * 
- * - * map<int32, string> tasks = 2; - */ - - java.lang.String getTasksOrThrow( - int key); -} 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/JobDeviceFiltersOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/JobDeviceFiltersOrBuilder.java deleted file mode 100644 index 92c3ba82935..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/JobDeviceFiltersOrBuilder.java +++ /dev/null @@ -1,81 +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 JobDeviceFiltersOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.JobDeviceFilters) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * The name of this job.
-   * 
- * - * string name = 1; - */ - java.lang.String getName(); - /** - *
-   * The name of this job.
-   * 
- * - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
-   * Mapping from task ID to task device filters.
-   * 
- * - * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; - */ - int getTasksCount(); - /** - *
-   * Mapping from task ID to task device filters.
-   * 
- * - * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; - */ - boolean containsTasks( - int key); - /** - * Use {@link #getTasksMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getTasks(); - /** - *
-   * Mapping from task ID to task device filters.
-   * 
- * - * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; - */ - java.util.Map - getTasksMap(); - /** - *
-   * Mapping from task ID to task device filters.
-   * 
- * - * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; - */ - - org.tensorflow.proto.distruntime.TaskDeviceFilters getTasksOrDefault( - int key, - org.tensorflow.proto.distruntime.TaskDeviceFilters defaultValue); - /** - *
-   * Mapping from task ID to task device filters.
-   * 
- * - * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; - */ - - org.tensorflow.proto.distruntime.TaskDeviceFilters getTasksOrThrow( - int key); -} 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 d8158b11f38..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/BytesList.java +++ /dev/null @@ -1,572 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/feature.proto - -package org.tensorflow.proto.example; - -/** - *
- * 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; - } - /** - *
-   * 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/FeatureListsOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureListsOrBuilder.java deleted file mode 100644 index 9f582b998ce..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureListsOrBuilder.java +++ /dev/null @@ -1,63 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/feature.proto - -package org.tensorflow.proto.example; - -public interface FeatureListsOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.FeatureLists) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Map from feature name to feature list.
-   * 
- * - * map<string, .tensorflow.FeatureList> feature_list = 1; - */ - int getFeatureListCount(); - /** - *
-   * Map from feature name to feature list.
-   * 
- * - * map<string, .tensorflow.FeatureList> feature_list = 1; - */ - boolean containsFeatureList( - java.lang.String key); - /** - * Use {@link #getFeatureListMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getFeatureList(); - /** - *
-   * Map from feature name to feature list.
-   * 
- * - * map<string, .tensorflow.FeatureList> feature_list = 1; - */ - java.util.Map - getFeatureListMap(); - /** - *
-   * Map from feature name to feature list.
-   * 
- * - * map<string, .tensorflow.FeatureList> feature_list = 1; - */ - - org.tensorflow.proto.example.FeatureList getFeatureListOrDefault( - java.lang.String key, - org.tensorflow.proto.example.FeatureList defaultValue); - /** - *
-   * Map from feature name to feature list.
-   * 
- * - * map<string, .tensorflow.FeatureList> feature_list = 1; - */ - - org.tensorflow.proto.example.FeatureList getFeatureListOrThrow( - java.lang.String key); -} 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/FeaturesOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeaturesOrBuilder.java deleted file mode 100644 index 2ee80ee66a0..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeaturesOrBuilder.java +++ /dev/null @@ -1,63 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/feature.proto - -package org.tensorflow.proto.example; - -public interface FeaturesOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.Features) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Map from feature name to feature.
-   * 
- * - * map<string, .tensorflow.Feature> feature = 1; - */ - int getFeatureCount(); - /** - *
-   * Map from feature name to feature.
-   * 
- * - * map<string, .tensorflow.Feature> feature = 1; - */ - boolean containsFeature( - java.lang.String key); - /** - * Use {@link #getFeatureMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getFeature(); - /** - *
-   * Map from feature name to feature.
-   * 
- * - * map<string, .tensorflow.Feature> feature = 1; - */ - java.util.Map - getFeatureMap(); - /** - *
-   * Map from feature name to feature.
-   * 
- * - * map<string, .tensorflow.Feature> feature = 1; - */ - - org.tensorflow.proto.example.Feature getFeatureOrDefault( - java.lang.String key, - org.tensorflow.proto.example.Feature defaultValue); - /** - *
-   * Map from feature name to feature.
-   * 
- * - * map<string, .tensorflow.Feature> feature = 1; - */ - - org.tensorflow.proto.example.Feature getFeatureOrThrow( - java.lang.String key); -} 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/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/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/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/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 c756a6ef126..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ConfigProto.java +++ /dev/null @@ -1,6359 +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(); - } - /** - *
-   * 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; - } - - @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; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (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), - UNRECOGNIZED(-1), - ; - - /** - *
-       * If this field is left unspecified, the MLIR bridge may be selectively
-       * enabled on a per graph basis.
-       * 
- * - * MLIR_BRIDGE_ROLLOUT_UNSPECIFIED = 0; - */ - public static final int MLIR_BRIDGE_ROLLOUT_UNSPECIFIED_VALUE = 0; - /** - *
-       * Enabling the MLIR bridge enables it for all graphs in this session.
-       * 
- * - * MLIR_BRIDGE_ROLLOUT_ENABLED = 1; - */ - public static final int MLIR_BRIDGE_ROLLOUT_ENABLED_VALUE = 1; - /** - *
-       * Disabling the MLIR bridge disables it for all graphs in this session.
-       * 
- * - * MLIR_BRIDGE_ROLLOUT_DISABLED = 2; - */ - public static final int MLIR_BRIDGE_ROLLOUT_DISABLED_VALUE = 2; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static MlirBridgeRollout valueOf(int value) { - return forNumber(value); - } - - public static MlirBridgeRollout forNumber(int value) { - switch (value) { - case 0: return MLIR_BRIDGE_ROLLOUT_UNSPECIFIED; - case 1: return MLIR_BRIDGE_ROLLOUT_ENABLED; - case 2: return MLIR_BRIDGE_ROLLOUT_DISABLED; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - MlirBridgeRollout> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public MlirBridgeRollout findValueByNumber(int number) { - return MlirBridgeRollout.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProto.Experimental.getDescriptor().getEnumTypes().get(0); - } - - private static final MlirBridgeRollout[] VALUES = values(); - - public static MlirBridgeRollout valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private MlirBridgeRollout(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.ConfigProto.Experimental.MlirBridgeRollout) - } - - public static final int COLLECTIVE_GROUP_LEADER_FIELD_NUMBER = 1; - private volatile java.lang.Object collectiveGroupLeader_; - /** - *
-     * 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_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (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_); - } - 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_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - 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 (!unknownFields.equals(other.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 = (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; - - 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_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.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()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return 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; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(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 describe 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 describe 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 describe 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 describe 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 83eabfe7d8d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ConfigProtos.java +++ /dev/null @@ -1,399 +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\"\311\005\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\202\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\032" + - ";\n\016VirtualDevices\022\027\n\017memory_limit_mb\030\001 \003" + - "(\002\022\020\n\010priority\030\002 \003(\005\"\205\003\n\020OptimizerOption" + - "s\022+\n#do_common_subexpression_elimination" + - "\030\001 \001(\010\022\033\n\023do_constant_folding\030\002 \001(\010\022$\n\034m" + - "ax_folded_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\".tensorflow.OptimizerOptions.Level\022E" + - "\n\020global_jit_level\030\005 \001(\0162+.tensorflow.Op" + - "timizerOptions.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\016GlobalJitLeve" + - "l\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\021optimizer_optio" + - "ns\030\003 \001(\0132\034.tensorflow.OptimizerOptions\022\030" + - "\n\020build_cost_model\030\004 \001(\003\022\036\n\026build_cost_m" + - "odel_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\030enable_bfl" + - "oat16_sendrecv\030\007 \001(\010\022\025\n\rtimeline_step\030\010 " + - "\001(\005\0223\n\017rewrite_options\030\n \001(\0132\032.tensorflo" + - "w.RewriterConfigJ\004\010\001\020\002R%skip_common_sube" + - "xpression_elimination\"A\n\025ThreadPoolOptio" + - "nProto\022\023\n\013num_threads\030\001 \001(\005\022\023\n\013global_na" + - "me\030\002 \001(\t\"\264\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\"0\n\017Sessi" + - "onMetadata\022\014\n\004name\030\001 \001(\t\022\017\n\007version\030\002 \001(" + - "\003\"\232\014\n\013ConfigProto\022>\n\014device_count\030\001 \003(\0132" + - "(.tensorflow.ConfigProto.DeviceCountEntr" + - "y\022$\n\034intra_op_parallelism_threads\030\002 \001(\005\022" + - "$\n\034inter_op_parallelism_threads\030\005 \001(\005\022\037\n" + - "\027use_per_session_threads\030\t \001(\010\022G\n\034sessio" + - "n_inter_op_thread_pool\030\014 \003(\0132!.tensorflo" + - "w.ThreadPoolOptionProto\022\030\n\020placement_per" + - "iod\030\003 \001(\005\022\026\n\016device_filters\030\004 \003(\t\022+\n\013gpu" + - "_options\030\006 \001(\0132\026.tensorflow.GPUOptions\022\034" + - "\n\024allow_soft_placement\030\007 \001(\010\022\034\n\024log_devi" + - "ce_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.tensorflow.ClusterDef\022\035\n\025isolat" + - "e_session_state\030\017 \001(\010\022(\n share_cluster_d" + - "evices_in_session\030\021 \001(\010\022:\n\014experimental\030" + - "\020 \001(\0132$.tensorflow.ConfigProto.Experimen" + - "tal\0322\n\020DeviceCountEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005" + - "value\030\002 \001(\005:\0028\001\032\224\006\n\014Experimental\022\037\n\027coll" + - "ective_group_leader\030\001 \001(\t\022\025\n\rexecutor_ty" + - "pe\030\003 \001(\t\022\032\n\022recv_buf_max_chunk\030\004 \001(\005\022\031\n\021" + - "use_numa_affinity\030\005 \001(\010\0225\n-collective_de" + - "terministic_sequential_execution\030\006 \001(\010\022\027" + - "\n\017collective_nccl\030\007 \001(\010\0226\n.share_session" + - "_state_in_clusterspec_propagation\030\010 \001(\010\022" + - "\037\n\027disable_thread_spinning\030\t \001(\010\022(\n shar" + - "e_cluster_devices_in_session\030\n \001(\010\0225\n\020se" + - "ssion_metadata\030\013 \001(\0132\033.tensorflow.Sessio" + - "nMetadata\022!\n\031optimize_for_static_graph\030\014" + - " \001(\010\022\032\n\022enable_mlir_bridge\030\r \001(\010\022S\n\023mlir" + - "_bridge_rollout\030\021 \001(\01626.tensorflow.Confi" + - "gProto.Experimental.MlirBridgeRollout\022&\n" + - "\036enable_mlir_graph_optimization\030\020 \001(\010\022\'\n" + - "\037disable_output_partition_graphs\030\016 \001(\010\022#" + - "\n\033xla_fusion_autotuner_thresh\030\017 \001(\003\"{\n\021M" + - "lirBridgeRollout\022#\n\037MLIR_BRIDGE_ROLLOUT_" + - "UNSPECIFIED\020\000\022\037\n\033MLIR_BRIDGE_ROLLOUT_ENA" + - "BLED\020\001\022 \n\034MLIR_BRIDGE_ROLLOUT_DISABLED\020\002" + - "J\004\010\002\020\003\"\341\004\n\nRunOptions\0226\n\013trace_level\030\001 \001" + - "(\0162!.tensorflow.RunOptions.TraceLevel\022\025\n" + - "\rtimeout_in_ms\030\002 \001(\003\022\034\n\024inter_op_thread_" + - "pool\030\003 \001(\005\022\037\n\027output_partition_graphs\030\005 " + - "\001(\010\022/\n\rdebug_options\030\006 \001(\0132\030.tensorflow." + - "DebugOptions\022*\n\"report_tensor_allocation" + - "s_upon_oom\030\007 \001(\010\0229\n\014experimental\030\010 \001(\0132#" + - ".tensorflow.RunOptions.Experimental\032\322\001\n\014" + - "Experimental\022\034\n\024collective_graph_key\030\001 \001" + - "(\003\022\034\n\024use_run_handler_pool\030\002 \001(\010\022[\n\030run_" + - "handler_pool_options\030\003 \001(\01329.tensorflow." + - "RunOptions.Experimental.RunHandlerPoolOp" + - "tions\032)\n\025RunHandlerPoolOptions\022\020\n\010priori" + - "ty\030\001 \001(\003\"R\n\nTraceLevel\022\014\n\010NO_TRACE\020\000\022\022\n\016" + - "SOFTWARE_TRACE\020\001\022\022\n\016HARDWARE_TRACE\020\002\022\016\n\n" + - "FULL_TRACE\020\003J\004\010\004\020\005\"\207\003\n\013RunMetadata\022)\n\nst" + - "ep_stats\030\001 \001(\0132\025.tensorflow.StepStats\022,\n" + - "\ncost_graph\030\002 \001(\0132\030.tensorflow.CostGraph" + - "Def\022.\n\020partition_graphs\030\003 \003(\0132\024.tensorfl" + - "ow.GraphDef\022?\n\017function_graphs\030\004 \003(\0132&.t" + - "ensorflow.RunMetadata.FunctionGraphs\032\255\001\n" + - "\016FunctionGraphs\022.\n\020partition_graphs\030\001 \003(" + - "\0132\024.tensorflow.GraphDef\0224\n\026pre_optimizat" + - "ion_graph\030\002 \001(\0132\024.tensorflow.GraphDef\0225\n" + - "\027post_optimization_graph\030\003 \001(\0132\024.tensorf" + - "low.GraphDef\":\n\020TensorConnection\022\023\n\013from" + - "_tensor\030\001 \001(\t\022\021\n\tto_tensor\030\002 \001(\t\"\260\003\n\017Cal" + - "lableOptions\022\014\n\004feed\030\001 \003(\t\022\r\n\005fetch\030\002 \003(" + - "\t\022\016\n\006target\030\003 \003(\t\022+\n\013run_options\030\004 \001(\0132\026" + - ".tensorflow.RunOptions\0227\n\021tensor_connect" + - "ion\030\005 \003(\0132\034.tensorflow.TensorConnection\022" + - "B\n\014feed_devices\030\006 \003(\0132,.tensorflow.Calla" + - "bleOptions.FeedDevicesEntry\022D\n\rfetch_dev" + - "ices\030\007 \003(\0132-.tensorflow.CallableOptions." + - "FetchDevicesEntry\022\027\n\017fetch_skip_sync\030\010 \001" + - "(\010\0322\n\020FeedDevicesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" + - "alue\030\002 \001(\t:\0028\001\0323\n\021FetchDevicesEntry\022\013\n\003k" + - "ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\212\001\n\036org.tens" + - "orflow.proto.frameworkB\014ConfigProtosP\001ZU" + - "github.com/tensorflow/tensorflow/tensorf" + - "low/go/core/protobuf/for_core_protos_go_" + - "proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - 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", }); - 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", }); - 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", }); - 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/DebuggedSourceFilesOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebuggedSourceFilesOrBuilder.java deleted file mode 100644 index 3afc8e4f78f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebuggedSourceFilesOrBuilder.java +++ /dev/null @@ -1,53 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/debug.proto - -package org.tensorflow.proto.framework; - -public interface DebuggedSourceFilesOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.DebuggedSourceFiles) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * A collection of source code files.
-   * 
- * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - java.util.List - getSourceFilesList(); - /** - *
-   * A collection of source code files.
-   * 
- * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - org.tensorflow.proto.framework.DebuggedSourceFile getSourceFiles(int index); - /** - *
-   * A collection of source code files.
-   * 
- * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - int getSourceFilesCount(); - /** - *
-   * A collection of source code files.
-   * 
- * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - java.util.List - getSourceFilesOrBuilderList(); - /** - *
-   * A collection of source code files.
-   * 
- * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - org.tensorflow.proto.framework.DebuggedSourceFileOrBuilder getSourceFilesOrBuilder( - int index); -} 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/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 a4ad715f17c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionDefLibrary.java +++ /dev/null @@ -1,1116 +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(); - } - - @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; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (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_); - } - 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); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - 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)); - } - 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)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - 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 (!unknownFields.equals(other.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(); - } - 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(); - } - } - @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(); - } - 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(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.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_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return 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_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(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 cfb61e977ba..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionDefLibraryOrBuilder.java +++ /dev/null @@ -1,57 +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); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionProtos.java deleted file mode 100644 index e33df603ca8..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionProtos.java +++ /dev/null @@ -1,184 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/function.proto - -package org.tensorflow.proto.framework; - -public final class FunctionProtos { - private FunctionProtos() {} - 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_FunctionDefLibrary_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - internal_static_tensorflow_GradientDef_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/function.pro" + - "to\022\ntensorflow\032*tensorflow/core/framewor" + - "k/attr_value.proto\032(tensorflow/core/fram" + - "ework/node_def.proto\032&tensorflow/core/fr" + - "amework/op_def.proto\"j\n\022FunctionDefLibra" + - "ry\022)\n\010function\030\001 \003(\0132\027.tensorflow.Functi" + - "onDef\022)\n\010gradient\030\002 \003(\0132\027.tensorflow.Gra" + - "dientDef\"\304\006\n\013FunctionDef\022$\n\tsignature\030\001 " + - "\001(\0132\021.tensorflow.OpDef\022/\n\004attr\030\005 \003(\0132!.t" + - "ensorflow.FunctionDef.AttrEntry\0226\n\010arg_a" + - "ttr\030\007 \003(\0132$.tensorflow.FunctionDef.ArgAt" + - "trEntry\022P\n\026resource_arg_unique_id\030\010 \003(\0132" + - "0.tensorflow.FunctionDef.ResourceArgUniq" + - "ueIdEntry\022%\n\010node_def\030\003 \003(\0132\023.tensorflow" + - ".NodeDef\022-\n\003ret\030\004 \003(\0132 .tensorflow.Funct" + - "ionDef.RetEntry\022<\n\013control_ret\030\006 \003(\0132\'.t" + - "ensorflow.FunctionDef.ControlRetEntry\032B\n" + - "\tAttrEntry\022\013\n\003key\030\001 \001(\t\022$\n\005value\030\002 \001(\0132\025" + - ".tensorflow.AttrValue:\0028\001\032\210\001\n\010ArgAttrs\0228" + - "\n\004attr\030\001 \003(\0132*.tensorflow.FunctionDef.Ar" + - "gAttrs.AttrEntry\032B\n\tAttrEntry\022\013\n\003key\030\001 \001" + - "(\t\022$\n\005value\030\002 \001(\0132\025.tensorflow.AttrValue" + - ":\0028\001\032P\n\014ArgAttrEntry\022\013\n\003key\030\001 \001(\r\022/\n\005val" + - "ue\030\002 \001(\0132 .tensorflow.FunctionDef.ArgAtt" + - "rs:\0028\001\032:\n\030ResourceArgUniqueIdEntry\022\013\n\003ke" + - "y\030\001 \001(\r\022\r\n\005value\030\002 \001(\r:\0028\001\032*\n\010RetEntry\022\013" + - "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0321\n\017Contro" + - "lRetEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028" + - "\001J\004\010\002\020\003\";\n\013GradientDef\022\025\n\rfunction_name\030" + - "\001 \001(\t\022\025\n\rgradient_func\030\002 \001(\tB\206\001\n\036org.ten" + - "sorflow.proto.frameworkB\016FunctionProtosP" + - "\001ZOgithub.com/tensorflow/tensorflow/tens" + - "orflow/go/core/framework/function_go_pro" + - "to\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(), - }); - internal_static_tensorflow_FunctionDefLibrary_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_FunctionDefLibrary_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_FunctionDefLibrary_descriptor, - new java.lang.String[] { "Function", "Gradient", }); - internal_static_tensorflow_FunctionDef_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_FunctionDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.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( - 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( - 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( - 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( - 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( - 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( - 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( - 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( - internal_static_tensorflow_GradientDef_descriptor, - new java.lang.String[] { "FunctionName", "GradientFunc", }); - org.tensorflow.proto.framework.AttrValueProtos.getDescriptor(); - org.tensorflow.proto.framework.NodeProto.getDescriptor(); - org.tensorflow.proto.framework.OpDefProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} 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 08549e9715c..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() { - experimentalCompile_ = 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(); - - experimentalCompile_ = 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.ExperimentalCompile} - */ - public enum ExperimentalCompile - implements com.google.protobuf.ProtocolMessageEnum { - /** - * DEFAULT = 0; - */ - DEFAULT(0), - /** - * ON = 1; - */ - ON(1), - /** - * OFF = 2; - */ - OFF(2), - UNRECOGNIZED(-1), - ; - - /** - * DEFAULT = 0; - */ - public static final int DEFAULT_VALUE = 0; - /** - * ON = 1; - */ - public static final int ON_VALUE = 1; - /** - * OFF = 2; - */ - public static final int OFF_VALUE = 2; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static ExperimentalCompile valueOf(int value) { - return forNumber(value); - } - - public static ExperimentalCompile forNumber(int value) { - switch (value) { - case 0: return DEFAULT; - case 1: return ON; - case 2: return OFF; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - ExperimentalCompile> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public ExperimentalCompile findValueByNumber(int number) { - return ExperimentalCompile.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return org.tensorflow.proto.framework.FunctionSpec.getDescriptor().getEnumTypes().get(0); - } - - private static final ExperimentalCompile[] VALUES = values(); - - public static ExperimentalCompile valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private ExperimentalCompile(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.FunctionSpec.ExperimentalCompile) - } - - public static final int FULLARGSPEC_FIELD_NUMBER = 1; - private org.tensorflow.proto.framework.StructuredValue fullargspec_; - /** - *
-   * 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 EXPERIMENTAL_COMPILE_FIELD_NUMBER = 6; - private int experimentalCompile_; - /** - * .tensorflow.FunctionSpec.ExperimentalCompile experimental_compile = 6; - */ - public int getExperimentalCompileValue() { - return experimentalCompile_; - } - /** - * .tensorflow.FunctionSpec.ExperimentalCompile experimental_compile = 6; - */ - public org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile getExperimentalCompile() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile result = org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile.valueOf(experimentalCompile_); - return result == null ? org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile.UNRECOGNIZED : result; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (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 (experimentalCompile_ != org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile.DEFAULT.getNumber()) { - output.writeEnum(6, experimentalCompile_); - } - 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 (experimentalCompile_ != org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile.DEFAULT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(6, experimentalCompile_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - 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 (experimentalCompile_ != other.experimentalCompile_) 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) + EXPERIMENTAL_COMPILE_FIELD_NUMBER; - hash = (53 * hash) + experimentalCompile_; - 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; - } - experimentalCompile_ = 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.experimentalCompile_ = experimentalCompile_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.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.experimentalCompile_ != 0) { - setExperimentalCompileValue(other.getExperimentalCompileValue()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return 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 experimentalCompile_ = 0; - /** - * .tensorflow.FunctionSpec.ExperimentalCompile experimental_compile = 6; - */ - public int getExperimentalCompileValue() { - return experimentalCompile_; - } - /** - * .tensorflow.FunctionSpec.ExperimentalCompile experimental_compile = 6; - */ - public Builder setExperimentalCompileValue(int value) { - experimentalCompile_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.FunctionSpec.ExperimentalCompile experimental_compile = 6; - */ - public org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile getExperimentalCompile() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile result = org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile.valueOf(experimentalCompile_); - return result == null ? org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile.UNRECOGNIZED : result; - } - /** - * .tensorflow.FunctionSpec.ExperimentalCompile experimental_compile = 6; - */ - public Builder setExperimentalCompile(org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile value) { - if (value == null) { - throw new NullPointerException(); - } - - experimentalCompile_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.FunctionSpec.ExperimentalCompile experimental_compile = 6; - */ - public Builder clearExperimentalCompile() { - - experimentalCompile_ = 0; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(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 09ebc013bdc..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.ExperimentalCompile experimental_compile = 6; - */ - int getExperimentalCompileValue(); - /** - * .tensorflow.FunctionSpec.ExperimentalCompile experimental_compile = 6; - */ - org.tensorflow.proto.framework.FunctionSpec.ExperimentalCompile getExperimentalCompile(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GPUOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GPUOptions.java deleted file mode 100644 index 44b8a1c43e3..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GPUOptions.java +++ /dev/null @@ -1,5061 +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(); - } - /** - * 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; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (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_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - 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_); - } - 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_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - 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 (!unknownFields.equals(other.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 = (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; - - 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_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.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()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return 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; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(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 18e75b5e768..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphDef.java +++ /dev/null @@ -1,1588 +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_; - /** - *
-   * EXPERIMENTAL. DO NOT USE OR DEPEND ON THIS YET.
-   * "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; - } - /** - *
-   * EXPERIMENTAL. DO NOT USE OR DEPEND ON THIS YET.
-   * "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_; - } - /** - *
-   * EXPERIMENTAL. DO NOT USE OR DEPEND ON THIS YET.
-   * "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_; - /** - *
-     * EXPERIMENTAL. DO NOT USE OR DEPEND ON THIS YET.
-     * "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; - } - /** - *
-     * EXPERIMENTAL. DO NOT USE OR DEPEND ON THIS YET.
-     * "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(); - } - } - /** - *
-     * EXPERIMENTAL. DO NOT USE OR DEPEND ON THIS YET.
-     * "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; - } - /** - *
-     * EXPERIMENTAL. DO NOT USE OR DEPEND ON THIS YET.
-     * "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; - } - /** - *
-     * EXPERIMENTAL. DO NOT USE OR DEPEND ON THIS YET.
-     * "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; - } - /** - *
-     * EXPERIMENTAL. DO NOT USE OR DEPEND ON THIS YET.
-     * "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; - } - /** - *
-     * EXPERIMENTAL. DO NOT USE OR DEPEND ON THIS YET.
-     * "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(); - } - /** - *
-     * EXPERIMENTAL. DO NOT USE OR DEPEND ON THIS YET.
-     * "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_; - } - } - /** - *
-     * EXPERIMENTAL. DO NOT USE OR DEPEND ON THIS YET.
-     * "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 0e4ac4dca6e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphDefOrBuilder.java +++ /dev/null @@ -1,163 +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(); - - /** - *
-   * EXPERIMENTAL. DO NOT USE OR DEPEND ON THIS YET.
-   * "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(); - /** - *
-   * EXPERIMENTAL. DO NOT USE OR DEPEND ON THIS YET.
-   * "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(); - /** - *
-   * EXPERIMENTAL. DO NOT USE OR DEPEND ON THIS YET.
-   * "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/GraphTransferNodeInputOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeInputOrBuilder.java deleted file mode 100644 index 971ffed8443..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeInputOrBuilder.java +++ /dev/null @@ -1,19 +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 GraphTransferNodeInputOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.GraphTransferNodeInput) - com.google.protobuf.MessageOrBuilder { - - /** - * int32 node_id = 1; - */ - int getNodeId(); - - /** - * int32 output_port = 2; - */ - int getOutputPort(); -} 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/InterconnectLinkOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/InterconnectLinkOrBuilder.java deleted file mode 100644 index 61316cfa8cc..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/InterconnectLinkOrBuilder.java +++ /dev/null @@ -1,29 +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 InterconnectLinkOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.InterconnectLink) - com.google.protobuf.MessageOrBuilder { - - /** - * int32 device_id = 1; - */ - int getDeviceId(); - - /** - * string type = 2; - */ - java.lang.String getType(); - /** - * string type = 2; - */ - com.google.protobuf.ByteString - getTypeBytes(); - - /** - * int32 strength = 3; - */ - int getStrength(); -} 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/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/OpDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpDef.java deleted file mode 100644 index 80839f48dcc..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpDef.java +++ /dev/null @@ -1,6284 +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; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (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(); - - /** - *
-     * 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_ = ""; - } - - @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(); - } - com.google.protobuf.UnknownFieldSet.Builder 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 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 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 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; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (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_); - } - if (isRef_ != false) { - output.writeBool(16, isRef_); - } - 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_); - } - if (isRef_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(16, isRef_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - 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 (getIsRef() - != other.getIsRef()) 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(); - 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 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) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - description_ = ""; - - type_ = 0; - - typeAttr_ = ""; - - numberAttr_ = ""; - - typeListAttr_ = ""; - - isRef_ = false; - - 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); - result.name_ = name_; - result.description_ = description_; - result.type_ = type_; - result.typeAttr_ = typeAttr_; - result.numberAttr_ = numberAttr_; - result.typeListAttr_ = typeListAttr_; - result.isRef_ = isRef_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.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 (other.getIsRef() != false) { - setIsRef(other.getIsRef()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return 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 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 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; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(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_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (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)); - } - 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(); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - 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 (!unknownFields.equals(other.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 = (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; - - 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_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.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()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return 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; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(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/OpDefProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpDefProtos.java deleted file mode 100644 index 8beef161f83..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpDefProtos.java +++ /dev/null @@ -1,121 +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/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[] { - org.tensorflow.proto.framework.AttrValueProtos.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", }); - 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", "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 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.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/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/OptimizerOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OptimizerOptions.java deleted file mode 100644 index 2afa5a96067..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OptimizerOptions.java +++ /dev/null @@ -1,1210 +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.
-   * 
- * - * 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.
-   * 
- * - * 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.
-     * 
- * - * bool do_common_subexpression_elimination = 1; - */ - public boolean getDoCommonSubexpressionElimination() { - return doCommonSubexpressionElimination_; - } - /** - *
-     * If true, optimize the graph using common subexpression elimination.
-     * 
- * - * 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.
-     * 
- * - * 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.
-     * 
- * - * bool do_constant_folding = 2; - */ - public boolean getDoConstantFolding() { - return doConstantFolding_; - } - /** - *
-     * If true, perform constant folding optimization on the graph.
-     * 
- * - * bool do_constant_folding = 2; - */ - public Builder setDoConstantFolding(boolean value) { - - doConstantFolding_ = value; - onChanged(); - return this; - } - /** - *
-     * If true, perform constant folding optimization on the graph.
-     * 
- * - * 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 255ace49e05..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OptimizerOptionsOrBuilder.java +++ /dev/null @@ -1,77 +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.
-   * 
- * - * bool do_common_subexpression_elimination = 1; - */ - boolean getDoCommonSubexpressionElimination(); - - /** - *
-   * If true, perform constant folding optimization on the graph.
-   * 
- * - * 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 6c1a717876d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RPCOptions.java +++ /dev/null @@ -1,905 +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; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (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_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (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_); - } - 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_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - 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 (!unknownFields.equals(other.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 = (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; - - 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_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.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()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return 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; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(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 e7178532c17..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RPCOptionsOrBuilder.java +++ /dev/null @@ -1,72 +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(); -} 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/RemoteFusedGraphExecuteInfo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RemoteFusedGraphExecuteInfo.java deleted file mode 100644 index bc2e6840de2..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RemoteFusedGraphExecuteInfo.java +++ /dev/null @@ -1,3007 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/remote_fused_graph_execute_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.RemoteFusedGraphExecuteInfo} - */ -public final class RemoteFusedGraphExecuteInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.RemoteFusedGraphExecuteInfo) - RemoteFusedGraphExecuteInfoOrBuilder { -private static final long serialVersionUID = 0L; - // Use RemoteFusedGraphExecuteInfo.newBuilder() to construct. - private RemoteFusedGraphExecuteInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RemoteFusedGraphExecuteInfo() { - graphInputNodeName_ = com.google.protobuf.LazyStringArrayList.EMPTY; - graphOutputNodeName_ = com.google.protobuf.LazyStringArrayList.EMPTY; - executorName_ = ""; - serializedExecutorParameters_ = com.google.protobuf.ByteString.EMPTY; - defaultGraphInputTensorShape_ = java.util.Collections.emptyList(); - defaultGraphOutputTensorShape_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RemoteFusedGraphExecuteInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RemoteFusedGraphExecuteInfo( - 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.GraphDef.Builder subBuilder = null; - if (remoteGraph_ != null) { - subBuilder = remoteGraph_.toBuilder(); - } - remoteGraph_ = input.readMessage(org.tensorflow.proto.framework.GraphDef.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(remoteGraph_); - remoteGraph_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - graphInputNodeName_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - graphInputNodeName_.add(s); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - graphOutputNodeName_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - graphOutputNodeName_.add(s); - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - executorName_ = s; - break; - } - case 42: { - - serializedExecutorParameters_ = input.readBytes(); - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - defaultGraphInputTensorShape_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - defaultGraphInputTensorShape_.add( - input.readMessage(org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.parser(), extensionRegistry)); - break; - } - case 58: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - defaultGraphOutputTensorShape_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000008; - } - defaultGraphOutputTensorShape_.add( - input.readMessage(org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.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)) { - graphInputNodeName_ = graphInputNodeName_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - graphOutputNodeName_ = graphOutputNodeName_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - defaultGraphInputTensorShape_ = java.util.Collections.unmodifiableList(defaultGraphInputTensorShape_); - } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - defaultGraphOutputTensorShape_ = java.util.Collections.unmodifiableList(defaultGraphOutputTensorShape_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfoProto.internal_static_tensorflow_RemoteFusedGraphExecuteInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfoProto.internal_static_tensorflow_RemoteFusedGraphExecuteInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.class, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.Builder.class); - } - - public interface TensorShapeTypeProtoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) - 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(); - } - /** - * Protobuf type {@code tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto} - */ - public static final class TensorShapeTypeProto extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) - TensorShapeTypeProtoOrBuilder { - private static final long serialVersionUID = 0L; - // Use TensorShapeTypeProto.newBuilder() to construct. - private TensorShapeTypeProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TensorShapeTypeProto() { - dtype_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TensorShapeTypeProto(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TensorShapeTypeProto( - 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.RemoteFusedGraphExecuteInfoProto.internal_static_tensorflow_RemoteFusedGraphExecuteInfo_TensorShapeTypeProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfoProto.internal_static_tensorflow_RemoteFusedGraphExecuteInfo_TensorShapeTypeProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.class, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.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.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto other = (org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) 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.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto parseFrom( - 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.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto parseFrom( - com.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.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto parseFrom( - java.io.InputStream 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.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto parseDelimitedFrom( - java.io.InputStream 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.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, 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.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new 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.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProtoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfoProto.internal_static_tensorflow_RemoteFusedGraphExecuteInfo_TensorShapeTypeProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfoProto.internal_static_tensorflow_RemoteFusedGraphExecuteInfo_TensorShapeTypeProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.class, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.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.RemoteFusedGraphExecuteInfoProto.internal_static_tensorflow_RemoteFusedGraphExecuteInfo_TensorShapeTypeProto_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto getDefaultInstanceForType() { - return org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto build() { - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto buildPartial() { - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto result = new org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto(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.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) { - return mergeFrom((org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto other) { - if (other == org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.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.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) 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.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) - } - - // @@protoc_insertion_point(class_scope:tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) - private static final org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto(); - } - - public static org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TensorShapeTypeProto parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TensorShapeTypeProto(input, extensionRegistry); - } - }; - - public static com.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.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int REMOTE_GRAPH_FIELD_NUMBER = 1; - private org.tensorflow.proto.framework.GraphDef remoteGraph_; - /** - *
-   * Definition of remote graph
-   * 
- * - * .tensorflow.GraphDef remote_graph = 1; - */ - public boolean hasRemoteGraph() { - return remoteGraph_ != null; - } - /** - *
-   * Definition of remote graph
-   * 
- * - * .tensorflow.GraphDef remote_graph = 1; - */ - public org.tensorflow.proto.framework.GraphDef getRemoteGraph() { - return remoteGraph_ == null ? org.tensorflow.proto.framework.GraphDef.getDefaultInstance() : remoteGraph_; - } - /** - *
-   * Definition of remote graph
-   * 
- * - * .tensorflow.GraphDef remote_graph = 1; - */ - public org.tensorflow.proto.framework.GraphDefOrBuilder getRemoteGraphOrBuilder() { - return getRemoteGraph(); - } - - public static final int GRAPH_INPUT_NODE_NAME_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList graphInputNodeName_; - /** - *
-   * Remote fused graph input node name
-   * 
- * - * repeated string graph_input_node_name = 2; - */ - public com.google.protobuf.ProtocolStringList - getGraphInputNodeNameList() { - return graphInputNodeName_; - } - /** - *
-   * Remote fused graph input node name
-   * 
- * - * repeated string graph_input_node_name = 2; - */ - public int getGraphInputNodeNameCount() { - return graphInputNodeName_.size(); - } - /** - *
-   * Remote fused graph input node name
-   * 
- * - * repeated string graph_input_node_name = 2; - */ - public java.lang.String getGraphInputNodeName(int index) { - return graphInputNodeName_.get(index); - } - /** - *
-   * Remote fused graph input node name
-   * 
- * - * repeated string graph_input_node_name = 2; - */ - public com.google.protobuf.ByteString - getGraphInputNodeNameBytes(int index) { - return graphInputNodeName_.getByteString(index); - } - - public static final int GRAPH_OUTPUT_NODE_NAME_FIELD_NUMBER = 3; - private com.google.protobuf.LazyStringList graphOutputNodeName_; - /** - *
-   * Remote fused graph output node name
-   * 
- * - * repeated string graph_output_node_name = 3; - */ - public com.google.protobuf.ProtocolStringList - getGraphOutputNodeNameList() { - return graphOutputNodeName_; - } - /** - *
-   * Remote fused graph output node name
-   * 
- * - * repeated string graph_output_node_name = 3; - */ - public int getGraphOutputNodeNameCount() { - return graphOutputNodeName_.size(); - } - /** - *
-   * Remote fused graph output node name
-   * 
- * - * repeated string graph_output_node_name = 3; - */ - public java.lang.String getGraphOutputNodeName(int index) { - return graphOutputNodeName_.get(index); - } - /** - *
-   * Remote fused graph output node name
-   * 
- * - * repeated string graph_output_node_name = 3; - */ - public com.google.protobuf.ByteString - getGraphOutputNodeNameBytes(int index) { - return graphOutputNodeName_.getByteString(index); - } - - public static final int EXECUTOR_NAME_FIELD_NUMBER = 4; - private volatile java.lang.Object executorName_; - /** - *
-   * Executor's name
-   * 
- * - * string executor_name = 4; - */ - public java.lang.String getExecutorName() { - java.lang.Object ref = executorName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - executorName_ = s; - return s; - } - } - /** - *
-   * Executor's name
-   * 
- * - * string executor_name = 4; - */ - public com.google.protobuf.ByteString - getExecutorNameBytes() { - java.lang.Object ref = executorName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - executorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SERIALIZED_EXECUTOR_PARAMETERS_FIELD_NUMBER = 5; - private com.google.protobuf.ByteString serializedExecutorParameters_; - /** - *
-   * Optional: Parameters given to the executor
-   * 
- * - * bytes serialized_executor_parameters = 5; - */ - public com.google.protobuf.ByteString getSerializedExecutorParameters() { - return serializedExecutorParameters_; - } - - public static final int DEFAULT_GRAPH_INPUT_TENSOR_SHAPE_FIELD_NUMBER = 6; - private java.util.List defaultGraphInputTensorShape_; - /** - *
-   * Optional: Default graph input tensor shape used to allocate memory
-   * before executing op
-   * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public java.util.List getDefaultGraphInputTensorShapeList() { - return defaultGraphInputTensorShape_; - } - /** - *
-   * Optional: Default graph input tensor shape used to allocate memory
-   * before executing op
-   * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public java.util.List - getDefaultGraphInputTensorShapeOrBuilderList() { - return defaultGraphInputTensorShape_; - } - /** - *
-   * Optional: Default graph input tensor shape used to allocate memory
-   * before executing op
-   * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public int getDefaultGraphInputTensorShapeCount() { - return defaultGraphInputTensorShape_.size(); - } - /** - *
-   * Optional: Default graph input tensor shape used to allocate memory
-   * before executing op
-   * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto getDefaultGraphInputTensorShape(int index) { - return defaultGraphInputTensorShape_.get(index); - } - /** - *
-   * Optional: Default graph input tensor shape used to allocate memory
-   * before executing op
-   * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProtoOrBuilder getDefaultGraphInputTensorShapeOrBuilder( - int index) { - return defaultGraphInputTensorShape_.get(index); - } - - public static final int DEFAULT_GRAPH_OUTPUT_TENSOR_SHAPE_FIELD_NUMBER = 7; - private java.util.List defaultGraphOutputTensorShape_; - /** - *
-   * Optional: Default graph input tensor shape used to allocate memory
-   * before executing op
-   * TODO(satok): Remote output tensor shape once shape information is stored
-   * in NodeDef
-   * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public java.util.List getDefaultGraphOutputTensorShapeList() { - return defaultGraphOutputTensorShape_; - } - /** - *
-   * Optional: Default graph input tensor shape used to allocate memory
-   * before executing op
-   * TODO(satok): Remote output tensor shape once shape information is stored
-   * in NodeDef
-   * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public java.util.List - getDefaultGraphOutputTensorShapeOrBuilderList() { - return defaultGraphOutputTensorShape_; - } - /** - *
-   * Optional: Default graph input tensor shape used to allocate memory
-   * before executing op
-   * TODO(satok): Remote output tensor shape once shape information is stored
-   * in NodeDef
-   * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public int getDefaultGraphOutputTensorShapeCount() { - return defaultGraphOutputTensorShape_.size(); - } - /** - *
-   * Optional: Default graph input tensor shape used to allocate memory
-   * before executing op
-   * TODO(satok): Remote output tensor shape once shape information is stored
-   * in NodeDef
-   * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto getDefaultGraphOutputTensorShape(int index) { - return defaultGraphOutputTensorShape_.get(index); - } - /** - *
-   * Optional: Default graph input tensor shape used to allocate memory
-   * before executing op
-   * TODO(satok): Remote output tensor shape once shape information is stored
-   * in NodeDef
-   * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProtoOrBuilder getDefaultGraphOutputTensorShapeOrBuilder( - int index) { - return defaultGraphOutputTensorShape_.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 (remoteGraph_ != null) { - output.writeMessage(1, getRemoteGraph()); - } - for (int i = 0; i < graphInputNodeName_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, graphInputNodeName_.getRaw(i)); - } - for (int i = 0; i < graphOutputNodeName_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, graphOutputNodeName_.getRaw(i)); - } - if (!getExecutorNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, executorName_); - } - if (!serializedExecutorParameters_.isEmpty()) { - output.writeBytes(5, serializedExecutorParameters_); - } - for (int i = 0; i < defaultGraphInputTensorShape_.size(); i++) { - output.writeMessage(6, defaultGraphInputTensorShape_.get(i)); - } - for (int i = 0; i < defaultGraphOutputTensorShape_.size(); i++) { - output.writeMessage(7, defaultGraphOutputTensorShape_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (remoteGraph_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getRemoteGraph()); - } - { - int dataSize = 0; - for (int i = 0; i < graphInputNodeName_.size(); i++) { - dataSize += computeStringSizeNoTag(graphInputNodeName_.getRaw(i)); - } - size += dataSize; - size += 1 * getGraphInputNodeNameList().size(); - } - { - int dataSize = 0; - for (int i = 0; i < graphOutputNodeName_.size(); i++) { - dataSize += computeStringSizeNoTag(graphOutputNodeName_.getRaw(i)); - } - size += dataSize; - size += 1 * getGraphOutputNodeNameList().size(); - } - if (!getExecutorNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, executorName_); - } - if (!serializedExecutorParameters_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(5, serializedExecutorParameters_); - } - for (int i = 0; i < defaultGraphInputTensorShape_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, defaultGraphInputTensorShape_.get(i)); - } - for (int i = 0; i < defaultGraphOutputTensorShape_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, defaultGraphOutputTensorShape_.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.RemoteFusedGraphExecuteInfo)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo other = (org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo) obj; - - if (hasRemoteGraph() != other.hasRemoteGraph()) return false; - if (hasRemoteGraph()) { - if (!getRemoteGraph() - .equals(other.getRemoteGraph())) return false; - } - if (!getGraphInputNodeNameList() - .equals(other.getGraphInputNodeNameList())) return false; - if (!getGraphOutputNodeNameList() - .equals(other.getGraphOutputNodeNameList())) return false; - if (!getExecutorName() - .equals(other.getExecutorName())) return false; - if (!getSerializedExecutorParameters() - .equals(other.getSerializedExecutorParameters())) return false; - if (!getDefaultGraphInputTensorShapeList() - .equals(other.getDefaultGraphInputTensorShapeList())) return false; - if (!getDefaultGraphOutputTensorShapeList() - .equals(other.getDefaultGraphOutputTensorShapeList())) 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 (hasRemoteGraph()) { - hash = (37 * hash) + REMOTE_GRAPH_FIELD_NUMBER; - hash = (53 * hash) + getRemoteGraph().hashCode(); - } - if (getGraphInputNodeNameCount() > 0) { - hash = (37 * hash) + GRAPH_INPUT_NODE_NAME_FIELD_NUMBER; - hash = (53 * hash) + getGraphInputNodeNameList().hashCode(); - } - if (getGraphOutputNodeNameCount() > 0) { - hash = (37 * hash) + GRAPH_OUTPUT_NODE_NAME_FIELD_NUMBER; - hash = (53 * hash) + getGraphOutputNodeNameList().hashCode(); - } - hash = (37 * hash) + EXECUTOR_NAME_FIELD_NUMBER; - hash = (53 * hash) + getExecutorName().hashCode(); - hash = (37 * hash) + SERIALIZED_EXECUTOR_PARAMETERS_FIELD_NUMBER; - hash = (53 * hash) + getSerializedExecutorParameters().hashCode(); - if (getDefaultGraphInputTensorShapeCount() > 0) { - hash = (37 * hash) + DEFAULT_GRAPH_INPUT_TENSOR_SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getDefaultGraphInputTensorShapeList().hashCode(); - } - if (getDefaultGraphOutputTensorShapeCount() > 0) { - hash = (37 * hash) + DEFAULT_GRAPH_OUTPUT_TENSOR_SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getDefaultGraphOutputTensorShapeList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo parseFrom( - 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.RemoteFusedGraphExecuteInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo parseFrom( - com.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.RemoteFusedGraphExecuteInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo parseFrom( - java.io.InputStream 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.RemoteFusedGraphExecuteInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo parseDelimitedFrom( - java.io.InputStream 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.RemoteFusedGraphExecuteInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, 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.RemoteFusedGraphExecuteInfo prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new 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.RemoteFusedGraphExecuteInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.RemoteFusedGraphExecuteInfo) - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfoProto.internal_static_tensorflow_RemoteFusedGraphExecuteInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfoProto.internal_static_tensorflow_RemoteFusedGraphExecuteInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.class, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getDefaultGraphInputTensorShapeFieldBuilder(); - getDefaultGraphOutputTensorShapeFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (remoteGraphBuilder_ == null) { - remoteGraph_ = null; - } else { - remoteGraph_ = null; - remoteGraphBuilder_ = null; - } - graphInputNodeName_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - graphOutputNodeName_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - executorName_ = ""; - - serializedExecutorParameters_ = com.google.protobuf.ByteString.EMPTY; - - if (defaultGraphInputTensorShapeBuilder_ == null) { - defaultGraphInputTensorShape_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - defaultGraphInputTensorShapeBuilder_.clear(); - } - if (defaultGraphOutputTensorShapeBuilder_ == null) { - defaultGraphOutputTensorShape_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - } else { - defaultGraphOutputTensorShapeBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfoProto.internal_static_tensorflow_RemoteFusedGraphExecuteInfo_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo getDefaultInstanceForType() { - return org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo build() { - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo buildPartial() { - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo result = new org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo(this); - int from_bitField0_ = bitField0_; - if (remoteGraphBuilder_ == null) { - result.remoteGraph_ = remoteGraph_; - } else { - result.remoteGraph_ = remoteGraphBuilder_.build(); - } - if (((bitField0_ & 0x00000001) != 0)) { - graphInputNodeName_ = graphInputNodeName_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.graphInputNodeName_ = graphInputNodeName_; - if (((bitField0_ & 0x00000002) != 0)) { - graphOutputNodeName_ = graphOutputNodeName_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.graphOutputNodeName_ = graphOutputNodeName_; - result.executorName_ = executorName_; - result.serializedExecutorParameters_ = serializedExecutorParameters_; - if (defaultGraphInputTensorShapeBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - defaultGraphInputTensorShape_ = java.util.Collections.unmodifiableList(defaultGraphInputTensorShape_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.defaultGraphInputTensorShape_ = defaultGraphInputTensorShape_; - } else { - result.defaultGraphInputTensorShape_ = defaultGraphInputTensorShapeBuilder_.build(); - } - if (defaultGraphOutputTensorShapeBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { - defaultGraphOutputTensorShape_ = java.util.Collections.unmodifiableList(defaultGraphOutputTensorShape_); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.defaultGraphOutputTensorShape_ = defaultGraphOutputTensorShape_; - } else { - result.defaultGraphOutputTensorShape_ = defaultGraphOutputTensorShapeBuilder_.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.RemoteFusedGraphExecuteInfo) { - return mergeFrom((org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo other) { - if (other == org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.getDefaultInstance()) return this; - if (other.hasRemoteGraph()) { - mergeRemoteGraph(other.getRemoteGraph()); - } - if (!other.graphInputNodeName_.isEmpty()) { - if (graphInputNodeName_.isEmpty()) { - graphInputNodeName_ = other.graphInputNodeName_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureGraphInputNodeNameIsMutable(); - graphInputNodeName_.addAll(other.graphInputNodeName_); - } - onChanged(); - } - if (!other.graphOutputNodeName_.isEmpty()) { - if (graphOutputNodeName_.isEmpty()) { - graphOutputNodeName_ = other.graphOutputNodeName_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureGraphOutputNodeNameIsMutable(); - graphOutputNodeName_.addAll(other.graphOutputNodeName_); - } - onChanged(); - } - if (!other.getExecutorName().isEmpty()) { - executorName_ = other.executorName_; - onChanged(); - } - if (other.getSerializedExecutorParameters() != com.google.protobuf.ByteString.EMPTY) { - setSerializedExecutorParameters(other.getSerializedExecutorParameters()); - } - if (defaultGraphInputTensorShapeBuilder_ == null) { - if (!other.defaultGraphInputTensorShape_.isEmpty()) { - if (defaultGraphInputTensorShape_.isEmpty()) { - defaultGraphInputTensorShape_ = other.defaultGraphInputTensorShape_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureDefaultGraphInputTensorShapeIsMutable(); - defaultGraphInputTensorShape_.addAll(other.defaultGraphInputTensorShape_); - } - onChanged(); - } - } else { - if (!other.defaultGraphInputTensorShape_.isEmpty()) { - if (defaultGraphInputTensorShapeBuilder_.isEmpty()) { - defaultGraphInputTensorShapeBuilder_.dispose(); - defaultGraphInputTensorShapeBuilder_ = null; - defaultGraphInputTensorShape_ = other.defaultGraphInputTensorShape_; - bitField0_ = (bitField0_ & ~0x00000004); - defaultGraphInputTensorShapeBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getDefaultGraphInputTensorShapeFieldBuilder() : null; - } else { - defaultGraphInputTensorShapeBuilder_.addAllMessages(other.defaultGraphInputTensorShape_); - } - } - } - if (defaultGraphOutputTensorShapeBuilder_ == null) { - if (!other.defaultGraphOutputTensorShape_.isEmpty()) { - if (defaultGraphOutputTensorShape_.isEmpty()) { - defaultGraphOutputTensorShape_ = other.defaultGraphOutputTensorShape_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureDefaultGraphOutputTensorShapeIsMutable(); - defaultGraphOutputTensorShape_.addAll(other.defaultGraphOutputTensorShape_); - } - onChanged(); - } - } else { - if (!other.defaultGraphOutputTensorShape_.isEmpty()) { - if (defaultGraphOutputTensorShapeBuilder_.isEmpty()) { - defaultGraphOutputTensorShapeBuilder_.dispose(); - defaultGraphOutputTensorShapeBuilder_ = null; - defaultGraphOutputTensorShape_ = other.defaultGraphOutputTensorShape_; - bitField0_ = (bitField0_ & ~0x00000008); - defaultGraphOutputTensorShapeBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getDefaultGraphOutputTensorShapeFieldBuilder() : null; - } else { - defaultGraphOutputTensorShapeBuilder_.addAllMessages(other.defaultGraphOutputTensorShape_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return 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.RemoteFusedGraphExecuteInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private org.tensorflow.proto.framework.GraphDef remoteGraph_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GraphDef, org.tensorflow.proto.framework.GraphDef.Builder, org.tensorflow.proto.framework.GraphDefOrBuilder> remoteGraphBuilder_; - /** - *
-     * Definition of remote graph
-     * 
- * - * .tensorflow.GraphDef remote_graph = 1; - */ - public boolean hasRemoteGraph() { - return remoteGraphBuilder_ != null || remoteGraph_ != null; - } - /** - *
-     * Definition of remote graph
-     * 
- * - * .tensorflow.GraphDef remote_graph = 1; - */ - public org.tensorflow.proto.framework.GraphDef getRemoteGraph() { - if (remoteGraphBuilder_ == null) { - return remoteGraph_ == null ? org.tensorflow.proto.framework.GraphDef.getDefaultInstance() : remoteGraph_; - } else { - return remoteGraphBuilder_.getMessage(); - } - } - /** - *
-     * Definition of remote graph
-     * 
- * - * .tensorflow.GraphDef remote_graph = 1; - */ - public Builder setRemoteGraph(org.tensorflow.proto.framework.GraphDef value) { - if (remoteGraphBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - remoteGraph_ = value; - onChanged(); - } else { - remoteGraphBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Definition of remote graph
-     * 
- * - * .tensorflow.GraphDef remote_graph = 1; - */ - public Builder setRemoteGraph( - org.tensorflow.proto.framework.GraphDef.Builder builderForValue) { - if (remoteGraphBuilder_ == null) { - remoteGraph_ = builderForValue.build(); - onChanged(); - } else { - remoteGraphBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Definition of remote graph
-     * 
- * - * .tensorflow.GraphDef remote_graph = 1; - */ - public Builder mergeRemoteGraph(org.tensorflow.proto.framework.GraphDef value) { - if (remoteGraphBuilder_ == null) { - if (remoteGraph_ != null) { - remoteGraph_ = - org.tensorflow.proto.framework.GraphDef.newBuilder(remoteGraph_).mergeFrom(value).buildPartial(); - } else { - remoteGraph_ = value; - } - onChanged(); - } else { - remoteGraphBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Definition of remote graph
-     * 
- * - * .tensorflow.GraphDef remote_graph = 1; - */ - public Builder clearRemoteGraph() { - if (remoteGraphBuilder_ == null) { - remoteGraph_ = null; - onChanged(); - } else { - remoteGraph_ = null; - remoteGraphBuilder_ = null; - } - - return this; - } - /** - *
-     * Definition of remote graph
-     * 
- * - * .tensorflow.GraphDef remote_graph = 1; - */ - public org.tensorflow.proto.framework.GraphDef.Builder getRemoteGraphBuilder() { - - onChanged(); - return getRemoteGraphFieldBuilder().getBuilder(); - } - /** - *
-     * Definition of remote graph
-     * 
- * - * .tensorflow.GraphDef remote_graph = 1; - */ - public org.tensorflow.proto.framework.GraphDefOrBuilder getRemoteGraphOrBuilder() { - if (remoteGraphBuilder_ != null) { - return remoteGraphBuilder_.getMessageOrBuilder(); - } else { - return remoteGraph_ == null ? - org.tensorflow.proto.framework.GraphDef.getDefaultInstance() : remoteGraph_; - } - } - /** - *
-     * Definition of remote graph
-     * 
- * - * .tensorflow.GraphDef remote_graph = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GraphDef, org.tensorflow.proto.framework.GraphDef.Builder, org.tensorflow.proto.framework.GraphDefOrBuilder> - getRemoteGraphFieldBuilder() { - if (remoteGraphBuilder_ == null) { - remoteGraphBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GraphDef, org.tensorflow.proto.framework.GraphDef.Builder, org.tensorflow.proto.framework.GraphDefOrBuilder>( - getRemoteGraph(), - getParentForChildren(), - isClean()); - remoteGraph_ = null; - } - return remoteGraphBuilder_; - } - - private com.google.protobuf.LazyStringList graphInputNodeName_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureGraphInputNodeNameIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - graphInputNodeName_ = new com.google.protobuf.LazyStringArrayList(graphInputNodeName_); - bitField0_ |= 0x00000001; - } - } - /** - *
-     * Remote fused graph input node name
-     * 
- * - * repeated string graph_input_node_name = 2; - */ - public com.google.protobuf.ProtocolStringList - getGraphInputNodeNameList() { - return graphInputNodeName_.getUnmodifiableView(); - } - /** - *
-     * Remote fused graph input node name
-     * 
- * - * repeated string graph_input_node_name = 2; - */ - public int getGraphInputNodeNameCount() { - return graphInputNodeName_.size(); - } - /** - *
-     * Remote fused graph input node name
-     * 
- * - * repeated string graph_input_node_name = 2; - */ - public java.lang.String getGraphInputNodeName(int index) { - return graphInputNodeName_.get(index); - } - /** - *
-     * Remote fused graph input node name
-     * 
- * - * repeated string graph_input_node_name = 2; - */ - public com.google.protobuf.ByteString - getGraphInputNodeNameBytes(int index) { - return graphInputNodeName_.getByteString(index); - } - /** - *
-     * Remote fused graph input node name
-     * 
- * - * repeated string graph_input_node_name = 2; - */ - public Builder setGraphInputNodeName( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureGraphInputNodeNameIsMutable(); - graphInputNodeName_.set(index, value); - onChanged(); - return this; - } - /** - *
-     * Remote fused graph input node name
-     * 
- * - * repeated string graph_input_node_name = 2; - */ - public Builder addGraphInputNodeName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureGraphInputNodeNameIsMutable(); - graphInputNodeName_.add(value); - onChanged(); - return this; - } - /** - *
-     * Remote fused graph input node name
-     * 
- * - * repeated string graph_input_node_name = 2; - */ - public Builder addAllGraphInputNodeName( - java.lang.Iterable values) { - ensureGraphInputNodeNameIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, graphInputNodeName_); - onChanged(); - return this; - } - /** - *
-     * Remote fused graph input node name
-     * 
- * - * repeated string graph_input_node_name = 2; - */ - public Builder clearGraphInputNodeName() { - graphInputNodeName_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
-     * Remote fused graph input node name
-     * 
- * - * repeated string graph_input_node_name = 2; - */ - public Builder addGraphInputNodeNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureGraphInputNodeNameIsMutable(); - graphInputNodeName_.add(value); - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList graphOutputNodeName_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureGraphOutputNodeNameIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - graphOutputNodeName_ = new com.google.protobuf.LazyStringArrayList(graphOutputNodeName_); - bitField0_ |= 0x00000002; - } - } - /** - *
-     * Remote fused graph output node name
-     * 
- * - * repeated string graph_output_node_name = 3; - */ - public com.google.protobuf.ProtocolStringList - getGraphOutputNodeNameList() { - return graphOutputNodeName_.getUnmodifiableView(); - } - /** - *
-     * Remote fused graph output node name
-     * 
- * - * repeated string graph_output_node_name = 3; - */ - public int getGraphOutputNodeNameCount() { - return graphOutputNodeName_.size(); - } - /** - *
-     * Remote fused graph output node name
-     * 
- * - * repeated string graph_output_node_name = 3; - */ - public java.lang.String getGraphOutputNodeName(int index) { - return graphOutputNodeName_.get(index); - } - /** - *
-     * Remote fused graph output node name
-     * 
- * - * repeated string graph_output_node_name = 3; - */ - public com.google.protobuf.ByteString - getGraphOutputNodeNameBytes(int index) { - return graphOutputNodeName_.getByteString(index); - } - /** - *
-     * Remote fused graph output node name
-     * 
- * - * repeated string graph_output_node_name = 3; - */ - public Builder setGraphOutputNodeName( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureGraphOutputNodeNameIsMutable(); - graphOutputNodeName_.set(index, value); - onChanged(); - return this; - } - /** - *
-     * Remote fused graph output node name
-     * 
- * - * repeated string graph_output_node_name = 3; - */ - public Builder addGraphOutputNodeName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureGraphOutputNodeNameIsMutable(); - graphOutputNodeName_.add(value); - onChanged(); - return this; - } - /** - *
-     * Remote fused graph output node name
-     * 
- * - * repeated string graph_output_node_name = 3; - */ - public Builder addAllGraphOutputNodeName( - java.lang.Iterable values) { - ensureGraphOutputNodeNameIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, graphOutputNodeName_); - onChanged(); - return this; - } - /** - *
-     * Remote fused graph output node name
-     * 
- * - * repeated string graph_output_node_name = 3; - */ - public Builder clearGraphOutputNodeName() { - graphOutputNodeName_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - *
-     * Remote fused graph output node name
-     * 
- * - * repeated string graph_output_node_name = 3; - */ - public Builder addGraphOutputNodeNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureGraphOutputNodeNameIsMutable(); - graphOutputNodeName_.add(value); - onChanged(); - return this; - } - - private java.lang.Object executorName_ = ""; - /** - *
-     * Executor's name
-     * 
- * - * string executor_name = 4; - */ - public java.lang.String getExecutorName() { - java.lang.Object ref = executorName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - executorName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Executor's name
-     * 
- * - * string executor_name = 4; - */ - public com.google.protobuf.ByteString - getExecutorNameBytes() { - java.lang.Object ref = executorName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - executorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Executor's name
-     * 
- * - * string executor_name = 4; - */ - public Builder setExecutorName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - executorName_ = value; - onChanged(); - return this; - } - /** - *
-     * Executor's name
-     * 
- * - * string executor_name = 4; - */ - public Builder clearExecutorName() { - - executorName_ = getDefaultInstance().getExecutorName(); - onChanged(); - return this; - } - /** - *
-     * Executor's name
-     * 
- * - * string executor_name = 4; - */ - public Builder setExecutorNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - executorName_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString serializedExecutorParameters_ = com.google.protobuf.ByteString.EMPTY; - /** - *
-     * Optional: Parameters given to the executor
-     * 
- * - * bytes serialized_executor_parameters = 5; - */ - public com.google.protobuf.ByteString getSerializedExecutorParameters() { - return serializedExecutorParameters_; - } - /** - *
-     * Optional: Parameters given to the executor
-     * 
- * - * bytes serialized_executor_parameters = 5; - */ - public Builder setSerializedExecutorParameters(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - serializedExecutorParameters_ = value; - onChanged(); - return this; - } - /** - *
-     * Optional: Parameters given to the executor
-     * 
- * - * bytes serialized_executor_parameters = 5; - */ - public Builder clearSerializedExecutorParameters() { - - serializedExecutorParameters_ = getDefaultInstance().getSerializedExecutorParameters(); - onChanged(); - return this; - } - - private java.util.List defaultGraphInputTensorShape_ = - java.util.Collections.emptyList(); - private void ensureDefaultGraphInputTensorShapeIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - defaultGraphInputTensorShape_ = new java.util.ArrayList(defaultGraphInputTensorShape_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.Builder, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProtoOrBuilder> defaultGraphInputTensorShapeBuilder_; - - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public java.util.List getDefaultGraphInputTensorShapeList() { - if (defaultGraphInputTensorShapeBuilder_ == null) { - return java.util.Collections.unmodifiableList(defaultGraphInputTensorShape_); - } else { - return defaultGraphInputTensorShapeBuilder_.getMessageList(); - } - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public int getDefaultGraphInputTensorShapeCount() { - if (defaultGraphInputTensorShapeBuilder_ == null) { - return defaultGraphInputTensorShape_.size(); - } else { - return defaultGraphInputTensorShapeBuilder_.getCount(); - } - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto getDefaultGraphInputTensorShape(int index) { - if (defaultGraphInputTensorShapeBuilder_ == null) { - return defaultGraphInputTensorShape_.get(index); - } else { - return defaultGraphInputTensorShapeBuilder_.getMessage(index); - } - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public Builder setDefaultGraphInputTensorShape( - int index, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto value) { - if (defaultGraphInputTensorShapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDefaultGraphInputTensorShapeIsMutable(); - defaultGraphInputTensorShape_.set(index, value); - onChanged(); - } else { - defaultGraphInputTensorShapeBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public Builder setDefaultGraphInputTensorShape( - int index, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.Builder builderForValue) { - if (defaultGraphInputTensorShapeBuilder_ == null) { - ensureDefaultGraphInputTensorShapeIsMutable(); - defaultGraphInputTensorShape_.set(index, builderForValue.build()); - onChanged(); - } else { - defaultGraphInputTensorShapeBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public Builder addDefaultGraphInputTensorShape(org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto value) { - if (defaultGraphInputTensorShapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDefaultGraphInputTensorShapeIsMutable(); - defaultGraphInputTensorShape_.add(value); - onChanged(); - } else { - defaultGraphInputTensorShapeBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public Builder addDefaultGraphInputTensorShape( - int index, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto value) { - if (defaultGraphInputTensorShapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDefaultGraphInputTensorShapeIsMutable(); - defaultGraphInputTensorShape_.add(index, value); - onChanged(); - } else { - defaultGraphInputTensorShapeBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public Builder addDefaultGraphInputTensorShape( - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.Builder builderForValue) { - if (defaultGraphInputTensorShapeBuilder_ == null) { - ensureDefaultGraphInputTensorShapeIsMutable(); - defaultGraphInputTensorShape_.add(builderForValue.build()); - onChanged(); - } else { - defaultGraphInputTensorShapeBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public Builder addDefaultGraphInputTensorShape( - int index, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.Builder builderForValue) { - if (defaultGraphInputTensorShapeBuilder_ == null) { - ensureDefaultGraphInputTensorShapeIsMutable(); - defaultGraphInputTensorShape_.add(index, builderForValue.build()); - onChanged(); - } else { - defaultGraphInputTensorShapeBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public Builder addAllDefaultGraphInputTensorShape( - java.lang.Iterable values) { - if (defaultGraphInputTensorShapeBuilder_ == null) { - ensureDefaultGraphInputTensorShapeIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, defaultGraphInputTensorShape_); - onChanged(); - } else { - defaultGraphInputTensorShapeBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public Builder clearDefaultGraphInputTensorShape() { - if (defaultGraphInputTensorShapeBuilder_ == null) { - defaultGraphInputTensorShape_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - defaultGraphInputTensorShapeBuilder_.clear(); - } - return this; - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public Builder removeDefaultGraphInputTensorShape(int index) { - if (defaultGraphInputTensorShapeBuilder_ == null) { - ensureDefaultGraphInputTensorShapeIsMutable(); - defaultGraphInputTensorShape_.remove(index); - onChanged(); - } else { - defaultGraphInputTensorShapeBuilder_.remove(index); - } - return this; - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.Builder getDefaultGraphInputTensorShapeBuilder( - int index) { - return getDefaultGraphInputTensorShapeFieldBuilder().getBuilder(index); - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProtoOrBuilder getDefaultGraphInputTensorShapeOrBuilder( - int index) { - if (defaultGraphInputTensorShapeBuilder_ == null) { - return defaultGraphInputTensorShape_.get(index); } else { - return defaultGraphInputTensorShapeBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public java.util.List - getDefaultGraphInputTensorShapeOrBuilderList() { - if (defaultGraphInputTensorShapeBuilder_ != null) { - return defaultGraphInputTensorShapeBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(defaultGraphInputTensorShape_); - } - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.Builder addDefaultGraphInputTensorShapeBuilder() { - return getDefaultGraphInputTensorShapeFieldBuilder().addBuilder( - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.getDefaultInstance()); - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.Builder addDefaultGraphInputTensorShapeBuilder( - int index) { - return getDefaultGraphInputTensorShapeFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.getDefaultInstance()); - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - public java.util.List - getDefaultGraphInputTensorShapeBuilderList() { - return getDefaultGraphInputTensorShapeFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.Builder, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProtoOrBuilder> - getDefaultGraphInputTensorShapeFieldBuilder() { - if (defaultGraphInputTensorShapeBuilder_ == null) { - defaultGraphInputTensorShapeBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.Builder, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProtoOrBuilder>( - defaultGraphInputTensorShape_, - ((bitField0_ & 0x00000004) != 0), - getParentForChildren(), - isClean()); - defaultGraphInputTensorShape_ = null; - } - return defaultGraphInputTensorShapeBuilder_; - } - - private java.util.List defaultGraphOutputTensorShape_ = - java.util.Collections.emptyList(); - private void ensureDefaultGraphOutputTensorShapeIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - defaultGraphOutputTensorShape_ = new java.util.ArrayList(defaultGraphOutputTensorShape_); - bitField0_ |= 0x00000008; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.Builder, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProtoOrBuilder> defaultGraphOutputTensorShapeBuilder_; - - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * TODO(satok): Remote output tensor shape once shape information is stored
-     * in NodeDef
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public java.util.List getDefaultGraphOutputTensorShapeList() { - if (defaultGraphOutputTensorShapeBuilder_ == null) { - return java.util.Collections.unmodifiableList(defaultGraphOutputTensorShape_); - } else { - return defaultGraphOutputTensorShapeBuilder_.getMessageList(); - } - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * TODO(satok): Remote output tensor shape once shape information is stored
-     * in NodeDef
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public int getDefaultGraphOutputTensorShapeCount() { - if (defaultGraphOutputTensorShapeBuilder_ == null) { - return defaultGraphOutputTensorShape_.size(); - } else { - return defaultGraphOutputTensorShapeBuilder_.getCount(); - } - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * TODO(satok): Remote output tensor shape once shape information is stored
-     * in NodeDef
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto getDefaultGraphOutputTensorShape(int index) { - if (defaultGraphOutputTensorShapeBuilder_ == null) { - return defaultGraphOutputTensorShape_.get(index); - } else { - return defaultGraphOutputTensorShapeBuilder_.getMessage(index); - } - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * TODO(satok): Remote output tensor shape once shape information is stored
-     * in NodeDef
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public Builder setDefaultGraphOutputTensorShape( - int index, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto value) { - if (defaultGraphOutputTensorShapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDefaultGraphOutputTensorShapeIsMutable(); - defaultGraphOutputTensorShape_.set(index, value); - onChanged(); - } else { - defaultGraphOutputTensorShapeBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * TODO(satok): Remote output tensor shape once shape information is stored
-     * in NodeDef
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public Builder setDefaultGraphOutputTensorShape( - int index, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.Builder builderForValue) { - if (defaultGraphOutputTensorShapeBuilder_ == null) { - ensureDefaultGraphOutputTensorShapeIsMutable(); - defaultGraphOutputTensorShape_.set(index, builderForValue.build()); - onChanged(); - } else { - defaultGraphOutputTensorShapeBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * TODO(satok): Remote output tensor shape once shape information is stored
-     * in NodeDef
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public Builder addDefaultGraphOutputTensorShape(org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto value) { - if (defaultGraphOutputTensorShapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDefaultGraphOutputTensorShapeIsMutable(); - defaultGraphOutputTensorShape_.add(value); - onChanged(); - } else { - defaultGraphOutputTensorShapeBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * TODO(satok): Remote output tensor shape once shape information is stored
-     * in NodeDef
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public Builder addDefaultGraphOutputTensorShape( - int index, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto value) { - if (defaultGraphOutputTensorShapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDefaultGraphOutputTensorShapeIsMutable(); - defaultGraphOutputTensorShape_.add(index, value); - onChanged(); - } else { - defaultGraphOutputTensorShapeBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * TODO(satok): Remote output tensor shape once shape information is stored
-     * in NodeDef
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public Builder addDefaultGraphOutputTensorShape( - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.Builder builderForValue) { - if (defaultGraphOutputTensorShapeBuilder_ == null) { - ensureDefaultGraphOutputTensorShapeIsMutable(); - defaultGraphOutputTensorShape_.add(builderForValue.build()); - onChanged(); - } else { - defaultGraphOutputTensorShapeBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * TODO(satok): Remote output tensor shape once shape information is stored
-     * in NodeDef
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public Builder addDefaultGraphOutputTensorShape( - int index, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.Builder builderForValue) { - if (defaultGraphOutputTensorShapeBuilder_ == null) { - ensureDefaultGraphOutputTensorShapeIsMutable(); - defaultGraphOutputTensorShape_.add(index, builderForValue.build()); - onChanged(); - } else { - defaultGraphOutputTensorShapeBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * TODO(satok): Remote output tensor shape once shape information is stored
-     * in NodeDef
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public Builder addAllDefaultGraphOutputTensorShape( - java.lang.Iterable values) { - if (defaultGraphOutputTensorShapeBuilder_ == null) { - ensureDefaultGraphOutputTensorShapeIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, defaultGraphOutputTensorShape_); - onChanged(); - } else { - defaultGraphOutputTensorShapeBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * TODO(satok): Remote output tensor shape once shape information is stored
-     * in NodeDef
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public Builder clearDefaultGraphOutputTensorShape() { - if (defaultGraphOutputTensorShapeBuilder_ == null) { - defaultGraphOutputTensorShape_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - } else { - defaultGraphOutputTensorShapeBuilder_.clear(); - } - return this; - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * TODO(satok): Remote output tensor shape once shape information is stored
-     * in NodeDef
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public Builder removeDefaultGraphOutputTensorShape(int index) { - if (defaultGraphOutputTensorShapeBuilder_ == null) { - ensureDefaultGraphOutputTensorShapeIsMutable(); - defaultGraphOutputTensorShape_.remove(index); - onChanged(); - } else { - defaultGraphOutputTensorShapeBuilder_.remove(index); - } - return this; - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * TODO(satok): Remote output tensor shape once shape information is stored
-     * in NodeDef
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.Builder getDefaultGraphOutputTensorShapeBuilder( - int index) { - return getDefaultGraphOutputTensorShapeFieldBuilder().getBuilder(index); - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * TODO(satok): Remote output tensor shape once shape information is stored
-     * in NodeDef
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProtoOrBuilder getDefaultGraphOutputTensorShapeOrBuilder( - int index) { - if (defaultGraphOutputTensorShapeBuilder_ == null) { - return defaultGraphOutputTensorShape_.get(index); } else { - return defaultGraphOutputTensorShapeBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * TODO(satok): Remote output tensor shape once shape information is stored
-     * in NodeDef
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public java.util.List - getDefaultGraphOutputTensorShapeOrBuilderList() { - if (defaultGraphOutputTensorShapeBuilder_ != null) { - return defaultGraphOutputTensorShapeBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(defaultGraphOutputTensorShape_); - } - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * TODO(satok): Remote output tensor shape once shape information is stored
-     * in NodeDef
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.Builder addDefaultGraphOutputTensorShapeBuilder() { - return getDefaultGraphOutputTensorShapeFieldBuilder().addBuilder( - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.getDefaultInstance()); - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * TODO(satok): Remote output tensor shape once shape information is stored
-     * in NodeDef
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.Builder addDefaultGraphOutputTensorShapeBuilder( - int index) { - return getDefaultGraphOutputTensorShapeFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.getDefaultInstance()); - } - /** - *
-     * Optional: Default graph input tensor shape used to allocate memory
-     * before executing op
-     * TODO(satok): Remote output tensor shape once shape information is stored
-     * in NodeDef
-     * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - public java.util.List - getDefaultGraphOutputTensorShapeBuilderList() { - return getDefaultGraphOutputTensorShapeFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.Builder, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProtoOrBuilder> - getDefaultGraphOutputTensorShapeFieldBuilder() { - if (defaultGraphOutputTensorShapeBuilder_ == null) { - defaultGraphOutputTensorShapeBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.Builder, org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProtoOrBuilder>( - defaultGraphOutputTensorShape_, - ((bitField0_ & 0x00000008) != 0), - getParentForChildren(), - isClean()); - defaultGraphOutputTensorShape_ = null; - } - return defaultGraphOutputTensorShapeBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:tensorflow.RemoteFusedGraphExecuteInfo) - } - - // @@protoc_insertion_point(class_scope:tensorflow.RemoteFusedGraphExecuteInfo) - private static final org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo(); - } - - public static org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RemoteFusedGraphExecuteInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RemoteFusedGraphExecuteInfo(input, extensionRegistry); - } - }; - - public static com.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.RemoteFusedGraphExecuteInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RemoteFusedGraphExecuteInfoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RemoteFusedGraphExecuteInfoOrBuilder.java deleted file mode 100644 index 6e14ad8a2e0..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RemoteFusedGraphExecuteInfoOrBuilder.java +++ /dev/null @@ -1,239 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/remote_fused_graph_execute_info.proto - -package org.tensorflow.proto.framework; - -public interface RemoteFusedGraphExecuteInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.RemoteFusedGraphExecuteInfo) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Definition of remote graph
-   * 
- * - * .tensorflow.GraphDef remote_graph = 1; - */ - boolean hasRemoteGraph(); - /** - *
-   * Definition of remote graph
-   * 
- * - * .tensorflow.GraphDef remote_graph = 1; - */ - org.tensorflow.proto.framework.GraphDef getRemoteGraph(); - /** - *
-   * Definition of remote graph
-   * 
- * - * .tensorflow.GraphDef remote_graph = 1; - */ - org.tensorflow.proto.framework.GraphDefOrBuilder getRemoteGraphOrBuilder(); - - /** - *
-   * Remote fused graph input node name
-   * 
- * - * repeated string graph_input_node_name = 2; - */ - java.util.List - getGraphInputNodeNameList(); - /** - *
-   * Remote fused graph input node name
-   * 
- * - * repeated string graph_input_node_name = 2; - */ - int getGraphInputNodeNameCount(); - /** - *
-   * Remote fused graph input node name
-   * 
- * - * repeated string graph_input_node_name = 2; - */ - java.lang.String getGraphInputNodeName(int index); - /** - *
-   * Remote fused graph input node name
-   * 
- * - * repeated string graph_input_node_name = 2; - */ - com.google.protobuf.ByteString - getGraphInputNodeNameBytes(int index); - - /** - *
-   * Remote fused graph output node name
-   * 
- * - * repeated string graph_output_node_name = 3; - */ - java.util.List - getGraphOutputNodeNameList(); - /** - *
-   * Remote fused graph output node name
-   * 
- * - * repeated string graph_output_node_name = 3; - */ - int getGraphOutputNodeNameCount(); - /** - *
-   * Remote fused graph output node name
-   * 
- * - * repeated string graph_output_node_name = 3; - */ - java.lang.String getGraphOutputNodeName(int index); - /** - *
-   * Remote fused graph output node name
-   * 
- * - * repeated string graph_output_node_name = 3; - */ - com.google.protobuf.ByteString - getGraphOutputNodeNameBytes(int index); - - /** - *
-   * Executor's name
-   * 
- * - * string executor_name = 4; - */ - java.lang.String getExecutorName(); - /** - *
-   * Executor's name
-   * 
- * - * string executor_name = 4; - */ - com.google.protobuf.ByteString - getExecutorNameBytes(); - - /** - *
-   * Optional: Parameters given to the executor
-   * 
- * - * bytes serialized_executor_parameters = 5; - */ - com.google.protobuf.ByteString getSerializedExecutorParameters(); - - /** - *
-   * Optional: Default graph input tensor shape used to allocate memory
-   * before executing op
-   * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - java.util.List - getDefaultGraphInputTensorShapeList(); - /** - *
-   * Optional: Default graph input tensor shape used to allocate memory
-   * before executing op
-   * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto getDefaultGraphInputTensorShape(int index); - /** - *
-   * Optional: Default graph input tensor shape used to allocate memory
-   * before executing op
-   * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - int getDefaultGraphInputTensorShapeCount(); - /** - *
-   * Optional: Default graph input tensor shape used to allocate memory
-   * before executing op
-   * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - java.util.List - getDefaultGraphInputTensorShapeOrBuilderList(); - /** - *
-   * Optional: Default graph input tensor shape used to allocate memory
-   * before executing op
-   * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; - */ - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProtoOrBuilder getDefaultGraphInputTensorShapeOrBuilder( - int index); - - /** - *
-   * Optional: Default graph input tensor shape used to allocate memory
-   * before executing op
-   * TODO(satok): Remote output tensor shape once shape information is stored
-   * in NodeDef
-   * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - java.util.List - getDefaultGraphOutputTensorShapeList(); - /** - *
-   * Optional: Default graph input tensor shape used to allocate memory
-   * before executing op
-   * TODO(satok): Remote output tensor shape once shape information is stored
-   * in NodeDef
-   * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto getDefaultGraphOutputTensorShape(int index); - /** - *
-   * Optional: Default graph input tensor shape used to allocate memory
-   * before executing op
-   * TODO(satok): Remote output tensor shape once shape information is stored
-   * in NodeDef
-   * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - int getDefaultGraphOutputTensorShapeCount(); - /** - *
-   * Optional: Default graph input tensor shape used to allocate memory
-   * before executing op
-   * TODO(satok): Remote output tensor shape once shape information is stored
-   * in NodeDef
-   * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - java.util.List - getDefaultGraphOutputTensorShapeOrBuilderList(); - /** - *
-   * Optional: Default graph input tensor shape used to allocate memory
-   * before executing op
-   * TODO(satok): Remote output tensor shape once shape information is stored
-   * in NodeDef
-   * 
- * - * repeated .tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; - */ - org.tensorflow.proto.framework.RemoteFusedGraphExecuteInfo.TensorShapeTypeProtoOrBuilder getDefaultGraphOutputTensorShapeOrBuilder( - int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RemoteFusedGraphExecuteInfoProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RemoteFusedGraphExecuteInfoProto.java deleted file mode 100644 index 95aeddaf025..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RemoteFusedGraphExecuteInfoProto.java +++ /dev/null @@ -1,85 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/remote_fused_graph_execute_info.proto - -package org.tensorflow.proto.framework; - -public final class RemoteFusedGraphExecuteInfoProto { - private RemoteFusedGraphExecuteInfoProto() {} - 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_RemoteFusedGraphExecuteInfo_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_RemoteFusedGraphExecuteInfo_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_RemoteFusedGraphExecuteInfo_TensorShapeTypeProto_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_RemoteFusedGraphExecuteInfo_TensorShapeTypeProto_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/remote_fused" + - "_graph_execute_info.proto\022\ntensorflow\032%t" + - "ensorflow/core/framework/graph.proto\032,te" + - "nsorflow/core/framework/tensor_shape.pro" + - "to\032%tensorflow/core/framework/types.prot" + - "o\"\202\004\n\033RemoteFusedGraphExecuteInfo\022*\n\014rem" + - "ote_graph\030\001 \001(\0132\024.tensorflow.GraphDef\022\035\n" + - "\025graph_input_node_name\030\002 \003(\t\022\036\n\026graph_ou" + - "tput_node_name\030\003 \003(\t\022\025\n\rexecutor_name\030\004 " + - "\001(\t\022&\n\036serialized_executor_parameters\030\005 " + - "\001(\014\022f\n default_graph_input_tensor_shape\030" + - "\006 \003(\0132<.tensorflow.RemoteFusedGraphExecu" + - "teInfo.TensorShapeTypeProto\022g\n!default_g" + - "raph_output_tensor_shape\030\007 \003(\0132<.tensorf" + - "low.RemoteFusedGraphExecuteInfo.TensorSh" + - "apeTypeProto\032h\n\024TensorShapeTypeProto\022#\n\005" + - "dtype\030\001 \001(\0162\024.tensorflow.DataType\022+\n\005sha" + - "pe\030\002 \001(\0132\034.tensorflow.TensorShapeProtoB\257" + - "\001\n\036org.tensorflow.proto.frameworkB Remot" + - "eFusedGraphExecuteInfoProtoP\001Zfgithub.co" + - "m/tensorflow/tensorflow/tensorflow/go/co" + - "re/framework/remote_fused_graph_execute_" + - "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.GraphProtos.getDescriptor(), - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(), - org.tensorflow.proto.framework.TypesProtos.getDescriptor(), - }); - internal_static_tensorflow_RemoteFusedGraphExecuteInfo_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_RemoteFusedGraphExecuteInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_RemoteFusedGraphExecuteInfo_descriptor, - new java.lang.String[] { "RemoteGraph", "GraphInputNodeName", "GraphOutputNodeName", "ExecutorName", "SerializedExecutorParameters", "DefaultGraphInputTensorShape", "DefaultGraphOutputTensorShape", }); - internal_static_tensorflow_RemoteFusedGraphExecuteInfo_TensorShapeTypeProto_descriptor = - internal_static_tensorflow_RemoteFusedGraphExecuteInfo_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_RemoteFusedGraphExecuteInfo_TensorShapeTypeProto_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_RemoteFusedGraphExecuteInfo_TensorShapeTypeProto_descriptor, - new java.lang.String[] { "Dtype", "Shape", }); - org.tensorflow.proto.framework.GraphProtos.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/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/RewriterConfig.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RewriterConfig.java deleted file mode 100644 index 9665f55231c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RewriterConfig.java +++ /dev/null @@ -1,6366 +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; - 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 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 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 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 equal to 0 the system picks a default (currently 5 minutes).
-   * If less than 0 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 (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 (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 (metaOptimizerIterations_ != other.metaOptimizerIterations_) return false; - if (getMinGraphNodes() - != other.getMinGraphNodes()) return false; - if (getExperimentalDisableCompressedTensorOptimization() - != other.getExperimentalDisableCompressedTensorOptimization()) return false; - if (memoryOptimization_ != other.memoryOptimization_) return false; - if (!getMemoryOptimizerTargetNodeNameScope() - .equals(other.getMemoryOptimizerTargetNodeNameScope())) return false; - 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) + 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) + 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; - - metaOptimizerIterations_ = 0; - - minGraphNodes_ = 0; - - experimentalDisableCompressedTensorOptimization_ = 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.metaOptimizerIterations_ = metaOptimizerIterations_; - result.minGraphNodes_ = minGraphNodes_; - result.experimentalDisableCompressedTensorOptimization_ = experimentalDisableCompressedTensorOptimization_; - 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.metaOptimizerIterations_ != 0) { - setMetaOptimizerIterationsValue(other.getMetaOptimizerIterationsValue()); - } - if (other.getMinGraphNodes() != 0) { - setMinGraphNodes(other.getMinGraphNodes()); - } - if (other.getExperimentalDisableCompressedTensorOptimization() != false) { - setExperimentalDisableCompressedTensorOptimization(other.getExperimentalDisableCompressedTensorOptimization()); - } - 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 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 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 equal to 0 the system picks a default (currently 5 minutes).
-     * If less than 0 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 equal to 0 the system picks a default (currently 5 minutes).
-     * If less than 0 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 equal to 0 the system picks a default (currently 5 minutes).
-     * If less than 0 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 baad17a9738..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RewriterConfigOrBuilder.java +++ /dev/null @@ -1,654 +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(); - - /** - *
-   * 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(); - - /** - *
-   * 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 equal to 0 the system picks a default (currently 5 minutes).
-   * If less than 0 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 fd75fc78d94..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RewriterConfigProtos.java +++ /dev/null @@ -1,164 +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\"\342\022\n\016RewriterConfig\022C\n" + - "\025cpu_layout_conversion\0302 \001(\0162$.tensorflo" + - "w.RewriterConfig.CpuLayout\022;\n\020layout_opt" + - "imizer\030\001 \001(\0162!.tensorflow.RewriterConfig" + - ".Toggle\022;\n\020constant_folding\030\003 \001(\0162!.tens" + - "orflow.RewriterConfig.Toggle\022=\n\022shape_op" + - "timization\030\r \001(\0162!.tensorflow.RewriterCo" + - "nfig.Toggle\0224\n\tremapping\030\016 \001(\0162!.tensorf" + - "low.RewriterConfig.Toggle\022F\n\033common_subg" + - "raph_elimination\030\030 \001(\0162!.tensorflow.Rewr" + - "iterConfig.Toggle\022B\n\027arithmetic_optimiza" + - "tion\030\007 \001(\0162!.tensorflow.RewriterConfig.T" + - "oggle\022B\n\027dependency_optimization\030\010 \001(\0162!" + - ".tensorflow.RewriterConfig.Toggle\022<\n\021loo" + - "p_optimization\030\t \001(\0162!.tensorflow.Rewrit" + - "erConfig.Toggle\022@\n\025function_optimization" + - "\030\n \001(\0162!.tensorflow.RewriterConfig.Toggl" + - "e\0229\n\016debug_stripper\030\013 \001(\0162!.tensorflow.R" + - "ewriterConfig.Toggle\022\035\n\025disable_model_pr" + - "uning\030\002 \001(\010\022H\n\035scoped_allocator_optimiza" + - "tion\030\017 \001(\0162!.tensorflow.RewriterConfig.T" + - "oggle\022C\n\030pin_to_host_optimization\030\022 \001(\0162" + - "!.tensorflow.RewriterConfig.Toggle\022B\n\027im" + - "plementation_selector\030\026 \001(\0162!.tensorflow" + - ".RewriterConfig.Toggle\022?\n\024auto_mixed_pre" + - "cision\030\027 \001(\0162!.tensorflow.RewriterConfig" + - ".Toggle\022C\n\030auto_mixed_precision_mkl\030\031 \001(" + - "\0162!.tensorflow.RewriterConfig.Toggle\022\036\n\026" + - "disable_meta_optimizer\030\023 \001(\010\022O\n\031meta_opt" + - "imizer_iterations\030\014 \001(\0162,.tensorflow.Rew" + - "riterConfig.NumIterationsType\022\027\n\017min_gra" + - "ph_nodes\030\021 \001(\005\022;\n3experimental_disable_c" + - "ompressed_tensor_optimization\030\032 \001(\010\022B\n\023m" + - "emory_optimization\030\004 \001(\0162%.tensorflow.Re" + - "writerConfig.MemOptType\022/\n\'memory_optimi" + - "zer_target_node_name_scope\030\006 \001(\t\022!\n\031meta" + - "_optimizer_timeout_ms\030\024 \001(\003\0226\n\rauto_para" + - "llel\030\005 \001(\0132\037.tensorflow.AutoParallelOpti" + - "ons\022 \n\030fail_on_optimizer_errors\030\025 \001(\010\022A\n" + - "\025scoped_allocator_opts\030\020 \001(\0132\".tensorflo" + - "w.ScopedAllocatorOptions\022\022\n\noptimizers\030d" + - " \003(\t\022K\n\021custom_optimizers\030\310\001 \003(\0132/.tenso" + - "rflow.RewriterConfig.CustomGraphOptimize" + - "r\022D\n\037inter_optimizer_verifier_config\030\254\002 " + - "\001(\0132\032.tensorflow.VerifierConfig\022F\n!post_" + - "optimization_verifier_config\030\255\002 \001(\0132\032.te" + - "nsorflow.VerifierConfig\032\312\001\n\024CustomGraphO" + - "ptimizer\022\014\n\004name\030\001 \001(\t\022X\n\rparameter_map\030" + - "\002 \003(\0132A.tensorflow.RewriterConfig.Custom" + - "GraphOptimizer.ParameterMapEntry\032J\n\021Para" + - "meterMapEntry\022\013\n\003key\030\001 \001(\t\022$\n\005value\030\002 \001(" + - "\0132\025.tensorflow.AttrValue:\0028\001\"6\n\006Toggle\022\013" + - "\n\007DEFAULT\020\000\022\006\n\002ON\020\001\022\007\n\003OFF\020\002\022\016\n\nAGGRESSI" + - "VE\020\003\"I\n\tCpuLayout\022\030\n\024NO_CONVERSION_ON_CP" + - "U\020\000\022\020\n\014NCHW_TO_NHWC\020\001\022\020\n\014NHWC_TO_NCHW\020\002\"" + - "<\n\021NumIterationsType\022\025\n\021DEFAULT_NUM_ITER" + - "S\020\000\022\007\n\003ONE\020\001\022\007\n\003TWO\020\002\"\237\001\n\nMemOptType\022\023\n\017" + - "DEFAULT_MEM_OPT\020\000\022\016\n\nNO_MEM_OPT\020\001\022\n\n\006MAN" + - "UAL\020\002\022\027\n\023SWAPPING_HEURISTICS\020\004\022\034\n\030RECOMP" + - "UTATION_HEURISTICS\020\005\022\031\n\025SCHEDULING_HEURI" + - "STICS\020\006\022\016\n\nHEURISTICS\020\003B\222\001\n\036org.tensorfl" + - "ow.proto.frameworkB\024RewriterConfigProtos" + - "P\001ZUgithub.com/tensorflow/tensorflow/ten" + - "sorflow/go/core/protobuf/for_core_protos" + - "_go_proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - 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", "MetaOptimizerIterations", "MinGraphNodes", "ExperimentalDisableCompressedTensorOptimization", "MemoryOptimization", "MemoryOptimizerTargetNodeNameScope", "MetaOptimizerTimeoutMs", "AutoParallel", "FailOnOptimizerErrors", "ScopedAllocatorOpts", "Optimizers", "CustomOptimizers", "InterOptimizerVerifierConfig", "PostOptimizationVerifierConfig", }); - internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_descriptor = - internal_static_tensorflow_RewriterConfig_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_fieldAccessorTable = new - 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/RunOptionsOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RunOptionsOrBuilder.java deleted file mode 100644 index c3f4a9d7205..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RunOptionsOrBuilder.java +++ /dev/null @@ -1,101 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/config.proto - -package org.tensorflow.proto.framework; - -public interface RunOptionsOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.RunOptions) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.RunOptions.TraceLevel trace_level = 1; - */ - int getTraceLevelValue(); - /** - * .tensorflow.RunOptions.TraceLevel trace_level = 1; - */ - org.tensorflow.proto.framework.RunOptions.TraceLevel getTraceLevel(); - - /** - *
-   * Time to wait for operation to complete in milliseconds.
-   * 
- * - * int64 timeout_in_ms = 2; - */ - long getTimeoutInMs(); - - /** - *
-   * 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; - */ - int getInterOpThreadPool(); - - /** - *
-   * Whether the partition graph(s) executed by the executor(s) should be
-   * outputted via RunMetadata.
-   * 
- * - * bool output_partition_graphs = 5; - */ - boolean getOutputPartitionGraphs(); - - /** - *
-   * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
-   * 
- * - * .tensorflow.DebugOptions debug_options = 6; - */ - boolean hasDebugOptions(); - /** - *
-   * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
-   * 
- * - * .tensorflow.DebugOptions debug_options = 6; - */ - org.tensorflow.proto.framework.DebugOptions getDebugOptions(); - /** - *
-   * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
-   * 
- * - * .tensorflow.DebugOptions debug_options = 6; - */ - org.tensorflow.proto.framework.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; - */ - boolean getReportTensorAllocationsUponOom(); - - /** - * .tensorflow.RunOptions.Experimental experimental = 8; - */ - boolean hasExperimental(); - /** - * .tensorflow.RunOptions.Experimental experimental = 8; - */ - org.tensorflow.proto.framework.RunOptions.Experimental getExperimental(); - /** - * .tensorflow.RunOptions.Experimental experimental = 8; - */ - org.tensorflow.proto.framework.RunOptions.ExperimentalOrBuilder getExperimentalOrBuilder(); -} 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/SaveSliceInfoDefOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SaveSliceInfoDefOrBuilder.java deleted file mode 100644 index c06b53fbb61..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SaveSliceInfoDefOrBuilder.java +++ /dev/null @@ -1,102 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/variable.proto - -package org.tensorflow.proto.framework; - -public interface SaveSliceInfoDefOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.SaveSliceInfoDef) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Name of the full variable of which this is a slice.
-   * 
- * - * string full_name = 1; - */ - java.lang.String getFullName(); - /** - *
-   * Name of the full variable of which this is a slice.
-   * 
- * - * string full_name = 1; - */ - com.google.protobuf.ByteString - getFullNameBytes(); - - /** - *
-   * Shape of the full variable.
-   * 
- * - * repeated int64 full_shape = 2; - */ - java.util.List getFullShapeList(); - /** - *
-   * Shape of the full variable.
-   * 
- * - * repeated int64 full_shape = 2; - */ - int getFullShapeCount(); - /** - *
-   * Shape of the full variable.
-   * 
- * - * repeated int64 full_shape = 2; - */ - long getFullShape(int index); - - /** - *
-   * Offset of this variable into the full variable.
-   * 
- * - * repeated int64 var_offset = 3; - */ - java.util.List getVarOffsetList(); - /** - *
-   * Offset of this variable into the full variable.
-   * 
- * - * repeated int64 var_offset = 3; - */ - int getVarOffsetCount(); - /** - *
-   * Offset of this variable into the full variable.
-   * 
- * - * repeated int64 var_offset = 3; - */ - long getVarOffset(int index); - - /** - *
-   * Shape of this variable.
-   * 
- * - * repeated int64 var_shape = 4; - */ - java.util.List getVarShapeList(); - /** - *
-   * Shape of this variable.
-   * 
- * - * repeated int64 var_shape = 4; - */ - int getVarShapeCount(); - /** - *
-   * Shape of this variable.
-   * 
- * - * repeated int64 var_shape = 4; - */ - long getVarShape(int index); -} 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 62106345581..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedConcreteFunction.java +++ /dev/null @@ -1,1156 +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_; - /** - *
-   * Bound inputs to the function. The SavedObjects identified by the node ids
-   * given here are appended as extra inputs to the caller-supplied inputs.
-   * The only types of SavedObjects valid here are SavedVariable, SavedResource
-   * and SavedAsset.
-   * 
- * - * repeated int32 bound_inputs = 2; - */ - public java.util.List - getBoundInputsList() { - return boundInputs_; - } - /** - *
-   * Bound inputs to the function. The SavedObjects identified by the node ids
-   * given here are appended as extra inputs to the caller-supplied inputs.
-   * The only types of SavedObjects valid here are SavedVariable, SavedResource
-   * and SavedAsset.
-   * 
- * - * repeated int32 bound_inputs = 2; - */ - public int getBoundInputsCount() { - return boundInputs_.size(); - } - /** - *
-   * Bound inputs to the function. The SavedObjects identified by the node ids
-   * given here are appended as extra inputs to the caller-supplied inputs.
-   * The only types of SavedObjects valid here are SavedVariable, SavedResource
-   * and SavedAsset.
-   * 
- * - * 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; - } - } - /** - *
-     * Bound inputs to the function. The SavedObjects identified by the node ids
-     * given here are appended as extra inputs to the caller-supplied inputs.
-     * The only types of SavedObjects valid here are SavedVariable, SavedResource
-     * and SavedAsset.
-     * 
- * - * repeated int32 bound_inputs = 2; - */ - public java.util.List - getBoundInputsList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(boundInputs_) : boundInputs_; - } - /** - *
-     * Bound inputs to the function. The SavedObjects identified by the node ids
-     * given here are appended as extra inputs to the caller-supplied inputs.
-     * The only types of SavedObjects valid here are SavedVariable, SavedResource
-     * and SavedAsset.
-     * 
- * - * repeated int32 bound_inputs = 2; - */ - public int getBoundInputsCount() { - return boundInputs_.size(); - } - /** - *
-     * Bound inputs to the function. The SavedObjects identified by the node ids
-     * given here are appended as extra inputs to the caller-supplied inputs.
-     * The only types of SavedObjects valid here are SavedVariable, SavedResource
-     * and SavedAsset.
-     * 
- * - * repeated int32 bound_inputs = 2; - */ - public int getBoundInputs(int index) { - return boundInputs_.getInt(index); - } - /** - *
-     * Bound inputs to the function. The SavedObjects identified by the node ids
-     * given here are appended as extra inputs to the caller-supplied inputs.
-     * The only types of SavedObjects valid here are SavedVariable, SavedResource
-     * and SavedAsset.
-     * 
- * - * repeated int32 bound_inputs = 2; - */ - public Builder setBoundInputs( - int index, int value) { - ensureBoundInputsIsMutable(); - boundInputs_.setInt(index, value); - onChanged(); - return this; - } - /** - *
-     * Bound inputs to the function. The SavedObjects identified by the node ids
-     * given here are appended as extra inputs to the caller-supplied inputs.
-     * The only types of SavedObjects valid here are SavedVariable, SavedResource
-     * and SavedAsset.
-     * 
- * - * repeated int32 bound_inputs = 2; - */ - public Builder addBoundInputs(int value) { - ensureBoundInputsIsMutable(); - boundInputs_.addInt(value); - onChanged(); - return this; - } - /** - *
-     * Bound inputs to the function. The SavedObjects identified by the node ids
-     * given here are appended as extra inputs to the caller-supplied inputs.
-     * The only types of SavedObjects valid here are SavedVariable, SavedResource
-     * and SavedAsset.
-     * 
- * - * repeated int32 bound_inputs = 2; - */ - public Builder addAllBoundInputs( - java.lang.Iterable values) { - ensureBoundInputsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, boundInputs_); - onChanged(); - return this; - } - /** - *
-     * Bound inputs to the function. The SavedObjects identified by the node ids
-     * given here are appended as extra inputs to the caller-supplied inputs.
-     * The only types of SavedObjects valid here are SavedVariable, SavedResource
-     * and SavedAsset.
-     * 
- * - * 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 49145b8ca01..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedConcreteFunctionOrBuilder.java +++ /dev/null @@ -1,102 +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 { - - /** - *
-   * Bound inputs to the function. The SavedObjects identified by the node ids
-   * given here are appended as extra inputs to the caller-supplied inputs.
-   * The only types of SavedObjects valid here are SavedVariable, SavedResource
-   * and SavedAsset.
-   * 
- * - * repeated int32 bound_inputs = 2; - */ - java.util.List getBoundInputsList(); - /** - *
-   * Bound inputs to the function. The SavedObjects identified by the node ids
-   * given here are appended as extra inputs to the caller-supplied inputs.
-   * The only types of SavedObjects valid here are SavedVariable, SavedResource
-   * and SavedAsset.
-   * 
- * - * repeated int32 bound_inputs = 2; - */ - int getBoundInputsCount(); - /** - *
-   * Bound inputs to the function. The SavedObjects identified by the node ids
-   * given here are appended as extra inputs to the caller-supplied inputs.
-   * The only types of SavedObjects valid here are SavedVariable, SavedResource
-   * and SavedAsset.
-   * 
- * - * 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 d38d76b85a1..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedObject.java +++ /dev/null @@ -1,3174 +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; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (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), - 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 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".
-   * 
- * - * 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".
-   * 
- * - * 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".
-   * 
- * - * 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".
-   * 
- * - * 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".
-   * 
- * - * 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 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); - 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__); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - 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 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 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(); - } - } - 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 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".
-     * 
- * - * 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".
-     * 
- * - * 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".
-     * 
- * - * 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".
-     * 
- * - * 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".
-     * 
- * - * 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".
-     * 
- * - * 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".
-     * 
- * - * 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".
-     * 
- * - * 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".
-     * 
- * - * 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".
-     * 
- * - * 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".
-     * 
- * - * 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".
-     * 
- * - * 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".
-     * 
- * - * 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".
-     * 
- * - * 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".
-     * 
- * - * 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".
-     * 
- * - * 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".
-     * 
- * - * 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".
-     * 
- * - * 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.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 9405d43b87d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedObjectGraphProtos.java +++ /dev/null @@ -1,270 +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_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\"\331\005\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\022F\n\020savea" + - "ble_objects\030\013 \003(\0132,.tensorflow.SavedObje" + - "ct.SaveableObjectsEntry\032R\n\024SaveableObjec" + - "tsEntry\022\013\n\003key\030\001 \001(\t\022)\n\005value\030\002 \001(\0132\032.te" + - "nsorflow.SaveableObject:\0028\001B\006\n\004kindJ\004\010\002\020" + - "\003R\nattributes\"`\n\017SavedUserObject\022\022\n\niden" + - "tifier\030\001 \001(\t\022\'\n\007version\030\002 \001(\0132\026.tensorfl" + - "ow.VersionDef\022\020\n\010metadata\030\003 \001(\t\"*\n\nSaved" + - "Asset\022\034\n\024asset_file_def_index\030\001 \001(\005\"\\\n\rS" + - "avedFunction\022\032\n\022concrete_functions\030\001 \003(\t" + - "\022/\n\rfunction_spec\030\002 \001(\0132\030.tensorflow.Fun" + - "ctionSpec\"\250\001\n\025SavedConcreteFunction\022\024\n\014b" + - "ound_inputs\030\002 \003(\005\022B\n\035canonicalized_input" + - "_signature\030\003 \001(\0132\033.tensorflow.Structured" + - "Value\0225\n\020output_signature\030\004 \001(\0132\033.tensor" + - "flow.StructuredValue\"\255\001\n\031SavedBareConcre" + - "teFunction\022\036\n\026concrete_function_name\030\001 \001" + - "(\t\022\031\n\021argument_keywords\030\002 \003(\t\022$\n\034allowed" + - "_positional_arguments\030\003 \001(\003\022/\n\rfunction_" + - "spec\030\004 \001(\0132\030.tensorflow.FunctionSpec\"\"\n\r" + - "SavedConstant\022\021\n\toperation\030\001 \001(\t\"\327\002\n\rSav" + - "edVariable\022#\n\005dtype\030\001 \001(\0162\024.tensorflow.D" + - "ataType\022+\n\005shape\030\002 \001(\0132\034.tensorflow.Tens" + - "orShapeProto\022\021\n\ttrainable\030\003 \001(\010\022<\n\017synch" + - "ronization\030\004 \001(\0162#.tensorflow.VariableSy" + - "nchronization\0224\n\013aggregation\030\005 \001(\0162\037.ten" + - "sorflow.VariableAggregation\022\014\n\004name\030\006 \001(" + - "\t\022\016\n\006device\030\007 \001(\t\022O\n,experimental_distri" + - "buted_variable_components\030\010 \003(\0132\031.tensor" + - "flow.SavedVariable\"\226\002\n\014FunctionSpec\0220\n\013f" + - "ullargspec\030\001 \001(\0132\033.tensorflow.Structured" + - "Value\022\021\n\tis_method\030\002 \001(\010\0224\n\017input_signat" + - "ure\030\005 \001(\0132\033.tensorflow.StructuredValue\022J" + - "\n\024experimental_compile\030\006 \001(\0162,.tensorflo" + - "w.FunctionSpec.ExperimentalCompile\"3\n\023Ex" + - "perimentalCompile\022\013\n\007DEFAULT\020\000\022\006\n\002ON\020\001\022\007" + - "\n\003OFF\020\002J\004\010\003\020\004J\004\010\004\020\005\"\037\n\rSavedResource\022\016\n\006" + - "device\030\001 \001(\t\"A\n\016SaveableObject\022\025\n\rsave_f" + - "unction\030\002 \001(\005\022\030\n\020restore_function\030\003 \001(\005B" + - "\224\001\n\036org.tensorflow.proto.frameworkB\026Save" + - "dObjectGraphProtosP\001ZUgithub.com/tensorf" + - "low/tensorflow/tensorflow/go/core/protob" + - "uf/for_core_protos_go_proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - 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", "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_SavedConcreteFunction_descriptor = - getDescriptor().getMessageTypes().get(5); - 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(6); - 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(7); - 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(8); - 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(9); - internal_static_tensorflow_FunctionSpec_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_FunctionSpec_descriptor, - new java.lang.String[] { "Fullargspec", "IsMethod", "InputSignature", "ExperimentalCompile", }); - internal_static_tensorflow_SavedResource_descriptor = - getDescriptor().getMessageTypes().get(10); - 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(11); - 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 269ee74c9f2..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedObjectOrBuilder.java +++ /dev/null @@ -1,249 +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".
-   * 
- * - * 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".
-   * 
- * - * 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".
-   * 
- * - * 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".
-   * 
- * - * 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".
-   * 
- * - * 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(); - - /** - * 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 f66874096f5..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedUserObject.java +++ /dev/null @@ -1,974 +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_; - /** - *
-   * Initialization-related metadata.
-   * 
- * - * string metadata = 3; - */ - 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; - } - } - /** - *
-   * Initialization-related metadata.
-   * 
- * - * string metadata = 3; - */ - 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_ = ""; - /** - *
-     * Initialization-related metadata.
-     * 
- * - * string metadata = 3; - */ - 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; - } - } - /** - *
-     * Initialization-related metadata.
-     * 
- * - * string metadata = 3; - */ - 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; - } - } - /** - *
-     * Initialization-related metadata.
-     * 
- * - * string metadata = 3; - */ - public Builder setMetadata( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - metadata_ = value; - onChanged(); - return this; - } - /** - *
-     * Initialization-related metadata.
-     * 
- * - * string metadata = 3; - */ - public Builder clearMetadata() { - - metadata_ = getDefaultInstance().getMetadata(); - onChanged(); - return this; - } - /** - *
-     * Initialization-related metadata.
-     * 
- * - * string metadata = 3; - */ - 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 bd7cbadcbd3..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedUserObjectOrBuilder.java +++ /dev/null @@ -1,70 +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(); - - /** - *
-   * Initialization-related metadata.
-   * 
- * - * string metadata = 3; - */ - java.lang.String getMetadata(); - /** - *
-   * Initialization-related metadata.
-   * 
- * - * string metadata = 3; - */ - 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/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/SessionMetadataOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SessionMetadataOrBuilder.java deleted file mode 100644 index eae7295e772..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SessionMetadataOrBuilder.java +++ /dev/null @@ -1,28 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/config.proto - -package org.tensorflow.proto.framework; - -public interface SessionMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.SessionMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - */ - java.lang.String getName(); - /** - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
-   * The version is optional. If set, needs to be >= 0.
-   * 
- * - * int64 version = 2; - */ - long getVersion(); -} 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 fe588917c86..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.
- * 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.
-   * 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/SpecializedType.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SpecializedType.java deleted file mode 100644 index 8af9cfa82cc..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SpecializedType.java +++ /dev/null @@ -1,126 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/types.proto - -package org.tensorflow.proto.framework; - -/** - *
- * For identifying the underlying type of a variant. For variants, the types
- * listed here are a subset of the types in the variant type registry,
- * corresponding to commonly used variants which must occasionally be
- * special-cased.
- * 
- * - * Protobuf enum {@code tensorflow.SpecializedType} - */ -public enum SpecializedType - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
-   * Invalid/unknown specialized type.
-   * 
- * - * ST_INVALID = 0; - */ - ST_INVALID(0), - /** - *
-   * "tensorflow::TensorList" in the variant type registry.
-   * 
- * - * ST_TENSOR_LIST = 1; - */ - ST_TENSOR_LIST(1), - UNRECOGNIZED(-1), - ; - - /** - *
-   * Invalid/unknown specialized type.
-   * 
- * - * ST_INVALID = 0; - */ - public static final int ST_INVALID_VALUE = 0; - /** - *
-   * "tensorflow::TensorList" in the variant type registry.
-   * 
- * - * ST_TENSOR_LIST = 1; - */ - public static final int ST_TENSOR_LIST_VALUE = 1; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static SpecializedType valueOf(int value) { - return forNumber(value); - } - - public static SpecializedType forNumber(int value) { - switch (value) { - case 0: return ST_INVALID; - case 1: return ST_TENSOR_LIST; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - SpecializedType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public SpecializedType findValueByNumber(int number) { - return SpecializedType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return org.tensorflow.proto.framework.TypesProtos.getDescriptor().getEnumTypes().get(1); - } - - private static final SpecializedType[] VALUES = values(); - - public static SpecializedType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private SpecializedType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.SpecializedType) -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/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 f5b217be8b1..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/StructProtos.java +++ /dev/null @@ -1,215 +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\"\264\003\n\rTypeSpecProto\022@\n\017type_spe" + - "c_class\030\001 \001(\0162\'.tensorflow.TypeSpecProto" + - ".TypeSpecClass\022/\n\ntype_state\030\002 \001(\0132\033.ten" + - "sorflow.StructuredValue\022\034\n\024type_spec_cla" + - "ss_name\030\003 \001(\t\"\221\002\n\rTypeSpecClass\022\013\n\007UNKNO" + - "WN\020\000\022\026\n\022SPARSE_TENSOR_SPEC\020\001\022\027\n\023INDEXED_" + - "SLICES_SPEC\020\002\022\026\n\022RAGGED_TENSOR_SPEC\020\003\022\025\n" + - "\021TENSOR_ARRAY_SPEC\020\004\022\025\n\021DATA_DATASET_SPE" + - "C\020\005\022\026\n\022DATA_ITERATOR_SPEC\020\006\022\021\n\rOPTIONAL_" + - "SPEC\020\007\022\024\n\020PER_REPLICA_SPEC\020\010\022\021\n\rVARIABLE" + - "_SPEC\020\t\022\026\n\022ROW_PARTITION_SPEC\020\n\022\020\n\014NDARR" + - "AY_SPEC\020\013B\207\001\n\036org.tensorflow.proto.frame" + - "workB\014StructProtosP\001ZUgithub.com/tensorf" + - "low/tensorflow/tensorflow/go/core/protob" + - "uf/for_core_protos_go_protob\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - 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

logits and labels must have the same type and shape. - * - *